/* ============================================================
   自由传输 · 网页版 — 样式表
   ------------------------------------------------------------
   设计语言「青墨纸感」与官网完全一致（需求 §4.1~§4.5）：
   · 纸感暖白底 + 青墨文字，青绿只作强调色
   · 标题衬线（Georgia / 宋体系），正文系统无衬线，数字用 tabular-nums
   · 发丝线（1px）代替粗边框，阴影克制到几乎看不见
   · 间距走 4px 栅格；卡片 10px 圆角、按钮 6px
   · 过渡统一 220ms cubic-bezier(0.22, 1, 0.36, 1)，只做状态反馈
   · 移动端优先，桌面端内容最大 720px 居中
   · 纯原生 CSS，无构建、无框架，可直接上传 Cloudflare Pages
   ============================================================ */

/* ============================================================
   §1 设计令牌（与官网 site/assets/styles.css §1 逐值对齐）
   ============================================================ */

:root {
  /* ---- 色彩 · 浅色「纸」（需求 §4.2）---- */
  --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;

  --danger: #9a3b32;
  --danger-soft: #f4e7e5;

  --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);

  /* ---- 字族（需求 §4.3）---- */
  --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;

  /* ---- 字号 ---- */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;

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

  /* ---- 形状与动效（需求 §4.5）---- */
  --radius: 10px;
  --radius-s: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 220ms;

  /* ---- 布局：最大内容宽度 720px，左右留白 20px ---- */
  --wrap: 720px;
  --gutter: 20px;
}

/* ---- 色彩 · 深色「青墨夜」（需求 §4.2）---- */
: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;

  --danger: #d98b80;
  --danger-soft: #33211f;

  --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);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

/* 数字统一等宽且等宽数字，避免进度跳变时数字宽度抖动（需求 §4.3） */
.num,
.code-display,
.code-input,
.badge {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: var(--s2) var(--s4);
  border-radius: var(--radius-s);
  z-index: 100;
}
.skip-link:focus {
  left: var(--s4);
  top: var(--s4);
}

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

/* ============================================================
   §3 顶栏
   ============================================================ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: 56px;
  padding-top: var(--s2);
  padding-bottom: var(--s2);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s2);
  min-width: 0;
}

.brand-mark {
  color: var(--brand);
  display: inline-flex;
  align-self: center;
}

.brand-name {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-tag {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 0 var(--s2);
  line-height: 1.6;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

/* 顶栏按钮：高度 36px，触摸目标靠 padding 补足 */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 36px;
  padding: 0 var(--s3);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition:
    background var(--t) var(--ease),
    color var(--t) var(--ease),
    border-color var(--t) var(--ease);
}

.icon-btn:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.icon-btn.is-active {
  color: var(--brand);
  background: var(--brand-soft);
}

.icon-btn:active {
  transform: translateY(1px);
}

.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.6875rem;
  line-height: 18px;
  text-align: center;
}

/* ============================================================
   §4 按钮
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  /* 移动端触摸友好：需求 §4.7 要求 ≥44px */
  min-height: 44px;
  padding: 0 var(--s5);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-base);
  cursor: pointer;
  transition:
    background var(--t) var(--ease),
    border-color var(--t) var(--ease),
    color var(--t) var(--ease);
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-alt);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.btn-primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: var(--on-brand);
}

.btn-quiet {
  background: transparent;
  color: var(--text-muted);
}

.btn-quiet:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  border-color: var(--border);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-sm {
  min-height: 32px;
  padding: 0 var(--s3);
  font-size: var(--fs-sm);
}

.btn[disabled],
.btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text-muted);
}

.btn[disabled]:hover,
.btn-disabled:hover {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text-muted);
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  padding: 0;
  min-height: 32px;
  transition: color var(--t) var(--ease);
}

.link-btn:hover {
  color: var(--brand);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* ============================================================
   §5 首页 · 未连接
   ============================================================ */

.view {
  padding-top: var(--s6);
  padding-bottom: var(--s7);
}

.hero-title {
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.hero-sub {
  margin-top: var(--s2);
  color: var(--text-muted);
  font-size: var(--fs-base);
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
  margin-top: var(--s5);
}

@media (min-width: 560px) {
  .action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s1);
  min-height: 128px;
  padding: var(--s5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    transform var(--t) var(--ease);
}

.action-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

.action-card:active {
  transform: translateY(1px);
}

.action-icon {
  color: var(--brand);
  display: inline-flex;
  margin-bottom: var(--s1);
}

.action-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
}

.action-desc {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* ---- 加入房间表单 ---- */

.join-form {
  margin-top: var(--s5);
  padding: var(--s5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.field-label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--s2);
}

.field-hint {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.join-row {
  display: flex;
  gap: var(--s3);
  align-items: stretch;
}

.code-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--text);
  font-size: 1.25rem;
  letter-spacing: 0.24em;
  transition: border-color var(--t) var(--ease);
}

.code-input:focus {
  border-color: var(--brand);
  outline: none;
}

.code-input::placeholder {
  letter-spacing: 0.08em;
  color: var(--border-strong);
}

/* ============================================================
   §6 首页 · 等待 / 已连接
   ============================================================ */

.status-line {
  font-size: var(--fs-base);
  color: var(--text-muted);
}

.code-display {
  margin: var(--s4) 0 var(--s2);
  font-size: clamp(2.25rem, 12vw, 3.25rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text);
  line-height: 1.2;
}

.hint {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* 等待页的网络建议：比 hint 更小一号，靠字号和顶部分隔线跟正文区分开 */
.waiting-tip {
  margin: var(--s4) 0 0;
  padding-top: var(--s3);
  border-top: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.8;
}

.conn-bar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--brand-soft);
  font-size: var(--fs-sm);
}

.conn-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--ok);
}

/* ---- 拖拽区 ---- */

.dropzone {
  margin-top: var(--s5);
  padding: var(--s6) var(--s5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  transition:
    border-color var(--t) var(--ease),
    background var(--t) var(--ease);
}

.dropzone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.dropzone-title {
  margin-bottom: var(--s4);
  color: var(--text-muted);
}

.dropzone .row {
  justify-content: center;
}

.dropzone-hint {
  margin-top: var(--s3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ---- 文本发送 ---- */

.text-send {
  margin-top: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.text-input {
  width: 100%;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-base);
  line-height: 1.7;
  resize: vertical;
  transition: border-color var(--t) var(--ease);
}

.text-input:focus {
  outline: none;
  border-color: var(--brand);
}

/* ============================================================
   §7 列表与卡片
   ============================================================ */

.list-section {
  margin-top: var(--s6);
}

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

.section-title {
  font-size: var(--fs-base);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.page-title {
  font-size: 1.375rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.card {
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty {
  padding: var(--s5) var(--s4);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}

.card-title {
  font-size: var(--fs-base);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  margin-top: var(--s1);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
}

.card-file {
  margin-top: var(--s2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- 进度条 ---- */

.progress-track {
  margin-top: var(--s3);
  height: 6px;
  border-radius: 99px;
  background: var(--bg-alt);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--brand);
  transition: width var(--t) var(--ease);
}

.progress-bar.is-done {
  background: var(--ok);
}

/* ---- 状态标签 ---- */

.tag {
  display: inline-block;
  padding: 0 var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--text-muted);
  white-space: nowrap;
}

.tag-ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}

.tag-fail {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

/* ============================================================
   §8 收件箱
   ============================================================ */

.inbox-item {
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.inbox-item.is-unread {
  border-left: 2px solid var(--brand);
}

.inbox-text {
  margin-top: var(--s2);
  white-space: pre-wrap;
  word-break: break-word;
}

.inbox-actions {
  margin-top: var(--s3);
  display: flex;
  gap: var(--s3);
}

/* ============================================================
   §9 模态（接收确认 / 传输进度 / 提示）
   ============================================================ */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background: color-mix(in srgb, #0d1516 45%, transparent);
  overflow-y: auto;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  padding: var(--s5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: modal-in var(--t) var(--ease);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-title {
  font-size: 1.125rem;
}

.modal-sub {
  margin-top: var(--s2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.modal-section {
  margin-top: var(--s4);
}

.modal-actions {
  margin-top: var(--s5);
  display: flex;
  gap: var(--s3);
}

.modal-actions .btn {
  flex: 1 1 0;
}

/* ---- 连接诊断 ---- */

/* 内容可能很长，限高后内部滚动，别把整个弹窗顶出屏幕 */
.diag-card {
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
}

.diag-rows {
  overflow-y: auto;
}

.diag-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}

.diag-row:last-child {
  border-bottom: none;
}

.diag-k {
  color: var(--text-muted);
  flex: 0 0 auto;
}

.diag-v {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-align: right;
  word-break: break-all;
}

.diag-section {
  margin: var(--s5) 0 var(--s2);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.diag-log {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  padding: var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg-alt);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.9;
}

.diag-log-line {
  display: flex;
  gap: var(--s2);
}

.diag-log-time {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.diag-log-scope {
  flex: 0 0 auto;
  color: var(--brand);
}

.diag-log-msg {
  word-break: break-all;
}

/* 配对码：首次配对时大号显示（需求 §4.6） */
.pairing {
  margin-top: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--brand-soft);
  text-align: center;
}

.pairing-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.pairing-code {
  margin-top: var(--s1);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.75rem, 9vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text);
}

.countdown {
  margin-top: var(--s3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-align: center;
}

.file-preview {
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.file-preview li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   §10 设置抽屉
   ============================================================ */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, #0d1516 35%, transparent);
}

.sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(400px, 100%);
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  animation: sheet-in var(--t) var(--ease);
}

@keyframes sheet-in {
  from {
    transform: translateX(16px);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}

.sheet-title {
  font-size: var(--fs-lg);
}

.sheet-body {
  padding: var(--s5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

.field-group {
  display: flex;
  flex-direction: column;
}

.text-field {
  height: 44px;
  padding: 0 var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-base);
  transition: border-color var(--t) var(--ease);
}

.text-field:focus {
  outline: none;
  border-color: var(--brand);
}

/* ---- 分段控件（主题三选一）---- */

.segmented {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--surface);
}

.seg {
  flex: 1 1 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition:
    background var(--t) var(--ease),
    color var(--t) var(--ease);
}

.seg + .seg {
  border-left: 1px solid var(--border);
}

.seg:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.seg.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}

/* ---- 开关（接收确认）---- */

.switch-row {
  display: flex;
  align-items: center;
  gap: var(--s4);
  cursor: pointer;
}

.switch-text {
  flex: 1 1 auto;
}

.switch-title {
  display: block;
  font-size: var(--fs-base);
}

.switch-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  flex: 0 0 auto;
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  transition:
    background var(--t) var(--ease),
    border-color var(--t) var(--ease);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform var(--t) var(--ease);
}

.switch-row input:checked + .switch-track {
  background: var(--brand);
  border-color: var(--brand);
}

.switch-row input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch-row input:focus-visible + .switch-track {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.about-line {
  font-size: var(--fs-sm);
}

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

.app-footer {
  border-top: 1px solid var(--border);
  /* 比正文底色沉一档，让页脚成为独立的一条带，和上面的内容分清层次 */
  background: var(--bg-alt);
  padding: var(--s6) 0 var(--s7);
}

/* 页脚两行都居中；靠字号、间距和一条短分隔线拉开层次 */
.footer-inner {
  text-align: center;
}

.footer-line {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.9;
}

/* 显式声明 color：避免被全局 a 的配色覆盖后与页脚底色撞色 */
.footer-link,
.footer-link:hover,
.footer-link:active,
.footer-link:visited {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.footer-link:hover,
.footer-link:active {
  color: var(--brand-strong);
}

.footer-author {
  margin-top: var(--s5);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  line-height: 1.9;
}

/* 两行之间压一条 32px 的短发丝线：比通栏分隔线更轻，也不抢内容 */
.footer-author::before {
  content: "";
  display: block;
  width: 32px;
  height: 1px;
  margin: 0 auto var(--s5);
  background: var(--border-strong);
}

/* ============================================================
   §12 无障碍与降级
   ============================================================ */

[hidden] {
  display: none !important;
}

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