/* ============================================================
   一碗葱 · 主样式表 v2
   视觉方向：墨绿标本 SPECIMEN VERDANT
   设计系统：../../DESIGN.md
   配色全部经 WCAG 实测（见 DESIGN.md 第 2 节）
   ============================================================ */

/* ---------- 色板（角色化，实测合规）---------- */
:root {
  /* 底 */
  --bg:            #1A2820;   /* 墨绿主底 */
  --bg-lift:       #243027;   /* 抬升面 */
  --bg-deep:       #16211A;   /* 更深（滚动条轨道、页脚） */

  /* 字（全部实色，不用 rgba 降透明度）*/
  --text:          #E8E5DE;   /* 12.20:1 AAA */
  --text-mid:      #B8B8B0;   /* 7.69:1 AA */
  --text-dim:      #8C9188;   /* 4.77:1 AA */

  /* 绿 */
  --green:         #6C8650;   /* 葱倩绿 · 3.77:1 仅大字/图标/边框 */
  --green-lift:    #8AA96A;   /* 提亮绿 · 5.82:1 可写小字 */
  --green-btn:     #5A7040;   /* 按钮底 · 白字对比 4.62:1 AA */

  /* 线 */
  --rule:          #35423A;   /* 主分隔线 1.6:1 可见 */
  --rule-soft:     #2A362E;   /* 内部分隔 */
  --rule-lit:      #3A3A3B;   /* 悬停边框 */

  /* 字体 */
  --font-sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* 字号（按 DESIGN.md 第 3 节）*/
  --fs-index:  11px;
  --fs-tag:    12px;
  --fs-small:  13px;
  --fs-body:   15px;
  --fs-lead:   17px;
  --fs-h4:     18px;
  --fs-h3:     24px;
  --fs-h2:     34px;
  --fs-h1:     56px;
  --fs-display:72px;

  /* 行高 */
  --lh-body: 1.8;
  --lh-tight: 1.15;

  /* 圆角（克制）*/
  --r-sm: 3px;
  --r-md: 3px;

  /* 容器 */
  --container-max: 1280px;
  --index-w: 168px;
  --gutter: 56px;

  /* 动效 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 180ms;
  --dur-mid: 220ms;
  --dur-slow: 320ms;

  --z-nav: 100;
}

/* ---------- 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   浏览器原生界面（DESIGN.md 第 8 节 · 不可省略）
   ============================================================ */
::selection {
  background: var(--green);
  color: #fff;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: var(--green); }
::-webkit-scrollbar-corner { background: var(--bg-deep); }

:focus-visible {
  outline: 2px solid var(--green-lift);
  outline-offset: 3px;
}
/* 鼠标点击不显示焦点环，键盘 Tab 显示 */
:focus:not(:focus-visible) { outline: none; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---------- 排版 ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 900;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { margin: 0 0 1.4em 0; }
p:last-child { margin-bottom: 0; }

/* 标本标签（签名元素 5.1）—— 顶部有细线的等宽小字 */
.spec-label {
  font-family: var(--font-mono);
  font-size: var(--fs-index);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-lift);
  display: block;
  margin-bottom: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--green);
}

/* 索引号（签名元素 5.2）*/
.index-no {
  font-family: var(--font-mono);
  font-size: var(--fs-index);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--green);
}

/* 分类标签（签名元素 5.4）*/
.cat-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-lift);
  display: block;
  margin-bottom: 10px;
}

/* 导语（细体）*/
.lead {
  font-size: var(--fs-lead);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-mid);
  text-wrap: pretty;   /* 避免末行只剩一两个字 */
}

/* 引文块 */
.quote-line {
  font-weight: 300;
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text);
  border-top: 1px solid var(--green);
  padding-top: 20px;
  margin: 0;
}
.quote-src {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-index);
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ---------- 布局 ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 骨架：左索引栏 + 右内容流（DESIGN.md 第 4 节）*/
.shell {
  display: grid;
  grid-template-columns: var(--index-w) 1fr;
  min-height: 100vh;
}

/* 左索引栏 */
.index-rail {
  border-right: 1px solid var(--rule);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}
/* 品牌组：logo + 中文名 + 英文名，整体水平居中于侧栏 */
.index-rail__brand {
  display: flex;
  flex-direction: column;   /* 桌面端竖排 */
  align-items: center;      /* ← logo 与文字左右居中对齐 */
  text-align: center;
  flex-shrink: 0;          /* 不被 flex 压扁 */
}

/* ⚠️ 必须是 block/flex：<a> 默认 display:inline，而行内元素的 height 属性不生效。
   之前写成 inline 时 height:26px 形同虚设，logo 实际撑到 224px（桌面）/ 342px（移动），
   因为 img 的 height:100% 在父级高度为 auto 时退化成"按内容自适应"。
   display:block 让设定值真正生效，img 才能被约束住。 */
.index-rail__logo {
  display: block;
  /* 桌面端 96px：侧栏可用宽 127px，中文名文字实宽 113px，
     logo 方形边长取 96px ≈ 中文名的 85%，视觉相当但略窄 */
  height: 96px;
  margin-bottom: 10px;
}
.index-rail__logo img {
  display: block;
  height: 100%;
  width: auto;      /* 保持 SVG 正方形比例，不被拉伸 */
}

/* 中文名：可点击回首页（与 logo 同一目标） */
.index-rail__cn {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  line-height: 1.3;
  white-space: nowrap;      /* 公司名不折行 */
  text-decoration: none;
}
.index-rail__cn:hover { color: var(--green-lift); }
.index-rail__cn:focus-visible { color: var(--green-lift); }

.index-rail__meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1.75;
  text-align: center;       /* 与 logo、中文名同轴 */
}
.index-rail__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}
.index-rail__nav a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  font-size: var(--fs-tag);
  color: var(--text-mid);
}
.index-rail__nav a .n {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green);
  min-width: 20px;
}
.index-rail__nav a:hover { color: var(--text); }
.index-rail__nav a:hover .n { color: var(--green-lift); }
.index-rail__nav a.active { color: var(--text); }
.index-rail__nav a.active .n { color: var(--green-lift); }

/* ---------- section 通用 ---------- */
.sect {
  padding: 72px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.sect:first-of-type { padding-top: 56px; }

.sect__head { margin-bottom: 44px; max-width: 640px; }
.sect__head h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.sect__head .lead { margin: 0; }

/* ---------- 按钮（DESIGN.md 第 6 节）---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--r-md);
  transition: background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--green-btn);
  color: #fff;
  border: 1px solid var(--green-btn);
}
.btn-primary:hover { background: var(--green-lift); border-color: var(--green-lift); }
.btn-primary:active { background: var(--green); }
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary.is-loading { position: relative; color: transparent; }
.btn-primary.is-loading::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-quiet {
  background: transparent;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--green);
  border-radius: 0;
  padding: 13px 0;
}
.btn-quiet:hover { color: var(--green-lift); border-color: var(--green-lift); }
.btn-quiet:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 页脚 ---------- */
/* 页脚：三列 grid，中间一列 auto → 备案号真正水平居中
   （规定要求备案编号置于页面底部中央，flex space-between 会因左右字数不等而偏） */
.site-foot {
  padding: 32px var(--gutter);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.site-foot p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin: 0;
  letter-spacing: 0.04em;
}
.site-foot__left   { text-align: left; }
.site-foot__center { text-align: center; justify-self: center; }
.site-foot__right  { text-align: right; }
.site-foot a { color: var(--text-dim); }
.site-foot a:hover { color: var(--green-lift); }

/* ICP 与公安备案之间的分隔竖线 */
.site-foot__sep {
  display: inline-block;
  width: 1px;
  height: 10px;
  margin: 0 10px;
  vertical-align: -1px;
  background: var(--rule);
}

/* 公安备案：规范要求「图标在前、编号在后」，整块链接到公安备案网站 */
.site-foot__psb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.site-foot__psb-icon {
  display: block;
  width: auto;
  height: auto;
  opacity: 0.85;
}
.icp { margin-left: 16px; }

/* ---------- 工具类 ---------- */
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }
.mb-6 { margin-bottom: 48px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-4 { margin-top: 32px !important; }
.mt-6 { margin-top: 48px !important; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* ---------- 动效（DESIGN.md 第 7 节）----------
   原则：一个精心设计的瞬间，不是全站散落的效果
   禁止：transition: all / scale(0) 入场 / 全站统一渐入
   本项目页面加载无入场动画
   ------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .index-rail, .site-foot { display: none; }
  body { background: #fff; color: #000; }
  .shell { grid-template-columns: 1fr; }
}
