/* ===================================================================
   DataHub AI 案例中心 · 共享 CSS
   适用：8 篇中文企业 AI 案例详情页
   =================================================================== */

/* --- 设计令牌 --- */
:root {
  --page-bg: #f4f9f6;
  --paper-bg: #ffffff;
  --warm-bg: #f5f3ee;
  --aside-bg: #f3f1ea;
  --aside-alt-bg: #eef6f4;
  --ink: #17231e;
  --text: #33463e;
  --text-secondary: #394840;
  --muted: #7b8982;
  --line: #d8ddd9;
  --teal: #087d72;
  --teal-dark: #197266;
  --caveat: #9b7a19;
  --reading-w: 660px;
  --aside-w: 240px;
  --gap: 54px;
  --page-max: 1120px;
  --radius: 14px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(26, 58, 42, 0.07);
  --shadow-deep: 0 18px 34px rgba(26, 58, 42, 0.07);
}

/* --- 重置 --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
    sans-serif;
  line-height: 1.78;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* ===================================================================
   顶栏
   =================================================================== */
.case-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid #e0d8c8;
  background: #f5f0e8;
  font-size: 0.88rem;
}

.case-brand {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

.case-brand:hover {
  color: var(--teal);
}

.case-status {
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

/* ===================================================================
   阅读纸张容器
   =================================================================== */
.case-page {
  width: min(var(--page-max), calc(100% - 48px));
  margin: 32px auto 40px;
  border-radius: var(--radius);
  background: var(--paper-bg);
  box-shadow: var(--shadow-deep);
  overflow: hidden;
}

/* ===================================================================
   首屏 Hero
   =================================================================== */
.case-hero {
  padding: 56px 64px 38px;
}

.case-kicker {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
}

.case-hero h1 {
  width: 100%;
  max-width: none;
  margin: 0;
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  line-height: 1.28;
  letter-spacing: 0;
  font-weight: 700;
}

.case-deck {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.7;
}

.case-meta {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ===================================================================
   两栏布局
   =================================================================== */
.case-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--reading-w)) var(--aside-w);
  gap: var(--gap);
  align-items: start;
  padding: 18px 64px 76px;
}

/* ===================================================================
   正文主列
   =================================================================== */
.case-article {
  min-width: 0;
  max-width: var(--reading-w);
}

.case-article h2 {
  margin: 76px 0 18px;
  font-size: 1.32rem;
  line-height: 1.38;
  letter-spacing: 0;
  font-weight: 700;
}

.case-article h2:first-child {
  margin-top: 0;
}

.case-article h3 {
  margin: 40px 0 12px;
  color: #263c34;
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 600;
}

.case-article p {
  margin: 0 0 20px;
  color: var(--text);
  line-height: 1.82;
}

.case-article ul,
.case-article ol {
  margin: 20px 0 28px;
  padding-left: 1.35rem;
}

.case-article li {
  margin-bottom: 10px;
  color: var(--text);
  line-height: 1.72;
}

.case-article a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.case-article a:hover {
  color: var(--teal-dark);
}

/* ===================================================================
   章节标记
   =================================================================== */
.case-section {
  margin-top: 76px;
}

.case-section:first-child {
  margin-top: 0;
}

/* ===================================================================
   侧栏
   =================================================================== */
.case-sidebar {
  position: static;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #53645d;
  font-size: 0.74rem;
  line-height: 1.55;
}

.side-note {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(123, 137, 130, 0.16);
  border-radius: var(--radius-sm);
  background: var(--aside-bg);
}

.side-note:last-child {
  margin-bottom: 0;
}

.side-note > :first-child {
  margin-top: 0;
}

.side-note > :last-child {
  margin-bottom: 0;
}

.side-note-title {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.case-sidebar p,
.case-sidebar li,
.case-sidebar dd {
  color: #53645d;
  font-size: 0.74rem;
  line-height: 1.55;
}

.case-sidebar ul,
.case-sidebar ol {
  margin: 0 0 12px;
  padding-left: 1rem;
}

.case-sidebar li {
  margin-bottom: 6px;
}

.case-sidebar dl {
  margin: 0;
}

.case-sidebar dt {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.45;
}

.case-sidebar dt:first-child {
  margin-top: 0;
}

.case-sidebar dd {
  margin: 3px 0 0;
}

/* ===================================================================
   图片 / 图表
   =================================================================== */
.case-figure {
  margin: 46px 0;
}

.case-figure-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.case-figure img,
.case-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.case-figure figcaption {
  max-width: 94%;
  margin-top: 10px;
  color: #65736d;
  font-size: 0.78rem;
  line-height: 1.58;
}

.figure-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.figure-title {
  display: block;
  margin-bottom: 3px;
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 600;
}

.figure-caption {
  color: #65736d;
  font-size: 0.78rem;
  line-height: 1.58;
}

/* 宽幅图：可突破正文列，但不超出纸张 */
.case-figure--wide {
  margin-left: 0;
  margin-right: calc(var(--aside-w) * -0.5 - var(--gap) * 0.5);
}

.case-figure--wide .case-figure-image,
.case-figure--wide img,
.case-figure--wide svg {
  width: 100%;
}

/* ===================================================================
   证据边界标注
   =================================================================== */
.evidence-note {
  margin: 18px 0 26px;
  padding: 10px 14px;
  border-left: 2px solid var(--line);
  background: #f8f7f1;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.58;
}

.evidence-note p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.58;
}

.evidence-note p:last-child {
  margin-bottom: 0;
}

/* ===================================================================
   引言
   =================================================================== */
.pull-quote {
  margin: 38px 0;
  padding: 24px 26px;
  background: var(--warm-bg);
  border-radius: 4px;
}

.pull-quote p {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.68;
}

.pull-quote cite,
.pull-quote footer {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
}

/* ===================================================================
   指标条
   =================================================================== */
.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0;
}

.metric-strip > * {
  flex: 1 1 180px;
  min-width: 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  background: var(--paper-bg);
  border-radius: 4px;
}

.metric-strip strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.metric-strip span {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.4;
}

.metric-strip small {
  display: block;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

/* 侧栏内指标 */
.case-sidebar .metric-strip {
  flex-direction: column;
  gap: 0;
  margin: 12px 0 0;
  border: 0;
}

.case-sidebar .metric-strip > * {
  flex: none;
  margin-top: 14px;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid rgba(123, 137, 130, 0.22);
  border-radius: 0;
  background: transparent;
}

.case-sidebar .metric-strip > *:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.case-sidebar .metric-strip strong {
  font-size: 1.04rem;
  line-height: 1.18;
}

.case-sidebar .metric-strip span {
  font-size: 0.73rem;
  line-height: 1.42;
}

.case-sidebar .metric-strip small {
  font-size: 0.67rem;
  line-height: 1.45;
}

/* ===================================================================
   来源 / 折叠区
   =================================================================== */
.source-details {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-bg);
}

.source-details summary {
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 650;
  list-style: none;
}

.source-details summary::-webkit-details-marker {
  display: none;
}

.source-details summary::before {
  content: "▸ ";
  color: var(--muted);
}

.source-details[open] summary::before {
  content: "▾ ";
}

.source-details > div,
.source-details > ul,
.source-details > ol,
.source-details > p {
  padding: 4px 16px 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

.source-details h3 {
  margin: 0;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 650;
  line-height: 1.5;
}

/* ===================================================================
   页脚
   =================================================================== */
.case-footer {
  width: min(var(--page-max), calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.case-footer p {
  margin: 0;
}

.case-footer a {
  color: var(--muted);
}

/* ===================================================================
   平板断点 ≤ 860px
   =================================================================== */
@media (max-width: 860px) {
  html {
    font-size: 16px;
  }

  .case-topbar {
    flex-wrap: wrap;
    padding: 12px 20px;
  }

  .case-brand {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .case-status {
    max-width: 58%;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .case-page {
    width: calc(100% - 24px);
    margin: 16px auto 24px;
  }

  .case-hero {
    padding: 34px 20px 26px;
  }

  .case-hero h1 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .case-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 8px 20px 48px;
    overflow-x: hidden;
  }

  .case-article {
    width: 100%;
    max-width: 100%;
  }

  .case-article h2 {
    margin-top: 52px;
    font-size: 1.18rem;
  }

  .case-article h2,
  .case-article h3 {
    display: block;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .case-sidebar {
    display: none;
  }

  .case-figure {
    margin: 32px 0;
  }

  .case-figure--wide {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .case-figure--wide .case-figure-image,
  .case-figure--wide img,
  .case-figure--wide svg {
    width: auto;
    min-width: 640px;
    max-width: none;
  }

  .metric-strip {
    flex-direction: column;
    gap: 12px;
  }

  .case-footer {
    width: calc(100% - 24px);
    padding: 24px 0;
  }
}

/* ===================================================================
   手机断点 ≤ 420px
   =================================================================== */
@media (max-width: 420px) {
  html {
    font-size: 15px;
  }

  .case-hero h1 {
    font-size: 1.35rem;
  }

  .case-hero {
    padding: 28px 16px 22px;
  }

  .case-layout {
    padding: 8px 16px 40px;
  }

  .case-article p {
    line-height: 1.76;
  }

  .case-article li {
    line-height: 1.68;
  }

  .pull-quote {
    padding: 20px;
  }

  .pull-quote p {
    font-size: 0.96rem;
  }

  .evidence-note {
    padding: 8px 12px;
  }
}

/* ===================================================================
   打印样式
   =================================================================== */
@media print {
  body {
    background: #fff;
  }

  .case-topbar,
  .case-sidebar {
    display: none;
  }

  .case-page {
    width: 100%;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .case-figure--wide {
    overflow: visible;
  }

  .case-figure--wide img,
  .case-figure--wide svg {
    min-width: 0;
    width: 100%;
  }
}
