/* Design tokens are now defined once in /static/tokens.css.
   This file holds only app-view component styles. */
.theme-light body { background: var(--bg); }
.theme-light .message.assistant code, .theme-light .message.assistant pre { background: var(--code-bg); color: var(--code-fg); }
.theme-light .insight-block code { background: var(--code-bg); color: var(--code-fg); }

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 全局滚动条：deepseek 风格（细 / 半透明 / 圆角） */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  border: none;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }
*::-webkit-scrollbar-corner { background: transparent; }
/* Light 模式：滚动条换成深色半透明 */
html[data-theme="light"] *,
.theme-light * {
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}
html[data-theme="light"] *::-webkit-scrollbar-thumb,
.theme-light *::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] *::-webkit-scrollbar-thumb:hover,
.theme-light *::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ============ 登录 / 注册 ============ */
.auth-view {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, var(--panel-2), var(--bg));
}
.auth-card {
  width: 360px;
  max-width: 92vw;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
}
.auth-logo { font-size: 2rem; font-weight: 800; margin-bottom: 28px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.auth-logo .logo-mark { font-size: 1.4rem; line-height: 1; }
.auth-logo .auth-tagline { font-size: 0.95rem; font-weight: 400; color: var(--muted); margin-left: 4px; width: 100%; margin-top: 4px; letter-spacing: 0.3px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; background: transparent; color: var(--muted); border: none;
  padding: 8px; cursor: pointer; font-size: 0.9rem; border-bottom: 2px solid transparent;
}
.auth-tab.active { color: var(--text); border-bottom-color: var(--gold); }
.auth-input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 0.95rem;
}
.auth-input:focus { outline: none; border-color: var(--gold); }
.auth-submit {
  width: 100%; background: var(--gold); color: #1a1300; border: none; border-radius: 10px;
  padding: 12px; font-weight: 700; cursor: pointer; font-size: 0.95rem; margin-top: 4px;
}
.auth-submit:hover { filter: brightness(1.05); }
.auth-form { display: contents; }
.auth-hint { color: var(--muted); font-size: 0.78rem; text-align: center; margin-top: 14px; }
.auth-error {
  background: var(--danger-bg); color: var(--danger-fg); border: 1px solid var(--danger-border);
  border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; margin-bottom: 14px;
  display: block; min-height: 42px; visibility: hidden;
}
.auth-error.visible { visibility: visible; }

/* ============ 聊天布局 ============ */
.app-view { display: flex; height: 100vh; position: relative; background: radial-gradient(circle at 88% 4%, rgba(127,119,221,0.22), transparent 46%), radial-gradient(circle at 6% 96%, rgba(239,159,39,0.14), transparent 46%), var(--bg); }

/* ---- 左侧固定侧边栏 ---- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  transition: width 250ms ease, flex-basis 250ms ease;
}
.sidebar.collapsed { width: 56px; flex-basis: 56px; }
.sidebar.collapsed .sidebar-top,
.sidebar.collapsed .sidebar-bottom { display: none; }

/* 折叠/展开按钮：默认态在右上角，图标 │◀（收起）；收起后 ▶│（展开） */
.sidebar-collapse-btn {
  position: absolute; right: 10px; top: 14px; z-index: 10;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  width: 34px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.85rem; line-height: 1; letter-spacing: -1px;
  transition: border-color .12s ease, color .12s ease, background .12s ease, opacity .12s ease;
}
.sidebar-collapse-btn:hover { border-color: var(--purple); color: var(--purple); background: var(--panel-2); opacity: 0.9; }
.sidebar.collapsed .sidebar-collapse-btn {
  right: 11px; top: 14px;
  color: var(--text);
}

/* 搜索历史：与侧边栏主题一致（用 var(--panel/--border/--text/--muted/--purple) 自动适配 light/dark） */
.history-search {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-family: inherit; font-size: 0.82rem;
  margin: 0 0 8px;
  outline: none;
  transition: border-color .12s ease, background .12s ease;
  -webkit-appearance: none; appearance: none;
}
.history-search::placeholder { color: var(--muted); }
.history-search:focus { border-color: var(--purple); background: var(--panel-2); }
.history-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.sidebar.collapsed .history-search { display: none; }
.sidebar-top { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding: 14px 12px 0; }
.sidebar-logo {
  font-weight: 800; font-size: 1.35rem; padding: 6px 8px 16px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.logo-mark { color: var(--gold); font-size: 1.15em; line-height: 1; }
.newchat-btn {
  width: 100%; text-align: left; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
  cursor: pointer; font-size: 0.9rem; font-weight: 600; margin-bottom: 14px;
}
.newchat-btn:hover { border-color: var(--purple); color: var(--purple); }

.history-list { flex: 1 1 auto; overflow-y: auto; padding-bottom: 12px; }
.history-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 34px 18px; color: var(--muted); gap: 10px;
}
.history-empty .he-ico { font-size: 2rem; opacity: 0.75; }
.history-empty .he-title { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.history-empty .he-hint { font-size: 0.78rem; line-height: 1.5; }
.history-filter {
  width: 100%; margin: 0 0 8px; padding: 7px 10px; border-radius: 8px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  font-size: 0.82rem; cursor: pointer; outline: none;
}
.history-filter:focus { border-color: var(--gold); }
.history-group-title {
  font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 12px 10px 6px; font-weight: 600;
}
.history-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
  cursor: pointer; margin-bottom: 2px; border: 1px solid transparent;
}
.history-item:hover { background: var(--panel-2); border-color: var(--border); }
.history-info { flex: 1; min-width: 0; }
.history-item .hi-title {
  font-size: 0.85rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-item .hi-meta { font-size: 0.7rem; color: var(--muted); margin-top: 1px; }
.history-del {
  background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 0.85rem;
  padding: 4px 6px; border-radius: 6px; flex: 0 0 auto; opacity: 0; transition: opacity .15s;
}
.history-item:hover .history-del { opacity: 1; }
.history-del:hover { color: #ff6b6b; background: var(--panel); }

/* 🔴 2026-09-10 H1（老板拍板）：评分记录侧边栏——分数徽标（对齐评分徽标语义：≥8 ok / ≥6 mid / low） */
.history-score-badge {
  flex: 0 0 auto; min-width: 32px; text-align: center;
  font-size: 0.78rem; font-weight: 800; border-radius: 8px; padding: 3px 6px;
  background: rgba(255,122,122,0.12); color: var(--red);
}
.history-score-badge.ok { background: rgba(95,220,138,0.14); color: var(--green); }
.history-score-badge.mid { background: rgba(255,215,0,0.12); color: var(--gold); }
.score-history-sidebar { margin-top: 2px; padding-bottom: 8px; }

/* 🔴 2026-09-05 历史治理：清空全部按钮——侧边栏主题统一（弱化紫色 hover 红色），
   与 history-del 视觉同族但常驻可见（不 hover 才出现） */
.history-clear-all {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 2px 0 8px; padding: 7px 10px; border-radius: 8px;
  font-size: 0.76rem; font-weight: 600; color: var(--muted);
  background: transparent; border: 1px dashed var(--border);
  cursor: pointer; transition: all .15s ease; user-select: none;
}
.history-clear-all:hover {
  color: #ff6b6b; border-color: rgba(255,107,107,.45); background: rgba(255,107,107,.07);
}

/* ---- 侧栏底部用户区 ---- */
.sidebar-bottom {
  flex: 0 0 auto; border-top: 1px solid var(--border); padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 8px; position: relative;
  align-self: stretch; width: 100%;
}
/* 常驻购买入口 */
.get-credits-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--purple); color: #fff; border: none; border-radius: 9px;
  padding: 11px 12px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: filter .15s, transform .12s;
}
.get-credits-btn:hover { filter: brightness(1.08); }
.get-credits-btn:active { transform: scale(.98); }
.get-credits-btn.low { animation: gcPulse 1.9s ease-in-out infinite; }
@keyframes gcPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(127,119,221,.45); }
  50% { box-shadow: 0 0 0 6px rgba(127,119,221,0); }
}
/* 头像整块可点击 */
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.user-chip:hover { border-color: var(--purple); background: var(--panel-2); }
.chip-chevron { margin-left: auto; color: var(--muted); flex: 0 0 auto; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #1a1300;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; flex: 0 0 auto;
}
.user-meta { min-width: 0; }
.user-email { font-size: 0.82rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-credits { font-size: 0.72rem; color: var(--gold); }
.user-credits.low { color: #ff9f43; font-weight: 500; }
.side-btn {
  width: 100%; text-align: left; background: transparent; color: var(--muted);
  border: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
}
.side-btn:hover { background: var(--panel-2); color: var(--text); }

/* ---- 右侧主区 ---- */
.main-area { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; height: 100vh; }

.topbar {
  height: 52px; flex: 0 0 52px; display: flex; align-items: center;
  padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.chat-title { font-weight: 600; font-size: 0.95rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn {
  display: none; background: transparent; border: none; color: var(--muted);
  font-size: 1.3rem; cursor: pointer; margin-right: 10px; line-height: 1;
}
.menu-btn:hover { color: var(--text); }

.topbar-links { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topbar-links a { color: var(--muted); font-size: 0.85rem; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border); transition: color .12s ease, background .12s ease, border-color .12s ease; }
.topbar-links a:hover { color: var(--text); background: var(--panel-2); border-color: var(--purple); }
.topbar-links a.active { color: #fff; background: var(--purple); border-color: var(--purple); }
.topbar-links a.tl-cta { color: var(--gold); border-color: rgba(245,166,35,0.5); }
.topbar-links a.tl-cta:hover { background: var(--gold); color: #1a1530; border-color: var(--gold); }
/* nav 内的主题切换按钮：跟 nav-link 风格统一（方角边框、紫色 hover），不用 pill 圆角 */
.topbar-links .nav-theme-toggle {
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--muted);
  font-family: inherit;
}
.topbar-links .nav-theme-toggle:hover {
  color: #fff;
  background: var(--panel-2);
  border-color: var(--purple);
}

.hero-trends-cta {
  display: flex; align-items: center; gap: 12px; max-width: 500px; margin: 2px auto 0;
  padding: 12px 16px; background: var(--cta-bg); border: 1px solid var(--cta-border); border-radius: 12px;
  color: var(--text); text-decoration: none;
}
.hero-trends-cta:hover { background: var(--cta-hover); }
.hero-trends-cta .ht-emoji { font-size: 1.2rem; }
.hero-trends-cta .ht-text { flex: 1; font-size: 0.9rem; color: var(--cta-fg); }
.hero-trends-cta .ht-text b { color: var(--cta-accent); }
.hero-trends-cta .ht-arrow { color: var(--cta-accent); font-weight: 700; }

/* ---- 消息区（扁平，仿 DeepSeek 直接铺在背景上） ---- */
.message-container {
  flex: 1 1 auto; overflow-y: auto; padding: 28px 0 16px;
  display: flex; flex-direction: column; gap: 22px; scroll-behavior: smooth;
}
.message-container > * { width: 100%; }
.empty-state {
  margin: auto; text-align: center; color: var(--muted); max-width: 520px; padding: 40px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state .empty-ico { display: block; margin-bottom: 4px; }
.empty-state .empty-title { font-size: 1.05rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.empty-state .empty-sub { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.empty-state .empty-hint { font-size: 0.78rem; color: var(--muted); line-height: 1.4; opacity: .9; }
.empty-state .empty-hint:not(:empty) { color: var(--purple); opacity: 1; }
.empty-state .empty-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.empty-state .empty-chip {
  position: relative; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 7px 14px; font-size: 0.8rem; cursor: pointer;
  transition: border-color .15s ease, transform .1s ease, background .15s ease;
}
.empty-state .empty-chip:hover { border-color: var(--purple); color: var(--purple); }
.empty-state .empty-chip:active { transform: scale(.97); }
.empty-state .chip-text { pointer-events: none; }
/* 真实热点角标（工作台×trends 打通，2026-08-21） */
.empty-state .live-tag {
  position: absolute; top: -7px; right: -4px; background: rgba(95,220,138,.16);
  color: var(--up, #5fdc8a); border: 1px solid rgba(95,220,138,.45);
  font-size: 0.58rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; letter-spacing: .04em;
}
.empty-state .empty-more { margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.empty-state .empty-more a { color: var(--purple); text-decoration: none; font-weight: 700; }
.empty-state .empty-more a:hover { text-decoration: underline; }
.empty-state .empty-platforms { font-size: 0.72rem; color: var(--muted); opacity: .8; margin-top: 8px; line-height: 1.5; }

.msg-row { display: flex; flex-direction: column; padding: 0 24px; }
.msg-row.user-row { align-items: flex-start; }
.msg-row.assistant-row { align-items: flex-start; }

/* 🔴 2026-09-13：长文正文预览折叠按钮（DeepSeek 式；评分卡不滚动即见） */
.article-expand-btn{display:block;width:100%;margin:14px auto 0;padding:9px 14px;font-size:.82rem;font-weight:700;
  color:var(--purple-bright,#a99df0);background:rgba(127,119,221,.10);border:1px solid rgba(127,119,221,.4);
  border-radius:9px;cursor:pointer;font-family:inherit;transition:background .12s,border-color .12s}
.article-expand-btn:hover{background:rgba(127,119,221,.2);border-color:rgba(127,119,221,.65)}
html[data-theme="light"] .article-expand-btn, .theme-light .article-expand-btn{color:var(--purple);background:rgba(127,119,221,.08);border-color:rgba(127,119,221,.35)}

/* 居中内容容器，限制最大阅读宽度 */
.msg-body { max-width: 760px; width: 100%; margin: 0 auto; }
.msg-row.user-row .msg-body { display: flex; justify-content: flex-end; }

.message {
  width: 100%; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
}
/* 用户消息：右对齐，宽度随内容自适应 */
.message.user {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px; font-weight: 500;
  width: fit-content; max-width: 80%;
}
/* 助手消息：直接铺在背景上，无卡片边框 */
.message.assistant {
  background: transparent; border: none; padding: 0;
}
.message.assistant.streaming::after { content: "▋"; color: var(--gold); animation: blink 1s steps(2) infinite; margin-left: 2px; }
.message.assistant.streaming .gen-status::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-left: 6px; animation: typingDot 1.2s infinite; }
@keyframes typingDot { 0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
@keyframes blink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }
/* 生成中状态文案（首 token 到达前显示，跟随闪烁光标） */
.gen-status { color: var(--muted); font-size: 0.95rem; font-style: italic; margin-top: 6px; }
/* 🔴 2026-09-10 P1：重建行内的"生成中 + Stop"条（生成中切历史回来仍可停止） */
.gen-stop-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.gen-stop-note { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.gen-stop-btn {
  background: none; border: 1px solid var(--muted, #bbb); color: var(--muted, #bbb);
  border-radius: 6px; padding: 4px 14px; cursor: pointer; font-size: 0.82rem;
}
.gen-stop-btn:hover { color: var(--red); border-color: var(--red); }
.gen-stop-btn:disabled { opacity: 0.5; cursor: default; }
/* 生成步骤指示器（Research → Outline → Draft → Polish） */
.gen-steps { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 2px 0 4px; }
.gen-step { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); transition: color .2s ease; }
.gen-step .gs-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--border-light); background: transparent; transition: all .2s ease; }
.gen-step.active { color: var(--purple-bright); }
.gen-step.active .gs-dot { border-color: var(--purple); background: var(--purple); box-shadow: 0 0 0 3px var(--purple-subtle); }
.gen-step.done { color: var(--text); }
.gen-step.done .gs-dot { border-color: var(--green, #4ade80); background: var(--green, #4ade80); }
.msg-meta { font-size: 0.7rem; color: var(--muted); margin-top: 4px; }

/* markdown 基本排版 */
.message.assistant h1, .message.assistant h2, .message.assistant h3 { margin: 0.7em 0 0.35em; line-height: 1.3; }
.message.assistant p { margin: 0.6em 0; }
.message.assistant ul, .message.assistant ol { margin: 0.5em 0 0.5em 1.3em; }
.message.assistant code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.message.assistant pre { background: var(--panel-2); padding: 12px; border-radius: 8px; overflow-x: auto; border: 1px solid var(--border); }
.message.assistant a { color: var(--gold); }

/* 跳到底部按钮：嵌入 composer-inner 内，浮在输入框正上方右侧（仿 DeepSeek 风格）
   .composer-inner 已有 position: relative，所以 absolute 相对它。 */
.scroll-btn {
  position: absolute;
  right: 12px;
  top: -14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border); color: var(--text);
  font-size: 0.95rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  z-index: 20;
  transition: transform .12s ease, border-color .12s ease, color .12s ease;
}
.scroll-btn:hover { border-color: var(--purple); color: var(--purple); transform: translateY(-1px); }

/* ---- 输入区：单条圆角输入条 ---- */
.composer {
  flex: 0 0 auto; padding: 14px 20px 18px; background: var(--bg);
}
.composer-inner {
  max-width: 760px; margin: 0 auto; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 18px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
}
.input-box {
  width: 100%; resize: none; background: transparent; color: var(--text);
  border: none; font-family: inherit; font-size: 0.98rem; line-height: 1.5;
  height: 58px; min-height: 58px; max-height: 200px;
  overflow-y: auto;
}
.input-box:focus { outline: none; }
.composer-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-select {
  background: var(--panel); color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.pill-select:focus { outline: none; border-color: var(--gold); }
.send-btn {
  margin-left: auto; background: var(--gold); color: #1a1300; border: none; border-radius: 50%;
  width: 38px; height: 38px; font-size: 1.1rem; font-weight: 700; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.send-btn:hover:not(:disabled) { filter: brightness(1.05); }
.send-btn.out { background: var(--purple); color: #fff; }
.send-btn.out:hover:not(:disabled) { filter: brightness(1.08); }
.credit-pill {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  font-size: 0.74rem; color: var(--muted); padding: 4px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); white-space: nowrap;
}
.credit-pill.low { color: #f5a623; border-color: rgba(245,166,35,.5); cursor: pointer; }
.credit-pill.out { color: #fff; background: var(--purple); border-color: var(--purple); cursor: pointer; font-weight: 600; }
.credit-pill:hover { filter: brightness(1.05); }
.mf-credit { color: var(--purple); font-weight: 600; }

/* ============ 消息操作栏 / 脚注 / 洞察 ============ */
.msg-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mini-btn {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  border-radius: 7px; padding: 4px 10px; cursor: pointer; font-size: 0.72rem;
}
.mini-btn:hover { color: var(--purple); border-color: var(--purple); }
.msg-footer {
  font-size: 0.7rem; color: var(--muted); margin-top: 8px; padding: 0 2px;
  border-top: 1px dashed var(--border); padding-top: 6px;
}
.mf-honesty {
  margin-top: 5px; font-size: 0.66rem; color: var(--muted);
  opacity: 0.75; letter-spacing: 0.01em;
}
.insight-block {
  margin-top: 12px; border-radius: 12px;
  background: var(--gold-subtle); border: 1px solid var(--gold-border);
  font-size: 0.9rem; overflow: hidden;
}
.insight-block.collapsed { padding: 0; }
.insight-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; cursor: pointer; user-select: none;
  color: var(--gold); font-weight: 700;
}
.insight-header:hover { background: var(--gold-soft); }
.insight-toggle-icon { font-size: 0.8rem; width: 12px; text-align: center; }
.insight-title-text { flex: 1; }
.insight-content { padding: 0 16px 14px; }
.insight-foot {
  padding: 8px 14px 11px; font-size: 0.72rem; color: var(--muted);
  border-top: 1px solid var(--gold-border); line-height: 1.4;
}

/* 内容质量评分（由真实输出推导，非伪造） */
.content-score {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--purple-subtle); border: 1px solid rgba(127,119,221,0.3);
  font-size: 0.85rem;
}
.cs-head { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); }
.cs-head .cs-ico { filter: grayscale(0.2); }
.cs-head .cs-num { color: var(--gold, #FFD700); margin-left: 2px; }
.content-score.all-done .cs-head .cs-num { color: var(--green, #4ade80); }
.cs-list { margin: 8px 0 4px; display: grid; gap: 4px; }
.cs-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.8rem; }
.cs-check.ok { color: var(--text); }
.cs-tick { color: var(--muted); font-weight: 700; width: 14px; text-align: center; }
.cs-check.ok .cs-tick { color: var(--green, #4ade80); }
.cs-suggest {
  margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600;
}
.cs-tip { color: var(--muted); }
.cs-note { margin-top: 6px; font-size: 0.7rem; color: var(--muted); line-height: 1.4; }
.insight-block h1, .insight-block h2, .insight-block h3 { margin: 0.5em 0 0.3em; color: var(--gold); line-height: 1.3; }
.insight-block p { margin: 0.45em 0; }
.insight-block ul, .insight-block ol { margin: 0.4em 0 0.4em 1.2em; }
.insight-block code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

/* 深度思考生成中：等待占位 + 旋转指示器 */
.insight-block.generating .insight-header { cursor: default; color: var(--gold); }
.insight-block.generating .insight-header:hover { background: transparent; }
.insight-spinner {
  width: 13px; height: 13px; flex: 0 0 auto;
  border: 2px solid rgba(245,166,35,0.3); border-top-color: var(--gold);
  border-radius: 50%; animation: insightSpin 0.7s linear infinite;
}
@keyframes insightSpin { to { transform: rotate(360deg); } }

/* ============ AI 内容质量审查（8 维度评分卡，蓝色系） ============ */
.review-block {
  margin-top: 12px; border-radius: 12px;
  background: rgba(108,168,255,0.08); border: 1px solid rgba(108,168,255,0.32);
  font-size: 0.9rem; overflow: hidden;
}
.review-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  color: var(--blue); font-weight: 700;
}
.review-icon { font-size: 1rem; }
.review-title { flex: 1; }
.review-block.generating .review-header { cursor: default; }
.review-spinner {
  width: 13px; height: 13px; flex: 0 0 auto;
  border: 2px solid rgba(108,168,255,0.3); border-top-color: var(--blue);
  border-radius: 50%; animation: insightSpin 0.7s linear infinite;
}
.review-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px 10px;
}
.review-score {
  font-size: 1.9rem; font-weight: 800; line-height: 1; min-width: 64px;
}
.review-score.high { color: var(--green); }
.review-score.mid { color: var(--gold); }
.review-score.low { color: var(--red); }
.review-score-max { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-left: 2px; }
.review-verdict { flex: 1; min-width: 0; }
.review-share { font-weight: 700; font-size: 0.95rem; }
.review-share.yes { color: var(--green); }
.review-share.no { color: var(--red); }
.review-share-reason { margin-top: 3px; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.review-dims { padding: 2px 14px 8px; display: grid; gap: 8px; }
.review-dim-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 3px;
}
.review-dim-name { font-size: 0.78rem; color: var(--text); font-weight: 600; }
.review-dim-score { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.review-dim-bar {
  height: 5px; border-radius: 3px;
  background: rgba(108,168,255,0.14); overflow: hidden;
}
.review-dim-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }
.review-dim-fill.high { background: var(--green); }
.review-dim-fill.mid { background: var(--gold); }
.review-dim-fill.low { background: var(--red); }
.review-dim-deduction {
  margin-top: 3px; font-size: 0.72rem; color: var(--muted); line-height: 1.45;
}
.review-suggestions {
  padding: 10px 14px 12px; border-top: 1px solid rgba(108,168,255,0.22);
}
.review-suggestions-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 700; margin-bottom: 6px;
}
.review-suggestion {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 0.8rem; color: var(--text); line-height: 1.45; margin-top: 4px;
}
.review-sug-num {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(108,168,255,0.18); color: var(--blue);
  font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.review-foot {
  padding: 8px 14px 11px; font-size: 0.72rem; color: var(--muted);
  border-top: 1px solid rgba(108,168,255,0.22); line-height: 1.4;
}

/* ============ 🔴 2026-09-12 Pro 页升级：Quality Gate 卡（生成端门禁透明展示） ============
   默认折叠成一行（总分 + 门禁判定），点击展开 4 维条 + 模板命中 + AI 味清理 + PRO 分。
   无 would_share ❌ 打击（对齐 GEN_REVIEW_KEEP_OR_CUT 砍卡理由），只呈现门禁事实。 */
.quality-gate {
  margin-top: 12px; border-radius: 12px; overflow: hidden;
  background: rgba(127,119,221,0.06); border: 1px solid rgba(127,119,221,0.28);
  font-size: 0.88rem;
}
.quality-gate-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; cursor: pointer; user-select: none;
  color: var(--text); font-weight: 700;
}
.quality-gate-head:hover { background: rgba(127,119,221,0.08); }
.qg-ico { font-size: 1rem; }
.qg-title { flex: 1; }
.qg-arrow {
  color: var(--muted); font-size: 0.8rem; transition: transform .15s ease;
}
.quality-gate.collapsed .qg-arrow { transform: rotate(90deg); }
.quality-gate-body { padding: 2px 14px 12px; display: grid; gap: 8px; }
.quality-gate.collapsed .quality-gate-body { display: none; }
.quality-gate-score-line {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 2px;
}
.qg-score { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.qg-score.high { color: var(--green); }
.qg-score.mid { color: var(--gold); }
.qg-score.low { color: var(--red); }
.qg-score-max { font-size: 0.75rem; font-weight: 600; color: var(--muted); margin-left: 2px; }
.qg-verdict {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.qg-verdict.ok { color: var(--green); background: rgba(74,222,128,0.12); }
.qg-verdict.warn { color: var(--gold); background: rgba(245,166,35,0.14); }
.qg-verdict.bad { color: var(--red); background: rgba(248,113,113,0.14); }
.qg-line { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.qg-line.muted { color: var(--muted); opacity: 0.8; }
/* 🔴 2026-09-13 AI-tone cleanup 报告（老板拍板，交付物；对齐评分卡 AI-Tone 板块风格） */
.qg-clean-report {
  margin-top: 2px; padding: 8px 10px;
  background: rgba(108,168,255,0.07); border: 1px dashed rgba(108,168,255,0.3);
  border-radius: 8px; display: grid; gap: 4px;
}
.qg-clean-head { font-size: 0.72rem; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; }
.qg-clean-line { font-size: 0.8rem; color: var(--text); line-height: 1.5; }
.qg-clean-list { display: grid; gap: 3px; margin-top: 2px; }
.qg-clean-item { display: flex; gap: 8px; align-items: baseline; font-size: 0.78rem; }
.qg-clean-item-name { font-weight: 700; color: var(--text); flex: 0 0 auto; }
.qg-clean-item-ev { color: var(--muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qg-clean-note { font-size: 0.72rem; color: var(--green); line-height: 1.4; margin-top: 2px; }
.quality-gate-dims { display: grid; gap: 8px; padding-top: 4px; }
.quality-gate-dim { min-width: 0; }
.qg-dim-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px;
}
.qg-dim-name { font-size: 0.78rem; color: var(--text); font-weight: 600; }
.qg-dim-score { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.qg-dim-bar {
  height: 5px; border-radius: 3px;
  background: rgba(127,119,221,0.14); overflow: hidden;
}
.qg-dim-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }
.qg-dim-fill.high { background: var(--green); }
.qg-dim-fill.mid { background: var(--gold); }
.qg-dim-fill.low { background: var(--red); }
.qg-dim-deduction {
  margin-top: 3px; font-size: 0.72rem; color: var(--muted); line-height: 1.45;
}

/* ============ Publish Pack：发布配套层（caption/title + hashtags） ============ */
.publish-pack-block {
  margin-top: 12px; border-radius: 12px;
  background: var(--purple-subtle); border: 1px solid var(--purple-border);
  font-size: 0.9rem; overflow: hidden;
}
.publish-pack-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  color: var(--purple); font-weight: 700;
  cursor: pointer; user-select: none;
  transition: color .12s ease, background .12s ease;
}
.publish-pack-header:hover { color: var(--purple-bright); background: rgba(127,119,221,0.06); }
.publish-pack-block.open .publish-pack-header { border-bottom: 1px solid var(--purple-border); }
/* Publish Pack 折叠：箭头 + grid 0fr/1fr 平滑过渡 */
.pp-arrow {
  display: inline-block; font-size: .75rem; color: var(--muted);
  transition: transform .2s ease, color .2s ease;
}
.publish-pack-block.open .pp-arrow { transform: rotate(90deg); color: var(--purple-bright); }
.pp-title { flex: 1; }
.pp-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}
.publish-pack-block.open .pp-collapse { grid-template-rows: 1fr; }
.pp-inner { overflow: hidden; min-height: 0; }
.publish-pack-icon { font-size: 1rem; }
.publish-pack-title { flex: 1; }
.publish-pack-field {
  padding: 12px 14px;
  border-bottom: 1px solid var(--purple-border);
}
.publish-pack-field:last-of-type { border-bottom: none; }
.publish-pack-label {
  font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.publish-pack-box {
  padding: 10px 12px; border-radius: 8px;
  background: var(--panel-2); color: var(--text);
  font-size: 0.9rem; line-height: 1.45;
  margin-bottom: 8px; white-space: pre-wrap; word-break: break-word;
}
.publish-pack-tags { font-weight: 500; }
.publish-pack-foot {
  padding: 8px 14px 11px; font-size: 0.72rem; color: var(--muted);
  border-top: 1px solid var(--purple-border); line-height: 1.4;
}
.publish-pack-block.generating .publish-pack-header { cursor: default; }
.publish-pack-spinner {
  width: 13px; height: 13px; flex: 0 0 auto;
  border: 2px solid rgba(127,119,221,0.3); border-top-color: var(--purple);
  border-radius: 50%; animation: insightSpin 0.7s linear infinite;
}

/* === Key Takeaways === */
/* 固定容器：insight / publish_pack / review 各唯一，所有状态切换在容器内替换内容（防重复渲染） */
.insight-container, .publish-pack-container, .review-container { display: block; }

/* 🔴 2026-08-22：Reddit 推荐 subreddit 板块 chips */
.publish-pack-subs { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-sub-chip {
  display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px;
  background: rgba(127,119,221,0.12); border: 1px solid var(--purple-border, rgba(127,119,221,0.35));
  color: var(--purple-bright); font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all 0.12s ease;
}
.pp-sub-chip:hover { background: rgba(127,119,221,0.22); transform: translateY(-1px); }
.pp-sub-note { font-size: 0.72rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }

/* 发布时机/操作提示/备选标题/评论回复/置顶评论（紧凑卡） */
.publish-pack-times { display: flex; flex-direction: column; gap: 6px; }
.pp-time-row { display: flex; gap: 6px; font-size: 0.88rem; line-height: 1.45; }
.pp-time-key { color: var(--purple-bright); font-weight: 600; flex-shrink: 0; }
.pp-time-source { font-size: 0.7rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.pp-tip-row { font-size: 0.86rem; line-height: 1.5; margin-bottom: 5px; }
.pp-alt-row, .pp-reply-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 7px 0;
  border-bottom: 1px dashed var(--border); font-size: 0.86rem; line-height: 1.45;
}
.pp-alt-row:last-child, .pp-reply-row:last-child { border-bottom: none; }
.pp-alt-row > span:not(.pp-alt-num), .pp-reply-row { flex: 1; }
.pp-alt-num { color: var(--user-bubble); font-weight: 700; flex-shrink: 0; }
.pp-copy-mini { flex-shrink: 0; margin-left: auto; }

.publish-pack-quotes { display: flex; flex-direction: column; gap: 9px; }
.key-takeaway {
  position: relative;
  padding: 11px 13px 11px 15px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--user-bubble);
  transition: border-color .15s, background .15s;
}
.key-takeaway:hover { border-left-color: var(--gold); background: color-mix(in srgb, var(--panel-2) 85%, var(--text) 15%); }
.pq-text { font-size: 0.88rem; line-height: 1.5; color: var(--text); padding-right: 52px; }
.pq-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pq-type {
  font-size: 0.64rem; padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}
.pq-data { background: rgba(92,220,138,0.14); color: var(--green); }
.pq-view { background: rgba(127,119,221,0.16); color: var(--purple-bright); }
.pq-action { background: rgba(245,166,35,0.15); color: var(--user-bubble); }
.pq-emotion { background: rgba(255,122,122,0.14); color: #ff9a9a; }
.pq-src { font-size: 0.68rem; color: var(--muted); }
.pq-copy { position: absolute; top: 9px; right: 11px; }
.kt-badge {
  margin-top: 9px; padding: 3px 9px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 600; cursor: pointer;
  background: rgba(127,119,221,0.16); color: var(--purple-bright);
  border: 1px solid rgba(127,119,221,0.4);
}
.kt-badge:hover { background: rgba(127,119,221,0.28); }
.kt-source { background: rgba(255,215,0,0.28); color: inherit; border-radius: 3px; padding: 0 2px; transition: background .25s; }
.kt-source:hover { background: rgba(255,215,0,0.45); }
.kt-flash { animation: ktFlash 1.1s ease; }
@keyframes ktFlash {
  0%, 100% { background: rgba(255,215,0,0.28); }
  25% { background: rgba(127,119,221,0.6); }
}

/* ============ P2 多版本：版本切换条 + 对比视图 ============ */
.version-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.version-pill {
  padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; cursor: pointer;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.version-pill:hover { border-color: var(--purple); color: var(--text); }
.version-pill.active { background: var(--gold); color: #1a1a1a; border-color: var(--gold); font-weight: 600; }
.version-compare-btn {
  margin-left: auto; padding: 3px 10px; border-radius: 8px; font-size: 0.75rem; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
}
.version-compare-btn:hover { border-color: var(--purple); }
.version-compare-btn.active { background: rgba(245,166,35,0.15); border-color: var(--gold); color: var(--gold); }

.compare-view { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.compare-col {
  flex: 1 1 260px; min-width: 0; border-radius: 12px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--border);
}
.compare-col.active { border-color: var(--gold); background: rgba(245,166,35,0.06); }
.compare-col-head {
  padding: 8px 12px; font-size: 0.78rem; font-weight: 600; color: var(--muted);
  cursor: pointer; border-bottom: 1px solid var(--border); user-select: none;
}
.compare-col.active .compare-col-head { color: var(--gold); }
.compare-col-body { padding: 12px 14px; font-size: 0.9rem; }
.compare-col-body p { margin: 0.45em 0; }
.compare-col-body h1, .compare-col-body h2, .compare-col-body h3 { margin: 0.5em 0 0.3em; color: var(--gold); line-height: 1.3; }
.compare-col-body ul, .compare-col-body ol { margin: 0.4em 0 0.4em 1.2em; }
.compare-col-body code { background: var(--panel); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

/* ============ 设置面板（右侧浮层） ============ */
.settings-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 300px; max-width: 84vw;
  background: var(--panel); border-left: 1px solid var(--border); z-index: 40;
  display: flex; flex-direction: column;
}
.settings-body { padding: 16px; overflow-y: auto; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.settings-select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 0.82rem;
}
.settings-link { color: var(--gold); text-decoration: none; font-size: 0.85rem; }
.settings-link:hover { text-decoration: underline; }
.settings-link-btn {
  background: transparent; border: none; color: var(--gold); cursor: pointer;
  font-size: 0.85rem; padding: 0; font-family: inherit;
}
.settings-link-btn:hover { text-decoration: underline; }
.settings-ver { color: var(--muted); font-size: 0.82rem; }
.settings-note {
  margin-top: 16px; font-size: 0.76rem; color: var(--muted); line-height: 1.6;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
}

/* ============ 账户下拉菜单 ============ */
.account-menu {
  position: absolute; bottom: calc(100% - 4px); left: 12px; width: 232px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; z-index: 50; display: flex; flex-direction: column;
  box-shadow: var(--shadow-modal);
}
.am-email {
  font-size: 0.78rem; color: var(--muted); padding: 8px 10px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.am-group { display: flex; flex-direction: column; gap: 1px; }
.am-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; border-left: 2px solid transparent;
  color: var(--text); font-size: 0.88rem;
  text-align: left; padding: 10px; border-radius: 8px; cursor: pointer; text-decoration: none;
  font-family: inherit; transition: background .12s ease, border-color .12s ease;
}
.am-item .am-ico { flex: 0 0 auto; color: var(--muted); transition: color .12s ease; }
.am-item:hover { background: rgba(255,255,255,.06); border-left-color: var(--purple); }
.am-item:hover .am-ico { color: var(--text); }
.am-val { color: var(--muted); }
.am-danger { color: #ff7a7a; }
.am-danger .am-ico { color: #ff7a7a; }
.am-danger:hover { background: rgba(255,107,107,.12); border-left-color: #ff7a7a; }
.am-danger:hover .am-ico { color: #ff7a7a; }
.am-sep { height: 1px; background: var(--border); margin: 5px 8px; }

/* ============ 通用 ============ */
.ghost-btn {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 0.82rem;
}
.ghost-btn:hover { color: var(--text); border-color: var(--purple); }
.history-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600;
}

/* 🔴 2026-08-22：侧边栏遮罩层（移动端 Drawer+Overlay）。
   基础 display:none 放全局（不进媒体查询，避免匹配问题）；.show 时显示。
   z-index 低于 sidebar(50)、高于正文；桌面端不会触发 open，遮罩保持隐藏。 */
.sidebar-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5); z-index: 45;
}
.sidebar-overlay.show { display: block; }

/* ============ 移动端：侧栏改为可抽屉 ============ */
@media (max-width: 720px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    position: absolute; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .scroll-btn { right: 8px; top: -12px; width: 28px; height: 28px; font-size: 0.9rem; }
  .msg-row { padding: 0 14px; }
  .composer { padding: 10px 12px 14px; }
  .menu-btn { display: block; }
  .composer-tools { gap: 6px; }
  .pill-select { padding: 5px 9px; font-size: 0.72rem; }
  .send-btn { width: 34px; height: 34px; font-size: 1rem; }
  .credit-pill { font-size: 0.7rem; padding: 3px 8px; }
  .empty-state { padding: 24px 16px; max-width: 100%; gap: 8px; }
  .empty-state .empty-ico { width: 32px; height: 32px; margin-bottom: 0; }
  .empty-state .empty-title { font-size: 1.02rem; }
  .empty-state .empty-sub { display: none; }       /* 🔴 2026-08-22 移动端隐藏副标题（拥挤） */
  .empty-state .empty-hint { display: none; }      /* 🔴 2026-08-22 移动端隐藏"Try a topic"提示（chips 够直白） */
  .empty-state .empty-chip { padding: 7px 11px; font-size: 0.75rem; }
  .empty-state .empty-platforms { display: none; } /* 🔴 2026-08-22 移动端隐藏支持平台行（信息重复） */
  .empty-state .empty-more { margin-top: 4px; font-size: 0.76rem; }
  .empty-chips { width: 100%; }
  /* 移动端补充：侧边栏用户信息不溢出 + 消息内容宽度控制 + 附属块紧凑 */
  .user-meta { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-credits, .user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .message { max-width: 100%; width: 100%; }
  .insight-content, .publish-pack-box { word-break: break-word; }
  .pp-alt-row, .pp-reply-row { flex-wrap: wrap; }
  .pp-copy-mini { margin-left: 0; }
  .content-score { max-width: 100%; }
  .composer-inner { align-items: flex-end; }
}

/* ============ 微动效 ============ */
.btn-primary, .auth-submit, .send-btn, .newchat-btn, .mini-btn, .side-btn, .ghost-btn, .version-pill, .version-compare-btn, .buy-card, .scroll-btn {
  transition: transform .08s ease, filter .12s ease, border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
}
.auth-submit:hover, .send-btn:hover:not(:disabled), .newchat-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.auth-submit:active, .send-btn:active:not(:disabled), .newchat-btn:active, .mini-btn:active, .side-btn:active, .ghost-btn:active, .version-pill:active, .version-compare-btn:active, .buy-card:active, .scroll-btn:active {
  transform: scale(0.98);
}
.mini-btn:hover, .scroll-btn:hover { transform: translateY(-1px); }
.buy-card:hover { transform: translateY(-2px); border-color: var(--purple); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }

/* ============ Toast 提示 ============ */
.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--toast-error-bg); color: var(--toast-error-fg); border: 1px solid var(--toast-error-border);
  border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  font-size: 0.88rem; line-height: 1.45;
  display: flex; align-items: flex-start; gap: 10px;
  animation: toastIn .25s ease, toastOut .3s ease 4.7s forwards;
  max-width: 100%;
}
.toast.success { background: var(--toast-success-bg); color: var(--toast-success-fg); border-color: var(--toast-success-border); }
.toast.info { background: var(--toast-info-bg); color: var(--toast-info-fg); border-color: var(--toast-info-border); }
.toast .toast-icon { font-size: 1.1rem; flex: 0 0 auto; }
.toast .toast-msg { flex: 1; }
.toast .toast-close {
  background: transparent; border: none; color: inherit; cursor: pointer; font-size: 1rem; opacity: 0.7; padding: 0 0 0 4px;
}
.toast .toast-close:hover { opacity: 1; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ============ 购买积分弹窗 ============ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.modal-card {
  position: relative; width: min(440px, 92vw); max-height: 88vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow-modal);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 1.05rem; font-weight: 600; margin-bottom: 16px;
}
/* ============ 删除确认弹窗 ============ */
.confirm-card { width: min(400px, 92vw); }
.confirm-icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--danger-bg); color: var(--red); margin-bottom: 16px;
}
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.confirm-desc { font-size: .9rem; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.confirm-desc b { color: var(--text); font-weight: 600; }
.confirm-meta { font-size: .78rem; color: var(--muted); margin-bottom: 18px; display: flex; align-items: center; gap: 6px; }
.confirm-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.confirm-actions { display: flex; gap: 10px; }
.confirm-btn {
  flex: 1; font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  padding: 11px 14px; border-radius: 10px; transition: all .14s ease;
}
.confirm-cancel { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.confirm-cancel:hover { border-color: var(--border-light); }
.confirm-delete { background: var(--danger-solid); color: #fff; border: 1px solid transparent; }
.confirm-delete:hover { filter: brightness(1.08); }
.buy-card-modal { width: min(720px, 94vw); }
.buy-packages { display: flex; flex-direction: row; gap: 12px; flex-wrap: wrap; }
.buy-card {
  position: relative; flex: 1 1 0; min-width: 180px; text-align: left; font-family: inherit;
  display: flex; flex-direction: column;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 16px 16px; transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.buy-card:hover { border-color: var(--purple); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.buy-card.featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 10px 30px rgba(127,119,221,0.18); }
.buy-card.selected { border-color: var(--purple); box-shadow: 0 0 0 2px var(--purple), 0 12px 32px rgba(127,119,221,0.22); }
.buy-card.featured.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--purple), 0 12px 32px rgba(127,119,221,0.25); }
.buy-credits { font-size: 1.55rem; font-weight: 700; color: var(--text); }
.buy-credits span { font-size: 0.85rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.buy-label { font-size: 0.8rem; color: var(--muted); margin: 2px 0 4px; font-weight: 600; letter-spacing: .02em; }
.buy-sub { font-size: 0.72rem; color: var(--muted); margin: 0 0 10px; line-height: 1.4; }
.buy-price { font-size: 1.25rem; font-weight: 700; color: var(--gold); }
.buy-per { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.buy-save { font-size: 0.74rem; font-weight: 600; color: #4ade80; margin-top: 6px; }
.buy-save-muted { color: var(--muted); font-weight: 500; }
.buy-posts { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.buy-risk { font-size: 0.66rem; color: var(--muted); text-align: center; margin-top: 8px; opacity: 0.85; }
.buy-btn {
  /* margin-top:auto 贴底对齐（与 buy-modal-sa-css 注入版一致）——
     否则内容多的卡（如 500 带 sub 行）按钮位置会比其他卡低，三卡不对齐 */
  margin-top: auto; width: 100%; font-family: inherit; font-size: 0.9rem; font-weight: 600;
  color: #fff; background: var(--purple); border: none; border-radius: 10px; padding: 11px 12px;
  cursor: pointer; transition: background .15s ease, transform .08s ease;
}
.buy-btn:hover { background: var(--purple-hover); }
.buy-btn:active { transform: translateY(1px); }
.buy-btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }
.buy-card.featured .buy-btn { background: var(--gold); color: #1a1530; }
.buy-card.featured .buy-btn:hover { background: #ffb838; }
.buy-btn-crypto {
  margin-top: 8px; width: 100%; font-family: inherit; font-size: 0.86rem; font-weight: 600;
  color: var(--gold); background: transparent; border: 1px solid var(--gold);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
  transition: background .15s ease, transform .08s ease;
}
.buy-btn-crypto:hover { background: rgba(255,215,0,0.10); }
.buy-btn-crypto:active { transform: translateY(1px); }
.buy-crypto-note { font-size: 0.7rem; color: var(--muted); margin-top: 6px; text-align: center; }

/* 角标 */
.buy-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; font-weight: 700; letter-spacing: .03em; padding: 3px 12px;
  border-radius: 999px; white-space: nowrap;
}
.badge-pop  { background: var(--gold);   color: #1a1530; }
.badge-best { background: #2dd4bf;       color: #07241f; }

/* 即时到账提示 */
.buy-instant {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 0.8rem; color: var(--text); margin-bottom: 14px;
  background: rgba(74, 222, 128, 0.10); border: 1px solid rgba(74, 222, 128, 0.28);
  border-radius: 10px; padding: 8px 12px; text-align: center; line-height: 1.4;
}

/* 价值锚点 hero */
.buy-hero {
  background: linear-gradient(135deg, rgba(127,119,221,0.16), rgba(245,166,35,0.12));
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
}
.buy-hero-l1 { font-size: 1.02rem; color: var(--text); }
.buy-hero-l1 b { color: var(--gold); }
.buy-hero-l2 { font-size: 0.95rem; color: var(--text); margin-top: 6px; line-height: 1.5; }
.buy-hero-l2 b { color: #4ade80; }
.buy-aster { color: var(--muted); font-weight: 700; }
.buy-hero-foot { font-size: 0.7rem; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* 支付方式 */
.buy-pay { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.buy-pay-label { font-size: 0.74rem; color: var(--muted); margin-right: 2px; }
.pay-ico {
  font-size: 0.66rem; font-weight: 700; letter-spacing: .02em; color: var(--chip-fg);
  background: var(--chip-bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; line-height: 1;
}
.pay-ico-soft { color: var(--muted); }

.buy-loading { color: var(--muted); font-size: 0.85rem; padding: 8px; text-align: center; width: 100%; }
.buy-note {
  margin-top: 16px; font-size: 0.74rem; color: var(--muted); line-height: 1.6;
  border-top: 1px solid var(--border); padding-top: 12px; text-align: center;
}

/* 政策确认勾选框（结账前必选） */
.buy-agree {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 14px;
  font-size: 0.75rem; color: var(--muted); line-height: 1.55;
  background: rgba(127,119,221,0.06); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.buy-agree input[type="checkbox"] {
  margin-top: 2px; width: 16px; height: 16px; flex: 0 0 auto; accent-color: #7F77DD; cursor: pointer;
}
.buy-agree a { color: #7F77DD; text-decoration: underline; }
.buy-agree.shake { border-color: #ef4444; background: rgba(239,68,68,0.08); animation: buyAgreeShake .3s; }
@keyframes buyAgreeShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
@media (max-width: 560px) { .buy-agree { font-size: 0.72rem; } }

/* ============ $1 试用活动 ============ */
.trial-strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(45,212,191,0.12), rgba(45,212,191,0.04));
  border: 1px solid rgba(45,212,191,0.45); border-radius: 14px;
  padding: 14px 16px; margin: 22px auto 0; max-width: 620px;
}
.trial-strip .trial-badge {
  font-size: 0.66rem; font-weight: 700; letter-spacing: .04em; color: #062925;
  background: #2dd4bf; padding: 4px 9px; border-radius: 6px; white-space: nowrap;
}
.trial-strip .trial-copy { flex: 1; min-width: 200px; }
.trial-strip .trial-t1 { font-weight: 700; font-size: 0.98rem; color: var(--text); }
.trial-strip .trial-t2 { font-size: 0.82rem; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.trial-strip .trial-t2 b { color: #2dd4bf; }
.trial-btn {
  font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  color: #062925; background: #2dd4bf; border: none; border-radius: 10px;
  padding: 10px 16px; white-space: nowrap; transition: background .15s ease, transform .08s ease;
}
.trial-btn:hover { background: #5fe3d2; }
.trial-btn:active { transform: translateY(1px); }
.trial-fine { width: 100%; font-size: 0.7rem; color: var(--muted); margin-top: 8px; }

/* 定价页独立 TRIAL 卡 */
.trial-card {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(45,212,191,0.14), rgba(45,212,191,0.03));
  border: 1px solid rgba(45,212,191,0.45); border-radius: 16px;
  padding: 18px 22px; max-width: 960px; margin: 0 auto 22px;
}
.trial-card .trial-price { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.trial-card .trial-price small { display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted); margin-top: 4px; }
.trial-card .trial-mid { flex: 1; min-width: 220px; }
.trial-card .trial-lab { font-size: 0.7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #2dd4bf; }
.trial-card .trial-mid ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: 0.82rem; color: var(--muted); }
.trial-card .trial-mid li { margin: 2px 0; }
.trial-card .trial-mid b { color: #2dd4bf; }

/* 购买弹窗内试用入口 */
.trial-entry {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(45,212,191,0.08); border: 1px dashed rgba(45,212,191,0.5);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.trial-entry .trial-mbadge {
  font-size: 0.6rem; font-weight: 700; letter-spacing: .03em; color: #062925;
  background: #2dd4bf; padding: 3px 7px; border-radius: 5px; white-space: nowrap;
}
.trial-entry .trial-mtxt { flex: 1; min-width: 180px; font-size: 0.84rem; color: var(--text); line-height: 1.45; }
.trial-entry .trial-mtxt b { color: #2dd4bf; }
.trial-entry .trial-btn { padding: 8px 14px; font-size: 0.84rem; }

/* 窄屏：卡片堆叠 */
@media (max-width: 560px) {
  .buy-packages { flex-direction: column; }
  .buy-card { flex: 1 1 auto; width: 100%; min-width: 0; }
  .buy-card-modal { width: 100%; max-width: 100%; border-radius: 0; height: 100%; max-height: 100%; }
  .buy-card-modal .modal-head { padding: 0 4px; }
  .trial-strip { flex-direction: column; align-items: stretch; text-align: center; }
  .trial-card { flex-direction: column; align-items: stretch; }
  .trial-strip .trial-btn, .trial-card .trial-btn { width: 100%; }
  .trial-entry { flex-direction: column; align-items: stretch; text-align: center; }
  .trial-entry .trial-btn { width: 100%; }
}

/* 反馈弹窗样式已迁移至 feedback-modal.js（自包含注入，含 dark/light 适配），此处不再保留 */

@media (max-width: 600px) {
  .account-menu { width: calc(100% - 24px); }
}

/* 全局页脚 */
.site-footer {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 24px; font-size: 0.78rem; color: var(--muted);
  border-top: 1px solid var(--border); background: var(--bg);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }

/* ============ 发送按钮加载态 ============ */
.send-btn.loading { position: relative; color: transparent; pointer-events: none; }
.send-btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid rgba(26,19,0,0.35); border-top-color: #1a1300; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 错误气泡 ============ */
.message.assistant.error-bubble {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--panel-2, #1a1a22); border: 1px solid #5c2a2a; border-left: 3px solid #e0564f;
  color: #ffd9d6; padding: 14px 16px; border-radius: 12px; max-width: 760px;
}
.message.assistant.error-bubble .err-icon { font-size: 1.2rem; line-height: 1.4; }
.message.assistant.error-bubble .err-msg { font-size: 0.95rem; line-height: 1.5; }
.theme-light .message.assistant.error-bubble { background: #fff3f2; border-color: #e8a5a0; color: #8a2a23; }
.retry-btn {
  background: var(--gold); color: #1a1300; border: none; border-radius: 8px;
  padding: 7px 14px; font-size: 0.82rem; font-weight: 700; cursor: pointer;
  transition: transform .08s ease, filter .12s ease;
}
.retry-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.retry-btn:active { transform: scale(0.97); }

/* ============ Step4：生成中断"未完成"标记 ============ */
.interrupted-badge {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 12px;
  background: rgba(224, 86, 79, 0.08); border: 1px solid rgba(224, 86, 79, 0.35); border-left: 3px solid #e0564f;
  border-radius: 8px; color: #ffd9d6; font-size: 0.85rem;
}
.theme-light .interrupted-badge { background: #fff3f2; border-color: #e8a5a0; color: #8a2a23; }
.interrupted-badge .int-ico { font-size: 0.95rem; line-height: 1; }
.int-regen-btn {
  margin-left: auto; background: var(--gold); color: #1a1300; border: none;
  border-radius: 8px; padding: 5px 12px; font-size: 0.8rem; font-weight: 700; cursor: pointer;
  transition: transform .08s ease, filter .12s ease;
}
.int-regen-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.int-regen-btn:active { transform: scale(0.97); }

/* ============ 公开定价页（pricing.html 内联样式之外的基础兜底） ============ */
body.pricing-page { min-height: 100vh; }
.pricing-page .site-footer { border-top: 1px solid var(--footer-border); }

/* ============ 登录弹窗内微调（复用 .modal / .auth-*） ============ */
#auth-modal .auth-logo { font-size: 1.5rem; margin-bottom: 16px; }
#auth-modal .auth-tabs { margin-top: 4px; margin-bottom: 16px; }
#auth-modal .auth-hint { margin-top: 16px; }

/* ---- 登录弹窗升级 ---- */
.auth-card-modal { position: relative; }
.auth-card-modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  border-radius: 16px 16px 0 0; background: var(--gold);
}
.auth-modal--login .auth-card-modal::before { background: #7F77DD; }
.auth-modal--signup .auth-card-modal::before { background: var(--gold); }

.auth-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.auth-modal-head { text-align: center; margin: 4px 0 16px; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--text); margin: 0 0 4px; }
.auth-sub { font-size: 0.85rem; color: var(--muted); margin: 0; }

.auth-tab {
  flex: 1; background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px;
  cursor: pointer; font-size: 0.9rem; transition: all .15s ease;
}
.auth-modal--login .auth-tab.active { background: #7F77DD; color: #fff; border-color: #7F77DD; }
.auth-modal--signup .auth-tab.active { background: var(--gold); color: #1a1300; border-color: var(--gold); }

.field { margin-bottom: 14px; text-align: left; }
.field-label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.auth-card-modal .auth-input { margin-bottom: 0; box-sizing: border-box; }
.auth-modal--login .auth-input:focus { border-color: #7F77DD; }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1.05rem;
  color: var(--muted); padding: 4px 6px; line-height: 1;
}
.pw-toggle:hover { color: var(--text); }
.pw-strength { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.pw-bar { flex: 1; height: 4px; border-radius: 3px; background: var(--border); transition: background .2s ease; }
.pw-hint { font-size: 0.7rem; color: var(--muted); margin-left: 6px; font-style: normal; }
.pw-strength.weak .pw-bar:nth-child(1) { background: #e24b4a; }
.pw-strength.medium .pw-bar:nth-child(1),
.pw-strength.medium .pw-bar:nth-child(2) { background: #ef9f27; }
.pw-strength.strong .pw-bar:nth-child(1),
.pw-strength.strong .pw-bar:nth-child(2),
.pw-strength.strong .pw-bar:nth-child(3) { background: #5fdc8a; }

.auth-modal--login .auth-submit { background: #7F77DD; color: #fff; }
.auth-modal--signup .auth-submit { background: var(--gold); color: #1a1300; }
.auth-submit { width: 100%; border: none; border-radius: 10px; padding: 12px; font-weight: 700;
  cursor: pointer; font-size: 0.95rem; margin-top: 4px; font-family: inherit; transition: filter .15s ease; }
.auth-submit:hover { filter: brightness(1.05); }
.auth-submit.loading { position: relative; color: transparent; pointer-events: none; }
.auth-submit.loading::after {
  content: ''; position: absolute; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%;
  left: 50%; top: 50%; transform: translate(-50%,-50%); animation: spin .7s linear infinite;
}
.auth-google-btn {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 11px; font-weight: 600;
  cursor: pointer; font-size: 0.92rem; margin-top: 10px; font-family: inherit;
  background: var(--panel-2); color: var(--text); transition: background .15s ease, border-color .15s ease;
}
.auth-google-btn:hover { background: var(--bg); border-color: var(--purple); }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 2px; color: var(--muted); font-size: .76rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-modal--signup .auth-submit.loading::after { border-color: rgba(26,19,0,0.4); border-top-color: #1a1300; }

.auth-resend { font-size: 0.78rem; color: var(--muted); text-align: center; margin-top: -2px; margin-bottom: 12px; }
.auth-resend a, .auth-switch-link { color: var(--gold); cursor: pointer; text-decoration: none; }
.auth-resend a:hover, .auth-switch-link:hover { text-decoration: underline; }

/* 窄屏：弹窗更紧凑 */
@media (max-width: 480px) {
  .modal-card { width: min(440px, 96vw); padding: 16px; border-radius: 14px; }
  .auth-title { font-size: 1.25rem; }
  .auth-sub { font-size: 0.8rem; }
  .auth-tab { padding: 8px; font-size: 0.85rem; }
  .auth-input { padding: 11px 12px; }
  .auth-submit { padding: 11px; font-size: 0.92rem; }
  .auth-card-modal .auth-logo { font-size: 1.3rem; margin-bottom: 12px; }
  .field { margin-bottom: 12px; }
  .field-label { font-size: 0.74rem; }
}
