/* ============================================================
   AI 求职工作台 · 样式
   配色与布局对齐 Codex / ChatGPT 设计语言：
   最左图标栏 · 对话侧栏 · 线程工作区（顶栏 + 对话 + Composer）· 右侧结果面板
   双主题（跟随系统 / 浅色 / 深色）
   ============================================================ */

:root {
  /* —— 浅色（默认）—— */
  --bg:        #ffffff;
  --bg-side:   #f9f9f9;
  --bg-rail:   #f9f9f9;
  --bg-hover:  #ececec;
  --bg-active: #e3e3e3;
  --bg-soft:   #f4f4f4;
  --bubble:    #f4f4f4;
  --card:      #ffffff;
  --line:      #e5e5e5;
  --line-soft: #ececec;
  --text:      #0d0d0d;
  --text-2:    #424242;
  --muted:     #8f8f8f;
  --faint:     #b4b4b4;
  --accent:      #0d0d0d;
  --accent-fg:   #ffffff;
  --accent-hover:#2f2f2f;
  --green: #10a37f;
  --red:   #ef4146;
  --amber: #c2740a;
  --blue:  #2f6feb;
  --green-line: rgba(16,163,127,.42);
  --red-line:   rgba(239,65,70,.42);
  --amber-line: rgba(194,116,10,.42);
  --blue-line:  rgba(47,111,235,.42);
  --shadow: 0 4px 18px rgba(0,0,0,.07);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.14);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-bubble: 18px;
  --r-input: 26px;
  --r-pill: 999px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg:        #212121;
  --bg-side:   #171717;
  --bg-rail:   #171717;
  --bg-hover:  #2a2a2a;
  --bg-active: #303030;
  --bg-soft:   #2a2a2a;
  --bubble:    #303030;
  --card:      #212121;
  --line:      #2f2f2f;
  --line-soft: #2a2a2a;
  --text:      #ececec;
  --text-2:    #cdcdcd;
  --muted:     #9b9b9b;
  --faint:     #6e6e6e;
  --accent:      #ffffff;
  --accent-fg:   #0d0d0d;
  --accent-hover:#d9d9d9;
  --green: #19c37d;
  --red:   #ff7a7a;
  --amber: #ffb224;
  --blue:  #7aa2f7;
  --green-line: rgba(25,195,125,.46);
  --red-line:   rgba(255,122,122,.46);
  --amber-line: rgba(255,178,36,.46);
  --blue-line:  rgba(122,162,247,.46);
  --shadow: 0 4px 18px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg:        #212121;
    --bg-side:   #171717;
    --bg-rail:   #171717;
    --bg-hover:  #2a2a2a;
    --bg-active: #303030;
    --bg-soft:   #2a2a2a;
    --bubble:    #303030;
    --card:      #212121;
    --line:      #2f2f2f;
    --line-soft: #2a2a2a;
    --text:      #ececec;
    --text-2:    #cdcdcd;
    --muted:     #9b9b9b;
    --faint:     #6e6e6e;
    --accent:      #ffffff;
    --accent-fg:   #0d0d0d;
    --accent-hover:#d9d9d9;
    --green: #19c37d;
    --red:   #ff7a7a;
    --amber: #ffb224;
    --blue:  #7aa2f7;
    --green-line: rgba(25,195,125,.46);
    --red-line:   rgba(255,122,122,.46);
    --amber-line: rgba(255,178,36,.46);
    --blue-line:  rgba(122,162,247,.46);
    --shadow: 0 4px 18px rgba(0,0,0,.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; }
.hidden { display: none !important; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--faint); }
a:hover { text-decoration-color: currentColor; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--faint); border-radius: 6px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ======================= 主布局：图标栏 · 侧栏 · 工作区 · 结果面板 ======================= */
.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 52px 264px minmax(0, 1fr) 330px;
  transition: grid-template-columns .18s ease;
}
.app.no-side  { grid-template-columns: 52px 0 minmax(0, 1fr) 330px; }
.app.no-panel { grid-template-columns: 52px 264px minmax(0, 1fr) 0; }
.app.no-side.no-panel { grid-template-columns: 52px 0 minmax(0, 1fr) 0; }
.app.no-side .sidebar, .app.no-panel .inspector { overflow: hidden; opacity: 0; pointer-events: none; }

/* ---------- 最左图标栏 ---------- */
.rail {
  background: var(--bg-rail);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0 12px; gap: 4px; min-height: 0;
}
.rail-top { margin-bottom: 8px; }
.rail-logo {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-fg);
  font-size: 11.5px; font-weight: 700; letter-spacing: -.02em;
  cursor: default; user-select: none;
}
.rail-group { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.rail-spacer { flex: 1; }
.rail-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: background .13s, color .13s;
}
.rail-btn svg { width: 19px; height: 19px; }
.rail-btn:hover { background: var(--bg-hover); color: var(--text); }
.rail-btn.on { background: var(--bg-active); color: var(--text); }

/* ---------- 侧栏 ---------- */
.sidebar {
  background: var(--bg-side);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  padding: 10px 8px 8px; min-height: 0; min-width: 0;
  transition: opacity .15s;
}
.side-head { padding: 4px 8px 10px; }
.side-brand { font-size: 14px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }

.new-chat {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 11px; margin-bottom: 6px;
  font-size: 14px; font-weight: 500; color: var(--text);
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--bg); transition: background .13s, border-color .13s;
}
.new-chat:hover { background: var(--bg-hover); }
.new-chat svg { color: var(--muted); flex: none; }

.side-label {
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  padding: 14px 8px 6px; letter-spacing: .01em;
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; padding: 7px 11px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.search-box svg { color: var(--muted); flex: none; }
.search-box input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  font-family: inherit; font-size: 13.5px; color: var(--text);
}
.search-box input::placeholder { color: var(--faint); }
.sessions { flex: 1; overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.sess {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 1px;
  border-radius: var(--r-sm); cursor: pointer;
  color: var(--text-2); font-size: 13.5px;
  transition: background .12s, color .12s;
}
.sess:hover { background: var(--bg-hover); color: var(--text); }
.sess.on { background: var(--bg-active); color: var(--text); font-weight: 500; }
.sess .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .d { font-size: 11px; color: var(--muted); flex: none; opacity: 0; transition: opacity .12s; }
.sess:hover .d { opacity: 1; }
.sess .del { flex: none; opacity: 0; color: var(--muted); padding: 2px; border-radius: 5px; display: flex; }
.sess:hover .del { opacity: 1; }
.sess .del:hover { color: var(--red); background: var(--bg-soft); }
.empty-tip { padding: 12px 10px; font-size: 13px; color: var(--muted); line-height: 1.7; }

.user-box {
  display: flex; align-items: center; gap: 9px;
  margin-top: 8px; padding: 9px 8px 4px;
  border-top: 1px solid var(--line-soft);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-fg);
  font-size: 12.5px; font-weight: 600;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-points { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mini-btn {
  flex: none; padding: 5px 12px; font-size: 12.5px; font-weight: 500;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); transition: background .13s;
}
.mini-btn:hover { background: var(--bg-hover); }

.icon-btn {
  padding: 6px; border-radius: var(--r-sm); color: var(--muted);
  transition: background .13s, color .13s; display: flex; align-items: center;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- 工作区 ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }

.topbar {
  height: 52px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}
.thread { display: flex; align-items: center; gap: 8px; min-width: 0; }
.thread-title {
  font-size: 14.5px; font-weight: 600; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}
.side-toggle { flex: none; }
.top-right { display: flex; align-items: center; gap: 4px; flex: none; }

.points-pill {
  padding: 6px 13px; font-size: 12.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--bg); color: var(--text-2);
  transition: background .13s, color .13s;
}
.points-pill:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- 对话流 ---------- */
.chat { flex: 1; overflow-y: auto; padding: 28px 0 8px; min-height: 0; }
.chat-inner { max-width: 768px; margin: 0 auto; padding: 0 24px; }

.msg { margin-bottom: 30px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble {
  max-width: 78%; padding: 11px 16px;
  background: var(--bubble); border-radius: var(--r-bubble);
  font-size: 15px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.msg.ai .head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.msg.ai .who { font-size: 13.5px; font-weight: 600; color: var(--text); }
.msg.ai .model-tag { font-size: 11.5px; color: var(--muted); }
.msg.ai .body { font-size: 15px; color: var(--text); word-break: break-word; }
.msg.ai .body p { margin: 0 0 12px; }
.msg.ai .body p:last-child { margin-bottom: 0; }
.msg.ai .body h2 { font-size: 16px; font-weight: 600; margin: 20px 0 9px; letter-spacing: -.01em; }
.msg.ai .body h3 { font-size: 15px; font-weight: 600; margin: 16px 0 7px; }
.msg.ai .body ul { margin: 8px 0 12px; padding-left: 22px; }
.msg.ai .body li { margin-bottom: 5px; }
.msg.ai .body strong { font-weight: 600; }
.msg.ai .body code {
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-soft); padding: 2px 6px; border-radius: 5px;
}
.msg.ai .body blockquote {
  border-left: 2px solid var(--line); padding: 2px 0 2px 14px;
  margin: 0 0 12px; color: var(--muted); font-size: 13.5px;
}
.cursor {
  display: inline-block; width: 8px; height: 16px;
  background: var(--text); vertical-align: -2px; margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 0%,50% { opacity: 1 } 50.01%,100% { opacity: 0 } }

.msg-meta {
  display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px;
  font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.msg-meta .badge { padding: 2px 9px; border-radius: var(--r-pill); border: 1px solid var(--line); }
.msg-meta .badge.local { color: var(--amber); border-color: var(--amber-line); }
.msg-meta .badge.model { color: var(--green); border-color: var(--green-line); }

.note-line {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12.5px; color: var(--muted);
  padding: 8px 12px; background: var(--bg-soft);
  border-radius: var(--r-sm); margin-bottom: 12px;
}
.note-line.warn { color: var(--amber); }

/* ---------- 卡片 ---------- */
.cards { margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.kcard {
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; background: var(--card);
  transition: border-color .13s;
}
.kcard:hover { border-color: var(--faint); }
.kcard-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px; border-bottom: 1px solid var(--line-soft);
}
.kcard-title { font-size: 14.5px; font-weight: 600; flex: 1; letter-spacing: -.01em; }
.kcard-sub { font-size: 12px; color: var(--muted); }
.kcard-body { padding: 13px 15px; font-size: 13.5px; color: var(--text-2); }
.krow { display: flex; gap: 10px; margin-bottom: 7px; align-items: flex-start; }
.krow:last-child { margin-bottom: 0; }
.krow .k { color: var(--muted); flex: none; min-width: 44px; font-size: 12.5px; }
.krow .v { flex: 1; word-break: break-word; }
.krow .v b { color: var(--text); font-weight: 600; }

.tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag {
  font-size: 12px; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--bg-soft); color: var(--text-2);
  transition: background .13s, color .13s;
}
.tag.hot { cursor: pointer; }
.tag.hot:hover { background: var(--bg-active); color: var(--text); }

.score-ring {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  border: 2px solid var(--green); color: var(--text);
}
.score-ring small { font-size: 9px; font-weight: 400; color: var(--muted); line-height: 1; }
.tier-chip {
  font-size: 11.5px; padding: 3px 10px; border-radius: var(--r-pill);
  font-weight: 500; flex: none; border: 1px solid;
}
.tier-chip.优先投递 { color: var(--green); border-color: var(--green-line); }
.tier-chip.稳妥投递 { color: var(--blue);  border-color: var(--blue-line); }
.tier-chip.补充选择 { color: var(--muted); border-color: var(--line); }

.kcard-foot {
  padding: 11px 15px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
}
.kcard-foot .warn { color: var(--amber); }

.src-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.src {
  font-size: 12px; padding: 4px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line); color: var(--text-2);
  text-decoration: none; transition: background .13s, color .13s;
}
.src:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }

/* ---------- Composer ---------- */
.composer { flex: none; padding: 8px 24px 18px; }
.composer-box {
  max-width: 768px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-input); padding: 14px 14px 10px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.composer-box:focus-within {
  border-color: var(--faint);
  box-shadow: 0 2px 14px rgba(0,0,0,.05);
}
.composer textarea {
  width: 100%; resize: none; border: none; outline: none; background: none;
  color: var(--text); font-family: inherit; font-size: 15px; line-height: 1.6;
  max-height: 200px; padding: 0 0 6px;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 8px; border-top: 1px solid var(--line-soft);
}
.cb-left { display: flex; align-items: center; gap: 8px; min-width: 0; }

.agent-switch { display: flex; gap: 2px; background: var(--bg-soft); padding: 2px; border-radius: var(--r-pill); }
.agent-switch button {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 13px; font-size: 12.5px; font-weight: 500;
  color: var(--muted); border-radius: var(--r-pill);
  transition: background .13s, color .13s; white-space: nowrap;
}
.agent-switch button:hover { color: var(--text-2); }
.agent-switch button.on { background: var(--accent); color: var(--accent-fg); }
.agent-switch svg { display: none; }

.model-select {
  padding: 5px 8px; font-size: 12.5px; font-family: inherit; max-width: 180px;
  background: none; border: none; border-radius: var(--r-sm);
  color: var(--muted); outline: none; cursor: pointer;
  transition: background .13s, color .13s;
}
.model-select:hover { background: var(--bg-hover); color: var(--text); }
.model-select option { background: var(--bg); color: var(--text); }

.send-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-fg);
  transition: background .13s, opacity .13s;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { opacity: .3; cursor: not-allowed; }

.composer-tip {
  max-width: 768px; margin: 8px auto 0;
  font-size: 12px; color: var(--muted); text-align: center; min-height: 16px;
}

/* ---------- 右侧结果面板 ---------- */
.inspector {
  background: var(--bg-side);
  border-left: 1px solid var(--line-soft);
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  transition: opacity .15s;
}
.insp-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 0; flex: none; }
.tabs { display: flex; gap: 2px; flex: 1; }
.tabs button {
  padding: 7px 12px; font-size: 13px; font-weight: 500;
  color: var(--muted); border-radius: var(--r-sm);
  transition: background .13s, color .13s;
}
.tabs button:hover { background: var(--bg-hover); color: var(--text-2); }
.tabs button.on { background: var(--bg-active); color: var(--text); }
.insp-close { flex: none; }
.insp-body { flex: 1; overflow-y: auto; padding: 18px 14px; min-height: 0; }

.sec { margin-bottom: 24px; }
.sec h4 {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin-bottom: 10px; letter-spacing: .02em;
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat {
  background: var(--bg); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 11px 12px;
}
.stat .n { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.hot-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px;
  color: var(--text-2); cursor: pointer; transition: background .12s, color .12s;
}
.hot-item:hover { background: var(--bg-hover); color: var(--text); }
.hot-item .cnt { font-size: 11.5px; color: var(--muted); flex: none; }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 8px 11px; font-size: 13.5px; font-family: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text); outline: none; transition: border-color .13s;
}
.field input:focus, .field select:focus { border-color: var(--faint); }
.field input::placeholder { color: var(--faint); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.65; margin-top: 7px; }

button.ghost {
  width: 100%; padding: 9px; font-size: 13.5px; font-weight: 500; margin-top: 6px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--text-2);
  transition: background .13s, color .13s;
}
button.ghost:hover { background: var(--bg-hover); color: var(--text); }
button.ghost.accent { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.ghost.accent:hover { background: var(--accent-hover); }

.ledger-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--line-soft);
}
.ledger-row:last-child { border-bottom: none; }
.ledger-row .amt { font-variant-numeric: tabular-nums; flex: none; }
.ledger-row .amt.pos { color: var(--green); }
.ledger-row .amt.neg { color: var(--text-2); }

/* ======================= 空状态 ======================= */
.welcome { max-width: 640px; margin: 8vh auto 0; padding: 0 24px; text-align: center; }
.welcome .logo {
  width: 46px; height: 46px; border-radius: 12px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-fg);
  font-size: 15px; font-weight: 700; letter-spacing: -.02em;
}
.welcome h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 8px; }
.welcome p { font-size: 14.5px; color: var(--muted); margin-bottom: 28px; line-height: 1.7; }
.guest-bar {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  flex-wrap: wrap; margin: 0 0 22px; padding: 10px 15px;
  font-size: 13px; color: var(--text-2);
  background: var(--bg-soft); border-radius: var(--r-md);
}
.guest-bar strong { color: var(--text); font-weight: 600; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; text-align: left; }
.quick {
  padding: 13px 15px; font-size: 13.5px; color: var(--text-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card); transition: background .13s, color .13s, border-color .13s;
}
.quick:hover { background: var(--bg-hover); color: var(--text); border-color: var(--faint); }

/* ======================= 弹窗 ======================= */
.modal-layer {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45);
}
.modal {
  width: 460px; max-width: calc(100vw - 40px);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-lg);
}
.auth-modal { width: 400px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.6; }

.auth-tabs { display: flex; gap: 2px; background: var(--bg-soft); padding: 3px; border-radius: var(--r-sm); margin-bottom: 20px; }
.auth-tabs button {
  flex: 1; padding: 8px 0; font-size: 13.5px; font-weight: 500;
  color: var(--muted); border-radius: 6px; transition: background .13s, color .13s;
}
.auth-tabs button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.07); }

#authForm label { display: block; margin-bottom: 15px; }
#authForm span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
#authForm input {
  width: 100%; padding: 10px 13px; font-size: 14px; font-family: inherit;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--text); outline: none;
  transition: border-color .13s;
}
#authForm input:focus { border-color: var(--faint); }
#authForm input::placeholder { color: var(--faint); }

button.primary {
  width: 100%; padding: 12px; margin-top: 6px;
  font-size: 14.5px; font-weight: 500;
  background: var(--accent); color: var(--accent-fg);
  border-radius: var(--r-sm); transition: background .13s;
}
button.primary:hover { background: var(--accent-hover); }
button.primary:disabled { opacity: .4; cursor: not-allowed; }

.auth-msg { font-size: 13px; color: var(--red); min-height: 19px; margin-top: 11px; text-align: center; }
.auth-msg.ok { color: var(--green, #2f7d4f); }

.code-field { display: flex; gap: 8px; }
.code-field input { flex: 1; width: auto; min-width: 0; }
.code-btn {
  flex: none; padding: 0 14px; font-size: 13px; font-weight: 500;
  font-family: inherit; color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: background .13s, border-color .13s, color .13s;
  white-space: nowrap; cursor: pointer;
}
.code-btn:hover:not(:disabled) { border-color: var(--faint); }
.code-btn:disabled { color: var(--muted); cursor: not-allowed; }
.auth-foot { font-size: 12px; color: var(--muted); text-align: center; margin-top: 16px; line-height: 1.6; }

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan {
  position: relative; padding: 15px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg); transition: border-color .13s, background .13s;
}
.plan:hover { border-color: var(--faint); background: var(--bg-soft); }
.plan .ptag {
  position: absolute; top: -9px; right: 11px;
  font-size: 10.5px; padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-fg); font-weight: 500;
}
.plan .t { font-size: 13.5px; font-weight: 600; }
.plan .p { font-size: 21px; font-weight: 600; margin: 7px 0 2px; letter-spacing: -.02em; }
.plan .p small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.plan .d { font-size: 12px; color: var(--muted); }
.modal-note { font-size: 13px; color: var(--green); text-align: center; margin-top: 14px; min-height: 19px; }

/* ======================= Toast ======================= */
.toast-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  padding: 10px 18px; font-size: 13.5px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-fg);
  box-shadow: var(--shadow-lg); animation: toastIn .18s ease;
}
.toast.err { background: var(--red); color: #fff; }
.toast.ok { background: var(--green); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ======================= 自适应 ======================= */
@media (max-width: 1240px) {
  .app { grid-template-columns: 52px 264px minmax(0, 1fr); }
  .app .inspector { display: none; }
  .app.show-panel { grid-template-columns: 52px 264px minmax(0, 1fr) 330px; }
  .app.show-panel .inspector { display: flex; }
}
@media (max-width: 880px) {
  .app { grid-template-columns: 52px minmax(0, 1fr); }
  .app .sidebar { display: none; }
  .app.show-side { grid-template-columns: 52px 264px minmax(0, 1fr); }
  .app.show-side .sidebar { display: flex; }
}
