:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #171717;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #111827;
  --accent-weak: #eef2ff;
  --danger: #b42318;
  --shadow: 0 8px 30px rgba(0,0,0,.08);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

.topbar {
  height: 58px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50;
}
.brand { font-weight: 750; letter-spacing: -.02em; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.save-indicator { font-size: 12px; color: var(--muted); min-width: 58px; text-align: right; }

.btn {
  border: 1px solid var(--border); background: #fff; color: #111827; border-radius: 9px;
  padding: 8px 11px; line-height: 1; transition: .15s ease; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: #c7cdd6; background: #fafafa; }
.btn.primary { background: #111827; border-color: #111827; color: #fff; }
.btn.primary:hover { background: #000; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 6px 8px; font-size: 12px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.icon { width: 31px; height: 31px; padding: 0; justify-content: center; }

.dashboard { max-width: 1100px; margin: 0 auto; padding: 42px 24px 80px; }
.dashboard-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.dashboard h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.03em; }
.dashboard p { margin: 0; color: var(--muted); }
.resume-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.resume-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.03); min-height: 160px; display: flex; flex-direction: column; justify-content: space-between;
}
.resume-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); transition: .18s ease; }
.resume-card h3 { margin: 0; font-size: 17px; }
.resume-card .meta { color: var(--muted); font-size: 12px; margin-top: 8px; }
.resume-card .actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 24px; }
.empty-state { grid-column: 1 / -1; background: #fff; border: 1px dashed #cfd4dc; border-radius: 14px; padding: 50px; text-align: center; color: var(--muted); }

.editor-shell {
  --editor-width: 46vw;
  height: calc(100vh - 58px); display: grid;
  grid-template-columns: minmax(360px, var(--editor-width)) 7px minmax(0, 1fr); overflow: hidden;
}
.editor-panel { background: #fff; border-right: 1px solid var(--border); overflow: auto; }
.editor-inner { padding: 16px 16px 80px; }
.editor-splitter { position: relative; cursor: col-resize; background: #eef0f3; outline: none; touch-action: none; }
.editor-splitter::after { content: ""; position: absolute; top: 50%; left: 2px; width: 3px; height: 46px; border-radius: 999px; background: #c7ccd4; transform: translateY(-50%); transition: .15s ease; }
.editor-splitter:hover::after, .editor-splitter:focus-visible::after, .editor-shell.is-resizing .editor-splitter::after { background: #667085; height: 64px; }
.editor-shell.is-resizing, .editor-shell.is-resizing * { cursor: col-resize !important; user-select: none !important; }
.preview-panel { position: relative; overflow: auto; padding: 18px 10px 80px; min-width: 0; }
.preview-toolbar {
  position: sticky; top: -18px; z-index: 30; max-width: 1100px; min-height: 46px; margin: 0 auto 12px;
  padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  color: var(--muted); font-size: 12px; background: rgba(244,245,247,.94); border-bottom: 1px solid rgba(215,219,226,.85); backdrop-filter: blur(10px);
}
.preview-toolbar-status, .preview-toolbar-actions, .zoom-controls { display: flex; align-items: center; gap: 6px; }
.preview-toolbar-status { white-space: nowrap; }
.preview-toolbar-status span + span::before { content: "·"; margin-right: 6px; color: #a3a8b0; }
.preview-toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
.preview-tool {
  min-height: 28px; border: 1px solid #d8dce3; border-radius: 7px; padding: 5px 8px;
  background: rgba(255,255,255,.94); color: #344054; font-size: 11px; line-height: 1; cursor: pointer;
}
.preview-tool:hover { border-color: #aeb4be; background: #fff; }
.preview-tool.active { border-color: #111827; background: #111827; color: #fff; }
.preview-tool.icon { width: 28px; padding: 0; justify-content: center; font-size: 17px; }
.outline-wrap { position: relative; }
.preview-outline {
  position: absolute; top: calc(100% + 8px); right: 0; width: 230px; max-height: min(420px, calc(100vh - 150px)); overflow: auto;
  padding: 7px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 16px 44px rgba(17,24,39,.18);
}
.outline-item { width: 100%; border: 0; border-radius: 7px; padding: 8px 9px; display: flex; align-items: center; gap: 8px; background: transparent; color: #344054; text-align: left; font-size: 12px; }
.outline-item:hover, .outline-item.active { background: #f2f4f7; color: #111827; }
.outline-index { flex: 0 0 20px; color: #98a2b3; font-size: 10px; text-align: right; }
.preview-panel:fullscreen { padding: 18px 18px 80px; background: var(--bg); }
.preview-panel:fullscreen .preview-toolbar { max-width: 1280px; }
.preview-panel.is-fullscreen-fallback { position: fixed; inset: 0; z-index: 200; padding: 18px 18px 80px; background: var(--bg); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; background: #f3f4f6; border-radius: 10px; margin-bottom: 14px; position: sticky; top: 0; z-index: 20; }
.tab { border: 0; border-radius: 8px; padding: 9px; background: transparent; color: var(--muted); }
.tab.active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.panel-card { border: 1px solid var(--border); border-radius: 11px; margin-bottom: 12px; background: #fff; overflow: hidden; }
.panel-card-head { padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.panel-card-head h3 { margin: 0; font-size: 14px; }
.panel-card-body { padding: 12px 13px; }
.muted { color: var(--muted); }
.section-row { display: flex; align-items: center; gap: 8px; }
.drag-handle { cursor: grab; color: #9ca3af; user-select: none; font-size: 16px; display: inline-flex; padding: 3px 4px; border-radius: 5px; touch-action: none; }
.drag-handle:hover { color: #344054; background: #f2f4f7; }
.drag-handle:active { cursor: grabbing; }
.dragging { opacity: .45; }

.field { display: grid; gap: 5px; margin-bottom: 10px; align-content: start; }
.panel-card-body > .field:last-child, .setting-group > .field:last-child, .sub-setting > .field:last-child { margin-bottom: 0; }
.field label { font-size: 11px; font-weight: 650; color: #5f6672; letter-spacing: .01em; }
.input, .textarea, .select {
  width: 100%; border: 1px solid #d8dce3; border-radius: 8px; padding: 8px 9px; background: #fff; color: #111827; outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: #7b8492; box-shadow: 0 0 0 2px rgba(17,24,39,.06); }
.textarea { min-height: 112px; resize: vertical; line-height: 1.45; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.four-col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.entry-editor { border: 1px solid #eaecf0; border-radius: 9px; padding: 10px; margin-bottom: 9px; background: #fcfcfd; }
.entry-editor:last-child { margin-bottom: 0; }
.entry-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }
.entry-title-mini { font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-setting { margin: 10px 0; padding: 10px; border: 1px solid #edf0f3; border-radius: 8px; background: #fafbfc; }
.sub-setting h4 { margin: 0 0 9px; font-size: 12px; }
.photo-editor { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: start; }
.photo-thumb { width: 76px; height: 96px; border: 1px dashed #cfd4dc; border-radius: 8px; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 11px; background: #f8fafc; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.custom-field-editor { border-top: 1px solid #edf0f3; padding-top: 10px; margin-top: 10px; }
.custom-field-row { display: grid; grid-template-columns: .65fr 1fr 1fr auto; gap: 7px; align-items: end; margin-bottom: 8px; }

details.panel-card > summary { list-style: none; }
details.panel-card > summary::-webkit-details-marker { display: none; }

.markdown-toolbar { display: flex; gap: 5px; margin-bottom: 5px; }
.md-tool { border: 1px solid #e1e4e8; background: #fff; border-radius: 6px; min-width: 28px; height: 26px; font-size: 11px; }

.setting-group { padding: 4px 0 12px; }
.setting-group + .setting-group { border-top: 1px solid var(--border); padding-top: 14px; }
.setting-group h4 { margin: 0 0 10px; font-size: 12px; }
.range-row { display: grid; grid-template-columns: 1fr 86px; gap: 8px; align-items: center; }
.palette-row { display: flex; gap: 9px; align-items: center; }
input[type="color"] { width: 48px; height: 34px; padding: 2px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; }
input[type="color"].palette-input { width: 100%; min-width: 88px; height: 40px; flex: 1; }
.palette-toggle { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 11px; color: var(--muted); cursor: pointer; }
.palette-toggle input { margin: 0; }
.help { font-size: 11px; color: var(--muted); line-height: 1.5; }

.paper-stage { position: relative; margin: 0 auto; transition: width .16s ease, height .16s ease; }
.paper-wrap { position: relative; width: max-content; transform-origin: top left; }
.resume-document {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
  padding: var(--margin-top) var(--margin-right) var(--margin-bottom) var(--margin-left);
  color: var(--resume-text);
  font-family: var(--resume-font);
  font-size: var(--body-size);
  line-height: var(--line-height);
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.page-break-marker {
  position: absolute; left: -18px; right: -18px; height: 1px; border-top: 1px dashed #d0d5dd; pointer-events: none;
}
.page-break-marker::after { content: attr(data-label); position: absolute; right: 0; top: -17px; font-size: 10px; color: #98a2b3; background: var(--bg); padding-left: 6px; }

.resume-header { margin-bottom: var(--section-gap); }
.resume-header.has-photo { display: flex; align-items: flex-start; gap: 14px; }
.resume-header-content { min-width: 0; flex: 1; }
.resume-header.photo-right .resume-photo { order: 2; }
.resume-header.photo-left .resume-photo { order: 0; }
.resume-header.photo-left .resume-header-content { order: 1; }
.resume-header.align-center .resume-header-content { text-align: center; }
.resume-header.align-right .resume-header-content { text-align: right; }
.resume-header.align-center .contact-line { justify-content: center; }
.resume-header.align-right .contact-line { justify-content: flex-end; }
.resume-photo { flex: 0 0 auto; object-fit: cover; object-position: center; border: 1px solid var(--resume-rule); }
.resume-name { font-size: var(--name-size); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.resume-target { font-size: calc(var(--entry-title-size) + 1px); font-weight: 600; margin-top: 4px; }
.contact-line { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; color: var(--resume-muted); font-size: var(--meta-size); }
.contact-line a { text-decoration: none; color: inherit; }
.contact-item::after { content: var(--contact-separator, "·"); margin-left: 10px; color: #a3a3a3; }
.contact-item:last-child::after { content: ""; margin: 0; }

.resume-section { margin-top: var(--section-gap); break-inside: auto; }
.resume-header.preview-focus, .resume-section.preview-focus, .resume-entry.preview-focus { animation: preview-focus 1.25s ease; }
@keyframes preview-focus {
  0%, 100% { outline: 0 solid transparent; background-color: transparent; }
  20% { outline: 3px solid rgba(59,130,246,.22); background-color: rgba(59,130,246,.08); }
}
.resume-section.manual-break { break-before: page; }
.section-title { font-size: var(--section-title-render-size, var(--section-title-size)); font-weight: var(--section-title-weight, 800); margin: 0 0 var(--title-gap); display: flex; align-items: center; gap: 8px; break-after: avoid; color: var(--resume-accent); }
.section-title span { min-width: 0; overflow-wrap: anywhere; }
.section-title::after { content: ""; flex: 1; border-top: 1px solid var(--resume-rule); }
.section-title.align-center::before { content: ""; flex: 1; border-top: 1px solid var(--resume-rule); }
.section-title.align-right::before { content: ""; flex: 1; border-top: 1px solid var(--resume-rule); }
.section-title.align-right::after { display: none; }
.section-title.no-rule::before, .section-title.no-rule::after { display: none; }
.section-title.no-rule.align-left { justify-content: flex-start; }
.section-title.no-rule.align-center { justify-content: center; }
.section-title.no-rule.align-right { justify-content: flex-end; }
.resume-entry { margin-bottom: var(--entry-gap); break-inside: avoid; page-break-inside: avoid; }
.resume-entry.manual-break { break-before: page; }
.resume-entry:last-child { margin-bottom: 0; }
.resume-section.with-entry-dividers .resume-entry + .resume-entry { border-top: 1px solid var(--resume-rule); padding-top: max(4px, calc(var(--entry-gap) * .65)); }
.entry-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .7fr) auto; gap: 12px; align-items: baseline; }
.entry-title { font-size: var(--entry-title-size); font-weight: 750; line-height: 1.25; }
.entry-title-center { min-width: 0; font-size: var(--entry-title-size); font-weight: 650; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.entry-meta-right { font-size: var(--meta-size); color: var(--resume-text); font-weight: 750; text-align: right; white-space: nowrap; }
.entry-subhead { margin-top: 1px; color: var(--resume-muted); font-size: var(--meta-size); }
.md { margin-top: 4px; font-size: var(--body-size); }
.md p { margin: 0 0 4px; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 3px 0 0; padding-left: 1.3em; }
.md li { margin: 0 0 var(--list-gap); }
.md li:last-child { margin-bottom: 0; }
.md strong { font-weight: 750; }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .92em; background: rgba(127,127,127,.09); border-radius: 3px; padding: 0 2px; }
.md a { color: var(--resume-accent); text-decoration: underline; text-underline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: #111827; color: #fff; padding: 9px 13px; border-radius: 9px; font-size: 12px; opacity: 0; pointer-events: none; transition: .18s ease; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

dialog { border: 0; border-radius: 14px; width: min(460px, calc(100vw - 32px)); padding: 0; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(17,24,39,.35); backdrop-filter: blur(2px); }
.dialog-head { padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 750; }
.dialog-body { padding: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 18px; }

/* UESTC-inspired interface refresh. Resume document colors remain data-driven. */
:root {
  --bg: #f2f5f9;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6d7788;
  --border: #dfe5ed;
  --border-strong: #cad4e2;
  --accent: #164b9b;
  --accent-hover: #103f84;
  --accent-soft: #eaf2fc;
  --orange: #ef871c;
  --orange-soft: #fff3e4;
  --danger: #c2413b;
  --shadow: 0 16px 44px rgba(22, 48, 85, .11);
  --shadow-soft: 0 5px 18px rgba(22, 48, 85, .06);
  --radius: 14px;
}

html, body {
  background:
    radial-gradient(circle at 8% 0%, rgba(30, 86, 160, .055), transparent 28rem),
    var(--bg);
}

::selection { background: rgba(30, 86, 160, .18); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(30, 86, 160, .2);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: .45; }

.topbar {
  height: 66px;
  padding: 0 22px;
  border-bottom-color: rgba(202, 212, 226, .82);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 1px 0 rgba(255,255,255,.85), 0 6px 24px rgba(23, 52, 92, .045);
}
.topbar-left { min-width: 0; }
.topbar-right { gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  position: relative; width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  overflow: hidden; border-radius: 11px; color: #fff; background: var(--accent);
  box-shadow: 0 5px 14px rgba(30, 86, 160, .22);
}
.brand-mark::after {
  content: ""; position: absolute; width: 23px; height: 23px; right: -10px; bottom: -10px;
  border: 5px solid var(--orange); border-radius: 50%;
}
.brand-mark span { position: relative; z-index: 1; font-size: 15px; font-weight: 850; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { color: #17345c; font-size: 14px; font-weight: 790; letter-spacing: .01em; }
.brand-copy small { margin-top: 5px; color: #8993a2; font-size: 8px; font-weight: 750; letter-spacing: .16em; }
.save-indicator { min-width: 62px; color: #607085; font-weight: 600; }
.save-indicator:not(:empty)::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; vertical-align: 1px;
  border-radius: 50%; background: #2f9e6f; box-shadow: 0 0 0 3px rgba(47, 158, 111, .1);
}

.btn {
  min-height: 34px; border-color: var(--border-strong); color: #314057; border-radius: 9px;
  padding: 8px 12px; font-weight: 620; box-shadow: 0 1px 1px rgba(23, 52, 92, .025);
  transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn:hover { color: var(--accent); border-color: #aebed3; background: #f8fafd; box-shadow: 0 3px 10px rgba(22, 48, 85, .06); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  border-color: var(--accent); background: linear-gradient(135deg, #215cac, var(--accent)); color: #fff;
  box-shadow: 0 6px 15px rgba(30, 86, 160, .2);
}
.btn.primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: #fff; box-shadow: 0 8px 20px rgba(30, 86, 160, .25); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: #efc3bf; background: #fff6f5; color: #a9342f; }
.btn.small { min-height: 29px; padding: 6px 9px; font-size: 11px; border-radius: 8px; }
.btn.ghost { box-shadow: none; color: #536176; }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn.utility { border-color: transparent; background: transparent; box-shadow: none; color: #657186; }

.dashboard { max-width: 1160px; padding: 58px 28px 88px; }
.dashboard-head { align-items: center; margin-bottom: 30px; }
.dashboard-title { max-width: 620px; }
.eyebrow { display: block; margin-bottom: 9px; color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.dashboard h1 { margin-bottom: 10px; color: #17345c; font-size: clamp(30px, 4vw, 40px); font-weight: 810; }
.dashboard p { color: #748095; line-height: 1.6; }
.resume-grid { grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 18px; }
.resume-card {
  position: relative; min-height: 195px; padding: 20px; overflow: hidden;
  border-color: rgba(202, 212, 226, .9); box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.resume-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--accent), var(--orange));
  opacity: 0; transition: opacity .18s ease;
}
.resume-card:hover { border-color: #b8c7da; box-shadow: var(--shadow); transform: translateY(-3px); }
.resume-card:hover::before { opacity: 1; }
.resume-card-main { min-width: 0; }
.resume-card-icon {
  position: relative; width: 38px; height: 48px; margin-bottom: 16px; border: 1px solid #cad8e9; border-radius: 5px;
  background: linear-gradient(145deg, #fff, #edf4fc); box-shadow: 3px 4px 0 var(--accent-soft);
}
.resume-card-icon::before, .resume-card-icon::after, .resume-card-icon span {
  content: ""; position: absolute; left: 8px; right: 8px; height: 2px; border-radius: 2px; background: #a9bbd2;
}
.resume-card-icon::before { top: 13px; background: var(--accent); }
.resume-card-icon::after { top: 21px; }
.resume-card-icon span { top: 29px; right: 13px; }
.resume-card h3 { color: #1c2c43; font-size: 17px; font-weight: 750; }
.resume-card .meta { margin-top: 7px; color: #8490a2; }
.resume-card .actions { padding-top: 14px; margin-top: 18px; border-top: 1px solid #edf1f6; }
.empty-state { border-color: #bcc9d9; background: rgba(255,255,255,.72); padding: 64px; }

.editor-shell { height: calc(100vh - 66px); grid-template-columns: minmax(360px, var(--editor-width)) 8px minmax(0, 1fr); }
.editor-panel { border-right-color: var(--border-strong); box-shadow: 8px 0 30px rgba(23, 52, 92, .035); }
.editor-inner { padding: 18px 18px 88px; }
.editor-splitter { background: #e7ecf3; }
.editor-splitter::after { left: 2px; width: 4px; background: #b9c5d4; }
.editor-splitter:hover::after, .editor-splitter:focus-visible::after, .editor-shell.is-resizing .editor-splitter::after { background: var(--accent); }
.preview-panel {
  padding: 20px 16px 80px;
  background-color: #e9eef5;
  background-image: radial-gradient(rgba(130, 148, 169, .24) .7px, transparent .7px);
  background-size: 18px 18px;
}

.tabs {
  gap: 4px; padding: 4px; margin-bottom: 16px; top: 0; border: 1px solid #dfe6ef; border-radius: 11px;
  background: #eef2f7; box-shadow: 0 8px 18px rgba(23, 52, 92, .045);
}
.tab { padding: 10px; border-radius: 8px; color: #69768a; font-weight: 680; transition: .16s ease; }
.tab:hover { color: var(--accent); }
.tab.active { color: var(--accent); box-shadow: 0 2px 7px rgba(23, 52, 92, .1); }

.panel-card { margin-bottom: 14px; border-color: var(--border); border-radius: 13px; box-shadow: 0 3px 12px rgba(23, 52, 92, .045); }
.panel-card-head { min-height: 48px; padding: 12px 14px; border-bottom-color: #e9edf3; }
.panel-card-head h3 { color: #25354d; font-size: 13px; font-weight: 740; }
.panel-card-body { padding: 14px; }
details.panel-card > summary { cursor: pointer; transition: background .16s ease; }
details.panel-card > summary:hover { background: #f8fafc; }
details.panel-card > summary h3::before {
  content: "⌄"; display: inline-grid; width: 18px; height: 18px; margin-right: 6px; place-items: center;
  color: var(--accent); font-size: 14px; transform: rotate(-90deg); transition: transform .16s ease;
}
details.panel-card[open] > summary h3::before { transform: rotate(0); }
.section-badge {
  display: inline-flex; align-items: center; min-height: 20px; padding: 3px 7px; border: 1px solid #d9e4f1; border-radius: 999px;
  background: var(--accent-soft); color: #55739a; font-size: 9px; font-weight: 700; white-space: nowrap;
}
.section-row { min-width: 0; }
.section-row h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drag-handle { color: #a4afbf; }
.drag-handle:hover { color: var(--accent); background: var(--accent-soft); }
.entry-editor { border-color: #e1e7ef; border-radius: 11px; padding: 11px; background: #f9fbfd; }
.entry-editor:hover { border-color: #cbd8e7; }
.sub-setting { border-color: #e1e8f0; border-radius: 10px; background: #f8fafc; }
.sub-setting h4, .setting-group h4 { color: #34445c; font-weight: 740; }

.field { gap: 6px; margin-bottom: 12px; }
.field label { color: #667287; font-size: 10px; font-weight: 680; }
.input, .textarea, .select { border-color: #cfd8e4; border-radius: 9px; padding: 9px 10px; color: #223149; transition: .15s ease; }
.input:hover, .textarea:hover, .select:hover { border-color: #aebed2; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30, 86, 160, .1); }
.textarea { background: #fbfcfe; }
.md-tool { border-color: #d9e1eb; color: #536176; transition: .14s ease; }
.md-tool:hover { border-color: #aec0d7; background: var(--accent-soft); color: var(--accent); }
.setting-group + .setting-group { border-top-color: #e8edf3; }
input[type="color"] { border-color: #cfd8e4; }
.help { color: #7c8798; }

.preview-toolbar {
  top: -20px; max-width: 1180px; min-height: 48px; margin-bottom: 18px; padding: 8px 10px;
  border: 1px solid rgba(202, 212, 226, .92); border-top: 0; border-radius: 0 0 12px 12px;
  background: rgba(255,255,255,.91); color: #66758a; box-shadow: 0 8px 22px rgba(23, 52, 92, .09);
}
.preview-toolbar-status { font-weight: 650; }
.preview-tool { min-height: 29px; border-color: #d7dfe9; color: #56657a; font-weight: 620; }
.preview-tool:hover { border-color: #aebed3; background: var(--accent-soft); color: var(--accent); }
.preview-tool.active { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 4px 10px rgba(30, 86, 160, .17); }
.preview-outline { border-color: #ced8e5; border-radius: 12px; box-shadow: 0 18px 50px rgba(23, 52, 92, .2); }
.outline-item:hover, .outline-item.active { background: var(--accent-soft); color: var(--accent); }
.outline-item.active { box-shadow: inset 3px 0 var(--orange); }
.resume-document { box-shadow: 0 20px 55px rgba(23, 44, 73, .18), 0 0 0 1px rgba(148, 163, 184, .16); }
.page-break-marker::after { background: #e9eef5; color: #7d8999; }
.toast { border: 1px solid rgba(255,255,255,.14); background: #17345c; box-shadow: 0 12px 30px rgba(23,52,92,.25); }
dialog { border: 1px solid #d9e1eb; box-shadow: 0 28px 90px rgba(23,52,92,.28); }
dialog::backdrop { background: rgba(18, 38, 66, .42); }
.dialog-head { color: #21344f; }

.user-badge {
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 6px 9px; border: 1px solid #d9e4f1; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 720;
}
.auth-shell {
  min-height: calc(100vh - 66px); padding: 56px 20px; display: grid; place-items: start center;
  background:
    radial-gradient(circle at 15% 10%, rgba(30, 86, 160, .12), transparent 24rem),
    radial-gradient(circle at 85% 80%, rgba(239, 135, 28, .09), transparent 24rem);
}
.auth-card {
  width: min(440px, 100%); padding: 30px; border: 1px solid rgba(202, 212, 226, .95);
  border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: 0 24px 70px rgba(23,52,92,.13);
}
.auth-intro h1 { margin: 0 0 10px; color: #17345c; font-size: 28px; letter-spacing: -.025em; }
.auth-intro p { margin: 0; color: #748095; font-size: 13px; line-height: 1.7; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 24px 0 18px; padding: 4px;
  border: 1px solid #dfe6ef; border-radius: 11px; background: #eef2f7;
}
.auth-tab { border: 0; border-radius: 8px; padding: 10px; background: transparent; color: #69768a; font-weight: 680; }
.auth-tab.active { background: #fff; color: var(--accent); box-shadow: 0 2px 7px rgba(23,52,92,.1); }
.auth-form .field { margin-bottom: 14px; }
.auth-submit { width: 100%; min-height: 42px; justify-content: center; margin-top: 4px; }
.auth-error { margin: 0 0 12px; padding: 9px 11px; border: 1px solid #efc3bf; border-radius: 8px; background: #fff6f5; color: #a9342f; font-size: 12px; line-height: 1.5; }
.auth-note { margin: 16px 0 0; color: #8993a2; font-size: 11px; text-align: center; }
.cloud-status { display: inline-flex; align-items: center; gap: 6px; }
.cloud-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2f9e6f; }

@media (max-width: 980px) {
  .editor-shell { grid-template-columns: 1fr; overflow: visible; height: auto; }
  .editor-splitter { display: none; }
  .editor-panel { border-right: 0; max-height: none; }
  .preview-panel { min-height: 100vh; }
  .topbar { position: sticky; }
  .custom-field-row { grid-template-columns: 1fr 1fr; }
  .preview-toolbar { top: 0; align-items: flex-start; }
  .preview-toolbar-status { padding-top: 7px; }
  .editor-inner { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

@media (max-width: 680px) {
  .topbar { min-height: 62px; height: auto; padding: 8px 10px; gap: 8px; }
  .topbar-left, .topbar-right { gap: 5px; }
  .brand-mark { width: 31px; height: 31px; flex-basis: 31px; }
  .brand-copy { display: none; }
  .save-indicator { display: none; }
  .topbar .btn { min-height: 31px; padding: 6px 8px; font-size: 10px; }
  .user-badge { max-width: 88px; padding: 5px 7px; font-size: 10px; }
  .auth-shell { min-height: calc(100vh - 62px); padding: 28px 14px; }
  .auth-card { padding: 22px 18px; }
  .dashboard { padding: 36px 16px 64px; }
  .dashboard-head { align-items: stretch; flex-direction: column; }
  .dashboard-head .inline-actions { justify-content: flex-start; }
  .resume-grid { grid-template-columns: 1fr; }
  .resume-card { min-height: 180px; }
  .editor-shell { height: auto; }
  .editor-inner { padding: 12px 12px 72px; }
  .two-col, .three-col, .four-col { grid-template-columns: 1fr; }
  .panel-card-head { align-items: flex-start; }
  .panel-card-head > .inline-actions { justify-content: flex-end; }
  .section-row { flex-wrap: wrap; }
  .preview-toolbar { flex-direction: column; align-items: stretch; }
  .preview-toolbar-actions { justify-content: flex-start; }
  .zoom-controls { flex-wrap: wrap; }
  .preview-outline { left: 0; right: auto; }
}

@media print {
  html, body { background: #fff !important; }
  .resume-document, .resume-document * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .topbar, .auth-shell, .editor-panel, .editor-splitter, .preview-toolbar, .page-break-marker, .toast, dialog { display: none !important; }
  .editor-shell { display: block; height: auto; overflow: visible; }
  .preview-panel { position: static !important; inset: auto !important; padding: 0 !important; overflow: visible; background: #fff !important; }
  .paper-stage { width: auto !important; height: auto !important; margin: 0; }
  .paper-wrap { width: auto; margin: 0; transform: none !important; }
  .resume-document {
    width: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  .preview-focus { animation: none !important; outline: none !important; background: transparent !important; }
}
