/* ============================================================
   柒协议控制台 · Apple 设计系统（HIG-inspired）
   token: surface / content / accent / signal，明暗双套自动切换
   ============================================================ */
:root {
  --surface: #F5F5F7;
  --surface-elevated: rgba(255, 255, 255, 0.72);
  --surface-solid: #FFFFFF;
  --surface-subtle: rgba(0, 0, 0, 0.04);
  --content: #1D1D1F;
  --content-secondary: #6E6E73;
  --content-tertiary: #86868B;
  --accent: #0071E3;
  --accent-hover: #0077ED;
  --accent-soft: rgba(0, 113, 227, 0.10);
  --signal-green: #34C759;
  --signal-red: #FF3B30;
  --signal-orange: #FF9F0A;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.18);
  --bar-bg: rgba(251, 251, 253, 0.82);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 980px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #000000;
    --surface-elevated: rgba(28, 28, 30, 0.72);
    --surface-solid: #1C1C1E;
    --surface-subtle: rgba(255, 255, 255, 0.06);
    --content: #F5F5F7;
    --content-secondary: #98989D;
    --content-tertiary: #7D7D81;
    --accent: #0A84FF;
    --accent-hover: #409CFF;
    --accent-soft: rgba(10, 132, 255, 0.16);
    --signal-green: #30D158;
    --signal-red: #FF453A;
    --signal-orange: #FF9F0A;
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.24);
    --bar-bg: rgba(22, 22, 24, 0.72);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--surface);
  color: var(--content);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---------- 毛玻璃材料层（Liquid Glass 风格，仅用于功能层） ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px max(20px, calc((100vw - 980px) / 2));
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--content); font-weight: 600; font-size: 17px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #0A84FF 0%, #BF5AF2 100%);
  color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.25), 0 1px 4px rgba(0,0,0,0.2);
}
.capacity { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--content-secondary); font-size: 14px; }
.live-dot, .summary-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal-green);
  box-shadow: 0 0 0 0 rgba(52,199,89,0.5);
  animation: pulse 2s ease-out infinite;
}
.capacity.full .live-dot, .summary-dot.full { background: var(--signal-red); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,199,89,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(52,199,89,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); }
}
.auth-nav { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.auth-user { color: var(--content-secondary); font-size: 14px; font-weight: 600; }
.auth-link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 14px; text-decoration: none; padding: 4px 0; }
.auth-link:hover { text-decoration: underline; }

/* ---------- 通用按钮（buttons.md: 44pt 命中区、按压态、主次层级） ---------- */
.primary-button, .secondary-button, .mini-button, .text-button, .hero-button, .admin-tab, .auth-tab {
  min-height: 44px;
  border-radius: var(--radius-pill);
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.primary-button { background: var(--accent); color: #fff; box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.15), 0 1px 2px rgba(0,0,0,0.12); }
.primary-button:hover { background: var(--accent-hover); }
.primary-button:active { transform: scale(0.97); }
.primary-button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.secondary-button {
  background: var(--surface-elevated);
  color: var(--accent);
  border-color: var(--border-strong);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}
.secondary-button:hover { background: var(--surface-solid); }
.secondary-button:active { transform: scale(0.97); }
.mini-button {
  min-height: 32px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--accent);
  border: 1px solid var(--border);
}
.mini-button:hover { background: var(--accent-soft); }
.mini-button.danger { color: var(--signal-red); }
.mini-button.danger:hover { background: rgba(255, 59, 48, 0.10); }
.text-button {
  min-height: 32px;
  padding: 0 10px;
  background: none;
  color: var(--accent);
}
.text-button:hover { text-decoration: underline; }

/* ---------- 通用表单（text-fields.md: 独立标签 + 占位提示 + 焦点环） ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 600; color: var(--content); }
.field label small { font-weight: 400; color: var(--content-secondary); margin-left: 4px; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  color: var(--content);
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; font-family: var(--mono); font-size: 14px; }
.field input::placeholder, .field textarea::placeholder { color: var(--content-tertiary); }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface-solid);
}
.field-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--content-secondary); }
.field-meta .over-limit { color: var(--signal-red); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.error { color: var(--signal-red); font-size: 14px; margin: 10px 0; font-weight: 500; }
.error:empty { display: none; }

/* ---------- 面板 / 卡片 ---------- */
.panel {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-heading h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.panel-heading p { color: var(--content-secondary); font-size: 14px; }
.limit-pill {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
/* ---------- 首页 ---------- */
.home-shell { max-width: 980px; margin: 0 auto; padding: 64px 20px 40px; }
.hero { text-align: center; padding: 0 0 56px; }
.eyebrow {
  color: var(--accent);
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 16px;
}
.hero-copy {
  max-width: 560px; margin: 0 auto 28px;
  color: var(--content-secondary);
  font-size: 19px; line-height: 1.5;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }
.hero-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 22px; border-radius: var(--radius-pill); font-size: 16px; font-weight: 600; }
.primary-link { background: var(--accent); color: #fff; }
.primary-link:hover { background: var(--accent-hover); }
.secondary-link { background: var(--surface-elevated); color: var(--accent); border: 1px solid var(--border-strong); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); }
.secondary-link:hover { background: var(--surface-solid); }
.live-summary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--surface-elevated); border: 1px solid var(--border);
  color: var(--content-secondary); font-size: 14px;
}
.live-summary strong { color: var(--content); font-variant-numeric: tabular-nums; }
.live-summary.full { border-color: rgba(255,59,48,0.35); }

.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.service-card {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 26px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--content);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); border-color: var(--border-strong); }
.service-card:active { transform: scale(0.99); }
.service-icon {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 13px;
  font-size: 22px; font-weight: 700; color: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.3), inset 0 -6px 12px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.18);
}
.fx-icon { background: linear-gradient(135deg, #FF9F0A 0%, #FF3B30 100%); }
.wy-icon { background: linear-gradient(135deg, #30D158 0%, #00C7BE 100%); }
.dtx-icon { background: linear-gradient(135deg, #5E5CE6 0%, #BF5AF2 100%); }
.yz-icon { background: linear-gradient(135deg, #FFD60A 0%, #FF9F0A 100%); }
.ws-icon { background: linear-gradient(135deg, #0A84FF 0%, #BF5AF2 100%); }
.admin-icon { background: linear-gradient(135deg, #8E8E93 0%, #48484A 100%); }
.service-copy { flex: 1; min-width: 0; }
.service-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.service-heading h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.arrow { color: var(--content-tertiary); font-size: 22px; transition: transform 0.2s ease; }
.service-card:hover .arrow { transform: translateX(3px); color: var(--accent); }
.service-copy p { color: var(--content-secondary); font-size: 15px; line-height: 1.5; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tags span {
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--surface-subtle); border: 1px solid var(--border);
  color: var(--content-secondary); font-size: 12px; font-weight: 500;
}
.privacy-note {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 28px; padding: 18px 22px;
  background: var(--surface-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.privacy-icon {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(52,199,89,0.14); color: var(--signal-green);
  font-size: 14px; font-weight: 700;
}
.privacy-note strong { font-size: 15px; display: block; }
.privacy-note p { color: var(--content-secondary); font-size: 13px; margin-top: 2px; }

/* ---------- 任务页 / 工具页 ---------- */
.tool-shell { max-width: 820px; margin: 0 auto; padding: 32px 20px 48px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 15px; margin-bottom: 20px; }
.back-link:hover { text-decoration: underline; }
.tool-header { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 28px; }
.tool-header .eyebrow { margin-bottom: 6px; }
.tool-header h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 6px; }
.tool-header p { color: var(--content-secondary); font-size: 16px; }
.form-panel { margin-bottom: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.capacity-alert {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 18px; padding: 14px 18px;
  background: rgba(255,159,10,0.12); border: 1px solid rgba(255,159,10,0.35);
  border-radius: var(--radius-md);
  color: var(--signal-orange); font-size: 14px;
}
.capacity-alert[hidden] { display: none; }

/* ---------- 选项组 / 模式选择卡（forms: choices over typing） ---------- */
.options { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.mode-option {
  position: relative;
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  cursor: pointer;
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}
.mode-option:hover { border-color: var(--accent); }
.mode-option:active { transform: scale(0.99); }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-title { font-size: 15px; font-weight: 600; color: var(--content); }
.mode-desc { font-size: 13px; color: var(--content-secondary); line-height: 1.45; }
.mode-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.mode-option:has(input:checked) .mode-title { color: var(--accent); }


/* ---------- 日志（feedback.md: 状态即信号，颜色+文字双通道） ---------- */
.log-panel { margin-top: 24px; }
.log-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.task-status { display: flex; gap: 10px; align-items: center; }
.task-status strong { font-size: 17px; display: block; }
.task-status span:not(.dot) { color: var(--content-secondary); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--content-tertiary); transition: background 0.3s ease; }
.dot.on { background: var(--signal-green); box-shadow: 0 0 0 0 rgba(52,199,89,0.5); animation: pulse 2s ease-out infinite; }
#log, #adminLog {
  max-height: 420px; overflow-y: auto;
  padding: 14px 16px;
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
}
#log div, #adminLog div { padding: 2px 0; white-space: pre-wrap; word-break: break-all; }
#log .bad, #adminLog .bad { color: var(--signal-red); }
#log .ok, #adminLog .ok { color: var(--signal-green); }
#log .hi, #adminLog .hi { color: var(--accent); font-weight: 600; }
#log .dim, #adminLog .dim { color: var(--content-tertiary); }
.empty-log { color: var(--content-tertiary); text-align: center; padding: 40px 0 !important; }

/* ---------- 登录 / 注册页 ---------- */
/* 登录/注册页底部互链 */
.auth-foot { margin-top: 18px; text-align: center; color: var(--content-secondary); font-size: 14px; }

.auth-shell { max-width: 520px; margin: 0 auto; padding: 48px 20px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 24px; background: var(--surface-subtle); padding: 4px; border-radius: var(--radius-pill); }
.auth-tab { flex: 1; min-height: 40px; border-radius: var(--radius-pill); background: transparent; color: var(--content-secondary); border: none; font-size: 15px; }
.auth-tab.active { background: var(--surface-solid); color: var(--content); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.invite-check-row { display: flex; gap: 8px; align-items: center; }
.invite-check-row input { flex: 1; }
.invite-hint { margin-top: 6px; font-size: 13px; }
.invite-hint.ok { color: var(--signal-green); }
.invite-hint.bad { color: var(--signal-red); }

/* ---------- 管理后台 ---------- */
.admin-shell { max-width: 1080px; margin: 0 auto; padding: 32px 20px 48px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; background: var(--surface-subtle); padding: 4px; border-radius: var(--radius-pill); width: fit-content; }
.admin-tab { min-height: 40px; border-radius: var(--radius-pill); background: transparent; color: var(--content-secondary); border: none; font-size: 14px; font-weight: 600; }
.admin-tab.active { background: var(--surface-solid); color: var(--content); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.inline-form .field { margin-bottom: 0; min-width: 150px; }
.inline-form input, .inline-form select { padding: 8px 12px; min-height: 40px; }

/* 表格（lists-and-tables.md: 减少分隔线，用留白和字重建立层级） */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table thead th {
  text-align: left; padding: 10px 12px;
  color: var(--content-tertiary); font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table tbody td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr { transition: background 0.15s ease; }
.admin-table tbody tr:hover { background: var(--surface-subtle); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.table-empty { text-align: center; color: var(--content-tertiary); padding: 32px 12px !important; }
.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cell-label { font-weight: 600; }
.mono, .code-chip { font-family: var(--mono); }
.code-chip {
  display: inline-block; padding: 4px 10px;
  background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; letter-spacing: 1px;
}
.muted { color: var(--content-tertiary); font-size: 12px; }

/* Badge（颜色+文字双通道，避免只靠颜色传达状态） */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  background: var(--surface-subtle); color: var(--content-secondary);
  border: 1px solid var(--border);
}
.badge.running { background: rgba(52,199,89,0.12); color: var(--signal-green); border-color: rgba(52,199,89,0.3); }
.badge.done { background: var(--surface-subtle); color: var(--content-secondary); }
.badge:empty { display: none; }

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 20px; text-align: center;
  color: var(--content-secondary); cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* 页脚 */
footer {
  text-align: center; color: var(--content-tertiary);
  font-size: 13px; padding: 24px 16px 40px;
}
.admin-link { color: var(--content-tertiary); }
.admin-link:hover { color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .home-shell { padding-top: 40px; }
  .hero h1 { font-size: 38px; }
  .hero-copy { font-size: 17px; }
  .service-grid { grid-template-columns: 1fr; }
  .tool-shell, .admin-shell, .auth-shell { padding: 24px 16px 40px; }
  .tool-header h1 { font-size: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .mode-switch { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
  .topbar { padding: 12px 16px; }
}

/* ---------- 动效与无障碍降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .service-card:hover { transform: none; }
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================
   App / 移动端适配（手机浏览器 & App WebView）
   - 安全区（刘海屏 / 底部手势条）
   - 触摸反馈（去掉粘滞 hover，保留按压态）
   - 小屏按钮撑满、表格/日志可滚动
   ============================================================ */
html { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
.topbar { padding-top: max(14px, env(safe-area-inset-top)); }
footer { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
.tool-shell, .admin-shell, .auth-shell { padding-bottom: max(48px, env(safe-area-inset-bottom)); }
.table-wrap, #log, #adminLog { -webkit-overflow-scrolling: touch; }

@media (max-width: 760px) {
  /* 顶栏极简：只保留标题 + 退出，运行数/用户名/后台入口全部隐藏 */
  .topbar { flex-wrap: nowrap; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 16px; }
  .brand { font-size: 16px; gap: 8px; min-width: 0; }
  .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-mark { width: 28px; height: 28px; font-size: 15px; border-radius: 8px; flex: none; }
  .capacity { display: none; }
  .auth-user { display: none; }
  .auth-nav a.auth-link { display: none; }
  .auth-nav { margin-left: auto; min-width: 0; }
  .actions button { flex: 1 1 150px; }
  .inline-form button { flex: 1 1 130px; }
  .service-card { padding: 18px; }
  .service-icon { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; }
  .hero h1 { font-size: 34px; }
  .hero-copy { font-size: 16px; }
  .panel { padding: 18px; }
  #log, #adminLog { font-size: 12px; max-height: 360px; }
  .admin-table { font-size: 13px; }
  .admin-table thead th { padding: 8px 10px; }
  .admin-table tbody td { padding: 10px; }
  .admin-tabs { width: 100%; }
  .admin-tab { flex: 1 1 auto; }
}

@media (max-width: 480px) {
  .auth-nav { gap: 4px; }
  .auth-link { font-size: 13px; padding: 4px 10px; }
  .brand span:last-child { max-width: 150px; }
  .limit-pill { display: none; }
}

/* 触摸设备：hover 保持默认态（避免点击后粘滞），按压反馈已由 :active 提供 */
@media (hover: none) {
  .service-card:hover { transform: none; box-shadow: var(--shadow-card); border-color: var(--border); }
  .primary-button:hover { background: var(--accent); }
  .secondary-button:hover { background: var(--surface-elevated); }
  .mini-button:hover { background: var(--surface-subtle); }
}
