:root {
  --bg: #f2f5fa;
  --card: #ffffff;
  --line: #e3e8f0;
  --ink: #1c2433;
  --muted: #64748b;
  --brand: #1f5fe0;
  --brand-2: #1647a8;
  --brand-soft: #e9f0ff;
  --ok: #178a4e;
  --ok-soft: #e5f6ec;
  --warn: #b7791f;
  --warn-soft: #fdf3dd;
  --bad: #c2413a;
  --bad-soft: #fdeaea;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 380px at 85% -10%, #e4edff 0%, transparent 60%),
    radial-gradient(700px 320px at -5% 5%, #eef4ff 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
}
button { font: inherit; cursor: pointer; }
textarea, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.grow { flex: 1; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 26px; background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2d78ff, #1647a8); color: #fff; font-weight: 800;
  letter-spacing: .5px; box-shadow: 0 4px 10px rgba(31,95,224,.3);
}
.brandtext b { font-size: 19px; letter-spacing: .2px; display: block; line-height: 1.1; }
.brandtext em { font-style: normal; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 8px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 22px 60px; }

.steps { display: flex; gap: 8px; margin: 8px 0 20px; overflow-x: auto; }
.step {
  display: flex; align-items: center; gap: 9px; border: 1px solid var(--line);
  background: #fff; border-radius: 999px; padding: 7px 16px 7px 8px; color: var(--muted);
  white-space: nowrap; transition: all .15s;
}
.step i {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #edf1f7; font-style: normal; font-weight: 700; font-size: 13px;
}
.step.active { border-color: var(--brand); color: var(--brand-2); background: var(--brand-soft); }
.step.active i { background: var(--brand); color: #fff; }
.step.done i { background: var(--ok); color: #fff; }
.step.done { color: var(--ok); border-color: #b9e4cb; }

.step-view { display: none; }
.step-view.active { display: block; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.step-head { margin: 8px 0 16px; }
.step-head h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.2px; }
.step-head p { margin: 0; color: var(--muted); max-width: 820px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px;
}
.panel-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-bar label { font-weight: 700; }
.char-count { color: var(--muted); font-size: 12px; }
.seg { display: flex; gap: 4px; background: #e9edf4; padding: 4px; border-radius: 11px; margin: 0 0 12px; width: max-content; }
.seg-btn { border: none; background: transparent; color: var(--muted); padding: 6px 16px; border-radius: 8px; font-weight: 600; }
.seg-btn.active { background: #fff; color: var(--brand-2); box-shadow: 0 1px 4px rgba(16,24,40,.12); }
.url-row { display: flex; gap: 10px; }
.url-input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; background: #fbfcfe; outline: none; }
.url-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,95,224,.13); background: #fff; }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 2px; }
#urlStatus .ok-text { color: var(--ok); font-size: 13px; }
#urlStatus .err-text { color: var(--bad); font-size: 13px; }
.credit-pill {
  display: inline-flex; align-items: center; gap: 6px; background: var(--ok-soft);
  border: 1px solid #bfe4cd; color: var(--ok); border-radius: 999px;
  padding: 4px 11px; font-size: 12.5px; font-weight: 700; margin-left: 6px;
}
.ent-breakdown {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; font-size: 12.5px;
}
.ent-breakdown .ent-head,
.ent-breakdown .ent-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px;
  align-items: center; padding: 7px 10px;
}
.ent-breakdown .ent-head {
  background: #f2f5f9; color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .3px;
}
.ent-breakdown .ent-row { border-top: 1px solid var(--line); }
.ent-breakdown .ent-row b { color: var(--ok); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.plan-card { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; text-align: left; background: #fff; transition: .15s; display: flex; flex-direction: column; gap: 5px; }
.plan-card:hover { border-color: var(--brand); }
.plan-card .price { font-size: 26px; font-weight: 800; color: var(--brand-2); }
.plan-card .currency { color: var(--muted); font-size: 13px; }
.plan-card .plan-meta { color: var(--muted); font-size: 12.5px; }
.plan-card .buy-btn { margin-top: 8px; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.auth-tabs button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 0; font-weight: 600; color: var(--muted); }
.auth-tabs button.active { border-color: var(--brand); color: var(--brand-2); background: var(--brand-soft); }
.plans-compare { background: var(--brand-soft); border: 1px solid #c9dafb; color: var(--brand-2); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 12px; }
.check-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.check-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; }
.check-row .dot { flex: 0 0 auto; margin-top: 2px; }
.ats-score-big { font-size: 30px; font-weight: 800; color: var(--brand-2); }
.details-summary { cursor: pointer; color: var(--brand); font-size: 12.5px; }
.parse-pre { white-space: pre-wrap; font: 11.5px/1.5 ui-monospace, Consolas, monospace; background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 220px; overflow: auto; }
.big-input {
  width: 100%; min-height: 260px; resize: vertical; border: 1px solid var(--line);
  border-radius: 10px; padding: 14px; background: #fbfcfe; outline: none;
  font-size: 14px; line-height: 1.6; transition: border .15s, box-shadow .15s;
}
.big-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,95,224,.13); background: #fff; }
.row-buttons { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.btn {
  border: 1px solid #c9d4e4; background: #fff; color: var(--ink); border-radius: 10px;
  padding: 8px 15px; transition: all .14s; font-weight: 600;
}
.btn:hover { border-color: var(--brand); color: var(--brand-2); background: var(--brand-soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; background: #9db8ee; border-color: #9db8ee; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.big { padding: 11px 24px; font-size: 15px; border-radius: 12px; }
.btn.icon-btn { display: inline-flex; align-items: center; gap: 6px; }

.pill {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px;
  background: var(--brand-soft); color: var(--brand-2); margin: 0 2px; font-weight: 600;
}
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.gray { background: #eef1f6; color: var(--muted); }

.source-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 4px 0 18px; }
.source-card {
  border: 1.5px dashed #c9d4e4; background: #fff; border-radius: var(--radius);
  padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; text-align: left;
  transition: all .16s; align-items: flex-start;
}
.source-card:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }
.sc-ico { font-size: 30px; }
.source-card b { font-size: 16px; }
.source-card small { color: var(--muted); }

.source-pane { margin-bottom: 18px; }
.dropzone {
  border: 2px dashed #b9c8de; border-radius: var(--radius); background: #f8fafd;
  padding: 44px 20px; text-align: center; transition: all .15s;
}
.dropzone.drag, .dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dz-inner { display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--muted); }
.dz-ico { font-size: 36px; }
.dz-inner b { color: var(--ink); font-size: 16px; }

.notice {
  background: var(--brand-soft); border: 1px solid #c9dafb; color: var(--brand-2);
  border-radius: 10px; padding: 11px 14px; margin: 0 0 14px;
}
.notice.warn { background: var(--warn-soft); border-color: #efdcb0; color: var(--warn); }

.editor-toolbar, .paper-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 4px 0 12px; flex-wrap: wrap;
}
.editor-toolbar small { color: var(--muted); display: block; }
.editor-toolbar > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.personal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea, .mini-input {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  background: #fbfcfe; outline: none; transition: border .13s;
}
.field input:focus, .field select:focus, .field textarea:focus, .mini-input:focus {
  border-color: var(--brand); background: #fff;
}
.field.wide { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.sec-card { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 14px; overflow: hidden; background: #fff; }
.sec-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #f6f9fe; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.sec-head .sec-title-input { font-weight: 700; border: 1px solid transparent; border-radius: 7px; padding: 3px 8px; width: auto; min-width: 140px; background: transparent; }
.sec-head .sec-title-input:hover, .sec-head .sec-title-input:focus { border-color: var(--line); background: #fff; }
.sec-head .kind-badge { font-size: 11px; color: var(--brand-2); background: var(--brand-soft); border-radius: 999px; padding: 1px 8px; }
.sec-body { padding: 12px 14px; }
.entry-row { border: 1px solid #edf0f5; border-radius: 10px; padding: 10px; margin-bottom: 10px; background: #fcfdff; }
.entry-row.grid-3 { display: grid; grid-template-columns: 1fr 1fr 140px; gap: 8px; align-items: end; }
.entry-row.grid-3 .mini-input { width: 100%; }
.entry-row .bullets-label { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.bullets-area {
  width: 100%; min-height: 70px; resize: vertical; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; line-height: 1.55; background: #fff;
}
.chips-view { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: #eef3fb; border: 1px solid #d7e1f0; color: #33445e; border-radius: 999px;
  padding: 3px 11px; font-size: 13px;
}
.chip.covered { background: var(--ok-soft); border-color: #bfe4cd; color: var(--ok); }
.chip.missing { background: var(--warn-soft); border-color: #ecd7a5; color: var(--warn); }
.chip.muted { opacity: .55; }

.icon-btn-sm {
  border: none; background: transparent; color: var(--muted); width: 26px; height: 26px;
  border-radius: 7px; font-size: 15px;
}
.icon-btn-sm:hover { background: #e8edf6; color: var(--bad); }

.mode-cards { display: flex; flex-direction: column; gap: 10px; }
.mode-card {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: all .14s;
}
.mode-card input { display: none; }
.mode-card b { font-size: 15px; }
.mode-card small { color: var(--muted); }
.mode-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(31,95,224,.1); }
.ai-hint { background: var(--warn-soft); border: 1px solid #efdcb0; border-radius: 10px; padding: 9px 12px; margin-top: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--warn); }

.gen-panel { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gen-summary { color: var(--muted); flex: 1; min-width: 240px; }
.gen-summary b { color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } .result-grid { grid-template-columns: 1fr !important; } }

.result-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; align-items: stretch; }
.scrollable { max-height: 78vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #eceff4; padding: 22px; }
#resultLeft, #resultRight { min-width: 0; }
#resultLeft { display: flex; flex-direction: column; }
#resultLeft .scrollable { flex: 1 1 auto; max-height: none; min-height: 420px; }
#resultRight { position: sticky; top: 86px; align-self: start; display: flex; flex-direction: column; gap: 14px; }

.paper {
  background: #fff; box-shadow: 0 2px 10px rgba(20, 30, 60, .14); border-radius: 4px;
  padding: 34px 38px; color: #222;
  font-family: Calibri, "Segoe UI", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  max-width: 820px; margin: 0 auto;
}
.paper .p-name { font-size: 26px; font-weight: 700; color: #162b4a; margin: 0 0 2px; }
.paper .p-title { font-size: 15px; font-weight: 600; color: #555; margin: 0 0 4px; }
.paper .p-contact { font-size: 12px; color: #555; margin-bottom: 10px; }
.paper .p-summary { font-size: 13px; color: #333; margin: 8px 0 2px; }
.paper .sec {
  margin-top: 13px; page-break-inside: avoid;
}
.paper .sec h3 {
  font-size: 13.5px; text-transform: uppercase; letter-spacing: .7px; color: #162b4a;
  border-bottom: 1.2px solid #162b4a; padding-bottom: 2px; margin: 0 0 7px;
}
.paper .blk { margin: 0 0 8px; }
.paper .blk-top { display: flex; justify-content: space-between; gap: 12px; }
.paper .blk-role { font-weight: 700; font-size: 13.5px; }
.paper .blk-org { font-style: italic; color: #555; font-size: 12.5px; }
.paper .blk-date { font-size: 12px; color: #555; white-space: nowrap; }
.paper ul { margin: 3px 0; padding-left: 18px; }
.paper li { font-size: 12.8px; margin: 1.5px 0; }
.paper .skill-flow { font-size: 13px; line-height: 1.75; margin: 0; }
.paper .ev-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0 5px 1.5px 0; }
.ev-ok { background: #178a4e; }
.ev-check { background: #d97706; }
.ev-review { background: #dc2626; }

.audit-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.audit-card h4 { margin: 0 0 9px; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.meter { background: #edf0f5; height: 10px; border-radius: 999px; overflow: hidden; }
.meter > div { background: linear-gradient(90deg, #2d78ff, #22c55e); height: 100%; transition: width .4s; }
.stat-line { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kw-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.kw-wrap .kw { font-size: 12px; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line); color: #33445e; }
.kw.covered { background: var(--ok-soft); border-color: #bfe4cd; color: var(--ok); }
.kw.missing { background: var(--warn-soft); border-color: #ecd7a5; color: var(--warn); }
.kw.gap { background: var(--bad-soft); border-color: #efc4c1; color: var(--bad); }
.kw.more { background: transparent; border-style: dashed; cursor: pointer; font: inherit; line-height: 1.5; }
.kw.more:hover { border-color: var(--primary); color: var(--primary); }

.ev-list { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.ev-item { border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 8px; padding: 7px 9px; background: #fcfdff; }
.ev-item.status-check { border-left-color: #d97706; }
.ev-item.status-review { border-left-color: #dc2626; }
.ev-item .t { font-size: 12.5px; }
.ev-item .n { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ev-item .n b { color: inherit; }
.removed-list { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; max-height: 180px; overflow: auto; margin-top: 8px; }
.removed-list div { border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
.result-banner { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; box-shadow: var(--shadow); }
.result-banner .big { font-size: 17px; font-weight: 700; }

.export-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 10px 26px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
#exportNote { color: var(--muted); font-size: 12.5px; max-width: 430px; }

.footnote { text-align: center; color: #94a3b8; font-size: 12px; padding: 8px 16px 58px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 80;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 88vh;
  overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: rise .2s;
}
.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; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.kbd { background: #eef1f6; border-radius: 5px; padding: 0 6px; font: 12px ui-monospace, monospace; }

#toastRoot { position: fixed; top: 74px; right: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: #1c2433; color: #fff; border-radius: 10px; padding: 10px 15px; max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: slidein .2s; font-size: 13px;
}
.toast.ok { background: #116d3f; }
.toast.err { background: #a32f29; }
.toast.warn { background: #8a5a10; }
@keyframes slidein { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

#spinner {
  position: fixed; inset: 0; z-index: 150; background: rgba(244, 247, 252, .72);
  backdrop-filter: blur(2px); display: grid; place-items: center;
}
.spin { text-align: center; color: var(--muted); }
.ring {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  border: 5px solid #d9e3f5; border-top-color: var(--brand); animation: rot 0.9s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

details.help { margin-top: 10px; }
details.help summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table td, .mini-table th { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }

@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  #cvPaperWrap, #cvPaperWrap * { visibility: visible; }
  #cvPaperWrap { position: absolute; left: 0; top: 0; width: 100%; max-height: none; border: none; padding: 0; background: #fff; }
  .paper { box-shadow: none; max-width: none; padding: 0; }
  .paper .blk { page-break-inside: avoid; }
  .topbar, .steps, .footnote, .export-bar, .audit-card, .paper-toolbar, #resultRight { display: none !important; }
}
