/* ===========================================================
   财税实战学习平台 · 高级编辑风设计系统 v3.0
   配色：墨(深靛) + 宣纸(暖白) + 铜(克制的黄铜金)
   字体：标题思源宋体(衬线) / 正文苹方(无衬线)
   =========================================================== */
:root {
  /* 宣纸 / 表面 */
  --paper: #f3efe7;
  --paper-2: #ece5d7;
  --surface: #fffdf8;
  --surface-2: #fbf8f1;
  /* 墨 */
  --ink: #1e2128;
  --ink-2: #545861;
  --ink-3: #8a8c92;
  /* 发丝线 */
  --line: #e7e0d2;
  --line-2: #d8cfba;
  /* 深靛(品牌主色) */
  --navy: #1b2a3a;
  --navy-2: #243a4f;
  --navy-3: #34536e;
  /* 铜(克制金) */
  --brass: #9c7a43;
  --brass-2: #b6945a;
  --brass-soft: #efe6d3;
  --brass-deep: #6f5430;
  /* 语义色(低饱和) */
  --red: #a23b2e;
  --green: #3f6b54;
  --red-soft: #f3e3e0;
  --green-soft: #e6efe9;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(30, 33, 40, .04), 0 10px 28px -12px rgba(30, 33, 40, .10);
  --shadow-lg: 0 2px 6px rgba(30, 33, 40, .05), 0 22px 54px -16px rgba(30, 33, 40, .18);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "SimSun", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--paper);
  background-image:
    radial-gradient(120% 80% at 100% 0%, rgba(156, 122, 67, .05), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgba(27, 42, 58, .04), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--navy-2); text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }

/* ========== 顶部导航 ========== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(27, 42, 58, .9);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  color: #f3efe7;
  border-bottom: 1px solid rgba(182, 148, 90, .25);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 0 26px; height: 64px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; white-space: nowrap; letter-spacing: .02em; }
.brand .seal {
  width: 35px; height: 35px; border-radius: 10px;
  background: linear-gradient(150deg, var(--brass-2), var(--brass-deep));
  color: #1b2a3a; display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 18px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 6px rgba(0, 0, 0, .25);
}
.nav-tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  position: relative; padding: 9px 15px; border-radius: 9px; border: none; background: transparent;
  color: rgba(243, 239, 231, .68); font-size: 14px; white-space: nowrap;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.nav-tab:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-tab:active { transform: none; }
.nav-tab.active { color: #fff; background: transparent; font-weight: 600; }
.nav-tab.active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 5px; height: 2px;
  background: var(--brass-2); border-radius: 2px;
}
.searchbox { position: relative; width: 240px; flex-shrink: 0; }
.searchbox input {
  width: 100%; padding: 8px 12px 8px 34px; border-radius: 22px; border: 1px solid rgba(182, 148, 90, .28);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 13px; outline: none;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.searchbox input::placeholder { color: rgba(243, 239, 231, .55); }
.searchbox input:focus { background: rgba(255, 255, 255, .14); border-color: var(--brass-2); }
.searchbox::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 14px;
  transform: translateY(-50%); opacity: .8;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3efe7' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/svg%3E");
}

/* ========== 搜索浮层 ========== */
.search-panel {
  position: fixed; top: 72px; right: max(18px, calc((100vw - 1440px) / 2 + 26px));
  width: min(580px, calc(100vw - 36px)); max-height: 72vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 200; padding: 10px; display: none;
}
.search-panel.open { display: block; animation: fadein .22s var(--ease); }
.sr-item { padding: 11px 13px; border-radius: var(--radius-sm); cursor: pointer; transition: background .18s var(--ease); }
.sr-item:hover { background: var(--surface-2); }
.sr-item .t { font-weight: 600; font-size: 14px; color: var(--ink); }
.sr-item .t em, .sr-ctx em { color: var(--red); font-style: normal; background: var(--red-soft); padding: 0 2px; border-radius: 3px; }
.sr-item .src { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.sr-ctx { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sr-empty { padding: 26px; text-align: center; color: var(--ink-2); font-size: 13px; }

/* ========== 主布局 ========== */
.main { max-width: 1440px; margin: 0 auto; padding: 34px 26px 90px; }
.page { display: none; }
.page.active { display: block; animation: fadein .4s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ========== 首页 Hero ========== */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(130% 120% at 88% -10%, rgba(52, 83, 110, .55), transparent 55%),
    linear-gradient(155deg, #16222f 0%, #1b2a3a 52%, #20354a 100%);
  border: 1px solid rgba(182, 148, 90, .18);
  border-radius: 24px; color: #f3efe7; padding: 56px 54px; box-shadow: var(--shadow);
}
.hero::before {
  content: ""; position: absolute; right: -70px; top: -70px; width: 320px; height: 320px;
  border: 1px solid rgba(182, 148, 90, .16); border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(182, 148, 90, .05), 0 0 0 64px rgba(182, 148, 90, .025);
  pointer-events: none;
}
.hero::after {
  content: "稅"; position: absolute; right: -8px; bottom: -82px;
  font-family: var(--font-serif); font-size: 240px; font-weight: 700; color: rgba(243, 239, 231, .04);
  line-height: 1; pointer-events: none; user-select: none;
}
.hero .kicker {
  display: inline-block; font-family: var(--font); font-size: 11.5px; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase; color: var(--brass-2); margin-bottom: 18px;
}
.hero .kicker::before { content: ""; display: inline-block; width: 22px; height: 1px; background: var(--brass-2); vertical-align: middle; margin-right: 10px; opacity: .7; }
.hero h1 { font-size: 33px; letter-spacing: -.015em; font-weight: 700; line-height: 1.32; position: relative; }
.hero h1 .hl { color: var(--brass-2); }
.hero p { margin-top: 16px; color: rgba(243, 239, 231, .74); max-width: 62ch; font-size: 14.5px; line-height: 1.85; position: relative; }
.hero-stats { display: flex; gap: 40px; margin-top: 32px; flex-wrap: wrap; position: relative; z-index: 1; }
.hstat .n { font-family: var(--font-serif); font-size: 30px; font-weight: 700; color: var(--brass-2); line-height: 1.1; }
.hstat .l { font-size: 12.5px; color: rgba(243, 239, 231, .68); margin-top: 4px; }

/* Hero 搜索（搜索前置） */
.hero-search { display: flex; align-items: center; gap: 10px; margin-top: 26px; max-width: 640px; position: relative; z-index: 1; }
.hero-search .hs-ic { position: absolute; left: 16px; color: var(--brass-2); display: grid; place-items: center; pointer-events: none; }
#heroSearch {
  flex: 1; width: 100%; padding: 13px 16px 13px 46px; border-radius: 14px;
  border: 1px solid rgba(182, 148, 90, .35); background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 14.5px; font-family: var(--font); outline: none;
  transition: background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
#heroSearch::placeholder { color: rgba(243, 239, 231, .55); }
#heroSearch:focus { background: rgba(255, 255, 255, .14); border-color: var(--brass-2); box-shadow: 0 0 0 3px rgba(182, 148, 90, .18); }
.hero-search .btn-gold { flex-shrink: 0; }

/* 继续学习 */
.recent-row { display: flex; flex-wrap: wrap; gap: 9px; }
.recent-chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 8px 16px; font-size: 13px; color: var(--ink); font-family: var(--font); cursor: pointer;
  max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.recent-chip:hover { border-color: var(--brass); background: var(--brass-soft); color: var(--brass-deep); transform: translateY(-1px); }

.sec-title {
  font-size: 20px; font-weight: 700; margin: 44px 0 18px; display: flex; align-items: center; gap: 12px;
  color: var(--ink);
}
.sec-title::before { content: ""; width: 3px; height: 22px; border-radius: 2px; background: linear-gradient(var(--brass-2), var(--brass-deep)); }

/* 级联渐入 */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }

/* 通用卡片网格 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
/* Bento 非对称网格（首页板块）：首张主卡跨 2×2 */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.bento .card:first-child { grid-column: span 2; grid-row: span 2; }
.bento .card:first-child h3 { font-size: 21px; }
.bento .card:first-child .desc { -webkit-line-clamp: 4; font-size: 14.5px; }
.bento .card:first-child .icon-badge { width: 54px; height: 54px; border-radius: 14px; }
.bento .card:first-child .icon-badge svg { width: 27px; height: 27px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  cursor: pointer; overflow: hidden;
}
.card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--brass-2), var(--brass-deep)); opacity: 0; transition: opacity .35s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brass); }
.card:hover::after { opacity: 1; }
.card:active { transform: translateY(-1px); }
.card .icon-badge {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 18px; color: #fff; margin-bottom: 15px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.card .icon-badge svg { width: 21px; height: 21px; display: block; }
.card h3 { font-size: 16.5px; margin-bottom: 7px; color: var(--ink); }
.card .desc { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.65; }
.card .foot { margin-top: 14px; font-size: 12px; color: var(--brass-deep); font-weight: 600; letter-spacing: .02em; }

/* 工作流 */
.flow { display: flex; gap: 0; flex-wrap: wrap; align-items: stretch; }
.flow-step {
  flex: 1; min-width: 160px; background: var(--surface); border: 1px solid var(--line);
  padding: 18px 16px; position: relative; border-radius: 12px; margin: 6px 14px 6px 0;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.flow-step:hover { border-color: var(--brass); box-shadow: var(--shadow); }
.flow-step .badge {
  display: inline-block; background: var(--brass-soft); color: var(--brass-deep);
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 10px; margin-bottom: 8px; letter-spacing: .03em;
}
.flow-step .t { font-family: var(--font-serif); font-weight: 700; font-size: 15px; color: var(--ink); }
.flow-step .d { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* ========== 课程学习页 ========== */
.learn-layout { display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: start; }
.learn-nav { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; max-height: calc(100vh - 108px); overflow: auto; }
.ln-group { margin-bottom: 4px; }
.ln-sec {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: none; background: transparent; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: var(--ink); text-align: left; transition: background .15s;
}
.ln-sec:hover { background: var(--surface-2); }
.ln-sec .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ln-docs { padding-left: 16px; display: none; }
.ln-group.open .ln-docs { display: block; }
.ln-doc {
  width: 100%; display: block; text-align: left; padding: 7px 12px; border: none; background: transparent;
  border-radius: 8px; font-size: 13px; color: var(--ink-2); transition: all .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ln-doc:hover { color: var(--navy-2); background: var(--surface-2); }
.ln-doc.active { color: var(--brass-deep); background: var(--brass-soft); font-weight: 600; }

.doc-view { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 46px; min-height: 60vh; }
.doc-empty { text-align: center; color: var(--ink-2); padding: 90px 20px; }

/* Markdown 渲染 */
.md { max-width: 78ch; }
.md h1 { font-size: 26px; margin: 6px 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); color: var(--navy); }
.md h2 { font-size: 20px; margin: 34px 0 14px; padding-left: 14px; border-left: 3px solid var(--brass); color: var(--navy); }
.md h3 { font-size: 16.5px; margin: 24px 0 10px; color: var(--navy-2); }
.md h4 { font-size: 15px; margin: 18px 0 8px; font-family: var(--font); font-weight: 700; color: var(--ink); }
.md p { margin: 10px 0; }
.md ul, .md ol { padding-left: 24px; margin: 9px 0; }
.md li { margin: 5px 0; }
.md strong { color: var(--navy); }
.md table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 13.5px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.md th { background: var(--paper-2); color: var(--navy); font-weight: 600; font-family: var(--font); }
.md tr:nth-child(even) td { background: var(--surface-2); }
.md blockquote { border-left: 3px solid var(--brass); background: var(--brass-soft); padding: 12px 18px; margin: 14px 0; border-radius: 0 10px 10px 0; color: var(--brass-deep); font-size: 13.5px; }
.md code { background: var(--paper-2); padding: 2px 7px; border-radius: 5px; font-size: 13px; color: var(--red); font-family: "SF Mono", Menlo, monospace; }
.md pre { background: var(--navy); color: #d5e0ec; padding: 18px; border-radius: 12px; overflow-x: auto; margin: 14px 0; font-size: 13px; line-height: 1.6; }
.md pre code { background: none; color: inherit; padding: 0; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 26px 0; }
.md a { color: var(--navy-2); border-bottom: 1px dashed var(--brass); }

/* ========== 知识网络 ========== */
.graph-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.graph-legend { display: flex; gap: 20px; flex-wrap: wrap; padding: 6px 8px 16px; font-size: 12.5px; color: var(--ink-2); }
.graph-legend span { display: inline-flex; align-items: center; gap: 7px; }
.graph-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
#graphSvg { width: 100%; display: block; }
.gnode { cursor: pointer; }
.gnode circle, .gnode rect { transition: all .2s; }
.gnode:hover { filter: brightness(1.08); }
.gnode text { font-size: 11px; fill: #fff; pointer-events: none; }
.gedge { stroke: #cfc7b4; stroke-width: 1.2; fill: none; opacity: .6; }
.gedge.hl { stroke: var(--brass); stroke-width: 2.2; opacity: 1; }
.gnode.dim { opacity: .25; }
.gedge.dim { opacity: .1; }

/* ========== Skill 工坊 ========== */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.skill-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .35s var(--ease), transform .35s var(--ease); }
.skill-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.skill-head { padding: 20px 22px; color: #fff; display: flex; gap: 15px; align-items: center; position: relative; overflow: hidden; }
.skill-head::after { content: ""; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%; }
.skill-head .ic { width: 46px; height: 46px; border-radius: 12px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); position: relative; z-index: 1; }
.skill-head .ic svg { width: 23px; height: 23px; display: block; }
.skill-head h3 { font-size: 17.5px; position: relative; z-index: 1; }
.skill-head .tg { font-size: 12px; opacity: .85; margin-top: 3px; position: relative; z-index: 1; }
.skill-body { padding: 18px 22px 20px; }
.skill-body h4 { font-family: var(--font); font-size: 12px; color: var(--ink-2); margin: 14px 0 7px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.skill-body h4:first-child { margin-top: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; padding: 3px 11px; border-radius: 12px; color: var(--ink-2); }
.step-list { list-style: none; counter-reset: s; }
.step-list li { counter-increment: s; font-size: 13px; padding: 5px 0 5px 32px; position: relative; line-height: 1.6; }
.step-list li::before {
  content: counter(s); position: absolute; left: 0; top: 5px;
  width: 21px; height: 21px; border-radius: 50%; background: var(--brass-soft);
  color: var(--brass-deep); font-size: 11px; font-weight: 700; display: grid; place-items: center; font-family: var(--font);
}
.skill-actions { display: flex; gap: 9px; margin-top: 16px; }
.btn {
  border: none; border-radius: 10px; padding: 9px 17px; font-size: 13px; font-weight: 600;
  transition: all .25s var(--ease); display: inline-flex; align-items: center; gap: 7px;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: linear-gradient(150deg, var(--brass-2), var(--brass)); color: #1b2a3a; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--navy-2); color: var(--navy-2); }

/* ========== 案件分析 ========== */
.case-layout { display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; gap: 24px; align-items: start; }
.case-input-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; position: sticky; top: 84px; }
.case-input-card h3 { font-size: 16.5px; margin-bottom: 14px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.case-input-card textarea {
  width: 100%; min-height: 200px; border: 1px solid var(--line-2); border-radius: 12px;
  padding: 13px; font-family: var(--font); font-size: 14px; line-height: 1.75; resize: vertical; outline: none;
  background: var(--surface-2); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.case-input-card textarea:focus { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(156, 122, 67, .14); background: var(--surface); }
.file-drop {
  margin-top: 13px; border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 15px;
  text-align: center; font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: all .2s var(--ease);
}
.file-drop:hover, .file-drop.over { border-color: var(--brass); background: var(--brass-soft); color: var(--brass-deep); }
.case-fields { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.case-fields input, .case-fields select {
  border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; font-size: 13px;
  font-family: var(--font); outline: none; width: 100%; background: var(--surface); color: var(--ink);
  transition: border-color .2s var(--ease);
}
.case-fields input:focus, .case-fields select:focus { border-color: var(--brass); }
.case-run { width: 100%; margin-top: 15px; padding: 12px; font-size: 14.5px; justify-content: center; }
.case-history { margin-top: 15px; font-size: 12.5px; color: var(--ink-2); }
.case-history .h-item { padding: 6px 9px; border-radius: 7px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .15s; }
.case-history .h-item:hover { background: var(--surface-2); color: var(--navy-2); }

/* 案件文件队列 */
.case-files { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.cf-head { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.cf-row { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; transition: border-color .2s var(--ease); }
.cf-row:hover { border-color: var(--brass); }
.cf-ic { color: var(--navy-2); flex-shrink: 0; display: grid; place-items: center; }
.cf-ic svg { width: 15px; height: 15px; }
.cf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.cf-meta { font-size: 11.5px; color: var(--ink-3); flex-shrink: 0; }
.cf-chip { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 10px; flex-shrink: 0; white-space: nowrap; font-family: var(--font); }
.cf-chip.c-parsing { background: var(--brass-soft); color: var(--brass-deep); }
.cf-chip.c-ok { background: var(--green-soft); color: var(--green); }
.cf-chip.c-fail { background: var(--red-soft); color: var(--red); }
.cf-del { border: none; background: transparent; color: var(--ink-3); width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; cursor: pointer; font-size: 12px; line-height: 1; transition: all .15s; }
.cf-del:hover { background: var(--red-soft); color: var(--red); }
.case-input-card textarea { margin-top: 13px; }

/* ========== 案件输出列：工具栏 + 结果 + 原文视图 ========== */
.case-out-col { min-width: 0; }
.report-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 14px;
}
.report-toolbar .rt-title { font-size: 12.5px; font-weight: 700; color: var(--brass-deep); letter-spacing: .05em; margin-right: 4px; }
.report-toolbar .btn { padding: 7px 13px; font-size: 12.5px; }

.enc-row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.enc-row .btn { padding: 6px 12px; font-size: 12px; }
.enc-row .enc-danger { color: var(--red); border-color: rgba(162,59,46,.35); }
.enc-row .enc-danger:hover { background: var(--red-soft); color: var(--red); }

/* 证据引用标签 */
.ev-row { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.ev-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  background: var(--green-soft); color: var(--green); border: 1px solid rgba(63,107,84,.25);
  padding: 3px 10px; border-radius: 11px; cursor: pointer; transition: all .2s var(--ease);
}
.ev-tag svg { width: 11px; height: 11px; }
.ev-tag:hover { background: var(--green); color: #fff; }

/* 案件要素速览 */
.el-row { display: flex; flex-wrap: wrap; gap: 8px; }
.el-chip {
  font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 12px; color: var(--ink); line-height: 1.6;
}
.el-chip b { color: var(--brass-deep); font-weight: 700; margin-right: 7px; }

/* 风险量化测算 */
.est-input { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.est-input label { font-size: 12.5px; color: var(--ink-2); }
.est-ver { font-size: 11.5px; color: var(--ink-3); }
.est-tb { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--surface); }
.est-tb th, .est-tb td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.est-tb th { background: var(--navy); color: #fff; font-weight: 600; font-family: var(--font); font-size: 12px; }
.est-tb td b { color: var(--red); }
.est-tb tr:nth-child(2) td { background: var(--green-soft); }
.est-tb tr:nth-child(4) td { background: var(--red-soft); }
.est-assump {
  margin-top: 12px; font-size: 12px; color: var(--ink-2);
  background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 14px;
}
.est-assump b { color: var(--brass-deep); }
.est-assump ul { margin: 6px 0 0; padding-left: 18px; }
.est-assump li { margin: 3px 0; }
.est-disc {
  margin-top: 10px; font-size: 12px; color: var(--brass-deep);
  background: var(--brass-soft); border-radius: 9px; padding: 9px 13px; line-height: 1.65;
}

/* 文件类型标签（4.1） */
.cf-type {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: var(--navy-2);
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 9px;
  padding: 1px 8px;
}

/* 矛盾提示（4.4） */
.cf-conflict {
  margin-top: 10px; display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--red); background: var(--red-soft);
  border: 1px solid rgba(162,59,46,.25); border-radius: 9px; padding: 10px 13px; line-height: 1.6;
}
.cf-conflict svg { width: 13px; height: 13px; flex-shrink: 0; vertical-align: -2px; }

/* 应对路径评估（3.4） */
.pw-head { font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.pw-item {
  border: 1px solid var(--line); border-left: 4px solid var(--navy-3);
  border-radius: 11px; padding: 12px 15px; margin-bottom: 10px; background: var(--surface);
}
.pw-name { font-weight: 700; font-size: 14px; color: var(--navy); margin-bottom: 7px; }
.pw-row { display: flex; gap: 8px; font-size: 12.5px; margin: 3px 0; line-height: 1.65; }
.pw-lb { flex-shrink: 0; width: 36px; font-weight: 700; color: var(--brass-deep); font-size: 11.5px; padding-top: 1px; }

/* 测算可视化（8.2 纯 CSS） */
.vb { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.vb-row { display: flex; align-items: center; gap: 9px; font-size: 11.5px; }
.vb-lb { flex-shrink: 0; width: 46px; color: var(--ink-2); font-weight: 600; }
.vb-track { flex: 1; height: 12px; background: var(--paper-2); border-radius: 6px; overflow: hidden; }
.vb-fill { height: 100%; border-radius: 6px; transition: width .4s var(--ease); }
.vb-val { flex-shrink: 0; width: 84px; text-align: right; font-weight: 700; color: var(--ink); font-family: var(--font); }

/* 证据链关联图谱（4.3） */
.eg-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-2); padding: 4px 4px 10px; }
.eg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.eg-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.eg-edge { stroke: #cfc7b4; stroke-width: 1.2; fill: none; opacity: .65; }
.eg-edge.eg-hl { stroke: var(--brass); stroke-width: 2.4; opacity: 1; }
.eg-node { cursor: pointer; }
.eg-node.eg-dim { opacity: .22; }
.eg-node.eg-file rect { transition: all .2s; }
.eg-node.eg-file:hover rect { filter: brightness(1.12); }
.eg-node:focus-visible rect { stroke: var(--brass-2); stroke-width: 2; }

/* 案件摘要（3.2 模板版） */
.sm-one { font-size: 15px; font-weight: 700; color: var(--navy); line-height: 1.7; margin-bottom: 8px; font-family: var(--font-serif); }
.sm-ov { font-size: 13px; color: var(--ink-2); line-height: 1.75; background: var(--surface-2); border-radius: 9px; padding: 10px 14px; }
.sm-pts { list-style: none; margin-top: 10px; }
.sm-pts li { font-size: 12.5px; color: var(--ink); padding: 4px 0 4px 20px; position: relative; line-height: 1.65; }
.sm-pts li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--brass-2); }

/* 历史版本（6.3） */
.ver-list { display: flex; flex-direction: column; gap: 8px; }
.ver-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 15px;
  border: 1px solid var(--line); border-radius: 11px; cursor: pointer; background: var(--surface);
  transition: all .2s var(--ease);
}
.ver-item:hover { border-color: var(--brass); background: var(--brass-soft); }
.ver-ts { flex-shrink: 0; font-size: 12px; color: var(--ink-3); font-family: var(--font); }
.ver-one { flex: 1; min-width: 0; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ver-go { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--brass-deep); }

/* 证据支撑度（4.2） */
.head-r { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sup-badge {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 10px; border: 1px solid; white-space: nowrap; font-family: var(--font);
}
.sup-badge[data-lv="强"] { color: var(--green); border-color: rgba(63,107,84,.35); background: var(--green-soft); }
.sup-badge[data-lv="中"] { color: var(--brass-deep); border-color: rgba(156,122,67,.35); background: var(--brass-soft); }
.sup-badge[data-lv="弱"] { color: var(--ink-3); border-color: var(--line-2); background: var(--surface-2); }
.sup-badge[data-lv="缺"] { color: var(--red); border-color: rgba(162,59,46,.35); background: var(--red-soft); }

/* 案件时间轴（8.2） */
.tl2 { display: flex; flex-wrap: wrap; gap: 6px 0; margin-top: 10px; }
.tl2-item { display: flex; align-items: center; font-size: 11.5px; color: var(--ink-2); }
.tl2-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brass-2); margin: 0 7px 0 14px; flex-shrink: 0; }
.tl2-item:first-child .tl2-dot { margin-left: 0; }
.tl2-item::after { content: "—"; color: var(--line-2); margin-left: 6px; }
.tl2-item:last-child::after { content: ""; }

/* 原文视图 */
.src-view {
  margin-top: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.src-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: var(--navy); color: #fff; font-size: 13.5px;
}
.src-head .src-t { font-weight: 700; color: var(--brass-2); font-size: 12px; letter-spacing: .06em; }
.src-head .src-f { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-close { border: none; background: rgba(255,255,255,.14); color: #fff; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 12px; flex-shrink: 0; }
.src-close:hover { background: rgba(255,255,255,.28); }
.src-body { max-height: 46vh; overflow: auto; padding: 14px 18px; }
.src-block {
  position: relative; padding: 7px 10px 7px 52px; font-size: 13px; color: var(--ink);
  line-height: 1.75; border-left: 2px solid transparent; border-radius: 6px; transition: background .2s;
}
.src-block:hover { background: var(--surface-2); }
.src-block.active { background: var(--brass-soft); border-left-color: var(--brass); }
.src-bm {
  position: absolute; left: 10px; top: 9px; font-size: 10.5px; font-weight: 700; color: var(--ink-3);
  font-family: var(--font); letter-spacing: .02em;
}

/* ========== 打印报告（2.1 打印视图） ========== */
#printRoot { display: none; }
@media print {
  body > *:not(#printRoot) { display: none !important; }
  #printRoot { display: block !important; }
  .rpt { font-family: "Songti SC", "SimSun", serif; color: #000; padding: 18px 8px; font-size: 12px; line-height: 1.8; }
  .rpt-head { border-bottom: 2px solid #1b2a3a; padding-bottom: 10px; margin-bottom: 16px; }
  .rpt-firm { font-size: 15px; font-weight: 700; }
  .rpt-title { font-size: 22px; font-weight: 700; margin-top: 4px; }
  .rpt-meta { font-size: 10.5px; color: #444; margin-top: 5px; }
  .rpt-sec { margin-bottom: 13px; }
  .rpt-sec h4 { font-size: 13.5px; border-left: 3px solid #1b2a3a; padding-left: 8px; margin-bottom: 7px; }
  .rpt-tb { border-collapse: collapse; width: 100%; font-size: 11.5px; }
  .rpt-tb td { border: 1px solid #999; padding: 5px 8px; }
  .rpt-tb .k { background: #f0ede6; font-weight: 700; width: 80px; }
  .rpt-risk { margin-bottom: 9px; }
  .rpt-rk { font-weight: 700; font-size: 12.5px; }
  .rpt-lv { font-weight: 400; color: #555; font-size: 11px; }
  .rpt-adv { font-size: 11.5px; margin-top: 3px; padding: 6px 10px; background: #f7f4ee; border-radius: 5px; }
  .rpt-sec ul, .rpt-sec ol { font-size: 11.5px; padding-left: 20px; margin: 4px 0; }
  .rpt-sec li { margin: 2px 0; }
  .rpt-disc { font-size: 10px; color: #555; border-top: 1px solid #bbb; padding-top: 7px; margin-top: 14px; }
  .rpt-sign { text-align: right; font-size: 11.5px; margin-top: 20px; }
}

.case-result { min-height: 300px; }
.result-placeholder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 74px 30px; text-align: center; color: var(--ink-2); }
.result-placeholder .big { width: 54px; height: 54px; margin: 0 auto 16px; color: var(--navy-3); }
.result-placeholder .big svg { width: 100%; height: 100%; }
.file-drop svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.r-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; margin-bottom: 18px; }
.r-block h3 { font-size: 16.5px; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; color: var(--navy); font-family: var(--font-serif); }
.r-block h3 .n { background: var(--navy); color: #fff; width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-family: var(--font); flex-shrink: 0; }
.risk-item { border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 12px; padding: 15px 17px; margin-bottom: 12px; background: var(--surface); transition: box-shadow .25s var(--ease); }
.risk-item:hover { box-shadow: var(--shadow); }
.risk-item .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.risk-item .name { font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 7px; }
.risk-item .name svg { width: 16px; height: 16px; }
.score { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 10px; white-space: nowrap; font-family: var(--font); }
.score.s-hi { background: var(--red-soft); color: var(--red); }
.score.s-mid { background: var(--brass-soft); color: var(--brass-deep); }
.score.s-lo { background: var(--green-soft); color: var(--green); }
.risk-item .hits { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.risk-item .hits b { color: var(--red); font-weight: 600; }
.risk-item .adv { font-size: 13.5px; margin-top: 9px; background: var(--surface-2); border-radius: 9px; padding: 11px 14px; line-height: 1.7; }
.ref-link { display: inline-flex; align-items: center; margin: 4px 7px 4px 0; font-size: 12.5px; background: var(--surface-2); color: var(--navy-2); padding: 4px 12px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: all .25s var(--ease); }
.ref-link svg { width: 11px; height: 11px; margin-right: 5px; flex-shrink: 0; }
.ref-link:hover { border-color: var(--brass); background: var(--brass-soft); color: var(--brass-deep); }
.qa-item { border-bottom: 1px solid var(--line); padding: 10px 2px; font-size: 13.5px; cursor: pointer; transition: color .15s; }
.qa-item:last-child { border-bottom: none; }
.qa-item:hover { color: var(--navy-2); }
.qa-item .cat { font-size: 11px; color: var(--brass-deep); font-weight: 700; margin-right: 7px; }
.action-steps { counter-reset: a; list-style: none; }
.action-steps li { counter-increment: a; padding: 9px 0 9px 36px; position: relative; font-size: 13.5px; border-bottom: 1px dashed var(--line); line-height: 1.7; }
.action-steps li:last-child { border-bottom: none; }
.action-steps li::before {
  content: counter(a); position: absolute; left: 0; top: 9px;
  width: 23px; height: 23px; border-radius: 8px; background: var(--navy);
  color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; font-family: var(--font);
}

/* ========== 资料库 ========== */
.lib-filter { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.lib-filter select, .lib-filter input {
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 13px; font-size: 13px;
  font-family: var(--font); background: var(--surface); outline: none; color: var(--ink); transition: border-color .2s var(--ease);
}
.lib-filter select:focus, .lib-filter input:focus { border-color: var(--brass); }
.lib-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.lib-row { display: grid; grid-template-columns: 44px 1fr 150px 90px; gap: 10px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; transition: background .15s; }
.lib-row:last-child { border-bottom: none; }
.lib-row:hover { background: var(--surface-2); }
.lib-row .fi { font-size: 18px; text-align: center; }
.lib-row .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-row .fc { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-row .fs { font-size: 12px; color: var(--ink-2); text-align: right; }
.lib-head { background: var(--navy); color: #fff; font-weight: 600; font-size: 12.5px; font-family: var(--font); }
.lib-head:hover { background: var(--navy); }
.lib-count { font-size: 12.5px; color: var(--ink-2); margin-left: auto; }

/* ========== 弹窗 ========== */
.modal-mask { position: fixed; inset: 0; background: rgba(27, 42, 58, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 300; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.open { display: flex; animation: fadein .25s var(--ease); }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; max-width: 860px; width: 100%; max-height: 86vh; overflow: auto; padding: 32px 38px; position: relative; box-shadow: var(--shadow-lg); }
.modal .close-x { position: absolute; top: 16px; right: 18px; border: none; background: var(--surface-2); width: 32px; height: 32px; border-radius: 9px; font-size: 14px; color: var(--ink-2); transition: background .15s; }
.modal .close-x:hover { background: var(--line); }

/* toast */
.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 11px 24px; border-radius: 11px; font-size: 13.5px; opacity: 0; transition: all .3s; z-index: 400; pointer-events: none; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== 页脚 ========== */
.site-footer { border-top: 1px solid var(--line-2); background: var(--surface); }
.foot-inner { max-width: 1440px; margin: 0 auto; padding: 24px 26px 30px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot-brand { font-family: var(--font-serif); font-weight: 700; color: var(--navy); font-size: 15px; letter-spacing: .02em; }
.foot-note { flex: 1; min-width: 260px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.foot-links { font-size: 12px; color: var(--ink-3); }

/* ========== 无障碍与对比度 ========== */
.case-input-card textarea, .case-fields input, .case-fields select,
.lib-filter select, .lib-filter input { border-color: var(--line-2); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }
.nav-tab:focus-visible { outline-color: var(--brass-2); }
.searchbox input:focus-visible { outline-color: var(--brass-2); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ========== 骨架屏 ========== */
.skel { border-radius: 8px; background: linear-gradient(90deg, #e9e3d6 25%, #f4efe5 50%, #e9e3d6 75%); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 26px; margin-bottom: 16px; }
.skel-line { height: 14px; margin: 10px 0; }
.btn.loading { opacity: .7; pointer-events: none; }
.btn.loading::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -1px; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 移动端搜索抽屉 ========== */
.search-drawer {
  position: fixed; top: 0; left: 0; right: 0; z-index: 250;
  background: rgba(27, 42, 58, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: 14px 16px calc(14px + env(safe-area-inset-top, 0px));
  transform: translateY(-110%); transition: transform .25s ease-out;
  box-shadow: 0 8px 28px rgba(27, 42, 58, .35); display: flex; gap: 9px; align-items: center;
}
.search-drawer.open { transform: translateY(0); }
.search-drawer input {
  flex: 1; padding: 11px 16px; border-radius: 22px; border: 1px solid rgba(182, 148, 90, .3); font-size: 15px;
  background: rgba(255, 255, 255, .96); color: var(--ink); outline: none; font-family: var(--font);
}
.search-drawer .drawer-close { border: none; background: rgba(255, 255, 255, .16); color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 15px; flex-shrink: 0; }

/* ========== 知识网络 · 小屏列表视图 ========== */
.graph-list { padding: 8px; }
.gl-sec { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gl-sec-head { display: flex; align-items: center; gap: 9px; padding: 13px 15px; font-weight: 700; font-size: 14.5px; color: #fff; cursor: pointer; font-family: var(--font-serif); }
.gl-topic { padding: 11px 15px 11px 27px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s; }
.gl-topic:hover { background: var(--surface-2); }
.gl-links { padding: 0 15px 11px 41px; display: flex; flex-wrap: wrap; gap: 6px; }
.gl-links .ref-link { margin: 0; }

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
  .bento { grid-template-columns: repeat(3, 1fr); }
  .bento .card:first-child { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 1024px) {
  .nav-tabs { scrollbar-width: thin; scrollbar-color: rgba(182, 148, 90, .5) transparent; }
  .nav-tabs::-webkit-scrollbar { height: 5px; display: block; }
  .nav-tabs::-webkit-scrollbar-thumb { background: rgba(182, 148, 90, .5); border-radius: 3px; }
  .nav-tabs::-webkit-scrollbar-track { background: transparent; }
  .learn-layout { grid-template-columns: 1fr; }
  .learn-nav { position: static; max-height: none; }
  .case-layout { grid-template-columns: 1fr; }
  .case-input-card { position: static; }
  .searchbox { display: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 0 14px; gap: 8px; }
  .brand span.bt { display: none; }
  .main { padding: 18px 14px 64px; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 24px; }
  .hero-stats { gap: 24px; }
  .doc-view { padding: 22px 18px; }
  .lib-row { grid-template-columns: 34px 1fr 70px; }
  .lib-row .fc { display: none; }
  .search-panel { top: 64px; right: 10px; }
  .bento { grid-template-columns: 1fr; }
  .bento .card:first-child { grid-column: span 1; grid-row: span 1; }
  .bento .card:first-child h3 { font-size: 16.5px; }
  .bento .card:first-child .desc { -webkit-line-clamp: 2; font-size: 13px; }
  .flow { flex-direction: column; }
  .flow-step { min-width: 0; margin: 0 0 10px; }
  .hero-search { flex-wrap: wrap; }
  .hero-search .hs-ic { top: 24px; transform: translateY(-50%); }
  .hero-search #heroSearch { flex: 1 1 100%; }
  .hero-search .btn-gold { width: 100%; }
}

/* ========== 法规政策库（v3.1） ========== */
.law-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.law-tab {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  padding: 8px 16px; border-radius: 22px; font-size: 13.5px; font-weight: 600;
  transition: all .25s var(--ease);
}
.law-tab:hover { border-color: var(--brass); color: var(--brass-deep); }
.law-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.law-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
#lawSearch {
  flex: 1; min-width: 240px; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 14px; font-size: 13.5px; font-family: var(--font); background: var(--surface); color: var(--ink); outline: none;
  transition: border-color .2s var(--ease);
}
#lawSearch:focus { border-color: var(--brass); }
.law-catfilter { display: flex; gap: 6px; flex-wrap: wrap; }
.law-cat {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 12px; padding: 5px 12px; border-radius: 14px; transition: all .2s var(--ease);
}
.law-cat:hover { border-color: var(--brass); color: var(--brass-deep); }
.law-cat.active { background: var(--brass-soft); border-color: var(--brass); color: var(--brass-deep); font-weight: 700; }

.law-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.law-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; display: flex; flex-direction: column;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.law-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brass); }
.law-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.law-card-head h3 { font-size: 16px; color: var(--ink); line-height: 1.4; }
.law-meta { font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.law-sum { font-size: 13.5px; color: var(--ink); line-height: 1.7; margin-bottom: 12px; }
.law-arts { list-style: none; margin: 0 0 14px; padding: 0; }
.law-arts li {
  font-size: 12.5px; color: var(--ink-2); padding: 5px 0 5px 18px; position: relative; line-height: 1.6;
  border-bottom: 1px dashed var(--line);
}
.law-arts li:last-child { border-bottom: none; }
.law-arts li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--brass-2); }
.law-link { margin-top: auto; align-self: flex-start; }

.law-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 11px; white-space: nowrap; font-family: var(--font);
}
.law-badge.b-law { background: var(--green-soft); color: var(--green); }
.law-badge.b-draft { background: var(--brass-soft); color: var(--brass-deep); }
.law-badge.b-reg { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--navy-2); }
.law-badge.b-proc { background: var(--paper-2); color: var(--navy-2); }
.law-badge.b-case { background: var(--red-soft); color: var(--red); }

/* 政策条目（时间线） */
.pol-item {
  display: flex; gap: 18px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 22px; margin-bottom: 14px; transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.pol-item:hover { border-color: var(--brass); box-shadow: var(--shadow-lg); }
.pol-date {
  flex-shrink: 0; width: 110px; font-family: var(--font-serif); font-weight: 700; font-size: 14px; color: var(--brass-deep);
  border-right: 1px solid var(--line); padding-right: 16px;
}
.pol-main { flex: 1; min-width: 0; }
.pol-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pol-head h3 { font-size: 15.5px; color: var(--ink); }

/* 典型案件卡 */
.case-card .case-row { display: flex; gap: 8px; font-size: 13px; margin-bottom: 7px; line-height: 1.6; }
.case-lb { flex-shrink: 0; width: 36px; font-weight: 700; color: var(--navy-2); font-size: 12px; padding-top: 1px; }

/* 首页官方内容入口卡 */
.law-promo {
  display: flex; align-items: center; gap: 18px; background: linear-gradient(150deg, #16222f, #1b2a3a 55%, #20354a);
  border: 1px solid rgba(182, 148, 90, .25); border-radius: var(--radius); color: #f3efe7;
  padding: 24px 26px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.law-promo:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brass-2); }
.law-promo-ic {
  width: 48px; height: 48px; border-radius: 13px; background: rgba(182, 148, 90, .16);
  border: 1px solid rgba(182, 148, 90, .3); display: grid; place-items: center; color: var(--brass-2); flex-shrink: 0;
}
.law-promo-tx { flex: 1; min-width: 0; }
.law-promo-t { font-family: var(--font-serif); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.law-promo-d { font-size: 13.5px; color: rgba(243, 239, 231, .74); line-height: 1.7; }
.law-promo-go { flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--brass-2); white-space: nowrap; }

@media (max-width: 640px) {
  .pol-item { flex-direction: column; gap: 10px; }
  .pol-date { width: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 0 0 8px; }
  .law-promo { flex-direction: column; align-items: flex-start; }
  .law-grid { grid-template-columns: 1fr; }
}
