/* 拾色志 v11 · 档案馆页面级样式
   层级：tokens.css ① → components.css ② → 本文件 ③（→ motion.css 动效）
   本文件只写档案馆专属排版与栅格：
     · 不定义 :root（token 唯一源在 tokens.css）
     · 不重定义 components.css 已定义的组件选择器
   合并保留：子页旧类名兼容块（a-card / cblock / m-strip / kb-*）——v7 四个子页零改动可用
*/

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background-color: var(--paper);
  background-image: radial-gradient(rgba(20, 20, 20, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: var(--t-body-lh);
  font-size: var(--t-body);
  -webkit-font-smoothing: antialiased;
}

/* 首屏 Hero */
.hero { border-bottom: 1px solid var(--line-dark); position: relative; overflow: hidden; }
.hero-grid { max-width: 1200px; margin: 0 auto; padding: 0 var(--s5); display: grid; grid-template-columns: 1fr 1fr; position: relative; z-index: 1; }
.hero-copy {
  padding: var(--s8) var(--s7) var(--s8) 0; border-right: 1px solid var(--line-dark);
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--t-micro); font-weight: 700; letter-spacing: .2em;
  color: var(--brand); text-transform: uppercase; margin-bottom: 20px;
}
.hero-badge::before { content: ""; width: 6px; height: 6px; background: var(--brand); }
h1.hero-title { font-size: clamp(32px, 3.8vw, 52px); font-weight: 900; line-height: 1.15; letter-spacing: -.02em; margin-bottom: 20px; }
h1.hero-title em { font-style: normal; color: var(--brand); }
.hero-desc { font-size: 15.5px; color: var(--dim); line-height: 1.9; max-width: 44ch; }
.hero-actions { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }

/* 交互看板 */
.hero-preview { padding: var(--s7) 0 var(--s7) var(--s7); display: flex; flex-direction: column; justify-content: space-between; }
.preview-card {
  background: var(--paper-card); border: 1px solid var(--line-dark);
  box-shadow: var(--shadow-hard); padding: var(--s5);
  border-radius: 42px 0 0 0;
}
.preview-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: var(--s3); margin-bottom: 18px; }
.preview-title { font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.preview-palette { display: flex; height: 80px; border: 1px solid var(--line-dark); margin-bottom: 20px; }
.preview-palette button:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.mock-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); background: var(--paper-subtle); padding: 14px; border: 1px solid var(--line); }
.mock-item { background: #FFF; border: 1px solid var(--line); padding: var(--s3); text-align: center; font-size: 11px; font-weight: 700; }
.mock-visual {
  height: 54px; margin-bottom: var(--s2); border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex; align-items: center; justify-content: center; color: #FFF; font-size: 10px;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-dark); margin-top: var(--s6); }
.stat-box { padding: var(--s4) var(--s3); border-right: 1px solid var(--line-dark); }
.stat-box:last-child { border-right: none; }
.stat-box b { display: block; font-size: 22px; font-weight: 900; }
.stat-box span { font-size: 11px; color: var(--dim); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: var(--s7) 0; border-right: none; border-bottom: 1px solid var(--line-dark); }
  .hero-preview { padding: 36px 0; }
}

/* 核心通用区域 */
section.sec { max-width: 1200px; margin: 0 auto; padding: 72px var(--s5); position: relative; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-bottom: 2px solid var(--line-dark); padding-bottom: var(--s4); margin-bottom: var(--s6); }
.sec-kicker { font-size: var(--t-micro); font-weight: 800; letter-spacing: var(--ls-kicker); color: var(--brand); }
h2.sec-title { font-size: var(--t-h2); font-weight: 900; margin-top: var(--s1); }
.sec-link { font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink); }
.sec-link:hover { color: var(--brand); border-color: var(--brand); }
.page-head { border-bottom: 1px solid var(--line-dark); background: var(--paper-subtle); }
.page-head-in { max-width: 1200px; margin: 0 auto; padding: var(--s7) var(--s5) 36px; }
.page-kicker { font-size: var(--t-micro); font-weight: 800; letter-spacing: var(--ls-kicker); color: var(--brand); }
h1.page-title { font-size: var(--t-h1); font-weight: 900; margin-top: var(--s2); }
.page-sub { font-size: 14px; color: var(--dim); margin-top: 10px; max-width: 60ch; }

/* 色彩卡片网格 */
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.a-top { margin-bottom: 14px; }
.a-id { font-size: 10.5px; font-weight: 800; color: var(--faint); letter-spacing: .1em; }
.a-name { font-size: 17px; font-weight: 800; margin: 2px 0 4px; }
.a-src { font-size: 12px; color: var(--brand); font-weight: 600; }
.card__values > div, .a-values > div { display: flex; justify-content: space-between; }
.a-desc { font-size: 12.5px; color: var(--dim); line-height: 1.6; }
.a-warn-box { margin-top: 10px; padding: 6px 8px; background: var(--warn-bg); border: 1px solid var(--gold); color: #8A4D10; font-size: 11px; font-weight: 700; }

/* 名画参照系(保留区块) */
.m-row { margin-bottom: 34px; }
.m-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: 10px; }
.m-head img { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--line); background: var(--paper-subtle); }
.m-head h3 { font-size: 16px; font-weight: 800; }
.m-head p { font-size: 12px; color: var(--dim); }
.m-strip { display: flex; height: 72px; border: 1px solid var(--line-dark); }
.cblock {
  position: relative; border: none; cursor: pointer; min-width: 0; flex-basis: 0;
  overflow: hidden; outline: none; transition: transform .3s var(--ease);
}
.cblock:hover { transform: scaleY(1.05); z-index: 2; }
.cblock:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; z-index: 2; }
.cb-i { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; opacity: 0; transition: opacity .25s; pointer-events: none; }
.cb-i i { display: block; font-style: normal; font-weight: 400; font-size: 9.5px; opacity: .85; }
.cblock:hover .cb-i, .cblock:focus-visible .cb-i { opacity: 1; }
.cb-dark .cb-i { color: #141414; }
.cb-light .cb-i { color: #FAF8F5; }

/* 方法论三步(子页用) */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); }
.step { background: var(--paper); padding: 28px var(--s5); }
.step b { display: block; font-size: 26px; font-weight: 900; color: var(--brand); }
.step h3 { font-size: 16px; font-weight: 800; margin: var(--s2) 0 6px; }
.step p { font-size: 13px; color: var(--dim); }
@media (max-width: 768px) { .steps { grid-template-columns: 1fr; } }

/* 留资表单 */
.lead-section { border-top: 1px solid var(--line-dark); background: var(--paper-subtle); position: relative; overflow: hidden; }
.lead-wrap {
  max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 5fr 7fr;
  border-left: 1px solid var(--line-dark); border-right: 1px solid var(--line-dark);
  position: relative; z-index: 1;
}
.lead-side { background: var(--ink); color: #FFF; padding: 56px 44px; display: flex; flex-direction: column; justify-content: space-between; }
.lead-side h2 { font-size: 28px; font-weight: 900; line-height: 1.25; }
.lead-side p { font-size: 13.5px; color: var(--on-dark); margin-top: var(--s4); line-height: 1.8; }
.lead-perks { margin-top: var(--s6); list-style: none; font-size: 12.5px; color: var(--line); }
.lead-perks li { margin-bottom: 10px; display: flex; align-items: center; gap: var(--s2); }
.lead-perks li::before { content: "■"; color: var(--brand); font-size: 10px; }

.lead-form { background: var(--paper-card); padding: 56px 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.f-full { grid-column: 1 / -1; }
.lead-form label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; margin-bottom: 6px; }
.lead-form input, .lead-form select, .lead-form textarea {
  width: 100%; padding: 12px 14px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--line-dark); background: var(--paper); color: var(--ink);
  outline: none; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.lead-form input:focus, .lead-form select:focus, .lead-form textarea:focus { background: #FFF; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.lead-form select { color: var(--dim); }
.lead-form select.has-value, .lead-form select option { color: var(--ink); }
.lead-submit {
  grid-column: 1 / -1; min-height: 48px; background: var(--brand); color: #FFF; border: 1px solid var(--brand);
  padding: 14px; font-size: 14px; font-weight: 800; cursor: pointer; transition: background var(--dur-fast) var(--ease);
}
.lead-submit:hover { background: var(--brand-hover); }
.lead-submit:disabled { background: #CCC; border-color: #CCC; cursor: not-allowed; }
.lead-msg { grid-column: 1 / -1; font-size: 13px; font-weight: 700; min-height: 20px; }
.lead-msg.ok { color: #2E7D32; }
.lead-msg.err { color: var(--brand); }
@media (max-width: 900px) {
  .lead-wrap { grid-template-columns: 1fr; }
  .lead-side, .lead-form { padding: 36px 20px; }
  .lead-form { grid-template-columns: 1fr; }
}

/* ===== 子页(v7)兼容块:archive/method/service/about 旧类名 ===== */
.a-card .cblock { height: 120px; }
.a-card .a-info { padding: 18px 20px 20px; }
.a-card h3 { font-size: 16px; font-weight: 800; }
.a-card .a-vals { background: var(--paper-subtle); border-left: 2px solid var(--line-dark); padding: 10px 12px; font-size: 11.5px; color: var(--dim); margin-top: var(--s2); font-family: var(--font-mono); }
.a-card .a-note { font-size: 12.5px; color: var(--dim); margin-top: 6px; }
.a-card .a-warn { font-size: 11.5px; color: var(--brand); font-weight: 700; margin-top: var(--s2); }
.rule { height: 3px; background: var(--ink); }
.q { font-size: 13px; color: var(--on-dark); line-height: 2; margin-top: 16px; }

/* ===== v9 档案深度卡/筛选/方法论图表 ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: 8px; }
.filter-bar + .filter-bar { margin-top: 0; }
#hue-bar .fam-btn, #lum-bar .fam-btn { font-size: 12.5px; padding: 8px 13px; }
.fam-btn {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  padding: var(--s2) var(--s4); min-height: 40px; border: 1px solid var(--line-dark); background: var(--paper-card); color: var(--ink);
  display: inline-flex; align-items: center; gap: var(--s2);
  position: relative; overflow: hidden;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.fam-btn:hover { background: var(--paper-subtle); }
.fam-btn.on { background: var(--ink); color: #FFF; border-color: var(--ink); }
.arch-deep { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.arch-deep .k-card .a-swatch, .arch-deep .card .card__swatch { height: 120px; }
.a-fig { margin-top: var(--s3); }
.a-fig img { width: 100%; height: auto; display: block; border: 1px solid var(--line); transition: transform .5s var(--ease), box-shadow .4s var(--ease); }
.a-fig figcaption { font-size: 11px; color: var(--faint); padding: 6px 2px; }
.a-fig.fig-fallback { position: relative; border: 1px dashed var(--line); padding: 28px 12px; text-align: center; font-size: 12px; color: var(--faint); }
.a-fig.fig-fallback img { display: none; }
.a-fig.fig-fallback::after { content: '档案卡图加载失败 · 色值以上方数据为准'; display: block; }

/* 方法论页 */
.method-stage { max-width: 860px; margin: 0 auto 56px; }
.stage-no { display: inline-block; font-size: var(--t-micro); font-weight: 800; letter-spacing: var(--ls-kicker); color: #FFF; background: var(--ink); padding: 5px 12px; margin-bottom: 10px; }
.stage-title { font-size: clamp(21px, 2.4vw, 28px); font-weight: 900; margin-bottom: var(--s3); }
.stage-text { font-size: 14.5px; line-height: 2; color: #3a3a36; margin: 10px 0; }
.m-fig { margin: 22px 0; transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease); }
.m-fig img { width: 100%; height: auto; display: block; border: 1px solid var(--line-dark); background: var(--paper-card); }
.m-fig figcaption { font-size: 12px; color: var(--dim); padding: 10px 2px 0; line-height: 1.7; }

@media (max-width: 768px) {
  section.sec { padding: var(--s7) var(--s4); }
  .page-head-in { padding: var(--s6) var(--s4) var(--s5); }
  .hero-stats { grid-template-columns: 1fr; }
  .stat-box { border-right: none; border-bottom: 1px solid var(--line-dark); }
}
