/* ===== ZPH 简历中心 · 样式 ===== */
:root {
  --primary: #4f46e5;
  --primary-d: #4338ca;
  --primary-l: #eef2ff;
  --accent: #0ea5e9;
  --ink: #0f172a;
  --text: #334155;
  --muted: #94a3b8;
  --line: #e6e9f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .4em; line-height: 1.3; }
p { margin: 0 0 .6em; }
em.req { color: var(--danger); font-style: normal; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.mt-6 { margin-top: 20px; }
.mt-8 { margin-top: 32px; }

/* ===== 布局 ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: 0 0 248px;
  background: #0b1220;
  color: #cbd5e1;
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.logo {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .5px;
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 40px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 15px; }
.brand-text small { color: #64748b; font-size: 11px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; color: #cbd5e1;
  font-size: 14.5px; transition: .15s;
}
.nav a .ico { font-size: 16px; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff; box-shadow: 0 6px 18px rgba(79,70,229,.4); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.side-foot .ext { color: #64748b; font-size: 12.5px; }
.side-foot .ext:hover { color: #cbd5e1; }

/* 侧栏广告位 */
.side-ad { text-align: center; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.view { padding: 32px 40px; max-width: 1240px; width: 100%; margin: 0 auto; flex: 1 1 auto; }
.foot { padding: 20px 40px; color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; }

/* ===== 组件 ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: #cbd5e1; width: fit-content;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge.ok::before { background: #22c55e; }
.badge.warn::before { background: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s;
  font-family: inherit; background: #fff; color: var(--text);
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff; box-shadow: 0 8px 20px rgba(79,70,229,.28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(79,70,229,.38); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none; }
.card .btn-ghost.btn-block { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #cbd5e1; }
.card .btn-ghost.btn-block:hover { color: #fff; }
.sidebar .btn-ghost.btn-block { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #cbd5e1; }
.sidebar .btn-ghost.btn-block:hover { color: #fff; border-color: var(--primary); background: rgba(79,70,229,.25); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-title { font-size: 16px; margin: 0; }
.card-body { padding: 20px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-side { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(360px, 1.05fr); gap: 20px; align-items: start; }

/* ===== 首页 ===== */
.hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 55%, #0ea5e9 120%);
  color: #fff; border-radius: 20px; padding: 46px 44px; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%); }
.hero h1 { color: #fff; font-size: 34px; margin: 14px 0 12px; }
.hero p { color: rgba(255,255,255,.86); font-size: 16px; max-width: 620px; }
.hero .pill { display: inline-block; background: rgba(255,255,255,.16); color: #fff; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.hero-actions .btn-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.hero-actions .btn-ghost:hover { background: rgba(255,255,255,.22); color: #fff; }

.feature { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); transition: .18s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #dbe1f0; }
.feature h3 { margin: 14px 0 8px; }
.feature p { color: var(--text); font-size: 14px; }
.feature-link { color: var(--primary); font-weight: 600; font-size: 13.5px; }
.feature-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.feature-icon.big { width: 72px; height: 72px; font-size: 34px; margin: 0 auto 14px; }
.feature-icon.lv1 { background: #eef2ff; }
.feature-icon.lv2 { background: #ecfeff; }
.feature-icon.lv3 { background: #fdf2f8; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-no { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--primary-l); color: var(--primary); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step p { margin: 2px 0 0; font-size: 14px; color: var(--text); }

/* ===== 表单 ===== */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.input, .textarea, select.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: #fff; transition: .15s; outline: none;
}
.textarea { resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus, select.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-weight: 700; color: var(--ink); font-size: 13.5px; }
.repeat { display: flex; flex-direction: column; gap: 12px; }
.row-exp { position: relative; border: 1px dashed var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #fafbff; }
.row-remove { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: none; background: #fff; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.row-remove:hover { color: var(--danger); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ===== 结果 / 简历 ===== */
.result-card { position: sticky; top: 24px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 46px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--primary); font-size: 14px; padding: 40px 0; justify-content: center; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--primary-l); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.resume { color: var(--text); font-size: 14px; }
.resume-head { border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 18px; }
.resume-name { font-size: 24px; font-weight: 800; color: var(--ink); }
.resume-headline { color: var(--primary); font-weight: 600; margin-top: 2px; }
.resume-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.resume-section { margin-bottom: 18px; }
.resume-h { font-size: 15px; font-weight: 800; color: var(--ink); border-left: 4px solid var(--primary); padding-left: 8px; margin-bottom: 10px; }
.resume-item { margin-bottom: 12px; }
.resume-item-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.resume-item-top strong { color: var(--ink); }
.resume-item-top .period { color: var(--muted); font-size: 13px; }
.resume-bullets { margin: 6px 0 0; padding-left: 18px; }
.resume-bullets li { margin-bottom: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--primary-l); color: var(--primary-d); padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.tag.soft { background: #f1f5f9; color: var(--text); }

/* ===== 简历模板选择器 ===== */
.tpl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.tpl-bar-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.tpl-chip { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; transition: .15s; min-width: 76px; text-align: left; font: inherit; color: inherit; }
.tpl-chip:hover { border-color: var(--primary); transform: translateY(-1px); }
.tpl-chip b { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.tpl-chip small { font-size: 11px; color: var(--muted); margin-top: 1px; }
.tpl-chip.active { background: linear-gradient(135deg, var(--primary), var(--primary-d)); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.25); }
.tpl-chip.active b { color: #fff; }
.tpl-chip.active small { color: rgba(255,255,255,.85); }

/* ===== 模板：现代（modern） ===== */
.resume[data-resume-template="modern"] .resume-head { border-bottom: 1px solid var(--primary); padding-bottom: 18px; }
.resume[data-resume-template="modern"] .resume-name { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.resume[data-resume-template="modern"] .resume-h { border-left: none; padding: 0 0 6px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 2px; color: var(--primary-d); border-bottom: 1px solid var(--line); }
.resume[data-resume-template="modern"] .tag { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 4px; font-weight: 500; }
.resume[data-resume-template="modern"] .resume-bullets { padding-left: 0; list-style: none; }
.resume[data-resume-template="modern"] .resume-bullets li { padding-left: 18px; position: relative; }
.resume[data-resume-template="modern"] .resume-bullets li::before { content: '▸'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

/* ===== 模板：双栏（twocol） ===== */
.resume[data-resume-template="twocol"] { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.resume[data-resume-template="twocol"] .resume-main { min-width: 0; }
.resume[data-resume-template="twocol"] .resume-side { background: linear-gradient(180deg, #1e293b, #0f172a); color: #fff; padding: 22px 20px; border-radius: 12px; }
.resume[data-resume-template="twocol"] .resume-side .resume-head { border-bottom: 1px solid rgba(255,255,255,.2); padding-bottom: 14px; }
.resume[data-resume-template="twocol"] .resume-side .resume-name { color: #fff; font-size: 22px; }
.resume[data-resume-template="twocol"] .resume-side .resume-headline { color: #818cf8; }
.resume[data-resume-template="twocol"] .resume-side .resume-meta { color: rgba(255,255,255,.7); }
.resume[data-resume-template="twocol"] .resume-side .resume-h { color: #fff; border-left-color: #818cf8; }
.resume[data-resume-template="twocol"] .resume-side .tag { background: rgba(255,255,255,.12); color: #fff; }

/* ===== 模板：时间线（timeline） ===== */
.resume[data-resume-template="timeline"] .resume-h { border-left: none; padding: 0 0 6px; border-bottom: 2px solid var(--primary); margin-bottom: 18px; }
.resume[data-resume-template="timeline"] .resume-item { position: relative; padding-left: 28px; margin-bottom: 18px; }
.resume[data-resume-template="timeline"] .resume-item::before { content: ''; position: absolute; left: 6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-l); }
.resume[data-resume-template="timeline"] .resume-item::after { content: ''; position: absolute; left: 10px; top: 22px; bottom: -18px; width: 2px; background: var(--line); }
.resume[data-resume-template="timeline"] .resume-item:last-child::after { display: none; }

/* ===== 模板：极简（minimal） — ATS 友好 ===== */
.resume[data-resume-template="minimal"] .resume-head { border-bottom: 1px solid #000; padding-bottom: 10px; }
.resume[data-resume-template="minimal"] .resume-name { font-size: 22px; }
.resume[data-resume-template="minimal"] .resume-headline { color: #000; font-weight: 400; font-style: italic; }
.resume[data-resume-template="minimal"] .resume-meta { color: #555; }
.resume[data-resume-template="minimal"] .resume-h { border-left: none; padding: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: #000; border-bottom: 1px solid #ddd; }
.resume[data-resume-template="minimal"] .tag { background: transparent; color: #000; padding: 0 8px 0 0; border-radius: 0; font-weight: 500; }
.resume[data-resume-template="minimal"] .tag::after { content: ' ·'; color: #999; margin-left: 2px; }
.resume[data-resume-template="minimal"] .tag:last-child::after { content: ''; }

/* ===== 评分 / 维度 ===== */
.score-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.score-ring { position: relative; width: 132px; height: 132px; flex: 0 0 132px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .score-value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .score-value b { font-size: 34px; color: var(--ink); line-height: 1; }
.score-ring .score-value small { color: var(--muted); font-size: 12px; }
.score-meta { flex: 1 1 200px; min-width: 180px; }
.score-meta .grade { display: inline-block; padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--primary-l); color: var(--primary-d); margin-bottom: 8px; }

.dims { display: flex; flex-direction: column; gap: 14px; }
.dim-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.dim-top b { color: var(--ink); }
.bar { height: 8px; background: #eef1f7; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .6s ease; }
.dim-comment { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ===== 问题 / 建议 ===== */
.issue { border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.issue.high { border-left-color: var(--danger); }
.issue.medium { border-left-color: var(--warn); }
.issue.low { border-left-color: var(--ok); }
.issue-title { font-weight: 700; color: var(--ink); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.sev { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.sev.high { background: #fee2e2; color: #b91c1c; }
.sev.medium { background: #fef3c7; color: #b45309; }
.sev.low { background: #dcfce7; color: #15803d; }
.issue-detail { font-size: 13px; color: var(--text); margin-top: 4px; }
ul.plain { margin: 0; padding-left: 20px; }
ul.plain li { margin-bottom: 6px; }

.rewrite { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.rw-line { font-size: 13.5px; margin-bottom: 6px; }
.rw-before { color: #b91c1c; }
.rw-after { color: #15803d; }
.rw-arrow { color: var(--muted); font-weight: 700; }
.rw-reason { font-size: 12.5px; color: var(--muted); }

.kw-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kw { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.kw.ok { background: #dcfce7; color: #15803d; }
.kw.miss { background: #fee2e2; color: #b91c1c; }

.block-title { font-size: 14px; font-weight: 800; color: var(--ink); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.block-title::before { content: ''; width: 4px; height: 15px; border-radius: 2px; background: var(--primary); }

/* ===== 测评 ===== */
.center-card .center { text-align: center; padding: 40px 20px; }
.center-card h2 { margin-bottom: 8px; }
.progress { height: 6px; background: #eef1f7; border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s; }
.q { padding: 16px 0; border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: none; }
.q-title { font-size: 14.5px; color: var(--ink); margin-bottom: 10px; display: flex; gap: 8px; }
.q-title .num { color: var(--muted); font-weight: 700; flex: 0 0 26px; }
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.likert-opt { position: relative; }
.likert-opt input { position: absolute; opacity: 0; }
.likert-opt label { display: block; text-align: center; padding: 9px 4px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; cursor: pointer; transition: .12s; color: var(--muted); }
.likert-opt label:hover { border-color: var(--primary); color: var(--primary); }
.likert-opt input:checked + label { background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff; border-color: var(--primary); font-weight: 600; }

.type-card { background: linear-gradient(135deg, #1e1b4b, #4f46e5); color: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-lg); }
.type-card .type-code { font-size: 40px; font-weight: 800; letter-spacing: 2px; }
.type-card .type-name { font-size: 20px; font-weight: 700; }
.type-card .type-tag { color: rgba(255,255,255,.86); margin-top: 6px; }
.radar-wrap { display: flex; justify-content: center; padding: 10px 0; }
.radar-wrap svg { max-width: 100%; height: auto; }
.career { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.career:last-child { border-bottom: none; }
.career-fit { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--primary-d); background: var(--primary-l); font-size: 14px; }
.career-name { font-weight: 700; color: var(--ink); }
.career-reason { font-size: 13px; color: var(--muted); }

/* ===== 面试模拟 ===== */
.iv-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.iv-bar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.iv-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.iv-info { min-width: 0; }
.iv-info b { display: block; color: var(--ink); font-size: 14.5px; }
.iv-info small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.iv-bar-right { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.iv-bar-right b { color: var(--primary); font-size: 15px; }

.iv-chat-body { display: flex; flex-direction: column; height: 68vh; min-height: 480px; }
.chat-stream { flex: 1; overflow-y: auto; padding: 12px 4px; display: flex; flex-direction: column; gap: 14px; }
.bubble { display: flex; gap: 10px; max-width: 88%; align-items: flex-start; }
.bubble.ai { align-self: flex-start; }
.bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.bubble-avatar { width: 32px; height: 32px; border-radius: 50%; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.bubble.user .bubble-avatar { background: var(--primary-l); }
.bubble-body { padding: 10px 14px; border-radius: 12px; line-height: 1.65; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.bubble.ai .bubble-body { background: #f1f5f9; color: var(--text); border-top-left-radius: 4px; }
.bubble.user .bubble-body { background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff; border-top-right-radius: 4px; }

.bubble.typing .bubble-body { display: flex; gap: 4px; padding: 14px 16px; }
.bubble.typing .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.bubble.typing .dot:nth-child(2) { animation-delay: .2s; }
.bubble.typing .dot:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.chat-input-wrap { display: flex; gap: 8px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 12px; }
.chat-input { flex: 1; min-height: 44px; max-height: 180px; resize: none; }
.chat-send { flex-shrink: 0; height: 44px; padding: 0 20px; }

/* 面试报告：逐题点评 */
.qa-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.qa-q { font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.qa-q b { color: var(--primary); }
.qa-score { margin-left: auto; background: var(--primary-l); color: var(--primary-d); padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.qa-a { font-size: 13px; color: var(--muted); margin-bottom: 6px; border-left: 2px solid var(--line); padding: 4px 0 4px 10px; }
.qa-a b { color: var(--ink); margin-right: 4px; }
.qa-fb { font-size: 13px; color: var(--text); background: #f8fafc; padding: 8px 10px; border-radius: 6px; }

.grade.excellent { background: linear-gradient(135deg, #4f46e5, #7c3aed) !important; color: #fff !important; }
.grade.good { background: var(--primary-l) !important; color: var(--primary-d) !important; }
.grade.pass { background: #fef3c7 !important; color: #b45309 !important; }
.grade.warn { background: #fee2e2 !important; color: #b91c1c !important; }

/* ===== 求职信生成器 ===== */
.check-row { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: .15s; }
.check:hover { border-color: var(--primary); }
.check input { accent-color: var(--primary); }
.check b { font-weight: 700; color: var(--ink); }
.check small { color: var(--muted); font-size: 12px; }

.cover-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: #fff; }
.cover-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tone-badge { padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.tone-formal  { background: #e0e7ff; color: #3730a3; }
.tone-warm    { background: #fef3c7; color: #b45309; }
.tone-concise { background: #dcfce7; color: #15803d; }
.cover-subject { font-size: 13.5px; color: var(--ink); font-weight: 600; flex: 1; min-width: 0; word-break: break-all; }
.cover-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cover-body { width: 100%; font-family: inherit; font-size: 14px; line-height: 1.75; resize: vertical; min-height: 200px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fafbfc; }
.cover-body:focus { background: #fff; border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.cover-meta { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: right; }
.cover-meta b { color: var(--text); }
.cover-tips { background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fde68a; border-radius: 12px; padding: 14px 16px; margin-top: 16px; }

.cover-mode-note { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }

/* ===== 弹窗 / Toast ===== */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-card { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px; max-height: 62vh; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow-lg); z-index: 80; }
.toast.err { background: #b91c1c; }

/* ===== 打印 ===== */
@media print {
  .sidebar, .topbar, .foot, .head-actions, .hero-actions, .no-print { display: none !important; }
  body { background: #fff; }
  .app { display: block; }
  .view { padding: 0; max-width: none; }
  .grid-side { display: block; }
  .card { border: none; box-shadow: none; }
  #buildForm { display: none; }
  .grid-side > .card:not(.result-card) { display: none; }
  .result-card { position: static; }
  .result-card .card-head { display: none; }
  .card, .type-card, .resume-item { break-inside: avoid; }
  /* 双栏模板打印降级：浅底深字，省墨且易读 */
  .resume[data-resume-template="twocol"] { grid-template-columns: 35% 1fr; gap: 16px; }
  .resume[data-resume-template="twocol"] .resume-side { background: #f8fafc !important; color: #000 !important; border: 1px solid #e2e8f0; }
  .resume[data-resume-template="twocol"] .resume-side .resume-name,
  .resume[data-resume-template="twocol"] .resume-side .resume-h,
  .resume[data-resume-template="twocol"] .resume-side .resume-headline { color: #000 !important; }
  .resume[data-resume-template="twocol"] .resume-side .resume-meta { color: #555 !important; }
  .resume[data-resume-template="twocol"] .resume-side .tag { background: transparent !important; color: #000 !important; border: 1px solid #ccc; }
  /* 极简模板打印：去掉分隔点 */
  .resume[data-resume-template="minimal"] .tag::after { content: ''; }
}

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .grid-side { grid-template-columns: 1fr; }
  .result-card { position: static; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: column; padding: 12px; }
  .brand { padding: 4px 6px 10px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .nav a { white-space: nowrap; padding: 8px 12px; font-size: 13.5px; }
  .side-foot { margin-top: 8px; flex-direction: row; align-items: center; flex-wrap: wrap; padding-top: 8px; }
  .side-foot .btn { width: auto; }
  .side-foot .ext { margin-left: auto; }
  .view { padding: 20px 16px; }
  .foot { padding: 16px; flex-direction: column; }
  .hero { padding: 30px 22px; }
  .hero h1 { font-size: 25px; }
  .grid-2 { grid-template-columns: 1fr; }
  .likert { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .likert-opt label { font-size: 11px; padding: 8px 2px; }
}
