/* ==========================================================================
   武汉建设工程造价信息库
   设计语言参照 Anthropic / Claude 设计系统
   tokens: gray-10 #fcfcfb  gray-900 #0b0b0b  clay #d97757
   ========================================================================== */

:root {
  /* ---- surfaces ---- */
  --bg: #fcfcfb;
  --surface: #ffffff;
  --surface-2: #f9f9f7;
  --surface-3: #f0efec;

  /* ---- ink ---- */
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6d6b67;
  --ink-4: #898781;

  /* ---- lines ---- */
  --line: rgba(11, 11, 11, .10);
  --line-soft: rgba(11, 11, 11, .06);
  --line-2: #e7e6e1;

  /* ---- brand ---- */
  --clay: #d97757;
  --clay-d: #c6613f;
  --clay-tint: #f9ece7;
  --clay-tint-2: #f7e1d7;

  /* ---- support ---- */
  --green: #0f7e5c;
  --green-tint: #e2f4ed;
  --violet: #6250d6;
  --violet-tint: #efedff;
  --blue: #256abf;
  --blue-tint: #e7f1fb;

  /* ---- elevation ---- */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .10), 0 2px 4px -2px rgba(0, 0, 0, .10);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .10), 0 4px 6px -4px rgba(0, 0, 0, .10);
  --shadow-pop: 0 4px 24px rgba(11, 11, 11, .10);

  /* ---- radius ---- */
  --r-card: 24px;
  --r-md: 16px;
  --r-ctl: 10px;
  --r-pill: 999px;

  /* ---- type ---- */
  --font-sans: anthropic-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Anthropic Serif Fallback Georgia", Georgia, "Times New Roman",
                "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;

  --head-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

::selection { background: var(--clay-tint-2); color: var(--ink); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ============================ header ============================ */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: rgba(252, 252, 251, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: var(--head-h); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 16px; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 22px; height: 22px; flex: 0 0 22px; display: block; color: var(--clay); }
.brand .mark svg { width: 100%; height: 100%; display: block; }

.site-nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.site-nav a {
  color: var(--ink-2); padding: 7px 14px; border-radius: var(--r-pill);
  font-size: 14.5px; white-space: nowrap; transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.site-nav a.on { background: var(--ink); color: #fff; font-weight: 500; }

/* ============================ hero ============================ */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 1.35rem + 2vw, 3rem);
  line-height: 1.16;
  letter-spacing: -.015em;
  color: var(--ink);
}
.hero p { margin: 0 auto 34px; max-width: 620px; color: var(--ink-3); font-size: 15px; line-height: 1.65; }
.hero p a { color: var(--clay-d); text-decoration: underline; text-underline-offset: 2px; }

/* ============================ search ============================ */
.searchbar {
  max-width: 720px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px;
  display: flex; gap: 8px; align-items: center;
  transition: border-color .15s, box-shadow .15s;
}
.searchbar:focus-within { border-color: var(--clay); box-shadow: 0 0 0 4px var(--clay-tint); }
.searchbar input[type=search] {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: transparent;
  padding: 10px 12px; font: 400 15.5px/1.4 var(--font-sans); color: var(--ink);
}
.searchbar input[type=search]::placeholder { color: var(--ink-4); }

/* ============================ buttons ============================ */
.btn {
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  height: 42px; padding: 0 20px; border-radius: var(--r-ctl);
  font: 500 15px/1 var(--font-sans); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn:active { transform: scale(.985); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--ink-4); }

.mini-btn {
  height: 34px; padding: 0 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: 500 13.5px/1 var(--font-sans); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.mini-btn:hover { border-color: var(--ink-4); color: var(--ink); background: var(--surface-2); text-decoration: none; }
.mini-btn.p { background: var(--ink); border-color: var(--ink); color: #fff; }
.mini-btn.p:hover { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }

/* ============================ layout ============================ */
.section { margin: 44px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 {
  margin: 0; font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(1.25rem, 1.05rem + .6vw, 1.65rem); line-height: 1.3;
  letter-spacing: -.01em; color: var(--ink);
}
.section-head .sub { color: var(--ink-4); font-size: 13.5px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.card-pad { padding: 28px 30px; }

/* ============================ month picker ============================ */
.picker-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.year-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.year-tabs button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  height: 36px; padding: 0 15px; border-radius: var(--r-pill);
  cursor: pointer; font: 500 14px/1 var(--font-sans); transition: .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.year-tabs button:hover { border-color: var(--ink-4); color: var(--ink); }
.year-tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.year-tabs button .n { font-weight: 400; opacity: .6; font-size: 12px; }

.month-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 980px) { .month-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .month-grid { grid-template-columns: repeat(3, 1fr); } }

.mcell {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  min-height: 112px; padding: 14px 15px 13px; display: flex; flex-direction: column; gap: 7px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.mcell.has:hover { border-color: var(--clay); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.mcell.empty { background: var(--surface-2); border-style: dashed; border-color: var(--line-2); }
.mcell .mnum {
  font-family: var(--font-serif); font-size: 21px; line-height: 1.1; color: var(--ink);
  display: flex; align-items: baseline; gap: 5px;
}
.mcell .mnum small { font-family: var(--font-sans); font-size: 11.5px; font-weight: 400; color: var(--ink-4); }
.mcell.empty .mnum { color: var(--ink-4); }
.mcell .mlink {
  display: block; font-size: 12.5px; line-height: 1.4; color: var(--ink-3);
  border-top: 1px solid var(--line-soft); padding-top: 7px; transition: color .15s;
}
.mcell .mlink:hover { color: var(--clay-d); text-decoration: none; }
.mcell .mlink .tag {
  display: inline-block; font-size: 10.5px; background: var(--clay-tint); color: var(--clay-d);
  border-radius: var(--r-pill); padding: 1px 7px; margin-right: 5px; font-weight: 500;
}
.mcell .none { font-size: 11.5px; color: var(--ink-4); margin-top: auto; }

/* ============================ category cards ============================ */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cat-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 22px 24px; min-height: 108px;
  display: block; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cat-card:hover { border-color: var(--ink-4); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.cat-card .cname { font-size: 15.5px; font-weight: 500; line-height: 1.45; margin-bottom: 8px; padding-right: 56px; color: var(--ink); }
.cat-card .cmeta { font-size: 12.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.cat-card .cnum {
  position: absolute; top: 20px; right: 22px; text-align: right;
  font-family: var(--font-serif); font-size: 24px; line-height: 1; color: var(--clay);
}
.cat-card .cnum small { display: block; font-family: var(--font-sans); font-size: 11px; font-weight: 400; color: var(--ink-4); margin-top: 3px; }

/* ============================ doc list ============================ */
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc {
  display: flex; gap: 16px; align-items: flex-start; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}
.doc:hover { border-color: var(--ink-4); box-shadow: var(--shadow-sm); }
.doc .d-date {
  flex: 0 0 84px; font-size: 12.5px; color: var(--ink-4); padding-top: 2px;
  font-variant-numeric: tabular-nums; font-weight: 500;
}
.doc .d-body { flex: 1; min-width: 0; }
.doc .d-title { font-size: 15px; font-weight: 500; line-height: 1.5; color: var(--ink); }
.doc .d-title:hover { color: var(--clay-d); text-decoration: none; }
.doc .d-meta { margin-top: 7px; font-size: 12px; color: var(--ink-4); display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.doc .d-act { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; padding-top: 1px; }

.chip {
  display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--clay-tint); color: var(--clay-d); font-weight: 500; white-space: nowrap;
}
.chip.grey { background: var(--surface-3); color: var(--ink-2); }
.chip.green { background: var(--green-tint); color: var(--green); }
.chip.blue { background: var(--blue-tint); color: var(--blue); }

/* ============================ filters ============================ */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filters select, .filters input {
  height: 42px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 0 14px; font: 400 14.5px/1 var(--font-sans); background: var(--surface);
  color: var(--ink); min-width: 140px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.filters select:focus, .filters input:focus { border-color: var(--clay); box-shadow: 0 0 0 4px var(--clay-tint); }
.filters input[type=search] { flex: 1 1 220px; min-width: 160px; }
.filters input::placeholder { color: var(--ink-4); }

/* ============================ stats ============================ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 24px; }
.stat .v {
  font-family: var(--font-serif); font-size: 30px; line-height: 1.1; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.stat .k { font-size: 12.5px; color: var(--ink-4); margin-top: 8px; }

/* ============================ reader ============================ */
.reader-layout { display: grid; grid-template-columns: 1fr 296px; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .reader-layout { grid-template-columns: 1fr; } }

.pdf-frame {
  width: 100%; height: calc(100vh - var(--head-h) - 130px); min-height: 560px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-3); display: block;
}
.article-body {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 36px 40px; font-size: 15.5px; line-height: 1.85; color: var(--ink);
}
.article-body img { max-width: 100%; height: auto; border-radius: var(--r-md); margin: 16px 0; border: 1px solid var(--line); }

.side-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 22px 24px; margin-bottom: 16px;
}
.side-card h3 {
  margin: 0 0 14px; font-size: 11.5px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-4);
}
.kv { display: flex; gap: 12px; font-size: 13.5px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: none; padding-bottom: 0; }
.kv .k { flex: 0 0 58px; color: var(--ink-4); }
.kv .v { flex: 1; color: var(--ink); word-break: break-word; }
.kv .v a { color: var(--clay-d); }
.kv .v a:hover { text-decoration: underline; text-underline-offset: 2px; }

.file-link {
  display: flex; gap: 11px; align-items: center; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  margin-bottom: 8px; font-size: 13.5px; color: var(--ink); background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.file-link:hover { border-color: var(--ink-4); background: var(--surface); text-decoration: none; }
.file-link .ic {
  flex: 0 0 28px; height: 28px; border-radius: 7px; background: var(--ink);
  color: #fff; display: grid; place-items: center; font-size: 8.5px; font-weight: 600; letter-spacing: .02em;
}
.file-link .ic.pdf { background: var(--clay); }
.file-link .ic.doc { background: var(--blue); }
.file-link .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-link .sz { flex: 0 0 auto; font-size: 11.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

/* ============================ misc ============================ */
.empty-state { text-align: center; padding: 72px 20px; color: var(--ink-4); }
.empty-state .big { font-size: 30px; margin-bottom: 12px; opacity: .55; }

.hidden { display: none !important; }
.mark-hl { background: var(--clay-tint-2); color: var(--ink); border-radius: 3px; padding: 0 2px; }

.to-top {
  position: fixed; right: 28px; bottom: 28px; z-index: 70; width: 42px; height: 42px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-md); cursor: pointer; font-size: 16px; color: var(--ink-2);
  display: none; transition: background .15s, border-color .15s;
}
.to-top.show { display: block; }
.to-top:hover { background: var(--surface-2); border-color: var(--ink-4); }

/* ============================ about ============================ */
.about-body { font-size: 15.5px; line-height: 1.85; color: var(--ink-2); }
.about-body h2 { font-family: var(--font-serif); font-weight: 400; font-size: 26px; color: var(--ink); margin: 0 0 16px; letter-spacing: -.01em; }
.about-body h3 { font-size: 15px; font-weight: 500; color: var(--ink); margin: 32px 0 12px; }
.about-body p { margin: 0 0 14px; }
.about-body ul { margin: 0 0 14px; padding-left: 20px; }
.about-body li { margin-bottom: 6px; }
.about-body code { background: var(--surface-3); border-radius: 5px; padding: 1px 6px; font-size: 13.5px; color: var(--ink); }
.about-body strong { color: var(--ink); font-weight: 500; }
.about-body table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.about-body th { font-size: 12px; font-weight: 500; color: var(--ink-4); text-align: left; padding: 0 22px 8px 0; border-bottom: 1px solid var(--line); }
.about-body td { padding: 9px 22px 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.about-body a { color: var(--clay-d); text-decoration: underline; text-underline-offset: 2px; }

/* ============================ footer ============================ */
.site-foot {
  margin-top: 72px; padding: 32px 0 56px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-4); font-size: 12.5px; line-height: 1.9;
}
.site-foot strong { color: var(--ink-2); font-weight: 500; }
.site-foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.site-foot .wrap > div + div { margin-top: 6px; }

/* ============================ scrollbar ============================ */
/* 默认轨道色与页面底色几乎同色，会被误看成一条空白；改成细 pill 滑块、透明轨道 */
html { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ============================ responsive ============================ */
@media (max-width: 860px) {
  .wrap { padding: 0 18px; }
  .section { margin: 34px 0; }

  /* 页头改为两行，避免横向溢出 */
  .site-head .wrap { height: auto; flex-wrap: wrap; gap: 10px; padding-top: 12px; padding-bottom: 10px; }
  .brand { font-size: 15px; }
  .site-nav { margin-left: 0; width: 100%; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 6px 11px; font-size: 13.5px; }

  .hero { padding: 40px 0 28px; }
  .hero p { margin-bottom: 26px; }

  .card-pad { padding: 22px 20px; }
  .article-body { padding: 24px 20px; }
  .side-card { padding: 18px 20px; }
}

@media (max-width: 620px) {
  .hero h1 { font-size: 1.6rem; }
  .doc { flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
  .doc .d-date { flex: 0 0 100%; }
  .doc .d-body { flex: 1 1 100%; }
  .doc .d-act { width: 100%; }
  .doc .d-act .mini-btn { flex: 1; }
  .filters select, .filters input { min-width: 0; flex: 1 1 140px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 18px 18px; }
  .stat .v { font-size: 25px; }
  .cat-grid { grid-template-columns: 1fr; }
  .picker-bar .sub { display: none; }
  .pdf-frame { height: 70vh; min-height: 420px; }
}
