/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #185FA5;
  --primary-light: #E6F1FB;
  --text: #1A1A1A;
  --text-2: #5A5A5A;
  --text-3: #999;
  --border: #E2E4E8;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --danger: #C0392B;
  --ok: #0F6E56;
  --radius: 12px;
  --warm: #D96B3A;
  --teal: #2B8585;
  --ink-deep: #24313A;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #EEF2F3;
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  overflow-x: hidden;
}

/* ===== 顶栏 ===== */
.topbar {
  position: relative;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar::before, .topbar::after {
  content: "";
  position: absolute;
  bottom: -2px;
  height: 2px;
}
.topbar::before { left: 0; width: 24%; background: var(--primary); }
.topbar::after { right: 0; width: 13%; background: var(--warm); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.api-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.api-badge.local { background: #FAEEDA; color: #854F0B; }
.api-badge.cloud { background: #E2F3EC; color: var(--ok); }
.logo {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
}
.tagline {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ===== 布局 ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 32px 70px;
}
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 28px 16px 42px;
  border-top: 1px solid #D8E0E2;
}
.footer-disclosure {
  display: inline-block;
  position: relative;
}
.footer-disclosure summary {
  display: inline;
  color: var(--primary);
  cursor: pointer;
}
.footer-disclosure > span {
  display: block;
  width: min(520px, calc(100vw - 32px));
  margin: 10px auto 0;
  padding: 10px 12px;
  color: var(--text-2);
  background: #F7FAFA;
  border: 1px solid #D8E0E2;
  border-radius: 6px;
  line-height: 1.7;
  text-align: left;
}
.footer-separator { margin: 0 6px; }

/* 两侧是工作台的边界索引，给宽屏留白一个与简历有关的阅读锚点。 */
.site-rail {
  position: fixed;
  top: 126px;
  bottom: 48px;
  z-index: 0;
  width: 86px;
  color: #7C8B91;
  pointer-events: none;
  user-select: none;
}
.site-rail-left { left: max(22px, calc(50% - 648px)); }
.site-rail-right { right: max(22px, calc(50% - 648px)); text-align: right; }
.site-rail > span { display: block; }
.rail-kicker { color: #A0ADB1; font-size: 9px; font-weight: 700; letter-spacing: 1.6px; line-height: 1.3; }
.rail-kicker b { color: var(--primary); font-size: 10px; }
.rail-number { margin-top: 8px; color: var(--warm); font-family: Georgia, serif; font-size: 24px; font-weight: 700; line-height: 1; letter-spacing: .5px; white-space: nowrap; }
.site-rail-right .rail-number { color: var(--teal); }
.rail-tick { width: 36px; height: 4px; margin-top: 14px; background: var(--primary); }
.site-rail-right .rail-tick { margin-left: auto; background: var(--warm); }
.rail-label { margin-top: 16px; color: #56666D; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; line-height: 1.65; }
.rail-axis { display: block; height: 142px; margin-top: 18px; border-left: 1px solid #C7D3D6; }
.site-rail-right .rail-axis { margin-left: auto; border-left: 0; border-right: 1px solid #C7D3D6; }
.rail-milestones { display: grid !important; gap: 8px; margin-top: 16px; }
.rail-milestone { display: flex !important; align-items: center; gap: 8px; color: #A0ADB1; font-family: Georgia, serif; font-size: 11px; line-height: 1; }
.rail-milestone i { display: block; width: 7px; height: 7px; border: 1px solid #B9C6C9; border-radius: 50%; }
.rail-milestone.active { color: var(--primary); }
.rail-milestone.active i { background: var(--primary); border-color: var(--primary); }
.rail-milestone.current { color: var(--warm); font-weight: 700; }
.rail-milestone.current i { width: 9px; height: 9px; background: var(--warm); border-color: var(--warm); box-shadow: 0 0 0 3px rgba(217, 107, 58, .14); }
.rail-caption { margin-top: 14px; color: #9AA7AB; font-size: 9px; letter-spacing: 1px; line-height: 1.5; }
@media (max-width: 1140px) { .site-rail { display: none; } }

/* ===== 步骤指示器 ===== */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 34px;
  padding: 10px 16px;
  border-top: 1px solid #D7E0E2;
  border-bottom: 1px solid #D7E0E2;
}
.step-ind {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
}
.step-ind.active { color: var(--primary); font-weight: 600; }
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.step-ind.active .step-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-label { font-size: 14px; }
.step-line { width: 60px; height: 2px; background: var(--border); }
.privacy-brief {
  margin: -12px 0 22px;
  padding: 11px 14px;
  color: #315B65;
  background: #F1F8F7;
  border: 1px solid #C7E2DD;
  border-left: 3px solid var(--teal);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.65;
}
.privacy-brief summary { color: #176E68; cursor: pointer; font-weight: 700; }
.privacy-brief div { margin-top: 8px; }
.privacy-brief p + p { margin-top: 6px; }
.privacy-brief a { color: var(--primary); }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 22px;
  box-shadow: 0 8px 22px rgba(38, 52, 59, .045);
}
.step-page > .card:nth-child(odd) { border-top: 3px solid rgba(43, 133, 133, .72); }
.step-page > .card:nth-child(even) { border-top: 3px solid rgba(217, 107, 58, .62); }
#resultBox > .card { border-left: 3px solid rgba(24, 95, 165, .58); }
#resultBox > .card:nth-child(3n + 2) { border-left-color: rgba(217, 107, 58, .62); }
#resultBox > .card:nth-child(3n + 3) { border-left-color: rgba(43, 133, 133, .72); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 17px;
  font-weight: 600;
}

/* ===== 表单 ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.card-subtitle { margin-top: 4px; color: var(--text-3); font-size: 12px; font-weight: 400; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 600;
}
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #FAFBFC;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
textarea { resize: vertical; }

/* ===== 基本信息卡：表单 + 证件照并排 ===== */
.basic-flex {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.basic-flex .form-grid { flex: 1; }
.photo-box {
  width: 128px;
  flex-shrink: 0;
  text-align: center;
}
.photo-frame {
  width: 96px;
  height: 128px; /* 3:4 证件照比例 */
  margin: 0 auto 10px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: #FAFBFC;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.photo-frame:hover { border-color: var(--primary); }
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-empty {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
  text-align: center;
}
.photo-empty span {
  display: block;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 2px;
}
.photo-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
.photo-editor-controls {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  text-align: left;
}
.photo-editor-controls.hidden { display: none; }
.photo-zoom-label {
  display: grid;
  gap: 3px;
  color: var(--text-3);
  font-size: 11px;
  text-align: left;
}
.photo-zoom-label input { width: 100%; accent-color: var(--primary); }
.photo-box .hint { text-align: left; line-height: 1.5; }

/* 结果页简历卡片右上角照片（文字环绕） */
.resume-photo {
  float: right;
  width: 84px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 0 0 8px 16px;
  position: relative;
  z-index: 1;
}

/* ===== 动态条目 ===== */
.entry-list { display: flex; flex-direction: column; gap: 14px; }
.entry {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: #FAFBFC;
  position: relative;
}
.entry-remove {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
}
.entry-remove:hover { color: var(--danger); }
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.custom-section-card .hint { max-width: 720px; margin-bottom: 14px; line-height: 1.6; }
.custom-entry { padding-right: 70px; }
.custom-entry .field { margin-bottom: 12px; }
.custom-resume-copy { color: var(--resume-text); font-size: 9px; line-height: 1.58; white-space: normal; overflow-wrap: anywhere; }
.optional-label { color: var(--text-3); font-size: 11px; font-weight: 400; margin-left: 4px; }
.polish-status { min-height: 24px; margin-top: 12px; color: #886D63; font-size: 12px; }
.draft-status { min-height: 24px; margin-top: 4px; color: var(--ok); font-size: 12px; }
.field-error { margin-top: 5px; color: var(--danger); font-size: 12px; line-height: 1.4; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); background: #FFF8F7; }
.polish-preview-dialog { position: relative; width: min(860px, 96vw); padding: 24px; max-height: 82vh; overflow: auto; }
.polish-preview-list { display: grid; gap: 12px; margin-top: 18px; }
.polish-preview-item { padding: 14px; background: #FAFBFC; border: 1px solid var(--border); border-left: 3px solid var(--warm); border-radius: 8px; }
.polish-preview-item strong { display: block; margin-bottom: 8px; color: var(--ink-deep); font-size: 13px; }
.polish-preview-item p { margin: 7px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.polish-preview-item .polish-optimized { color: var(--ok); }
.polish-item-actions { display: flex; gap: 8px; margin-top: 11px; }

/* ===== 按钮 ===== */
.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: #0C447C; }
.btn-primary:disabled {
  background: #A0BBD4;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); background: var(--primary-light); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-template {
  color: #fff;
  background: #08786C;
  border: 1px solid #08786C;
  box-shadow: 0 4px 12px rgba(8, 120, 108, .2);
  font-weight: 700;
}
.btn-template:hover {
  background: #05675D;
  border-color: #05675D;
  box-shadow: 0 6px 16px rgba(8, 120, 108, .26);
  transform: translateY(-1px);
}
.btn-template:focus-visible {
  outline: 3px solid rgba(8, 120, 108, .25);
  outline-offset: 3px;
}
.btn-template:active {
  transform: translateY(0);
  box-shadow: 0 2px 7px rgba(8, 120, 108, .2);
}
.btn-warm {
  flex: 0 0 auto;
  background: var(--warm);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(217, 107, 58, .22);
}
.btn-warm:hover { background: #BC542B; transform: translateY(-1px); }
.btn-warm:disabled { background: #D9A28D; cursor: not-allowed; transform: none; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.step-actions { text-align: center; margin-top: 8px; }
.template-entry-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.step-actions.between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== 弹窗 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  width: min(420px, 90vw);
}
.modal-card h3 { font-size: 17px; margin-bottom: 10px; }
.modal-card input { margin: 12px 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.ai-assist-notice {
  color: #315B65;
  background: #EEF8F7;
  border: 1px solid #BBDDD8;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.65;
}
.ai-assist-notice strong { color: #0B6A63; }
.ai-assist-notice span { margin-left: 6px; }
.result-ai-notice { margin-bottom: 14px; padding: 10px 12px; }
.polish-preview-dialog > .ai-assist-notice { margin: 14px 0 0; padding: 9px 11px; }
.paid-action-dialog { position: relative; width: min(410px, 92vw); padding: 27px; }
.paid-dialog-close {
  position: absolute;
  top: 11px;
  right: 12px;
  width: 34px;
  height: 34px;
  color: #69757C;
  background: transparent;
  border: 0;
  font-size: 25px;
  cursor: pointer;
}
.paid-dialog-close:focus-visible,
.paid-format-option:focus-visible,
.paid-method-option:focus-within { outline: 3px solid rgba(24, 95, 165, .2); outline-offset: 2px; }
.paid-action-heading { text-align: center; }
.paid-action-kicker { color: var(--primary); font-size: 12px; font-weight: 700; }
.paid-action-heading h3 { margin: 7px 0 5px; font-size: 20px; }
.paid-action-price { margin-bottom: 22px; color: #C94E2D; font-size: 38px; font-weight: 800; line-height: 1; }
.paid-action-price span { margin-right: 3px; font-size: 16px; vertical-align: 12px; }
.paid-format-switch { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; padding: 3px; background: #EEF1F3; border-radius: 7px; }
.paid-format-option { height: 36px; color: #5D6970; background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.paid-format-option.active { color: var(--text); background: #FFF; box-shadow: 0 1px 4px rgba(20, 30, 36, .12); font-weight: 700; }
.paid-methods { display: grid; gap: 8px; margin-bottom: 18px; }
.paid-method-option { min-height: 52px; padding: 8px 12px; display: grid; grid-template-columns: 0 30px 1fr; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; }
.paid-method-option input { width: 0; height: 0; opacity: 0; }
.paid-method-option.active { border-color: #78ABB9; background: #F2F8F9; }
.paid-method-mark { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: #FFF; border-radius: 6px; font-size: 13px; font-weight: 700; }
.paid-method-mark.wechat { background: #16A05D; }
.paid-method-mark.alipay { background: #1677FF; }
.paid-action-submit { width: 100%; }
.paid-action-recover { width: 100%; margin-top: -4px; }
.paid-action-flow { display: grid; justify-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.paid-action-qr { width: 190px; height: 190px; padding: 8px; background: #FFF; border: 1px solid var(--border); border-radius: 4px; }
.paid-action-order-copy { display: grid; gap: 4px; text-align: center; }
.paid-action-order-copy strong { font-size: 14px; }
.paid-action-order-copy span { color: var(--text-3); font-family: Consolas, monospace; font-size: 10px; overflow-wrap: anywhere; }
.paid-action-dev, .paid-action-download { width: 100%; text-align: center; text-decoration: none; }
.paid-action-status { min-height: 20px; margin: 10px 0 0; color: #A43A2C; text-align: center; font-size: 11px; }
.hint { font-size: 12px; color: var(--text-3); }
.hint-inline { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* ===== 结果页 ===== */
.score-card { text-align: left; }
.score-total {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 12px 0 20px;
}
.score-big {
  font-size: 64px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -1px;
}
.score-summary { color: var(--text-2); font-size: 14px; flex: 1; }

.score-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.bar-label { width: 88px; font-size: 13px; color: var(--text-2); text-align: right; }
.bar-track {
  flex: 1;
  height: 10px;
  background: #EEF0F3;
  border-radius: 5px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 5px;
  width: 0;
  transition: width .8s ease;
}
.bar-value { width: 40px; font-size: 14px; font-weight: 600; }

.gap-item {
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  background: #FAFBFC;
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
}
.gap-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.gap-keyword { font-weight: 700; font-size: 14px; color: var(--ok); }
.gap-importance {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  background: #FCEBEB;
  color: var(--danger);
}
.gap-importance.中 { background: #FAEEDA; color: #854F0B; }
.gap-importance.低 { background: #EAF3DE; color: #3B6D11; }
.gap-suggestion { font-size: 13px; color: var(--text-2); }

.rewrite-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}
.rewrite-original {
  background: #FAFBFC;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px dashed var(--border);
}
.rewrite-optimized {
  padding: 12px 16px;
  font-size: 14px;
  background: #F0F9F4;
}
.rewrite-reason {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--ok);
  background: #fff;
  border-top: 1px dashed var(--border);
}
.rewrite-tag { font-size: 11px; color: var(--text-3); margin-right: 6px; font-weight: 600; }

.tips-list { padding-left: 22px; }
.tips-list li { margin-bottom: 8px; font-size: 14px; }

.resume-pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #FAFBFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.8;
  max-height: 600px;
  overflow-y: auto;
}

/* ===== 加载 & 错误 ===== */
.loading-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 20px auto 16px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-card { text-align: center; padding: 40px; }
.loading-text { color: var(--text-2); font-size: 14px; }
.error-card { text-align: center; padding: 36px; }
.error-card h3 { color: var(--danger); margin-bottom: 10px; }
.error-card p { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }

.hidden { display: none !important; }

/* ===== 移动端 ===== */
@media (max-width: 600px) {
  .site-rail { display: none; }
  .container { padding: 26px 16px 56px; }
  .topbar { padding: 12px 16px; flex-direction: column; gap: 8px; }
  .card { padding: 18px 16px; }
  .step-line { width: 24px; }
  .step-label { display: none; }
  .score-big { font-size: 48px; }
  .topbar-right { flex-direction: column; gap: 6px; align-items: stretch; }
  .api-badge { text-align: center; }
  .step-actions.between { flex-direction: column; gap: 10px; }
  .template-entry-actions { flex-direction: column; }
  .template-entry-actions .btn { width: 100%; }
  .basic-flex { flex-direction: column; }
  .photo-box { width: 100%; display: flex; align-items: center; gap: 14px; }
  .photo-frame { margin: 0; flex-shrink: 0; }
  .photo-actions { margin: 0; flex-direction: column; }
  .photo-box .hint { flex: 1; }
  .paid-action-dialog { padding: 24px 18px; }
  .polish-preview-dialog { width: 94vw; padding: 22px 16px; }
}
