:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", SimSun, sans-serif;
  --bg: #f4f6f8;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --text: #17212b;
  --muted: #64748b;
  --line: #dde4ec;
  --primary: #1f3a5f;
  --primary-soft: #e8eef6;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(31, 58, 95, 0.08), transparent 30%),
    radial-gradient(circle at bottom right, rgba(148, 163, 184, 0.18), transparent 26%),
    var(--bg);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
}

.appShell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
  overflow: hidden;
}

.bgBlob {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.3;
  pointer-events: none;
}

.blobA {
  top: -80px;
  right: -100px;
  background: rgba(31, 58, 95, 0.28);
}

.blobB {
  bottom: -120px;
  left: -80px;
  background: rgba(148, 163, 184, 0.38);
}

.topBar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin: 0 auto 18px;
  max-width: 1400px;
}

.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.subBrand {
  margin-top: 6px;
  color: var(--muted);
}

.stepTracker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

.mainGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 18px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.contentPanel,
.sidePanel {
  min-width: 0;
}

.contentPanel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.sidePanel {
  position: sticky;
  top: 24px;
}

.previewSticky {
  display: grid;
  gap: 16px;
}

.progressWrap {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.progressMeta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.progressMeta span {
  color: var(--muted);
}

.progressBar {
  height: 10px;
  background: #e5ebf1;
  border-radius: 999px;
  overflow: hidden;
}

.progressFill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f3a5f, #3b5b85);
}

.stepShell {
  padding: 4px 0;
}

.stepHeader h2,
.heroCard h1 {
  margin: 0;
  font-size: 30px;
}

.stepHeader p,
.heroLead {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.heroBadge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.heroGrid,
.cardGrid,
.formGrid,
.summaryList {
  display: grid;
  gap: 12px;
}

.heroGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 26px 0;
}

.heroActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.previewHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.previewActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.heroPanel,
.summaryCard,
.nestedCard,
.hintBox,
.miniStat,
.finalPanel {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.heroPanel {
  padding: 16px;
}

.heroPanel strong,
.summaryCard strong,
.hintBox strong,
.miniStat strong {
  display: block;
  margin-bottom: 8px;
}

.heroPanel span,
.summaryCard span {
  color: var(--muted);
}

.primaryBtn,
.secondaryBtn,
.ghostBtn,
.optionCard,
.miniChip.toggle {
  transition: all 0.2s ease;
}

.primaryBtn,
.secondaryBtn,
.ghostBtn {
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
}

.primaryBtn {
  background: var(--primary);
  color: #fff;
}

.secondaryBtn {
  background: #edf2f7;
  color: var(--text);
}

.ghostBtn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--line);
}

.primaryBtn:disabled,
.ghostBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cardGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cardGrid.compact {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.optionCard {
  text-align: left;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  gap: 8px;
  min-height: 96px;
}

.optionCard span,
.hintText,
.blockLabel,
.statusText,
.miniStat span,
.stepTracker span,
.sideTitle,
.resumeMiniText {
  color: var(--muted);
  font-size: 14px;
}

.optionCard.active,
.miniChip.toggle.active {
  border-color: var(--primary);
  background: rgba(31, 58, 95, 0.08);
  color: var(--primary);
}

.formGrid.twoCol {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 700;
  font-size: 14px;
}

.field input,
.field textarea,
.field select,
.resumeSection textarea,
.intentLine input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.field textarea,
.resumeSection textarea {
  resize: vertical;
}

.stack {
  display: grid;
  gap: 16px;
}

.nestedCard {
  padding: 16px;
}

.rowBetween {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.blockGroup {
  display: grid;
  gap: 10px;
}

.blockLabel {
  font-weight: 700;
}

.chipRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.miniChip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.miniChip.toggle {
  cursor: pointer;
}

.activeToggle {
  border-color: var(--primary);
  background: rgba(31, 58, 95, 0.08);
  color: var(--primary);
}

.metricGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.hintBox {
  padding: 16px;
}

.navRow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.summaryCard {
  padding: 16px;
}

.summaryCard p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.miniStat {
  padding: 12px 14px;
}

.miniStat strong {
  margin-bottom: 0;
  font-size: 16px;
}

.topDebugBtn {
  white-space: nowrap;
}

.previewLayout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 300px;
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
}

.resumePaper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 45px 53px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
  width: 794px;
  max-width: none;
  min-height: 1040px;
  margin: 0 auto;
}

.previewCompact {
  font-size: 13.2px;
}

.previewStandard {
  font-size: 13.8px;
}

.resumeHeader h3 {
  margin: 0;
  font-size: 18pt;
  line-height: 1.1;
  text-align: center;
  font-weight: 700;
}

.resumeContacts {
  margin-top: 7px;
  font-size: 9pt;
  color: #4b5563;
  text-align: center;
  line-height: 1.35;
}

.resumeIntent {
  margin-top: 4px;
  text-align: center;
  font-size: 10pt;
  color: var(--primary);
  font-weight: 700;
}

.resumeColumns {
  display: grid;
  grid-template-columns: minmax(0, 26%) minmax(0, 74%);
  gap: 18px;
  margin-top: 30px;
}

.resumeColumn {
  min-width: 0;
}

.resumeColumnLeft {
  padding-right: 12px;
  border-right: 1px solid #e7edf5;
}

.resumeIntentText {
  font-weight: 600;
  color: #1f4e79;
}

.resumeParagraph {
  margin: 0;
  color: #1f2937;
  line-height: 1.7;
  font-weight: 400;
}

.skillLines {
  display: grid;
  gap: 3px;
  color: #1f2937;
  font-size: 9pt;
  line-height: 1.45;
  word-break: keep-all;
}

.skillLines div {
  white-space: nowrap;
}

.experienceTitleRow {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 2px;
}

.experienceTitle {
  font-weight: 600;
  color: #111827;
  line-height: 1.25;
  font-size: 10pt;
}

.experienceTime {
  margin: 0;
  color: #6b7280;
  font-size: 9pt;
  white-space: nowrap;
}

.experienceOrg {
  color: #6b7280;
  font-size: 9pt;
  line-height: 1.3;
  margin-bottom: 8px;
}

.intentLine {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.resumeSection {
  margin-top: 23px;
}

.resumeSection h4 {
  margin: 0 0 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid #d8e1ee;
  color: #1f4e79;
  font-size: 11pt;
  font-weight: 700;
}

.resumeExperience {
  padding: 14px 0 10px;
}

.bulletList {
  display: grid;
  gap: 7px;
  margin: 0;
}

.bulletItem {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  column-gap: 3px;
  align-items: start;
  line-height: 1.58;
  font-size: 9.5pt;
  color: #1f2937;
  font-weight: 400;
}

.bulletDot {
  color: #374151;
  font-size: 8.5pt;
  line-height: 1.45;
}

.previewSidebar {
  display: grid;
  gap: 12px;
  align-content: start;
  position: sticky;
  top: 24px;
}

.compactNotice {
  max-width: 860px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.editorCard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.editorLabel {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}

.editorHint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: -2px;
}

.editorCard input,
.editorCard textarea {
  width: 100%;
  border: 1px solid #dbe4ed;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 13px;
  line-height: 1.35;
  background: #fff;
}

.resumeEducation {
  display: grid;
  gap: 3px;
  margin: 0 0 8px;
  line-height: 1.45;
  color: #1f2937;
  font-size: 9.5pt;
  font-weight: 400;
}

.resumeEducation strong {
  font-weight: 600;
}

.finalPanel {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.statusText.done {
  color: #0f766e;
}

.statusText.error {
  color: #b91c1c;
}

.statusText.loading {
  color: #1d4ed8;
}

@media (max-width: 1120px) {
  .mainGrid,
  .previewLayout {
    grid-template-columns: 1fr;
  }

  .sidePanel {
    position: static;
  }

  .previewSidebar {
    position: static;
  }
}

@media (max-width: 520px) {
  .resumeColumns {
    grid-template-columns: 1fr;
  }

  .resumeColumnLeft {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid #e7edf5;
    padding-bottom: 8px;
  }

  .resumePaper {
    width: 100%;
    max-width: 100%;
    padding: 34px 30px;
  }
}

@media (max-width: 820px) {
  .appShell {
    padding: 14px;
  }

  .topBar,
  .progressMeta,
  .navRow {
    flex-direction: column;
    align-items: stretch;
  }

  .heroGrid,
  .cardGrid,
  .formGrid.twoCol,
  .metricGrid {
    grid-template-columns: 1fr;
  }

  .brand {
    font-size: 24px;
  }
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  html,
  body {
    width: 210mm;
    min-height: 297mm;
    background: #fff !important;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .appShell {
    padding: 0 !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  .bgBlob,
  .topBar,
  .progressWrap,
  .navRow,
  .sidePanel,
  .previewHead,
  .previewSidebar,
  .compactNotice {
    display: none !important;
  }

  .mainGrid,
  .contentPanel,
  .stepShell,
  .previewLayout {
    display: block !important;
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: visible !important;
  }

  .previewLayout > :not(.resumePaper) {
    display: none !important;
  }

  .resumePaper {
    width: 210mm !important;
    min-height: 297mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 12mm 14mm !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .resumeColumns {
    grid-template-columns: minmax(0, 26%) minmax(0, 74%) !important;
    gap: 18px !important;
  }
}
