/* ================================================================
   有料云 · 统一深色 SaaS 设计系统
   作用于 landing.html 和 index.html（工具页）
   版本：r20
   ================================================================ */

/* ── 1. 设计令牌 ── */
:root {
  --bg-base:      #08090a;
  --bg-surface:   #0f1011;
  --bg-elevated:  #161718;
  --bg-muted:     #1c1d1f;
  --bg-overlay:   #23252a;
  --border:       #1e2023;
  --border-mid:   #2a2d32;
  --border-hi:    #383b42;
  --text-primary:   #eef0f3;
  --text-secondary: #a8b0be;
  --text-muted:     #5c6370;
  --text-faint:     #373c44;
  --accent:     #02b8cc;
  --accent-dim: rgba(2,184,204,.10);
  --accent-glow:rgba(2,184,204,.22);
  --accent2:    #4f6ef7;
  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --font: 'Inter','PingFang SC','Noto Sans SC',system-ui,sans-serif;
  --mono: 'JetBrains Mono','Fira Code',monospace;
  --nav-h: 56px;
}

/* ── 2. Reset ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-font-smoothing:antialiased}
body{background:var(--bg-base);color:var(--text-primary);font-family:var(--font);font-size:14px;line-height:1.6}
a{color:inherit;text-decoration:none}
button,input,textarea,select{font:inherit;cursor:pointer}
img{display:block;max-width:100%}
[hidden]{display:none!important}
::-webkit-scrollbar{width:4px;height:4px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border-hi);border-radius:4px}

/* ── 3. 顶部导航（首页 & 工具页共用） ── */
.site-nav,
.tool-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: rgba(8,9,10,.85);
  border-bottom: 1px solid var(--border-mid);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}

/* Logo */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.2px;
}
.app-subtitle { display: none; }

/* 导航链接 */
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-elevated); }

/* 工具页中央标题 */
.nav-center {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.app-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -.1px;
}
.beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  pointer-events: auto;
}

/* 右侧区域 */
.nav-actions,
.top-actions,
.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

/* 用量 pill */
.usage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.usage-bonus {
  background: var(--success);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}
.usage-count { color: var(--text-muted); font-size: 11px; }

/* 用户标签 */
.user-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

/* ── 4. 通用按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, border-color .12s, opacity .12s, transform .1s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover  { background: var(--bg-overlay); border-color: var(--border-hi); }
.btn:active { opacity: .75; transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

.btn-primary, #parseBtn {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}
.btn-primary:hover, #parseBtn:hover {
  background: #01cfe7;
  border-color: #01cfe7;
}

.btn-secondary {
  background: var(--bg-muted);
  border-color: var(--border-mid);
  color: var(--text-secondary);
}
.btn-secondary:hover { background: var(--bg-overlay); border-color: var(--border-hi); color: var(--text-primary); }

.btn-text   { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-text:hover { background: var(--bg-muted); color: var(--text-secondary); }

.btn-danger { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.28); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,.18); }

.btn-sm    { min-height: 28px; padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-large { min-height: 44px; padding: 10px 24px; font-size: 15px; font-weight: 700; border-radius: var(--radius-lg); }

/* 特殊按钮状态 */
.logout-trigger, .redeem-trigger {
  background: transparent; border-color: transparent;
  color: var(--text-muted); font-size: 12px;
}
.logout-trigger:hover, .redeem-trigger:hover {
  color: var(--text-secondary); background: var(--bg-muted);
}
.admin-trigger {
  background: var(--accent-dim);
  border-color: rgba(2,184,204,.22);
  color: var(--accent);
  font-size: 12px;
}
.admin-trigger:hover { background: var(--accent-glow); }

/* ── 5. 表单 input ── */
.input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: var(--bg-muted);
  color: var(--text-primary);
  outline: none;
  transition: border-color .14s, box-shadow .14s;
  font-size: 13px;
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
select.input { cursor: pointer; }
textarea.input { resize: vertical; line-height: 1.65; }

/* ── 6. 通用 eyebrow / kicker ── */
.eyebrow, .panel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── 7. 弹窗基础 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.modal-overlay[style*="flex"] { display: flex; }

.modal-box {
  position: relative;
  width: min(460px, 100%);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  padding: 28px;
  box-shadow:
    inset 0 1px 0 rgba(2,184,204,.3),
    0 8px 40px rgba(0,0,0,.6),
    0 0 0 1px var(--border);
  animation: modalIn .18s cubic-bezier(.16,1,.3,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-mid);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
  line-height: 1;
}
.modal-close:hover { background: var(--bg-overlay); color: var(--text-primary); }

.modal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.modal-brand h2 { font-size: 19px; font-weight: 700; color: var(--text-primary); }
.modal-brand p  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-muted);
}
.modal-tab {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.modal-tab.active { background: var(--bg-elevated); color: var(--text-primary); font-weight: 600; }
.modal-tab:hover:not(.active) { background: var(--bg-overlay); color: var(--text-secondary); }

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-form label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.modal-form .btn { margin-top: 4px; }

.modal-error, .admin-error {
  color: var(--danger);
  font-size: 12px;
  min-height: 18px;
  margin-top: 8px;
}

.terms-check {
  display: grid !important;
  grid-template-columns: 16px minmax(0,1fr);
  gap: 8px;
  align-items: flex-start;
  color: var(--text-muted);
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.6;
  cursor: pointer;
}
.terms-check input[type="checkbox"] {
  width: 14px; height: 14px; margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.terms-check-optional {
  padding: 10px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: var(--bg-muted);
  color: var(--accent);
}
.protocol-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.protocol-link:hover { color: #01cfe7; }

/* 邀请码兑换 inline */
.redeem-box { display: inline-flex; align-items: center; gap: 6px; }
.redeem-input { width: 130px; min-height: 28px; padding: 4px 8px; font-size: 12px; }

/* ── 8. 协议弹窗 ── */
.protocol-box {
  width: min(580px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.protocol-box .modal-tabs { flex-shrink: 0; }
.protocol-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.protocol-content h3 { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.protocol-content h4 { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin: 16px 0 5px; }
.protocol-content p  { margin: 0 0 8px; color: var(--text-muted); }
.protocol-content ul { margin: 0 0 8px; padding-left: 18px; color: var(--text-muted); }
.protocol-content li { margin-bottom: 4px; }

/* ── 9. 建议箱弹窗 ── */
#suggestionModal .modal-box,
#landingSuggestionModal .modal-box {
  box-shadow:
    inset 0 1px 0 rgba(79,110,247,.3),
    0 8px 40px rgba(0,0,0,.6);
}

/* ====================================================
   首页 LANDING.HTML
   ==================================================== */

/* ── L1. Body ── */
body.landing-page {
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── L2. Hero ── */
.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 80px 32px 100px;
  min-height: calc(100vh - var(--nav-h));
}

/* 背景网格纹理 */
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(2,184,204,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(2,184,204,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* 背景渐变光晕 */
.landing-hero::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 30%;
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(2,184,204,.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 5px 12px;
  border: 1px solid rgba(2,184,204,.3);
  border-radius: 999px;
  background: rgba(2,184,204,.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
}
.hero-badge span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: blink 2s infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: .3; }
}

.hero-copy h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.5px;
  color: var(--text-primary);
}

.hero-sub {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 480px;
}

.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.landing-primary-cta {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 15px;
  min-height: 46px;
  padding: 10px 28px;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 24px rgba(2,184,204,.3);
  transition: background .15s, box-shadow .15s, transform .1s;
}
.landing-primary-cta:hover {
  background: #01cfe7;
  border-color: #01cfe7;
  box-shadow: 0 0 32px rgba(2,184,204,.45);
}

/* ── L3. 产品预览卡 ── */
.hero-product {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(2,184,204,.18),
    0 24px 60px rgba(0,0,0,.55),
    0 0 0 1px var(--border);
}

.product-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-mid);
  background: var(--bg-muted);
}
.product-top span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border-hi);
  flex-shrink: 0;
}
.product-top strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 4px;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0;
}

.product-input {
  grid-row: 1 / 3;
  border-right: 1px solid var(--border-mid);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-input > p {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.product-input > button {
  width: 100%;
  min-height: 32px;
  margin-top: auto;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 700;
}

.input-demo-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  transition: border-color .15s;
}
.input-demo-line.is-picked {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-primary);
}
.demo-check {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.product-chat {
  padding: 14px;
  border-bottom: 1px solid var(--border-mid);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.demo-bubble {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  max-width: 85%;
  line-height: 1.4;
  color: var(--text-secondary);
}
.demo-bubble.left  { background: var(--bg-elevated); border: 1px solid var(--border-mid); align-self: flex-start; }
.demo-bubble.right { background: var(--bg-muted); border: 1px solid var(--border); align-self: flex-end; }
.demo-bubble.is-hot { background: var(--accent-dim); border-color: rgba(2,184,204,.3); color: var(--accent); }

.product-explain {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-explain > p {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.product-explain > strong {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
}
.product-explain > span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── L4. 工具矩阵 ── */
.tool-strip {
  max-width: 1180px;
  margin: 0 auto;
  padding: 80px 32px;
  border-top: 1px solid var(--border);
}

.section-heading {
  text-align: center;
  margin-bottom: 48px;
}
.section-heading h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.3px;
  margin-top: 8px;
}

.tool-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  transition: border-color .18s, transform .18s, box-shadow .18s;
  cursor: default;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
  opacity: 0;
  transition: opacity .2s;
}
.tool-card.active {
  border-color: rgba(2,184,204,.35);
  background: linear-gradient(135deg, rgba(2,184,204,.06), var(--bg-surface));
  cursor: pointer;
}
.tool-card.active::before { opacity: 1; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.tool-card.active:hover {
  border-color: rgba(2,184,204,.55);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(2,184,204,.2);
}
.tool-card > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-hi);
  background: var(--bg-muted);
  color: var(--text-muted);
}
.tool-card.active > span {
  background: rgba(2,184,204,.12);
  border-color: rgba(2,184,204,.3);
  color: var(--accent);
}
.tool-card h3 { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.tool-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.65; }

/* ── L5. 步骤说明 ── */
.steps-band {
  max-width: 1180px;
  margin: 0 auto;
  padding: 80px 32px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.step-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-item strong {
  font-size: 36px;
  font-weight: 800;
  color: var(--border-hi);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1;
}
.step-item h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.step-item p  { font-size: 13px; color: var(--text-muted); line-height: 1.7; }

/* ── L6. 底部 CTA ── */
.landing-cta {
  border-top: 1px solid var(--border);
  padding: 80px 32px;
  text-align: center;
}
.landing-cta h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: -.3px;
}

/* ── L7. Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer strong { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.site-footer span   { font-size: 12px; color: var(--text-muted); }

/* ====================================================
   工具页 INDEX.HTML (APP)
   ==================================================== */

body.app-shell {
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── A1. 主工作区布局 ── */
#mainApp.workspace-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.import-panel {
  border-right: 1px solid var(--border-mid);
  overflow-y: auto;
}

.explain-panel {
  overflow-y: auto;
}

/* ── A2. 左栏内容区 ── */
.import-form-area {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 0;
  flex-shrink: 0;
}
.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.panel-copy { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── A3. 聊天输入区 ── */
.chat-input {
  min-height: 130px;
  max-height: 260px;
  font-size: 13px;
  resize: vertical;
  line-height: 1.7;
  font-family: var(--font);
  border-color: var(--border-mid);
}

/* ── A4. 上传区 ── */
.upload-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
  transition: border-color .14s, background .14s;
  cursor: pointer;
}
.upload-area:hover { border-color: var(--border-hi); background: var(--bg-overlay); }
.upload-area.drag-over { border-color: var(--accent); background: var(--accent-dim); }

.screenshot-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
}

.upload-copy { display: flex; flex-direction: column; gap: 3px; }
.upload-copy strong { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.upload-copy span   { font-size: 11px; color: var(--text-muted); }

/* ── A5. OCR 识别面板 ── */
.recognize-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(2,184,204,.25);
  border-radius: var(--radius-lg);
  background: var(--accent-dim);
}
.recognize-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.recognize-head strong { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.recognize-head span   { color: var(--accent); font-size: 11px; font-weight: 600; }
.recognize-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 按钮行 */
.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ── A6. 气泡列表 ── */
.chat-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  padding: 0;
  min-height: 0;
}

.chat-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

.batch-select-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 2px;
}

.batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-mid);
  flex-shrink: 0;
  animation: slideDown .16s ease;
}
.batch-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-right: auto;
}
@keyframes slideDown {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── A7. 单条气泡 ── */
.bubble {
  display: grid;
  grid-template-columns: 22px 32px minmax(0,1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  text-align: left;
  transition: background .1s, border-color .1s;
  cursor: pointer;
  position: relative;
}
.bubble:hover { background: var(--bg-elevated); border-color: var(--border-mid); }
.bubble.is-selected {
  background: var(--bg-surface);
  border-color: var(--accent);
  border-left-width: 2px;
}
.bubble.is-check-selected {
  background: var(--accent-dim);
  border-color: rgba(2,184,204,.28);
}
.bubble.is-explained .bubble-body {
  background: rgba(2,184,204,.05);
}

.bubble-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: var(--text-muted);
  border-radius: 5px;
  margin-top: 9px;
  transition: color .1s, background .1s;
}
.bubble-check:hover { color: var(--accent); background: var(--accent-dim); }

.bubble-avatar {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--avatar, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.bubble-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  transition: border-color .1s;
}
.bubble:hover .bubble-body       { border-color: var(--border-mid); }
.bubble.is-selected .bubble-body { border-color: rgba(2,184,204,.4); }

.bubble-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bubble-sender  { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.bubble-time    { font-size: 10px; color: var(--text-muted); }
.bubble-status  { font-size: 10px; color: var(--accent); }

.bubble-content {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* ── A8. 空状态 / 占位 ── */
.empty-state, .explain-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 280px;
  padding: 40px 24px;
  text-align: center;
}
.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}
.empty-state h2, .explain-placeholder h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.empty-state p, .explain-placeholder p {
  max-width: 280px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}
.explain-placeholder > span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── A9. 解释面板内容 ── */
.explain-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  min-height: 100%;
}

.explain-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.explain-sender { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.explain-time   { font-size: 11px; color: var(--text-muted); }

.explain-quote {
  padding: 12px 14px;
  border: 1px solid var(--border-mid);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.explain-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.explain-text {
  flex: 1;
  padding: 14px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.explain-ready .explain-text {
  background: rgba(2,184,204,.06);
  border-color: rgba(2,184,204,.18);
}
.has-error .explain-text {
  background: rgba(239,68,68,.06);
  border-color: rgba(239,68,68,.18);
}

.explain-actions, .explain-followup {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.explain-followup .input { flex: 1; }

/* 加载/错误 */
.loading-spinner {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.loading-spinner::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(2,184,204,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.explain-error { color: var(--danger); font-size: 12px; }

/* ── A10. 批量解释结果 ── */
.batch-item {
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.batch-item-index {
  background: var(--accent);
  color: #000;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}
.batch-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.batch-summary strong { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* ── A11. 底部信息条 ── */
.app-bottom-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
  font-size: 12px;
}
.app-bottom-band strong { color: var(--text-muted); font-weight: 500; }
.app-bottom-band span   { color: var(--text-muted); opacity: .6; }

.tool-hero { display: none !important; }

/* ── A14b. Mobile hamburger + drawer ── */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn:hover { background: var(--bg-overlay); }
.mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: transform .2s, opacity .2s;
}
body.drawer-open .mobile-menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.drawer-open .mobile-menu-btn span:nth-child(2) { opacity: 0; }
body.drawer-open .mobile-menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
body.drawer-open .mobile-drawer-backdrop { display: block; }

/* ── A12. 历史记录侧栏 ── */
.history-panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-mid);
  z-index: 150;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -8px 0 32px rgba(0,0,0,.4);
  animation: slideInRight .2s cubic-bezier(.16,1,.3,1);
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.history-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 0;
  flex-shrink: 0;
}
.history-panel-head h2 { font-size: 18px; font-weight: 700; color: var(--text-primary); }

.history-hint {
  margin: 8px 20px 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.55;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.history-list { flex: 1; overflow-y: auto; padding: 14px 20px; }
.history-detail { flex: 1; overflow-y: auto; padding: 14px 20px 32px; }

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 6px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.history-row:hover { border-color: var(--accent); background: var(--bg-muted); }
.history-row-main { min-width: 0; flex: 1; }
.history-row-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-row-meta { display: block; margin-top: 2px; font-size: 11px; color: var(--text-muted); }

.history-detail-card {
  padding: 16px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.history-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ── A13. 管理台 ── */
.admin-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  overflow-y: auto;
  flex: 1;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 22px 24px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: inset 0 1px 0 rgba(2,184,204,.15);
}
.admin-header h2 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-top: 4px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 20px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.stat-card-accent {
  background: var(--accent-dim);
  border-color: rgba(2,184,204,.25);
  box-shadow: inset 0 1px 0 rgba(2,184,204,.15);
}
.stat-num   { font-size: 38px; line-height: 1; font-weight: 800; color: var(--text-primary); letter-spacing: -1px; }
.stat-label { margin-top: 6px; font-size: 12px; color: var(--text-muted); }

.invite-section {
  padding: 20px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  margin-bottom: 16px;
}
.invite-section h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }

.section-heading { margin-bottom: 16px; }
.invite-gen-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.invite-form-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.invite-form-row:first-child { grid-template-columns: 2fr 1fr; }
.invite-field { display: flex; flex-direction: column; gap: 4px; }
.invite-field span { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.invite-field-sm { min-width: 0; }
.invite-submit { align-self: end; }

.invite-code-list { display: flex; flex-direction: column; gap: 6px; }
.invite-row {
  display: grid;
  grid-template-columns: minmax(220px,.9fr) 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: var(--bg-muted);
  transition: border-color .12s;
}
.invite-row:hover { border-color: var(--border-hi); }
.invite-row.is-disabled { opacity: .45; }
.invite-code-cell, .invite-meta, .invite-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.invite-code-text {
  padding: 3px 10px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: .05em;
}
.invite-meta span { color: var(--text-muted); font-size: 11px; }
.invite-meta .invite-tier { color: var(--text-secondary); font-weight: 600; }

.empty-row { padding: 20px; color: var(--text-muted); text-align: center; font-size: 13px; }

/* 用户表格 */
.user-section {
  padding: 20px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  margin-bottom: 16px;
}
.user-section h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }

.user-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
}
.user-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  font-size: 12px;
}
.user-table th {
  position: sticky; top: 0; z-index: 1;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-mid);
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 10px; font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.user-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text-secondary);
}
.user-row.is-disabled { opacity: .4; }
.user-row-clickable { cursor: pointer; }
.user-row-clickable:hover td { background: var(--bg-muted); }
.cell-sm { color: var(--text-muted); font-size: 11px; }
.cell-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.role-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  vertical-align: middle;
}
.role-tag-owner    { background: rgba(2,184,204,.10); color: var(--accent); }
.role-tag-operator { background: rgba(79,110,247,.10); color: var(--accent2); }

.muted-inline { color: var(--text-muted); font-size: .85em; }
.mobile-user-manage { display: none; }

/* 建议管理 */
.suggestion-section {
  padding: 20px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  margin-bottom: 16px;
}
.suggestion-section h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.suggestion-filter-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }

.suggestion-list-body { display: flex; flex-direction: column; gap: 8px; }
.suggestion-row {
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--bg-muted);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  transition: border-color .12s;
}
.suggestion-row:hover { border-color: var(--border-hi); }
.suggestion-row.suggestion-accepted { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.05); }
.suggestion-row.suggestion-rejected { opacity: .5; }
.suggestion-main { flex: 1; min-width: 0; }
.suggestion-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.suggestion-user    { font-weight: 600; font-size: 12px; color: var(--text-secondary); }
.suggestion-status  { font-size: 10px; font-weight: 700; }
.suggestion-date    { font-size: 10px; color: var(--text-muted); }
.suggestion-reward  { font-size: 10px; font-weight: 700; color: var(--success); background: rgba(34,197,94,.1); padding: 1px 7px; border-radius: 4px; }
.suggestion-content { font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: var(--text-primary); }
.suggestion-note    { margin: 5px 0 0; font-size: 11px; color: var(--text-muted); }
.suggestion-actions { display: flex; gap: 5px; flex-shrink: 0; align-self: flex-start; margin-top: 2px; }

/* 用户编辑弹窗 */
#editUserModal .modal-box { width: min(440px, 100%); }

/* ── A14. 手机端 Tab 切换 ── */
.mobile-tab-bar { display: none; }

/* ── A15. 响应式 ── */
@media (max-width: 1060px) {
  #mainApp.workspace-grid { grid-template-columns: 340px 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-h: 50px; }
  html,
  body,
  body.app-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  body.app-shell { overflow-y: auto; }

  /* 手机 Tab bar */
  .mobile-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border-mid);
    background: var(--bg-surface);
    flex-shrink: 0;
  }
  .mobile-tab-btn {
    flex: 1;
    min-height: 40px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color .12s, border-color .12s;
  }
  .mobile-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

  #mainApp.workspace-grid {
    display: flex;
    flex-direction: column;
    overflow: visible;
    height: auto;
    width: 100%;
    max-width: 100%;
  }
  .panel,
  .import-panel,
  .chat-panel,
  .explain-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .import-panel { border-right: none; border-bottom: 1px solid var(--border-mid); }
  .import-panel[data-tab-hidden="true"],
  .explain-panel[data-tab-hidden="true"] { display: none; }
  .chat-panel  { min-height: 240px; }
  .explain-panel { min-height: 300px; }

  /* 弹窗 → 底部抽屉 */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    border-bottom: none;
    box-shadow:
      inset 0 1px 0 rgba(2,184,204,.25),
      0 -4px 24px rgba(0,0,0,.5);
    animation: sheetUp .22s cubic-bezier(.16,1,.3,1);
  }
  @keyframes sheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* 首页响应式 */
  .landing-hero {
    grid-template-columns: 1fr;
    padding: 48px 20px 60px;
    min-height: auto;
  }
  .hero-product { display: none; }
  .hero-copy h1 { font-size: 26px; }
  .tool-cards, .steps-band { grid-template-columns: 1fr; }
  .tool-strip, .steps-band, .landing-cta { padding: 48px 20px; }

  /* 管理台 */
  .history-panel { top: 0; width: 100vw; border-left: none; }
  .admin-panel { padding: 0 14px 40px; }
  .stats-grid { grid-template-columns: 1fr; }
  .invite-form-row, .invite-form-row:first-child, .invite-row { grid-template-columns: 1fr; }
  .admin-header { flex-direction: column; align-items: flex-start; }

  .user-table-wrap { max-height: none; overflow: visible; border: none; border-radius: 0; }
  .user-table, .user-table tbody, .user-table tr, .user-table td { display: block; width: 100%; }
  .user-table { border-collapse: separate; background: transparent; }
  .user-table thead { display: none; }
  .user-row { margin-bottom: 8px; padding: 10px; border: 1px solid var(--border-mid); border-radius: var(--radius); background: var(--bg-elevated); }
  .user-table td { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); white-space: normal; word-break: break-word; }
  .user-table td::before { content: attr(data-label); flex: 0 0 72px; color: var(--text-muted); font-size: 10px; font-weight: 700; }
  .user-table td.user-name-cell::before, .user-table td.cell-actions::before { display: none; }
  .mobile-user-manage { display: inline-flex; margin-left: auto; }
  .cell-actions { display: grid !important; grid-template-columns: 1fr; gap: 6px; padding-top: 8px !important; border-bottom: 0 !important; }
  .cell-actions .btn { width: 100%; }

  .suggestion-row { flex-direction: column; }
  .suggestion-actions { width: 100%; justify-content: flex-end; }

  .btn-row { grid-template-columns: 1fr; }
  .explain-actions, .explain-followup,
  .upload-area, .screenshot-area, .recognize-actions { flex-direction: column; }
  .upload-area .btn,
  .screenshot-area .btn,
  .recognize-actions .btn {
    width: 100%;
  }
  .explain-followup .input { width: 100%; }
  .app-bottom-band { flex-direction: column; padding: 10px 14px; font-size: 11px; }
}

@media (max-width: 480px) {
  .hero-copy h1 { font-size: 22px; }
  .modal-box { padding: 20px; }
  .brand-name { font-size: 12px; }
  .app-title { font-size: 11px; }
  .mobile-menu-btn { width: 32px; height: 32px; }
}

/* ── A16. 顶部栏 + 抽屉 ≤1100px ── */
@media (max-width: 1100px) {
  .tool-topbar {
    padding: 0 12px;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
  }
  .brand-lockup { min-width: 0; }
  .brand-name { font-size: 13px; }

  /* 隐藏中央标题，只留 logo + 汉堡 */
  .nav-center { display: none; }

  /* 显示汉堡按钮 */
  .mobile-menu-btn { display: flex; }

  /* 右侧操作区 → 滑出抽屉 */
  .top-actions {
    position: fixed;
    top: 0;
    right: 0;
    width: min(280px, 80vw);
    height: 100vh;
    height: 100dvh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-mid);
    box-shadow: -8px 0 32px rgba(0,0,0,.5);
    padding: 56px 16px 24px;
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 200;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.drawer-open .top-actions {
    transform: translateX(0);
  }

  /* auth.js 动态渲染的内容也在抽屉里 */
  .auth-actions {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
  }

  /* 抽屉内元素全宽 */
  .usage-pill,
  .user-tag,
  .top-actions .btn,
  .auth-actions .btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .usage-pill { font-size: 12px; padding: 6px 12px; }
  .btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
}
