/* =========================================================
   Clash之家 · 6clash.com
   base.css —— 设计令牌 / reset / 排版 / 按钮 / 页头 / 页脚
   风格:「6 号线线网图海报」编辑风
   暖白纸面 + 信号橙 + 墨黑粗描边,硬直角,无投影无渐变
   ========================================================= */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 色板 */
  --paper: #FBF6EC;          /* 全站纸面底色 */
  --panel: #FFFFFF;          /* 白色面板 / 反白文字 */
  --panel-dim: #F2EBDC;      /* 次级面板 / 分隔浅色 */
  --ink: #1A1A1E;            /* 墨黑:描边 / 主文字 / 信息屏底 */
  --signal: #FF4E00;         /* 信号橙:线路主色 */
  --signal-deep: #C43700;    /* 信号橙深色变体 */
  --text: #1A1A1E;           /* 正文主色 */
  --text-dim: #5B6770;       /* 次要文字 */
  --ok: #0E8A5F;             /* 成功 */
  --warn: #D98E00;           /* 警告 */
  --bad: #C81E1E;            /* 错误 */

  /* 字体栈 */
  --font-display: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Noto Sans SC', 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, 'Courier New', monospace;

  /* 结构值 */
  --stroke: 2px solid var(--ink);   /* 全站统一粗描边 */
  --rail-w: 8px;                    /* 线路干线宽度 */
  --radius: 0;                      /* 硬直角,禁用圆角 */
  --gutter: clamp(16px, 4vw, 40px); /* 版心左右留白,任何断点不归零 */
  --hd-h: 64px;                     /* 页头总高(含顶部橙条) */
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hd-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

/* 汉堡菜单展开时锁死背景滚动 */
html.nav-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.78;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }

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

a { color: var(--signal-deep); text-underline-offset: 3px; }
a:hover { color: var(--signal); }

::selection { background: var(--signal); color: var(--panel); }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

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

/* ---------- 3. 排版层级 ---------- */
h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.3;
}

h4 { font-weight: 800; font-size: 1.05rem; }

.mono { font-family: var(--font-mono); }

/* 站牌小引题:等宽字体报站条 */
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--signal-deep);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.dim { color: var(--text-dim); }

/* ---------- 4. 版心与区块节奏 ---------- */
.wrap {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 区块节奏:只声明纵向 padding,禁止简写覆盖版心横向留白 */
.sec {
  padding-top: clamp(56px, 9vw, 110px);
  padding-bottom: clamp(56px, 9vw, 110px);
}

.sec-tight {
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(32px, 5vw, 56px);
}

/* 通用网格:子项 min-width:0 防长内容撑爆 */
.grid { display: grid; gap: clamp(16px, 2.6vw, 28px); }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 26px;
  border: var(--stroke);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 0 var(--ink); /* 硬边偏移层,非模糊投影 */
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn svg { flex-shrink: 0; }

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--ink);
  color: var(--ink);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--ink);
}

.btn-hot {
  background: var(--signal);
  color: var(--panel);
}
.btn-hot:hover { background: var(--signal-deep); color: var(--panel); }

.btn-ghost { background: var(--paper); }

.btn-ink {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 4px 0 0 var(--signal);
}
.btn-ink:hover {
  color: var(--paper);
  box-shadow: 6px 6px 0 0 var(--signal);
}
.btn-ink:active { box-shadow: 1px 1px 0 0 var(--signal); }

/* ---------- 6. 面板 / 卡片基元 ---------- */
.panel {
  background: var(--panel);
  border: var(--stroke);
}

.panel-dim { background: var(--panel-dim); }

/* 版画式厚度:向右下 8px 硬边墨块 */
.panel-raised { box-shadow: 8px 8px 0 0 var(--ink); }

.pad { padding: clamp(18px, 3vw, 30px); }

/* 虚线轨道分隔(dashed 边框拼出线路虚段,不用渐变) */
.rail-dashes {
  border: 0;
  border-top: var(--rail-w) dashed var(--signal);
  margin: 0;
}

/* ---------- 7. 代码 / 车厢信息屏 ---------- */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--panel-dim);
  border: 1px solid var(--ink);
  padding: 1px 6px;
}

pre {
  margin: 0 0 1.2em;
  background: var(--ink);
  color: var(--signal);
  border: var(--stroke);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  padding: 18px 20px;
  overflow-x: auto;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ---------- 8. 页头(header.js 注入) ---------- */
.hd-bar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--paper);
  border-top: 6px solid var(--signal);
  border-bottom: var(--stroke);
}

.hd-in {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: calc(var(--hd-h) - 8px);
}

.hd-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.hd-brand img { flex-shrink: 0; display: block; }
.hd-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.hd-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.hd-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.hd-nav a svg { flex-shrink: 0; }
.hd-nav a:hover { border-bottom-color: var(--ink); color: var(--ink); }
.hd-nav a.on { border-bottom-color: var(--signal); color: var(--signal-deep); }

.hd-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 语言切换 */
.lang-box { position: relative; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border: var(--stroke);
  background: var(--panel);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}
.lang-btn svg { flex-shrink: 0; }
.lang-btn[aria-expanded="true"] { background: var(--panel-dim); }

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 168px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--panel);
  border: var(--stroke);
  box-shadow: 6px 6px 0 0 var(--ink);
  display: none;
  z-index: 90;
}
.lang-menu.open { display: block; }

.lang-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid var(--panel-dim);
}
.lang-menu li:last-child a { border-bottom: 0; }
.lang-menu a:hover { background: var(--panel-dim); color: var(--ink); }
.lang-menu a.cur {
  background: var(--panel-dim);
  border-left: 6px solid var(--signal);
  font-weight: 700;
}

/* 汉堡按钮 */
.hd-burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  border: var(--stroke);
  background: var(--panel);
}
.hd-burger span {
  display: block;
  width: 20px;
  height: 3px;
  background: var(--ink);
  flex-shrink: 0;
  transition: transform .2s ease, opacity .2s ease;
}
.hd-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hd-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hd-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 窄屏:导航收进抽屉 */
@media (max-width: 1024px) {
  .hd-nav {
    /* 抽屉面板:实色不透明背景,禁半透明 */
    position: fixed;
    top: var(--hd-h);
    left: 0;
    right: 0;
    margin-left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--panel);
    border-bottom: var(--stroke);
    max-height: calc(100dvh - var(--hd-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 79;
  }
  .hd-nav.open { display: flex; }

  /* 整行可点,触达高度 ≥44px */
  .hd-nav a {
    display: flex;
    width: 100%;
    min-height: 48px;
    padding-top: 13px;
    padding-bottom: 13px;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    border-bottom: 1px solid var(--panel-dim);
    border-left: 6px solid transparent;
  }
  .hd-nav a:hover { border-bottom-color: var(--panel-dim); }
  .hd-nav a.on {
    border-left-color: var(--signal);
    background: var(--panel-dim);
    border-bottom-color: var(--panel-dim);
  }

  /* 工具区在窄屏必须仍贴最右:nav 脱离文档流后 auto 边距要自己补 */
  .hd-tools { margin-left: auto; }
  .hd-burger { display: flex; }
}

/* ---------- 9. 页脚(footer.js 注入) ---------- */
.ft {
  background: var(--ink);
  color: var(--paper);
  border-top: var(--rail-w) solid var(--signal);
  margin-top: clamp(56px, 9vw, 110px);
}

.ft-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.4fr;
  gap: clamp(24px, 4vw, 48px);
  padding-top: clamp(40px, 6vw, 64px);
  padding-bottom: clamp(32px, 5vw, 48px);
}
.ft-grid > * { min-width: 0; }

.ft-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ft-brand img { flex-shrink: 0; display: block; }
.ft-brand strong {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--panel);
}

.ft-about {
  color: var(--panel-dim);
  font-size: 14px;
  line-height: 1.8;
}

.ft-h {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--signal);
  margin: 0 0 14px;
  text-transform: uppercase;
}

.ft-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ft-nav li { margin-bottom: 2px; }
.ft-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--paper);
  text-decoration: none;
  font-size: 14px;
}
.ft-nav a:hover { color: var(--signal); }

.ft-hot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.ft-hot a {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--text-dim);
  color: var(--panel-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
}
.ft-hot a:hover { border-color: var(--signal); color: var(--signal); }

.ft-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ft-langs a {
  color: var(--panel-dim);
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.ft-langs a:hover { color: var(--signal); }

.ft-legal {
  border-top: 1px solid var(--text-dim);
  padding-top: 18px;
  padding-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--panel-dim);
}

@media (max-width: 860px) {
  .ft-grid { grid-template-columns: 1fr; }
}

/* ---------- 10. 滚动淡入 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.shown {
  opacity: 1;
  transform: none;
}

/* ---------- 11. 装饰动效 ---------- */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  margin-bottom: 18px;
}
.eyebrow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--signal);
  flex-shrink: 0;
  animation: pulse-dot 2.2s ease-in-out infinite;
}

/* ---------- 12. 表格 ---------- */
.table-scroll { overflow-x: auto; }

.board-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: var(--panel);
  border: var(--stroke);
  font-size: 14px;
}
.board-table th {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  text-align: left;
  padding: 10px 14px;
}
.board-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-dim);
  border-right: 1px solid var(--panel-dim);
}
.board-table tr:last-child td { border-bottom: 0; }
.board-table td:last-child { border-right: 0; }

/* ---------- 13. 无障碍降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
/* 1280 宽下 en/ja 导航+语言按钮总宽溢出视口 6~10px:窄桌面区间收紧留白 */
@media (min-width: 1025px) and (max-width: 1340px) {
  .hd-in { gap: 8px; }
  .hd-nav a { padding: 9px 7px; }
  .lang-btn { padding: 6px 8px; }
}
