/* ============================================================
   自由传输官网 — 样式表 v2「青墨纸感」
   ------------------------------------------------------------
   设计语言（安静精致）：
   · 纸感暖白底 + 青墨文字，青绿只作强调色（约 10% 面积）
   · 标题用衬线字族（Georgia / 宋体系），正文用系统无衬线
   · 发丝线（1px）代替粗边框，阴影克制到几乎看不见
   · 间距走 4px 栅格；字号五级，层级靠字重与留白而非色彩
   · 动效 0.22s ease-out-quart，只做状态反馈不做表演

   工程约定：
   · 纯原生 CSS，无构建、无框架，Pages 直接上传
   · 颜色用 hex + color-mix 派生（不依赖 oklch，兼容面更广）
   · 深浅色由 <html data-theme> 驱动，head 里的内联脚本在
     首帧前就把属性写好，不会闪一下白屏（FOUC）
   ============================================================ */

/* ============================================================
   §1 设计令牌（Design Tokens）
   ============================================================ */

:root {
  /* ---- 色彩 · 浅色「纸」 ---- */
  --bg: #f8f7f2;            /* 暖纸白，页面底色 */
  --bg-alt: #f1efe8;        /* 略沉的纸，交替区块 */
  --surface: #fdfcf9;       /* 卡面 */
  --text: #22302f;          /* 青墨，正文主色 */
  --text-muted: #5f6e6d;    /* 次级文字 */
  --border: #e2e5df;        /* 发丝线 */
  --border-strong: #cfd5cd; /* 发丝线 · 悬停 */

  --brand: #0f766e;         /* 青绿 · 主强调 */
  --brand-strong: #0b5d57;  /* 青绿 · 深一档（悬停） */
  --brand-soft: #e6efec;    /* 青染纸（弱底色） */
  --on-brand: #f7fdfb;      /* 青底之上的文字 */
  --ok: #337a5b;            /* 语义 · 可用 */

  --shadow-1: 0 1px 2px rgba(34, 48, 47, 0.05);
  --shadow-2: 0 2px 4px rgba(34, 48, 47, 0.04), 0 12px 32px rgba(34, 48, 47, 0.06);

  /* ---- 字族 ---- */
  --font-display: "Georgia", "Times New Roman", "Songti SC", "STSong",
    "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Source Code Pro",
    Consolas, "Courier New", monospace;

  /* ---- 字号五级（正文固定 rem，标题流式） ---- */
  --fs-xs: 0.75rem;    /* 注脚 / 法律 */
  --fs-sm: 0.875rem;   /* 次要 UI / 元信息 */
  --fs-base: 1rem;     /* 正文 */
  --fs-lg: 1.125rem;   /* 导语 */

  /* ---- 4px 间距栅格 ---- */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  /* ---- 形状与动效 ---- */
  --radius: 10px;
  --radius-s: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quart */
  --t: 220ms;

  --wrap: 1040px;
}

/* ---- 色彩 · 深色「青墨夜」：同一套令牌换值，组件零改动 ---- */
:root[data-theme="dark"] {
  --bg: #101a1b;
  --bg-alt: #0d1516;
  --surface: #162324;
  --text: #e7edeb;
  --text-muted: #94a6a4;
  --border: #273637;
  --border-strong: #35484a;

  --brand: #7fd1c6;
  --brand-strong: #a3ded5;
  --brand-soft: #1b2f2e;
  --on-brand: #0c1817;
  --ok: #6fbb93;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* ============================================================
   §2 基础
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.8; /* 中文正文需要比西文更松的行距 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 键盘可达：统一的青色焦点环 */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
}

/* 自定义滚动条：细、融入发丝线体系 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-track {
  background: transparent;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s5);
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--t) var(--ease);
}
a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--brand-soft);
  color: var(--brand-strong);
  padding: 1px 6px;
  border-radius: 4px;
  /* 校验值很长，禁连字避免视觉粘连 */
  font-variant-ligatures: none;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: var(--s5);
  top: var(--s3);
  z-index: 99;
  background: var(--surface);
  padding: var(--s2) var(--s4);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-2);
}

/* ============================================================
   §3 顶栏 + 主题开关
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--text);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
}
.brand:hover {
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--on-brand);
  transition: background var(--t) var(--ease);
}
.brand:hover .brand-mark {
  background: var(--brand-strong);
}

.nav {
  display: none;
  gap: var(--s5);
  font-size: var(--fs-sm);
  margin-left: auto;
  margin-right: var(--s5);
}
.nav a {
  color: var(--text-muted);
  /* 悬停下划线从左侧生长，比突现的下划线安静 */
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 1px);
  padding-bottom: 2px;
  transition: color var(--t) var(--ease), background-size var(--t) var(--ease);
}
.nav a:hover {
  color: var(--text);
  text-decoration: none;
  background-size: 100% 1px;
}

/* 主题开关：唯一始终可见的头部按钮（移动端导航隐藏时它仍在） */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease),
    background var(--t) var(--ease);
}
.theme-toggle:hover {
  color: var(--brand);
  border-color: var(--border-strong);
  background: var(--brand-soft);
}
.theme-toggle .icon-sun {
  display: none;
}
.theme-toggle .icon-moon {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (min-width: 720px) {
  .nav {
    display: flex;
  }
}

/* ============================================================
   §4 Hero
   ============================================================ */

.hero {
  position: relative;
  padding: clamp(72px, 11vw, 128px) 0 clamp(56px, 8vw, 88px);
  /* 一抹极淡的青晕，代替原来的大渐变 */
  background: radial-gradient(
      64% 42% at 50% 0%,
      color-mix(in srgb, var(--brand) 7%, transparent),
      transparent 72%
    ),
    var(--bg);
}

.hero-inner {
  text-align: center;
}

.eyebrow {
  margin: 0 0 var(--s4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.32em; /* 中文眉题拉开字距才有「刊头」感 */
  color: var(--brand);
}

.hero-title {
  margin: 0 0 var(--s4);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: 0.01em;
}

.hero-sub {
  margin: 0 auto var(--s6);
  max-width: 34em;
  font-size: var(--fs-lg);
  line-height: 1.9;
  color: var(--text-muted);
}

/* 传输路线徽记：两台设备 + 流动的虚线，本页的记忆点 */
.hero-route {
  display: flex;
  justify-content: center;
  margin: 0 0 var(--s6);
  color: var(--brand);
  opacity: 0.65;
}
.hero-route svg {
  width: min(264px, 60vw);
  height: auto;
}
.hero-route .route-line {
  stroke-dasharray: 3 7;
  animation: route-flow 14s linear infinite;
}
@keyframes route-flow {
  to {
    stroke-dashoffset: -100;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  justify-content: center;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  justify-content: center;
  margin: var(--s5) 0 0;
  font-size: var(--fs-sm);
}

.hero-note {
  margin: var(--s3) 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ============================================================
   §5 按钮
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 11px 22px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease),
    border-color var(--t) var(--ease), box-shadow var(--t) var(--ease),
    transform var(--t) var(--ease);
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
  transition-duration: 80ms;
}

/* 主按钮三态：color 与 background 全部显式写出，不依赖继承。
   原因：全局 a:hover { color: var(--brand-strong) } 的优先级高于
   .btn-primary，会把文字染成与悬停背景相同的颜色导致文字消失；
   hover / active 必须用更高优先级把文字颜色钉死。 */
.btn-primary {
  background: var(--brand-soft);   /* 正常态：浅青背景 */
  color: var(--brand-strong);      /* 正常态：深色文字 */
  box-shadow: var(--shadow-1);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--brand) 20%, var(--brand-soft)); /* 背景加深一档 */
  color: var(--brand-strong);      /* 文字保持深色，清晰可见 */
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 22%, transparent);
}
.btn-primary:active {
  background: color-mix(in srgb, var(--brand) 30%, var(--brand-soft)); /* 按压时再轻微变暗 */
  color: var(--brand-strong);
  box-shadow: none;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-1);
}
.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--bg);
}

.btn-block {
  display: flex;
  width: 100%;
  margin-top: var(--s4);
}

/* 置灰禁用按钮：未发布平台的占位，不可点击、无位移反馈 */
.btn-disabled {
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-disabled:hover,
.btn-disabled:active {
  transform: none;
  background: var(--bg-alt);
  color: var(--text-muted);
}

/* ============================================================
   §6 通用区块
   ============================================================ */

.section {
  padding: clamp(64px, 9vw, 104px) 0;
}
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* 标题前的青色短杠：编辑部式的章节记号 */
.section-title {
  margin: 0 0 var(--s2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.8vw, 1.875rem);
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 2px;
  margin-right: var(--s3);
  vertical-align: 0.32em;
  background: var(--brand);
}

.section-sub {
  margin: 0 0 var(--s7);
  max-width: 60ch;
  color: var(--text-muted);
}

.grid {
  display: grid;
  gap: var(--s4);
}
@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s5);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s5);
  }
}
@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   §7 卡片（功能 / 联系）
   ============================================================ */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: var(--shadow-1);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease),
    transform var(--t) var(--ease);
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.card h3 {
  margin: 0 0 var(--s2);
  font-size: 1.0625rem;
  font-weight: 600;
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.8;
}

/* 图标位：青染纸底的小方章，代替原先的 emoji */
.card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: var(--s4);
  border-radius: var(--radius-s);
  background: var(--brand-soft);
  color: var(--brand);
}
.card-icon svg {
  width: 20px;
  height: 20px;
}

.card-flat {
  box-shadow: none;
}

/* ============================================================
   §8 联系区细节
   ============================================================ */

.card .contact-line {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  margin: var(--s3) 0 0;
  font-size: var(--fs-sm);
}
.contact-label {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}

.btn-copy {
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--brand);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: var(--s1) var(--s3);
  cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
    color var(--t) var(--ease);
}
.btn-copy:hover {
  background: var(--brand-soft);
  border-color: var(--border-strong);
}
.btn-copy.is-done {
  color: var(--text-muted);
  border-style: dashed;
}

/* ============================================================
   §9 下载区
   ============================================================ */

.platforms {
  display: grid;
  gap: var(--s4);
}
@media (min-width: 768px) {
  .platforms {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s5);
  }
}
@media (min-width: 1024px) {
  .platforms {
    grid-template-columns: repeat(3, 1fr);
  }
}

.platform-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: var(--shadow-1);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease),
    transform var(--t) var(--ease);
}
.platform-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

/* 访问者所在平台：青色细环 + 微微染色，比角标安静 */
.platform-card.is-current {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}

.platform-card.is-disabled {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
  opacity: 0.78;
}
.platform-card.is-disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-strong);
}

.platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s2);
}

.platform-name {
  font-size: 1.0625rem;
  font-weight: 700;
}

.badge {
  font-size: var(--fs-xs);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge-ok {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  color: var(--ok);
}

.platform-card p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.75;
}
/* 说明文字占满剩余高度，按钮统一贴底对齐 */
.platform-card p.muted {
  flex: 1;
}

.callout {
  margin-top: var(--s6);
  padding: var(--s4) var(--s5);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border));
  border-left: 2px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: var(--fs-sm);
  line-height: 1.85;
}

.checksum {
  margin-top: var(--s4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  word-break: break-all;
  line-height: 2;
}

/* ============================================================
   §10 更新日志（编辑部式时间轴：发丝线 + 青点）
   ============================================================ */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--s6);
  border-left: 1px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 var(--s7);
}
.timeline-item:last-child {
  padding-bottom: 0;
}
/* 时间轴节点：纸面圆点 + 青环 */
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--s6) - 5.5px);
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--brand);
}

.timeline-head {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s2);
}

.timeline-version {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand);
}
.timeline-head .badge {
  font-size: var(--fs-xs);
}

.timeline-item ul {
  margin: 0;
  padding-left: 1.25em;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.9;
}

/* ============================================================
   §11 页脚
   ============================================================ */

.site-footer {
  padding: var(--s7) 0 var(--s8);
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer-inner {
  text-align: center;
  font-size: var(--fs-sm);
}
.footer-inner p {
  margin: var(--s1) 0;
}

.chip {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
}

/* ============================================================
   §12 无障碍：尊重「减少动态效果」系统设置
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
