/* theme-tigent.css — 虎符「青铜符节」主题层
 *
 * 加载顺序：styles-*.css（原始） → 本文件（sync 回放，恒在其后）。
 * 原则：只覆写 token 与 ac-* 层，不动冻结 chunk 的结构；全部改动可逆（删 link 即回到原貌）。
 * 品牌动机：虎符 = 青铜剖符。墨黑暖铜底、拓片宋体、剖符纹样、青铜光晕。
 */

/* ── 1. 令牌重着色：从「中性灰 + 纯金」转向「暖墨 + 青铜」 ───────────────────────── */
:root {
  /* 基底：墨黑带铜色底噪（原为纯中性 oklch(12% 0 0)） */
  --background: oklch(13.5% 0.008 78);
  --background-deep: oklch(9.5% 0.01 75);
  --card: oklch(17.5% 0.012 78);
  --popover: oklch(18% 0.012 78);
  /* 主色：亮金 → 青铜（降一档亮度、收一点饱和、暖一档色相） */
  --brand-gold: oklch(78% 0.115 80);
  --primary: var(--brand-gold);
  --accent: var(--brand-gold);
  --ring: var(--brand-gold);
  /* 辅助：拓片纸色（高亮文字场景）+ 铜绿（信标点缀） */
  --tg-paper: #e9dfc8;
  --tg-patina: oklch(66% 0.055 175);
  --tg-patina-dim: oklch(45% 0.04 175);
  /* 线与弱文字：全部暖化（原 hue 250 冷灰与金冲突） */
  --border: oklch(70% 0.05 80 / 0.15);
  --input: oklch(70% 0.05 80 / 0.2);
  --muted: oklch(24% 0.01 78);
  --muted-foreground: oklch(72% 0.018 80);
  --secondary: oklch(23% 0.012 78);
  /* 显示字体：拓片宋（数字仍走 Bebas/mono，不抢数据可读性） */
  --tg-font-display: "Noto Serif SC", "Songti SC", "SimSun", serif;
  /* 虎符品牌带：三条宽窄不一的斜波纹（白描 + mask 上色，8px 带高，repeat-x） */
  --tg-stripes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='8'%3E%3Cg fill='none' stroke='%23fff' stroke-linecap='round'%3E%3Cpath d='M-6 1.8 C 24 0.6 46 3 74 1.6 S 118 0.8 134 2' stroke-width='2'/%3E%3Cpath d='M-6 4.6 C 28 3.4 52 5.6 84 4.2 S 120 3.6 134 4.8' stroke-width='1.4'/%3E%3Cpath d='M-6 7 C 30 6.2 60 7.6 92 6.8 S 122 6.4 134 7' stroke-width='1' opacity='0.9'/%3E%3C/g%3E%3C/svg%3E");
  /* 字体换血：正文 Latin → Outfit（圆润几何，脱离原盘 Barlow 指纹）；中文仍 Noto Sans SC */
  --font-sans: "Outfit", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  --default-font-family: "Outfit", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  /* 数字/铭刻体：Bebas → Cinzel（罗马铭刻大写，青铜錾刻气质） */
  --tg-font-latin: "Cinzel", "Bebas Neue", serif;
}

/* Cinzel 数字比 Bebas 宽，数据带字号微收 */
.font-poster {
  font-family: var(--tg-font-latin);
  letter-spacing: 0.01em;
}
.ac-stats .font-poster {
  font-size: 0.88em;
}

/* 页级标题统一铭刻宋（全断点） */
.ac-page h1 {
  font-family: var(--tg-font-display);
  font-weight: 900;
  letter-spacing: 0.03em;
}

/* ── 2a. 虎纹部件：页顶品牌带（fixed，恒在视口上缘） ─────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  z-index: 9998;
  pointer-events: none;
  background-color: oklch(48% 0.075 78 / 0.85);
  -webkit-mask-image: var(--tg-stripes);
  mask-image: var(--tg-stripes);
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 128px 8px;
  mask-size: 128px 8px;
}

/* ── 2. 底色纵深：顶部青铜余晖 + 底部沉铜 + 全站噪点 ───────────────────────────── */
.ac-page {
  background:
    radial-gradient(1100px 620px at 72% -140px, oklch(26% 0.045 80 / 0.5), transparent 68%),
    radial-gradient(900px 500px at 8% 22%, oklch(20% 0.03 78 / 0.35), transparent 60%),
    radial-gradient(1400px 700px at 50% 118%, oklch(16% 0.03 60 / 0.55), transparent 70%),
    var(--background-deep);
}

/* 噪点：全站固定层，破「纯平矢量感」，pointer-events 不拦交互 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ── 2b. 移动端：顶部导航 chrome（<768px；桌面由 md+ 左栏接管） ──────────────────
 * 品牌条（56px）+ 页签条（44px）双层钉顶，滚动不消失；选全站 .ac-tabs（规则页无
 * #card-workspace 容器，逐页核实无误伤）。 */
@media (max-width: 767px) {
  .ac-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 84;
    padding-top: env(safe-area-inset-top);
    background: color-mix(in oklab, var(--background-deep) 92%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .ac-header .ac-container {
    height: 56px;
  }
  .ac-tabs {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 83;
    gap: 0;
    margin: 0;
    padding: 4px 6px;
    border-bottom: 1px solid oklch(55% 0.06 80 / 0.22);
    border-radius: 0;
    overflow-x: auto;
    background: color-mix(in oklab, var(--background-deep) 94%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    justify-content: space-around;
  }
  .ac-tabs > a {
    flex: 1 1 0;
    height: 40px;
    padding: 0 4px !important;
    justify-content: center;
    font-size: 12px;
    border-radius: 8px;
  }
  .ac-tabs > a[data-status="active"] {
    color: var(--brand-gold) !important;
    background: oklch(30% 0.03 78 / 0.55);
    box-shadow: inset 0 -2px 0 var(--brand-gold);
  }
  body {
    padding-top: calc(104px + env(safe-area-inset-top)); /* 品牌条 + 页签条让位 */
  }
}

/* ── 3. 排版：宋体显示层 + 数字等宽 ────────────────────────────────────────────── */
.ac-intro-copy h1,
.ac-flow h2,
h2.text-xl,
h2.mt-5 {
  font-family: var(--tg-font-display);
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* 主标语：青铜錾刻渐变 + 收紧行高 */
.ac-intro-copy h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.22;
  background: linear-gradient(178deg, #f2ddab 6%, var(--brand-gold) 52%, oklch(56% 0.08 72) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 oklch(20% 0.03 78 / 0.6);
}

/* 副文案：中文正文行高放宽，阅读宽度约束 */
.ac-intro-copy p {
  line-height: 1.95;
  max-width: 34em;
}

/* 剖符纹样：每个 h2 前一枚「两半符」印记（两段铜块夹一道合缝） */
.ac-flow h2,
h2.text-xl,
h2.mt-5 {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ac-flow h2::before,
h2.text-xl::before,
h2.mt-5::before {
  content: "";
  flex: 0 0 auto;
  width: 20px;
  height: 13px;
  background: linear-gradient(
    90deg,
    var(--brand-gold) 0 8px,
    oklch(30% 0.03 78) 8px 12px,
    var(--brand-gold) 12px
  );
  box-shadow: 0 0 12px oklch(60% 0.09 80 / 0.35);
}

/* 小节标题（h3）提重 */
.ac-flow h3 {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 数字与数据：等宽数字特性 */
.ac-stats,
.font-mono {
  font-variant-numeric: tabular-nums;
}

/* ── 4. 卡牌展台：青铜光晕 + 錾刻双框 ──────────────────────────────────────────── */
.ac-collectible {
  position: relative;
}
.ac-collectible::before {
  content: "";
  position: absolute;
  inset: -18% -24%;
  z-index: -1;
  background: radial-gradient(
    closest-side,
    oklch(52% 0.09 78 / 0.34),
    oklch(40% 0.06 70 / 0.12) 55%,
    transparent 78%
  );
  filter: blur(6px);
}
.ac-card-art {
  border-radius: 10px;
  box-shadow:
    0 0 0 1px oklch(60% 0.08 80 / 0.28),
    0 0 0 5px oklch(30% 0.03 78 / 0.35),
    0 0 0 6px oklch(55% 0.08 80 / 0.22),
    0 40px 90px -30px oklch(45% 0.08 72 / 0.55);
}

/* 侧码竖排字：铜绿点缀 */
.ac-side-code {
  color: var(--tg-patina-dim) !important;
}

/* ── 5. 数据带：虎纹刻度 ────────────────────────────────────────────────────────── */
.ac-stats > * {
  position: relative;
}
.ac-stats > *::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 38px;
  height: 5px;
  background-color: oklch(52% 0.08 78 / 0.9);
  -webkit-mask-image: var(--tg-stripes);
  mask-image: var(--tg-stripes);
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 96px 6px;
  mask-size: 96px 6px;
}
.ac-stats .font-poster {
  text-shadow: 0 2px 18px oklch(50% 0.08 78 / 0.35);
}

/* hero 短划：一撮虎纹 */
.ac-intro .h-px.w-7 {
  height: 6px;
  background-color: oklch(52% 0.08 78 / 0.95);
  -webkit-mask-image: var(--tg-stripes);
  mask-image: var(--tg-stripes);
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 84px 6px;
  mask-size: 84px 6px;
}

/* ── 6. 铸造面板：錾刻描边 + 顶部弧光 ──────────────────────────────────────────── */
.ac-mint-tool {
  position: relative;
  border-color: oklch(55% 0.07 80 / 0.3);
  box-shadow:
    inset 0 1px 0 oklch(60% 0.08 80 / 0.12),
    0 24px 60px -30px oklch(35% 0.05 70 / 0.6);
}
.ac-mint-tool::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, oklch(75% 0.1 80 / 0.7), transparent);
}

/* ── 7. 按钮：全局按压反馈 + 主按钮青铜錾面 ────────────────────────────────────── */
[data-slot="button"] {
  transition:
    transform 0.22s var(--ease-cine, cubic-bezier(0.16, 1, 0.3, 1)),
    box-shadow 0.22s var(--ease-cine, cubic-bezier(0.16, 1, 0.3, 1)),
    background-color 0.22s var(--ease-cine, cubic-bezier(0.16, 1, 0.3, 1)),
    filter 0.22s var(--ease-cine, cubic-bezier(0.16, 1, 0.3, 1));
}
[data-slot="button"]:hover {
  transform: translateY(-1px);
}
[data-slot="button"]:active {
  transform: translateY(0) scale(0.98);
}
[data-slot="button"].bg-primary {
  background: linear-gradient(180deg, oklch(84% 0.11 84), oklch(72% 0.115 78));
  box-shadow:
    0 10px 26px -10px oklch(55% 0.1 78 / 0.75),
    inset 0 1px 0 oklch(92% 0.05 88 / 0.5);
  color: oklch(16% 0.02 70);
}
[data-slot="button"].bg-primary:hover {
  filter: brightness(1.06);
  box-shadow:
    0 14px 34px -10px oklch(58% 0.11 78 / 0.85),
    inset 0 1px 0 oklch(92% 0.05 88 / 0.55);
}

/* 焦点可见性（无障碍，不改变布局） */
:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
}

/* 文本选中：拓片反色 */
::selection {
  background: oklch(72% 0.1 80);
  color: oklch(12% 0.02 70);
}

/* 滚动条：细身青铜 */
* {
  scrollbar-width: thin;
  scrollbar-color: oklch(38% 0.04 78) transparent;
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-thumb {
  background: oklch(34% 0.04 78);
  border-radius: 9px;
  border: 2px solid var(--background-deep);
}
*::-webkit-scrollbar-track {
  background: transparent;
}

/* ── 8. 页头 / 信标 / 导航 ──────────────────────────────────────────────────────── */
.ac-header {
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--background-deep) 78%, transparent);
  border-bottom-color: oklch(60% 0.06 80 / 0.18);
}
.ac-brand-icon {
  filter: drop-shadow(0 0 14px oklch(55% 0.09 78 / 0.5));
}

/* 审计信标条：金 → 铜绿（可信、不刺眼） */
.ac-audit-bar {
  background: linear-gradient(
    90deg,
    oklch(30% 0.035 175 / 0.55),
    oklch(24% 0.03 175 / 0.4)
  );
  border-bottom: 1px solid oklch(50% 0.05 175 / 0.25);
}
.ac-audit-bar,
.ac-audit-bar * {
  color: oklch(84% 0.05 165) !important;
}

/* 导航活页签：铜印下划线 */
.ac-tab {
  position: relative;
}
.ac-tab-active::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
  box-shadow: 0 0 10px oklch(60% 0.09 80 / 0.6);
}

/* ── 9. 流程三栏：断Line 为虎纹引线，序号铸印 ───────────────────────────────────── */
.ac-flow {
  border-top: none;
  position: relative;
}
.ac-flow::before {
  content: "";
  display: block;
  height: 7px;
  margin-bottom: 30px;
  opacity: 0.6;
  background-color: oklch(46% 0.07 78 / 0.9);
  -webkit-mask-image: var(--tg-stripes);
  mask-image: var(--tg-stripes);
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 128px 8px;
  mask-size: 128px 8px;
}
.ac-flow .grid > div {
  position: relative;
  border-top: none !important;
  padding-top: 18px;
}
.ac-flow .grid > div::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    oklch(50% 0.07 78 / 0.75),
    oklch(40% 0.04 74 / 0.25) 55%,
    transparent
  );
}
.ac-flow .grid > div > span {
  font-family: var(--tg-font-display);
  font-weight: 900;
  letter-spacing: 0.08em;
}

/* ── 10. 版式换骨（≥768px：不碰原版移动端栅格） ───────────────────────────────── */
@media (min-width: 768px) {
  /* 容器放宽一档（原盘 1180） */
  .ac-container {
    width: min(1260px, 100% - 80px);
  }

  /* hero 镜像：卡牌居左、文案居右（原盘为文左卡右） */
  .ac-intro {
    grid-template-columns: 1fr 1.32fr;
  }
  .ac-intro > .ac-collectible {
    order: -1;
  }
  .ac-intro > .ac-intro-copy {
    order: 1;
  }

  /* 数据带非等权：总发行量为主格 */
  .ac-stats {
    grid-template-columns: 1.45fr 1.05fr 0.85fr 0.85fr 1fr;
  }
  .ac-stats > :first-child .font-poster {
    font-size: 1.06em;
    background: linear-gradient(178deg, #f2ddab 8%, var(--brand-gold) 60%, oklch(58% 0.08 74) 98%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  /* 导航立左侧：页头变为固定左栏（logo 顶 / 菜单中 / 语言沉底），内容区右移 */
  .ac-header nav {
    display: flex !important;
  }
  .ac-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: 236px;
    height: 100vh;
    border-bottom: none;
    border-right: 1px solid oklch(55% 0.06 80 / 0.22);
    background:
      linear-gradient(180deg, oklch(16% 0.02 78 / 0.9), oklch(10.5% 0.012 75 / 0.92));
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    z-index: 90;
  }
  .ac-header .ac-container {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 26px;
    width: 100%;
    height: 100%;
    padding: 24px 18px 20px;
  }
  .ac-header > .ac-container > a {
    align-self: flex-start;
  }
  .ac-header nav {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .ac-header nav [data-slot="button"] {
    width: 100%;
    height: 44px;
    justify-content: flex-start;
    padding: 0 14px !important;
    border-radius: 10px;
    color: oklch(82% 0.02 80);
  }
  .ac-header nav [data-slot="button"]:hover {
    background: oklch(26% 0.02 78 / 0.7);
    color: var(--brand-gold);
  }
  .ac-header nav a[data-status="active"],
  .ac-header nav [data-slot="button"].text-primary {
    background: linear-gradient(180deg, oklch(84% 0.11 84), oklch(72% 0.115 78));
    color: oklch(16% 0.02 70) !important;
    box-shadow:
      0 10px 26px -12px oklch(55% 0.1 78 / 0.85),
      inset 0 1px 0 oklch(92% 0.05 88 / 0.5);
  }
  /* 语言切换沉底 */
  .ac-header .ac-container > .flex.gap-2 {
    margin-top: auto;
  }
  /* 内容区右移（fixed 栏不占流） */
  body {
    padding-left: 236px;
  }
}

/* ── 11. 细节收尾 ──────────────────────────────────────────────────────────────── */
/* 页脚与分隔线暖化由 token 层生效；此处只补平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 规则页「返回卡牌」：常驻导航（左栏/顶部 chrome）时代冗余，隐藏。
 * 选择器 = 指向首页且内含左箭头图标的链接（全站唯一；logo 与页签无 svg 不误伤）。
 * :has() 需 Chrome 105+/Safari 15.4+，不支持时优雅降级为显示原按钮。 */
a[href="/"]:has(> svg.lucide-arrow-left) {
  display: none;
}

/* 规则页第 11 节「合约安全」：新合约尚未完成审计——先隐藏（2026-11-06 站主指示）。
 * 审计通过后删除本规则即恢复。作用域用规则页 main 的唯一签名（py-10 sm:py-14），
 * 其它页 main 均无该 class，不会误伤。 */
main.ac-container.py-10 > div > section:last-of-type {
  display: none !important;
}

/* 预发射（html.tg-pre 由 apply-release 按 CFG.prelaunch 注入，React 根外、注水安全）：
 * Agent 指令页整页内容切「部署中」。发射日 CFG.prelaunch=false 重跑 apply，标记消失、页面自动恢复。 */
html.tg-pre main.ac-container section#card-workspace > div.pt-7 {
  display: none !important;
}
html.tg-pre main.ac-container section#card-workspace::after {
  content: "虎符 · 合约部署中 —— 铸造与市场开放后，Agent 指令将在此上线。Deploying…";
  display: block;
  margin-top: 44px;
  padding: 34px 24px;
  text-align: center;
  border: 1px solid oklch(55% .07 80 / .35);
  border-radius: 10px;
  background: oklch(18% .012 78 / .6);
  color: oklch(80% .09 82);
  font-size: 15px;
  line-height: 1.9;
}

/* 动效尊重系统偏好 */
@media (prefers-reduced-motion: reduce) {
  [data-slot="button"],
  .ac-card-art,
  .ac-collectible::before {
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}
