/* ============================================================
   拾色志 v6 · style.css
   设计基准:aesthetic-preset "11 Build"(奢侈极简)
   — 70%+ 留白 / 字重对比 200-600 / 单一强调色呼吸感
   深底 #101116 承袭 v5 基因,鎏金 #f5c66b 仅用于焦点强调
   ============================================================ */

:root {
  --bg: #101116;
  --bg-lift-1: #15151c;   /* 表面提亮阶梯 L1(暗色 UI 铁律:层级靠提亮不靠投影) */
  --bg-lift-2: #1a1a22;   /* L2 */
  --line: #26262e;
  --ink: #e8e6e1;
  --ink-dim: #9a97a0;
  --ink-faint: #6d6a75;
  --gold: #f5c66b;        /* 单一强调色:标题/选中/焦点 */
  --radius: 12px;
  --pad: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Microsoft YaHei", serif;
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  transition: color .8s var(--ease), background-color 1.1s var(--ease);
}

/* 底层纵深:极微妙的顶部冷紫→底部暖色弥散(color5 式氛围,不抢色块戏) */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(108, 92, 160, .10), transparent 60%),
    radial-gradient(1000px 500px at -10% 108%, rgba(212, 140, 69, .05), transparent 55%);
  pointer-events: none;
}

/* 晕染色影响全局墨色:浅晕染底上换深字,深晕染底上换浅字 */
body.ink-light { color: #1c1b20; }
body.ink-dark  { color: #f2f1ee; }

/* ---------- 全局晕染层 ---------- */
#dye {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%),
              var(--gc, transparent) 0%, transparent 72%);
  transition: opacity .9s var(--ease);
  will-change: opacity;
}
#dye.on { opacity: .92; transition: opacity .18s var(--ease); }

/* 页面内容浮在晕染层之上 */
.site-head, main, .site-foot { position: relative; z-index: 1; }

/* ---------- 头部 ---------- */
.site-head {
  padding: calc(var(--pad) * 1.1) var(--pad) calc(var(--pad) * .55);
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  align-items: baseline; justify-content: space-between;
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand-mark { display: inline-flex; width: 46px; height: 12px; border-radius: 99px; overflow: hidden; align-self: center; }
.brand-mark i { flex: 6; } .brand-mark i:nth-child(2) { flex: 3; border-left: 1px solid rgba(0,0,0,.25); border-right: 1px solid rgba(0,0,0,.25); } .brand-mark i:nth-child(3) { flex: 1; }
.brand-name { font-size: 30px; font-weight: 600; letter-spacing: .12em; }
.brand-sub { font-family: "Microsoft YaHei", sans-serif; font-size: 12px; letter-spacing: .3em; color: var(--ink-faint); text-transform: uppercase; }
.head-note { font-family: "Microsoft YaHei", sans-serif; font-size: 13px; color: var(--ink-dim); letter-spacing: .08em; }
/* ---------- 康保 Hero ---------- */
main { padding: 0 var(--pad) var(--pad); }

.kangbao { margin-bottom: calc(var(--pad) * .9); }
.kb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; margin-bottom: 18px; }
.kb-title { font-size: clamp(24px, 3.2vw, 34px); font-weight: 300; letter-spacing: .18em; }
.kb-title::after { content: ""; display: inline-block; width: 44px; height: 1px; background: var(--gold); margin-left: 18px; vertical-align: middle; }
.kb-note { font-family: "Microsoft YaHei", sans-serif; font-size: 13px; color: var(--ink-dim); }
.kb-hint { font-family: "Microsoft YaHei", sans-serif; font-size: 12px; color: var(--ink-faint); margin-top: 10px; letter-spacing: .12em; }
.kb-hint::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin-right: 8px; vertical-align: 2px; animation: hintPulse 2.4s infinite; }
@keyframes hintPulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* 不等宽色彩轨道:flex-grow = ratio */
.kb-track {
  display: flex;
  height: clamp(120px, 22vh, 180px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

/* ---------- 色块按钮(通用) ---------- */
.cblock {
  position: relative;
  border: none; cursor: pointer;
  font-family: "Microsoft YaHei", sans-serif;
  min-width: 0; min-height: 100%;
  flex-basis: 0;
  transition: flex-grow .45s var(--ease);
  overflow: hidden;
  outline: none;
}
.cblock:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; z-index: 2; }

.cblock-hex, .cblock-name, .cblock-ratio {
  position: absolute; left: 0; right: 0;
  text-align: center; white-space: nowrap;
  opacity: 0; transition: opacity .35s var(--ease);
  pointer-events: none;
}
.cblock-hex { top: 18%; font-size: 13px; font-weight: 600; letter-spacing: .06em; }
.cblock-name { bottom: 20%; font-size: 12px; font-weight: 400; letter-spacing: .04em; }
.cblock-ratio { top: 50%; transform: translateY(-50%); font-size: 11px; opacity: 0; }

.cblock:hover .cblock-hex, .cblock:hover .cblock-name,
.cblock:focus-visible .cblock-hex, .cblock:focus-visible .cblock-name { opacity: .95; }

/* 深浅底文字自适应(识别自 coolors:深色带白字/浅色带深灰字) */
.cblock-dark  .cblock-hex, .cblock-dark  .cblock-name { color: #101116; }
.cblock-light .cblock-hex, .cblock-light .cblock-name { color: #f7f7f5; }

/* 果冻弹跳:keyframes 只动 transform,不触发布局 */
@keyframes jelly {
  0%   { transform: scale(1, 1); }
  28%  { transform: scale(.82, 1.14); }
  46%  { transform: scale(1.12, .88); }
  64%  { transform: scale(.94, 1.05); }
  82%  { transform: scale(1.03, .98); }
  100% { transform: scale(1, 1); }
}
.cblock.jelly { animation: jelly .58s var(--ease); z-index: 2; }

/* ---------- 名画轨道区 ---------- */
.gal-head {
  display: flex; flex-wrap: wrap; gap: 14px 22px;
  align-items: baseline; justify-content: space-between;
  margin-bottom: 26px;
}
.gal-title { font-size: clamp(22px, 2.6vw, 30px); font-weight: 300; letter-spacing: .18em; }
.gal-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gal-tools input[type="search"], .gal-tools select {
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-lift-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  letter-spacing: .04em;
  transition: border-color .25s var(--ease);
}
.gal-tools input[type="search"] { width: min(260px, 60vw); }
.gal-tools input:focus, .gal-tools select:focus { outline: none; border-color: var(--gold); }
.gal-count { font-family: "Microsoft YaHei", sans-serif; font-size: 12px; color: var(--ink-faint); letter-spacing: .1em; }
.gal-count b { color: var(--gold); font-weight: 600; }

.tracks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
  gap: clamp(20px, 3vw, 34px);
}

.track {
  background: var(--bg-lift-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  /* 入场:Fade In Up + stagger(JS 加 .in;reduce-motion 下直接可见) */
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease), border-color .3s var(--ease);
}
.track.in { opacity: 1; transform: none; }
.track:hover { border-color: #3a3a45; }
.track.hide { display: none; }

/* 画作缩略图:16:10,失败/缺图降级纯色+首字;hover zoom+渐变遮罩(awwwards 式) */
.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-lift-2);
  overflow: hidden;
  flex: none;
}
.thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s var(--ease);
}
.track:hover .thumb img { transform: scale(1.05); }
.thumb::after {
  content: attr(data-label);
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 16px 10px;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 12px; letter-spacing: .14em;
  color: #fff;
  background: linear-gradient(transparent, rgba(10,10,14,.66));
  opacity: 0;
  transition: opacity .35s var(--ease);
  pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track:hover .thumb::after { opacity: 1; }
.thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 200;
  color: rgba(16, 17, 22, .82);
  letter-spacing: .1em;
}

.track-meta { padding: 18px 22px 6px; }
.track-name { font-size: 20px; font-weight: 500; letter-spacing: .08em; }
.track-sub { font-family: "Microsoft YaHei", sans-serif; font-size: 13px; color: var(--ink-dim); margin-top: 2px; }
.track-sub .dot { margin: 0 8px; opacity: .5; }
.artist-btn {
  font: inherit; color: var(--ink-dim);
  background: none; border: none; padding: 0; cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.artist-btn:hover { color: var(--gold); border-bottom-color: var(--gold); }
.track-school {
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 11px; letter-spacing: .2em;
  color: var(--gold);
  margin-top: 6px;
}

/* 名画色条:同样不等宽 */
.strip {
  display: flex;
  height: 64px;
  border-top: 1px solid var(--line);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 10;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 13.5px; letter-spacing: .05em;
  padding: 13px 22px;
  border-radius: 10px;
  opacity: 0; transform: translateY(14px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  pointer-events: none;
  max-width: min(82vw, 420px);
}
.toast.show { opacity: 1; transform: translateY(0); }

.toast-copy { left: 22px; bottom: 22px; background: #23232c; color: var(--ink); border: 1px solid var(--line); }
.toast-copy.fail { border-color: #d95555; color: #ffb4a6; }

/* 焦香色印刷预警 Toast:右下角,鎏金左边框点题 */
.toast-warn {
  right: 22px; bottom: 22px;
  background: #2a2018;
  color: #f3d9ac;
  border: 1px solid #5a4630;
  border-left: 3px solid #D48C45;
}

/* ---------- 页脚 ---------- */
.site-foot {
  padding: calc(var(--pad) * .7) var(--pad);
  border-top: 1px solid var(--line);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 12.5px; color: var(--ink-dim);
  letter-spacing: .06em;
}
.foot-dim { color: var(--ink-faint); margin-top: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .site-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .kb-track { height: 96px; }
  .cblock-hex { font-size: 11px; }
  .cblock-name { font-size: 10px; }
  .strip { height: 52px; }
  .tracks { grid-template-columns: 1fr; }
  .toast-copy { left: 14px; bottom: 14px; }
  .toast-warn { right: 14px; bottom: 64px; }
}

/* 弱动效偏好:尊重系统设置 */
@media (prefers-reduced-motion: reduce) {
  .cblock, .cblock-hex, .cblock-name, #dye, .toast { transition: none !important; }
  .cblock.jelly { animation: none; }
  .track { opacity: 1; transform: none; transition: none; }
  .thumb img, .thumb::after { transition: none; }
  .kb-hint::before { animation: none; }
}
