/* ===== 重置 & 基础 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 980px; margin: 0 auto; padding: 0 28px; }

/* ===== Header ===== */
.header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 6px; }
.logo-icon { font-size: 22px; color: var(--primary); }
.logo-text {
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.5px;
  color: #2563eb;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}
.nav { display: flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 24px; }
.nav-btn {
  padding: 6px 20px; border: none; background: transparent;
  border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-muted); transition: all .2s;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active { background: var(--surface); color: var(--primary); font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.lang-dropdown-wrap { position: relative; margin-left: 8px; }
.lang-globe-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border); background: transparent;
  border-radius: 50%; cursor: pointer; color: var(--text-muted); transition: all .15s;
}
.lang-globe-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-dropdown {
  display: none; position: absolute; top: 42px; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1); min-width: 120px; z-index: 200;
  overflow: hidden;
}
.lang-dropdown.show { display: block; }
.lang-option {
  padding: 10px 16px; font-size: 14px; font-weight: 500; cursor: pointer;
  color: var(--text); transition: background .12s;
}
.lang-option:hover { background: #f1f5f9; }
.lang-option.active { color: var(--primary); font-weight: 700; background: #eff6ff; }

@media (max-width: 700px) {
  html,
  body {
    overflow-x: hidden;
  }
  .container {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }
  .header .container {
    height: auto;
    min-height: 104px;
    padding: 10px 16px 12px;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-content: center;
  }
  .logo {
    order: 1;
    min-width: 0;
    flex: 1 1 auto;
  }
  .logo svg {
    width: 34px;
    height: 34px;
  }
  .logo-text {
    font-size: 21px;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .header-right {
    order: 2;
    flex: 0 0 auto;
    gap: 6px;
    margin-left: auto;
  }
  .lang-dropdown-wrap { margin-left: 0; }
  .lang-globe-btn,
  .user-avatar {
    aspect-ratio: 1 / 1;
  }
  .lang-globe-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }
  .user-avatar {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px;
    min-height: 30px;
    flex: 0 0 30px;
  }
  .user-menu-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0 !important;
    gap: 0 !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }
  .user-phone { display: none; }
  .login-btn {
    height: 36px;
    padding: 0 13px;
    white-space: nowrap;
  }
  .nav {
    order: 3;
    width: 100%;
    padding: 4px;
    gap: 4px;
    border-radius: 18px;
  }
  .nav-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    word-break: keep-all;
  }
  .lang-dropdown,
  .user-dropdown {
    top: calc(100% + 8px);
  }
  .card-grid,
  .card,
  .upload-zone,
  .saved-resume-bar,
  .photo-upload-section,
  .photo-upload-left {
    min-width: 0;
    max-width: 100%;
  }
  .card {
    padding: 22px 16px;
    overflow: hidden;
  }
  .upload-zone {
    width: 100%;
    padding: 30px 14px;
  }
  .upload-main,
  .upload-sub,
  .photo-tip {
    overflow-wrap: anywhere;
  }
  .saved-resume-bar {
    padding: 8px 10px;
    gap: 6px;
  }
  .saved-resume-text {
    min-width: 0;
  }
  .saved-resume-preview-btn,
  .saved-resume-use-btn {
    padding-left: 10px;
    padding-right: 10px;
  }
  .photo-upload-section {
    gap: 8px;
  }
  .photo-upload-card {
    flex: 0 0 56px;
  }
}

/* ===== Hero ===== */
.hero { text-align: center; padding: 64px 0 44px; }
.hero-title { font-size: 34px; font-weight: 900; letter-spacing: -.8px; line-height: 1.15;
  background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-desc { margin-top: 14px; color: var(--text-muted); font-size: 16px; max-width: 520px; margin-inline: auto; line-height: 1.7; }

/* ===== Panel ===== */
.panel { padding-bottom: 40px; }
.panel-collapsed { max-height: 0; overflow: hidden; padding: 0; margin: 0; opacity: 0; transition: all .4s ease; }
.hidden { display: none !important; }

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}
.card-grid > .card { width: 100%; min-width: 0; height: 100%; }
@media (max-width: 640px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .card-grid > .card { height: auto; }
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  min-width: 0; transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.09); }
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.card-num {
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: var(--primary); background: #eff6ff; padding: 3px 9px; border-radius: 20px;
}
.card-title { font-size: 15px; font-weight: 700; }
.optional { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.card-inline { margin-top: 16px; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .inline-fields { grid-template-columns: 1fr; } }

/* ===== Upload Zone ===== */
.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 32px 20px; text-align: center; cursor: pointer; transition: all .15s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: #eff6ff; }
.upload-icon { font-size: 32px; margin-bottom: 10px; }
.upload-main { font-size: 14px; font-weight: 500; color: var(--text); }
.upload-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.file-info {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 8px 12px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  width: 100%; min-width: 0; max-width: 100%;
}
.file-icon { font-size: 18px; flex-shrink: 0; }
.file-name { font-size: 13px; color: #15803d; font-weight: 500; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-remove { background: none; border: none; color: #64748b; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; flex-shrink: 0; }

/* Saved resume bar */
.saved-resume-bar {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 9px 14px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  width: 100%; min-width: 0; max-width: 100%;
}
.saved-resume-icon { font-size: 16px; flex-shrink: 0; }
.saved-resume-text { font-size: 13px; color: #1e40af; font-weight: 500; min-width: 0; max-width: 100%; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-resume-use-btn {
  padding: 4px 14px; background: var(--primary); color: #fff; border: none;
  border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s; flex-shrink: 0;
}
.saved-resume-use-btn:hover { background: var(--primary-hover); }
.saved-resume-preview-btn {
  padding: 4px 14px; background: #fff; color: var(--primary); border: 1px solid var(--primary);
  border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s; flex-shrink: 0;
}
.saved-resume-preview-btn:hover { background: #eff6ff; }
.file-remove:hover { color: #ef4444; }

/* Reserve the saved-resume row on desktop so both cards stay the same size
   when a saved file becomes available. Mobile keeps its compact natural flow. */
@media (min-width: 641px) {
  #saved-resume-bar.hidden {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
  }
}

/* ===== JD Tabs ===== */
.jd-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.jd-tab {
  padding: 5px 14px; border: 1px solid var(--border); background: transparent;
  border-radius: 20px; font-size: 13px; cursor: pointer; color: var(--text-muted); transition: all .15s;
}
.jd-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.jd-panel { display: none; }
.jd-panel.active { display: block; }

.url-input-wrap { display: flex; gap: 8px; }
.url-input-wrap .input { flex: 1; }
.btn-fetch {
  padding: 10px 16px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.btn-fetch:hover { background: var(--primary-hover); }
.btn-fetch:disabled { opacity: .6; cursor: not-allowed; }

.url-status {
  margin-top: 8px; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; line-height: 1.5;
}
.url-status.loading { background: #eff6ff; color: var(--primary); }
.url-status.error { background: #fef2f2; color: #dc2626; }
.url-status.success { background: #f0fdf4; color: #15803d; }

/* ===== Inputs ===== */
.input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text); outline: none; transition: border-color .15s; font-family: inherit;
}
.input:focus { border-color: var(--primary); }
.input-lg { font-size: 16px; padding: 14px 18px; border-radius: 10px; }
.textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text); resize: vertical; outline: none;
  transition: border-color .15s; font-family: inherit; line-height: 1.6;
}
.textarea:focus { border-color: var(--primary); }
#jd-text { resize: none; }

/* ===== Buttons ===== */
.action-row { display: flex; justify-content: center; margin-top: 28px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 44px;
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff; border: none; border-radius: 30px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: all .2s; letter-spacing: .2px;
  box-shadow: 0 4px 18px rgba(37,99,235,.4);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(37,99,235,.5); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-icon { font-size: 14px; }
.btn-secondary {
  padding: 7px 16px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text); transition: background .15s;
}
.btn-secondary:hover { background: var(--bg); }
.btn-dl { color: var(--primary); border-color: var(--primary); }
.btn-dl:hover { background: #eff6ff; }

/* ===== Wizard ===== */
.wizard-progress {
  display: flex; align-items: center; gap: 16px; margin-bottom: 32px;
}
.progress-bar { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s ease; }
.progress-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

.wizard-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 48px 40px; box-shadow: var(--shadow);
  min-height: 320px;
}
@media (max-width: 640px) { .wizard-wrap { padding: 32px 24px; } }

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.step-icon { font-size: 40px; margin-bottom: 16px; }
.step-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.step-desc { color: var(--text-muted); font-size: 15px; margin-bottom: 24px; }

.field-group { display: flex; flex-direction: column; gap: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.field-tip { font-size: 13px; color: var(--text-muted); margin-top: 10px; }

/* 动态经历块 */
.entry-block {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px; background: var(--surface);
}
.entry-block-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.entry-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.btn-remove-entry {
  font-size: 12px; color: #ef4444; background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.btn-remove-entry:hover { background: #fef2f2; }
.btn-add-entry {
  width: 100%; padding: 10px; border: 1.5px dashed var(--border);
  border-radius: 8px; background: none; color: var(--text-muted);
  font-size: 13px; cursor: pointer; transition: all 0.15s;
  margin-top: 4px;
}
.btn-add-entry:hover { border-color: var(--primary); color: var(--primary); background: #f5f3ff; }

.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 24px; padding-top: 8px;
}

/* ===== Result ===== */
.result-section { margin-top: 24px; }

/* 分析卡片单列横向（全宽） */
.analysis-grid {
  display: flex; flex-direction: column;
  gap: 10px; margin-bottom: 16px;
}


.analysis-card {
  border-radius: 10px; padding: 10px 14px;
  box-shadow: var(--shadow); border: 1px solid transparent;
  display: flex; align-items: flex-start; gap: 12px;
}
.card-green { background: #f0fdf4; border-color: #bbf7d0; }
.card-orange { background: #fff7ed; border-color: #fed7aa; }
.card-blue { background: #eff6ff; border-color: #bfdbfe; }

.analysis-card-title {
  font-size: 12px; font-weight: 700; white-space: nowrap;
  min-width: 80px; padding-top: 2px;
}
.card-green .analysis-card-title { color: #15803d; }
.card-orange .analysis-card-title { color: #c2410c; }
.card-blue .analysis-card-title { color: #1d4ed8; }

.analysis-card-body { font-size: 12px; line-height: 1.6; color: var(--text); flex: 1; }
.analysis-card-body ul { padding-left: 12px; }
.analysis-card-body li { margin-bottom: 3px; }
.analysis-card-body strong { font-weight: 700; }
.analysis-card-body p { margin-bottom: 4px; }

/* 评分 */
.score-main { font-size: 28px; font-weight: 800; color: #1d4ed8; margin-bottom: 10px; }
.score-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.score-table td { padding: 4px 6px; }
.score-table tr:not(:last-child) td { border-bottom: 1px solid #dbeafe; }
.score-table td:last-child { text-align: right; font-weight: 700; color: #1d4ed8; }
.score-table caption { font-size: 11px; color: #64748b; text-align: left; margin-bottom: 4px; }

/* Markdown 表格（分析卡片内通用）*/
.md-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 6px 0; }
.md-table th { font-weight: 700; background: rgba(0,0,0,0.04); padding: 5px 8px; text-align: left; border-bottom: 2px solid rgba(0,0,0,0.1); }
.md-table td { padding: 4px 8px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.md-table tr:last-child td { border-bottom: none; }
.md-table td:last-child, .md-table th:last-child { text-align: right; }

/* 优化前后对比 */
.score-compare {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 12px;
  background: #fff; border-radius: 8px; padding: 10px 8px;
  border: 1px solid #dbeafe;
}
.score-compare-item { text-align: center; }
.score-compare-label { font-size: 11px; color: #64748b; margin-bottom: 2px; }
.score-compare-val { font-size: 22px; font-weight: 800; line-height: 1; }
.score-compare-val span { font-size: 12px; font-weight: 400; color: #64748b; }
.score-val-before { color: #94a3b8; }
.score-val-after { color: #1d4ed8; }
.score-compare-arrow { font-size: 18px; color: #22c55e; font-weight: 700; }

/* 评分对比切换 */
.score-compare-toggle .score-compare-item {
  cursor: pointer;
  padding: 6px 14px; border-radius: 8px;
  transition: background 0.15s, transform 0.1s;
  user-select: none;
}
.score-compare-toggle .score-compare-item:hover { background: #f1f5f9; }
.score-compare-toggle .score-compare-item.active {
  background: #eff6ff; box-shadow: 0 0 0 2px #2563eb inset;
}
.score-compare-toggle .score-compare-item.active .score-compare-label {
  color: #2563eb; font-weight: 700;
}

/* 切换视图下方 markdown 内容 */
.score-toggle-content { font-size: 12px; line-height: 1.7; }
.score-toggle-content .md-table { margin: 6px 0 10px; }

/* 进一步优化建议面板（简历下方） */
.further-suggestions-panel {
  margin: 0 16px 16px; padding: 16px 20px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; font-size: 13px; line-height: 1.7; color: #334155;
}
.further-suggestions-panel .md-h4,
.further-suggestions-panel .md-h3 { margin: 0 0 8px; }
.further-suggestions-panel .md-h4 strong,
.further-suggestions-panel .md-h3 strong {
  font-size: 14px; font-weight: 700; color: #1e293b;
}
.further-suggestions-panel ul { margin: 0; padding-left: 20px; }
.further-suggestions-panel li { margin-bottom: 6px; }
.further-suggestions-panel li strong { color: #1e293b; }

/* PDF 叠加 + diff 侧边栏 */
.pdf-overlay-wrap { display: flex; gap: 16px; align-items: flex-start; }
.pdf-pages { flex: 1; min-width: 0; }
.docx-preview { padding: 20px 24px; font-size: 13px; line-height: 1.8; }

.pdf-diff-sidebar {
  flex: 0 0 240px; border-left: 2px solid var(--border);
  padding: 12px 14px; font-size: 12px; position: sticky; top: 72px;
  max-height: calc(100vh - 100px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 0;
}
.pdf-diff-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}

.pdf-diff-item {
  display: flex; align-items: flex-start; gap: 8px;
  border-radius: 6px; padding: 8px 10px; margin-bottom: 7px;
  border: 1px solid transparent; cursor: pointer;
}
.pdf-diff-item input[type="checkbox"] {
  margin-top: 2px; flex-shrink: 0; cursor: pointer;
  accent-color: var(--primary);
}
.diff-item-body { flex: 1; min-width: 0; }
.diff-modified { background: #fef9c3; border-color: #fde68a; }
.diff-added    { background: #f0fdf4; border-color: #bbf7d0; }
.diff-deleted  { background: #fef2f2; border-color: #fecaca; }

.diff-type-tag {
  display: inline-block; font-size: 9px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; color: #fff; margin-bottom: 5px;
}
.diff-modified .diff-type-tag { background: #d97706; }
.diff-added .diff-type-tag    { background: #16a34a; }
.diff-deleted .diff-type-tag  { background: #dc2626; }

.diff-orig { text-decoration: line-through; color: #94a3b8; margin-bottom: 3px; line-height: 1.5; font-size: 11px; }
.diff-new  { color: #0f172a; line-height: 1.5; }

.diff-confirm-btn {
  margin-top: 12px; width: 100%; padding: 10px;
  font-size: 13px; font-weight: 700; border-radius: 8px;
  position: sticky; bottom: 0; color: #fff !important;
}

@media (max-width: 700px) {
  .pdf-overlay-wrap { flex-direction: column; }
  .pdf-diff-sidebar { flex: none; width: 100%; position: static; border-left: none; border-top: 2px solid var(--border); }
}

/* 照片提示栏 */
.photo-hint-bar {
  margin: 0 16px 0; padding: 10px 14px;
  background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px;
  font-size: 13px; color: #92400e;
}

/* 简历下载栏 */
.resume-download-bar {
  display: flex; gap: 12px; justify-content: center;
  padding: 16px 20px; border-top: 1px solid var(--border);
  background: #f8fafc;
}
.resume-download-bar .btn-dl {
  padding: 10px 32px; font-size: 14px; font-weight: 700;
}

/* 左右分栏 */
.resume-split-view {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 16px;
}
.resume-split-left {
  flex: 1 1 0;
  min-width: 0;
}
.resume-split-right {
  flex: 0 0 300px;
  min-width: 0;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .resume-split-view { flex-direction: column; }
  .resume-split-right { flex: none; width: 100%; max-height: none !important; }
}
@media (max-width: 700px) {
  .resume-split-view {
    padding-left: 8px;
    padding-right: 8px;
  }
  .resume-split-left {
    width: 100%;
  }
}

/* AI 修改说明面板 */
.change-log-panel {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow: hidden;
}
.cl-item[data-sec] {
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.cl-item[data-sec]:hover {
  box-shadow: 0 2px 8px rgba(37,99,235,.15);
  transform: translateX(2px);
}
.cl-title {
  padding: 12px 16px;
  font-size: 13px; font-weight: 700; color: #1e293b;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 8px;
}
.cl-count {
  font-size: 11px; font-weight: 500; color: #64748b;
  background: #e2e8f0; border-radius: 20px; padding: 1px 8px;
}
.cl-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.cl-item {
  border-radius: 8px; padding: 10px 12px;
  border-left: 3px solid transparent;
  background: #fff; font-size: 12px; line-height: 1.6;
}
.cl-item.is-active { box-shadow: 0 0 0 2px rgba(37,99,235,.20); }
.cl-modified { border-color: #f59e0b; }
.cl-added { border-color: #10b981; }
.cl-deleted { border-color: #ef4444; }
.cl-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: nowrap; }
.cl-tag {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; color: #fff;
  flex-shrink: 0; white-space: nowrap;
}
.cl-modified .cl-tag { background: #f59e0b; }
.cl-added .cl-tag { background: #10b981; }
.cl-deleted .cl-tag { background: #ef4444; }
.cl-deleted .cl-orig { text-decoration: line-through; color: #ef4444; opacity: 0.7; }
.cl-section { font-size: 11px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-orig { color: #94a3b8; text-decoration: line-through; margin-bottom: 3px; }
.cl-new { color: #0f172a; font-weight: 500; margin-bottom: 4px; }
.cl-reason { color: #2563eb; font-size: 11px; }
.cl-orig, .cl-new, .cl-reason {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 简历结果区 */
.resume-result-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  position: relative;
}
.resume-result-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 116px 14px 20px; border-bottom: 1px solid var(--border);
  background: #f8fafc; flex-wrap: wrap; gap: 10px;
}
.resume-result-title { font-size: 15px; font-weight: 700; }
.resume-result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#btn-reset {
  position: absolute; top: 12px; right: 16px; z-index: 3;
}
@media (max-width: 640px) {
  .resume-result-header { padding: 14px 20px; }
  #btn-reset { position: static; }
}

.resume-typography-bar {
  display: flex; align-items: center; gap: 18px;
  min-height: 48px; padding: 8px 20px;
  border-bottom: 1px solid var(--border); background: #fff;
}
.typography-control {
  display: grid; grid-template-columns: max-content 120px 44px;
  align-items: center; gap: 9px;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
}
.typography-control input[type="range"] {
  width: 120px; margin: 0; accent-color: var(--primary); cursor: pointer;
}
.typography-control output {
  min-width: 44px; color: var(--text); text-align: right;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.typography-reset-btn {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-muted);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.typography-reset-btn:hover { border-color: var(--primary); color: var(--primary); }
.typography-reset-btn:disabled { opacity: 0.4; cursor: default; }
@media (max-width: 760px) {
  .resume-typography-bar { align-items: stretch; gap: 9px 14px; flex-wrap: wrap; }
  .typography-control { grid-template-columns: 64px minmax(100px, 1fr) 42px; flex: 1 1 250px; }
  .typography-control input[type="range"] { width: 100%; }
}

.resume-columns { display: flex; gap: 0; }
.resume-col { flex: 1; padding: 20px; min-width: 0; }
.resume-col + .resume-col { border-left: 1px solid var(--border); }

.resume-col-label-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.resume-col-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.resume-col-label-wrap .resume-col-label { margin-bottom: 0; }

.score-badge {
  font-size: 12px; font-weight: 700; padding: 2px 10px;
  background: var(--primary); color: #fff; border-radius: 20px;
}

/* ===== Loading ===== */
.result-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 48px; color: var(--text-muted); font-size: 14px;
}
.loading-dots { display: flex; gap: 6px; }
.loading-dots span {
  width: 8px; height: 8px; background: var(--primary);
  border-radius: 50%; animation: bounce .8s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40% { transform: translateY(-8px); opacity: 1; }
}

/* ===== Footer ===== */
.footer { margin-top: auto; padding: 24px 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 13px; }
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-sep { margin: 0 8px; }
.footer-xhs { margin-top: 6px; font-size: 12px; color: #94a3b8; }

/* ===== 照片提示 ===== */
.photo-tip { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }

/* ===== 简历预览框 ===== */
.resume-preview-box {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0; background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  overflow: hidden;
}
/* 只有渲染了 iframe（实际简历）时才锁 A4 比例 */
.resume-preview-box:has(iframe) {
  aspect-ratio: 210 / 297;
}
.resume-preview-box pre {
  padding: 24px 28px;
  max-height: 700px;
  overflow-y: auto;
}

/* ===== 模版弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 660px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text-muted); line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: var(--text); }

.template-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding: 20px 24px;
}
@media (max-width: 500px) { .template-grid { grid-template-columns: repeat(2, 1fr); } }

.template-card {
  border: 2px solid var(--border); border-radius: 10px; cursor: pointer;
  overflow: hidden; transition: all .15s;
}
.template-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.template-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

.template-preview {
  height: 90px; padding: 8px; display: flex; flex-direction: column; gap: 4px;
}
.tp-name-line { height: 8px; border-radius: 3px; width: 60%; }
.tp-bar { height: 3px; border-radius: 2px; width: 100%; margin: 2px 0; }
.tp-line { height: 5px; border-radius: 2px; }
.tp-line-short { height: 5px; border-radius: 2px; width: 70%; }

.template-info { padding: 8px 10px 10px; border-top: 1px solid var(--border); }
.template-name { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.template-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 24px; border-top: 1px solid var(--border); background: #f8fafc;
}

/* ===== 照片上传行 ===== */
.photo-upload-section {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 12px;
}
.photo-upload-left { flex: 1; min-width: 0; }
.photo-upload-label { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 6px; }
.photo-tip { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.6; }
.photo-upload-card {
  position: relative; width: 60px; height: 80px;
  border: 2px dashed var(--border); border-radius: 6px;
  cursor: pointer; overflow: hidden; background: #f8fafc;
  transition: border-color .15s;
}
.photo-upload-card:hover { border-color: var(--primary); }
.photo-upload-card.has-photo { border-style: solid; border-color: var(--primary); }
.photo-preview-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.photo-placeholder-text { font-size: 11px; color: var(--primary); text-align: center; padding: 4px; }
.photo-remove-btn {
  position: absolute; top: 1px; right: 1px; width: 16px; height: 16px;
  border: none; background: rgba(0,0,0,.5); color: #fff; border-radius: 50%;
  font-size: 12px; line-height: 1; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.photo-remove-btn:hover { background: #ef4444; }
.photo-name { display: block; width: 100%; max-width: 100%; min-width: 0; font-size: 12px; color: #15803d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-btn {
  padding: 5px 14px; border: 1px solid var(--border); background: transparent;
  border-radius: 20px; font-size: 13px; cursor: pointer; color: var(--text-muted); transition: all .15s;
}
.lang-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== 分析卡片四列 ===== */
.analysis-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .analysis-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .analysis-grid { grid-template-columns: 1fr; } }
.card-purple { background: #faf5ff; border-color: #e9d5ff; }
.card-purple .analysis-card-title { color: #7c3aed; white-space: nowrap; }
.card-teal { background: #f0fdfa; border-color: #99f6e4; }
.card-teal .analysis-card-title { color: #0f766e; }

/* ===== diff 图例 ===== */
.resume-result-title-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.diff-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.legend-item {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
}
.legend-added { background: #dcfce7; color: #16a34a; }
.legend-modified { background: #fef9c3; color: #d97706; }
.legend-deleted { background: #fee2e2; color: #dc2626; }

/* ===== 模版快速切换 ===== */
.template-hint {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted);
}
.template-hint-icon { font-size: 16px; }
.template-quick-list { display: flex; gap: 5px; flex-wrap: wrap; }
.tql-btn {
  padding: 4px 10px; border: 1.5px solid var(--border); background: var(--surface);
  border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
}
.tql-btn:hover { border-color: var(--tpl-color, var(--primary)); color: var(--tpl-color, var(--primary)); }
.tql-btn.active { background: var(--tpl-color, var(--primary)); border-color: var(--tpl-color, var(--primary)); color: #fff; }

/* ===== 模版弹窗实时预览 ===== */
.template-live-preview {
  height: 140px; overflow: hidden; position: relative; background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.tpl-iframe { width: 100%; border: none; display: block; overflow: hidden; pointer-events: none; }

/* ===== 打印样式（PDF 导出用）===== */
@media print {
  body { background: #fff; }
  .header, .hero, .panel, .footer, .result-header { display: none !important; }
  .result-section {
    border: none !important; box-shadow: none !important;
    margin: 0 !important; border-radius: 0 !important;
  }
  .result-box { padding: 0 !important; }
  .result-content { font-size: 11pt; line-height: 1.7; }
  .result-content h3 { font-size: 12pt; color: #000; margin: 14pt 0 6pt; }
  .result-content hr { border-top: 1px solid #999; margin: 10pt 0; }
}

/* ===== 登录按钮 & header-right ===== */
.header-right { display: flex; align-items: center; gap: 8px; }
.login-btn {
  padding: 6px 16px; border: 1.5px solid var(--primary); background: transparent;
  border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--primary); transition: all .15s;
}
.login-btn:hover { background: var(--primary); color: #fff; }
.login-btn.logged-in { border-color: var(--border); color: var(--text-muted); }
.login-btn.logged-in:hover { border-color: #ef4444; color: #ef4444; background: transparent; }

/* ===== 登录 & 套餐弹窗 ===== */
.modal-box {
  background: #fff; border-radius: 20px; padding: 36px 32px 28px;
  width: 100%; max-width: 420px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.modal-box .modal-close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-muted); line-height: 1;
}
.modal-box .modal-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.modal-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.modal-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 15px; outline: none; transition: border .15s;
}
.modal-input:focus { border-color: var(--primary); }
.code-row { display: flex; gap: 8px; }
.code-input { flex: 1; }
.send-code-btn {
  white-space: nowrap; padding: 0 14px; border: 1.5px solid var(--primary);
  background: transparent; border-radius: 10px; font-size: 13px; font-weight: 600;
  color: var(--primary); cursor: pointer; transition: all .15s;
}
.send-code-btn:hover:not(:disabled) { background: var(--primary); color: #fff; }
.send-code-btn:disabled { opacity: .5; cursor: default; }
.modal-submit {
  padding: 13px; background: var(--primary); color: #fff; border: none;
  border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .15s; margin-top: 4px;
}
.modal-submit:hover { background: var(--primary-hover); }
.modal-terms { font-size: 12px; color: var(--text-muted); margin-top: 14px; text-align: center; }
.modal-terms a { color: var(--primary); }

/* ===== 套餐弹窗 ===== */
.plan-modal-box { max-width: 760px; }
.plan-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 4px; }
@media (max-width: 700px) { .plan-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .plan-cards { grid-template-columns: 1fr; } }
.plan-card {
  border: 2px solid var(--border); border-radius: 14px; padding: 20px 16px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; cursor: pointer; transition: all .15s;
}
.plan-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.plan-card-featured { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px; white-space: nowrap;
}
.plan-name { font-size: 14px; font-weight: 700; color: var(--text); }
.plan-price { font-size: 26px; font-weight: 900; color: var(--primary); }
.plan-desc { font-size: 12px; color: var(--text-muted); }
.plan-buy-btn {
  margin-top: 8px; width: 100%; padding: 9px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.plan-buy-btn:hover { background: var(--primary-hover); }
.plan-card-featured .plan-buy-btn { background: var(--primary); }
.plan-note { font-size: 12px; color: var(--text-muted); margin-top: 16px; text-align: center; }

/* ===== 用户菜单 ===== */
.user-menu-wrap { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px;
  border: 1.5px solid var(--border); background: #fff; border-radius: 24px;
  cursor: pointer; transition: all .15s; font-size: 13px; color: var(--text);
}
.user-menu-btn:hover { border-color: var(--primary); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.user-phone { font-weight: 600; }
.user-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1); min-width: 220px; z-index: 300;
  overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-dropdown-info {
  padding: 14px 16px 10px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted); line-height: 1.7;
}
.user-dropdown-info .quota-line { color: var(--text); font-weight: 600; font-size: 14px; }
.user-dropdown-info .quota-label { color: var(--text-muted); font-size: 12px; }
.user-dropdown-item {
  padding: 10px 16px; font-size: 13px; cursor: pointer; display: block;
  color: var(--text); text-decoration: none; transition: background .1s;
}
.user-dropdown-item:hover { background: var(--bg); }
.user-dropdown-section {
  padding: 10px 16px; border-top: 1px solid var(--border);
}
.user-dropdown-section-title {
  font-size: 13px; font-weight: 400; color: var(--text); margin-bottom: 8px;
}
.saved-resume-actions { display: flex; gap: 6px; }
.sr-action-btn {
  padding: 5px 12px; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1;
  transition: all .15s; color: var(--text-muted); white-space: nowrap;
}
.sr-action-btn:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.sr-delete-btn { color: #ef4444; }
.sr-delete-btn:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.user-dropdown-item + .user-dropdown-item { border-top: 1px solid var(--border); }
.user-logout { color: #ef4444; border-top: 1px solid var(--border); }
.user-logout:hover { background: #fef2f2; }

/* ===== 消耗确认弹窗 ===== */
/* ===== 通用 Toast 弹窗 ===== */
.toast-box { max-width: 360px; text-align: center; padding: 32px 28px 24px; }
.toast-icon { font-size: 36px; margin-bottom: 12px; }
.toast-msg { font-size: 15px; color: var(--text); line-height: 1.7; margin-bottom: 22px; font-weight: 500; }
.toast-btns { display: flex; gap: 10px; }
.toast-btn-cancel {
  flex: 1; padding: 11px; border: 1.5px solid var(--border); background: #fff;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
}
.toast-btn-cancel:hover { border-color: var(--text-muted); }
.toast-btn-ok {
  flex: 1; padding: 11px; background: var(--primary); color: #fff; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.toast-btn-ok:hover { background: var(--primary-hover); }
.toast-btn-ok.danger { background: #ef4444; }
.toast-btn-ok.danger:hover { background: #dc2626; }
.toast-btn-ok.single { flex: none; min-width: 120px; margin: 0 auto; }

.confirm-use-box { max-width: 380px; text-align: center; }
.confirm-use-msg { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; }
.confirm-use-msg strong { color: var(--text); }
.confirm-use-btns { display: flex; gap: 10px; }
.confirm-use-cancel {
  flex: 1; padding: 11px; border: 1.5px solid var(--border); background: #fff;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
}
.confirm-use-cancel:hover { border-color: var(--text-muted); }
.confirm-use-ok {
  flex: 1; padding: 11px; background: var(--primary); color: #fff; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.confirm-use-ok:hover { background: var(--primary-hover); }

/* ===== Google 登录按钮 & 分割线 ===== */
.google-btn-wrap {
  position: relative; width: 100%; height: 44px; border-radius: 10px; overflow: hidden;
  border: 1.5px solid var(--border); background: #fff; cursor: pointer; transition: all .15s;
}
.google-btn-wrap:hover { border-color: #4285F4; background: #f8faff; }
.google-btn-face {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 100%; font-size: 14px; font-weight: 600;
  color: var(--text); pointer-events: none;
}
.google-btn-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0.01; overflow: hidden; z-index: 1;
}
.google-btn-overlay iframe { width: 100% !important; height: 100% !important; }
.login-divider {
  display: flex; align-items: center; gap: 12px; margin: 4px 0;
  color: var(--text-muted); font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
