/* ============================================================
 * styles.css — UI + A4 预览 + 打印样式
 * ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f1f5f9;
  color: #1f2937;
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ---------- 顶部栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #fff; border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.brand { font-size: 18px; font-weight: 700; color: #0f172a; }
.brand span { font-size: 12px; color: #94a3b8; font-weight: 400; margin-left: 6px; }
.topbar-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sep { width: 1px; height: 22px; background: #e5e7eb; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid #d1d5db; background: #fff; color: #1f2937;
  padding: 6px 14px; border-radius: 8px; font-size: 13px; transition: all .15s;
}
.btn:hover { border-color: #94a3b8; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { border: none; background: transparent; color: #475569; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-mini { border: 1px solid #e2e8f0; background: #f8fafc; color: #475569; padding: 3px 10px; border-radius: 6px; font-size: 12px; }
.btn-mini:hover { border-color: #94a3b8; }
.btn-remove { border: none; background: transparent; color: #cbd5e1; font-size: 18px; line-height: 1; padding: 0 6px; float: right; }
.btn-remove:hover { color: #ef4444; }

/* ---------- 主体三栏 ---------- */
.main { display: grid; grid-template-columns: 240px 360px 1fr; height: calc(100vh - 55px); }
.col { overflow-y: auto; padding: 14px; }
.col-templates { background: #fff; border-right: 1px solid #e5e7eb; }
.col-form { background: #f8fafc; border-right: 1px solid #e5e7eb; }
.col-preview { background: #e2e8f0; display: flex; flex-direction: column; }
.col-title { font-size: 14px; font-weight: 700; margin: 0 0 12px; color: #334155; }

/* ---------- 模板画廊 ---------- */
.gallery { display: flex; flex-direction: column; gap: 10px; }
.tpl-card { text-align: left; border: 2px solid #e5e7eb; border-radius: 10px; padding: 8px; background: #fff; transition: all .15s; }
.tpl-card:hover { border-color: #cbd5e1; }
.tpl-card.active { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.tpl-thumb { height: 76px; border-radius: 6px; overflow: hidden; }
.tpl-name { font-size: 13px; font-weight: 600; margin-top: 6px; color: #1f2937; }
.tpl-desc { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ---------- 表单 ---------- */
.section { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.section-head h3 { margin: 0; font-size: 15px; color: #0f172a; }
.section-tips { margin: 8px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.tip { border-left: 3px solid; background: #f8fafc; padding: 6px 10px; border-radius: 0 6px 6px 0; font-size: 12px; color: #475569; line-height: 1.5; }
.field { display: block; margin-bottom: 10px; }
.field-label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }
.input {
  width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 7px 10px;
  font-size: 13px; color: #1f2937; background: #fff; transition: border .15s;
}
.input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.area { resize: vertical; min-height: 60px; line-height: 1.6; }
.field-hint { display: block; font-size: 11px; margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.item-card { position: relative; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fbfcfe; }
.hl-label { font-size: 12px; color: #64748b; margin: 6px 0 4px; }
.hl-row { display: flex; gap: 6px; margin-bottom: 6px; }
.hl-row .input { flex: 1; }

/* ---------- 自我评价模板库 ---------- */
.summary-picker { margin-top: 4px; }
.summary-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.summary-item { border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; background: #f8fafc; }
.summary-tags { margin-bottom: 4px; }
.tag { display: inline-block; background: #e0e7ff; color: #4338ca; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin-right: 4px; }
.summary-text { font-size: 12px; color: #475569; line-height: 1.6; margin-bottom: 6px; }

/* ---------- 评分面板 ---------- */
.score-panel { margin-top: 20px; border-top: 1px solid #e5e7eb; padding-top: 14px; }
.score-top { display: flex; align-items: center; gap: 12px; }
.score-grade { font-size: 16px; font-weight: 700; }
.score-advice { font-size: 12px; color: #64748b; line-height: 1.5; margin-top: 2px; }
.score-detail { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.score-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #475569; }
.score-row span { width: 60px; flex: none; }
.score-row b { width: 22px; text-align: right; flex: none; }
.bar { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.bar div { height: 100%; border-radius: 3px; }
.suggestions { margin-top: 12px; background: #fefce8; border: 1px solid #fde68a; border-radius: 8px; padding: 10px; }
.suggest-title { font-size: 12px; font-weight: 700; color: #a16207; margin-bottom: 4px; }
.suggest-item { font-size: 12px; color: #713f12; line-height: 1.6; }

/* ---------- 评分圆环 ---------- */
.ring { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.ring-inner { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ring-inner b { font-size: 18px; color: #0f172a; }
.ring-inner span { font-size: 10px; color: #94a3b8; margin-top: 2px; }

/* ---------- 预览区 ---------- */
.preview-toolbar {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px;
  background: #fff; border-bottom: 1px solid #e5e7eb; flex: none;
  font-size: 13px; color: #475569;
}
.zoom { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #64748b; }
.zoom input { width: 120px; }
.tip-count { margin-left: auto; color: #b45309; font-size: 12px; }
.preview-scroll { flex: 1; overflow: auto; padding: 24px; }
.preview-zoom { transform-origin: top left; margin: 0 auto; width: max-content; }
.preview-scroll .rs-page, .preview-scroll div[style*="width:210mm"] { box-shadow: 0 2px 12px rgba(0,0,0,.15); }

/* ---------- 提示 Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* ---------- 选择器 ---------- */
.select { border: 1px solid #d1d5db; border-radius: 8px; padding: 6px 8px; font-size: 13px; background: #fff; max-width: 260px; }

/* ---------- 打印：只打印简历页 ---------- */
@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .main { display: block !important; height: auto !important; }
  .col-preview { display: block !important; overflow: visible !important; background: #fff !important; }
  .preview-scroll { padding: 0 !important; overflow: visible !important; }
  .preview-zoom { zoom: 1 !important; transform: none !important; margin: 0 !important; width: auto !important; }
  .preview-scroll div[style*="width:210mm"] { box-shadow: none !important; }
  .toast { display: none !important; }
}

/* ---------- AI 润色 / 设置 ---------- */
.field-label { display: flex; align-items: center; justify-content: space-between; }
.ai-btn { margin-left: 8px; color: #7c3aed; border-color: #ddd6fe; background: #f5f3ff; }
.ai-btn:hover { border-color: #a78bfa; }
.ai-btn:disabled { opacity: .5; cursor: not-allowed; }

.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 440px; max-width: 92vw; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.modal h3 { margin: 0 0 8px; font-size: 16px; }
.modal-desc { font-size: 12px; color: #64748b; line-height: 1.6; margin: 0 0 14px; }
.modal .field { margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- 照片上传 ---------- */
.avatar-picker { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; padding: 10px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; }
.avatar-preview { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: #e2e8f0; flex: none; display: flex; align-items: center; justify-content: center; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-empty { font-size: 11px; color: #94a3b8; text-align: center; line-height: 1.3; }
.avatar-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.avatar-hint { font-size: 11px; color: #94a3b8; width: 100%; }

/* ---------- 区块说明 ---------- */
.section-desc { font-size: 11.5px; color: #94a3b8; line-height: 1.5; margin: 2px 0 8px; }

/* ---------- 引导条 ---------- */
.guide-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; background: #eff6ff; border-bottom: 1px solid #dbeafe; font-size: 12.5px; color: #1e40af; }
.guide-steps { line-height: 1.5; }

/* ---------- 手机端 Tab（默认隐藏，小屏显示） ---------- */
.mobile-tabs { display: none; }

/* ---------- 手机端适配（仅屏幕，不影响打印） ---------- */
@media screen and (max-width: 900px) {
  .topbar { position: static; padding: 8px 10px; }
  .brand { font-size: 16px; }
  .topbar-controls { width: 100%; gap: 6px; }
  .topbar-controls .btn, .topbar-controls .btn-ghost { font-size: 12px; padding: 5px 9px; }
  .topbar-controls .select { max-width: 100%; flex: 1 1 180px; }

  .main { display: block; height: auto; }
  .col { padding: 12px; }
  .col-templates, .col-form { border-right: none; }
  .col-form, .col-preview { border-top: 1px solid #e5e7eb; }
  .col:not(.mobile-active) { display: none; }
  .col-preview.mobile-active { display: flex; min-height: calc(100vh - 120px); }

  .mobile-tabs {
    display: flex; position: sticky; top: 0; z-index: 15; background: #fff;
    border-bottom: 1px solid #e5e7eb;
  }
  .mobile-tabs .mtab { flex: 1; border: none; background: transparent; padding: 10px 4px; font-size: 13px; color: #64748b; border-bottom: 2px solid transparent; }
  .mobile-tabs .mtab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

  .grid2 { grid-template-columns: 1fr; }
  .preview-scroll { padding: 10px; }
  .preview-zoom { zoom: 0.42 !important; }
  .preview-toolbar .zoom { display: none; }
  .guide-banner { font-size: 12px; padding: 8px 10px; }
}

@media screen and (max-width: 480px) {
  .preview-zoom { zoom: 0.36 !important; }
  .avatar-picker { flex-direction: column; align-items: flex-start; }
}

/* ---------- 进场引导页 ---------- */
.landing {
  position: fixed; inset: 0; z-index: 200; overflow: auto;
  display: flex; align-items: center; justify-content: center; padding: 40px 20px;
  color: #f8fafc;
  background:
    radial-gradient(900px 500px at 15% 0%, #1e3a8a 0%, rgba(11,17,32,0) 60%),
    radial-gradient(700px 500px at 85% 100%, #4c1d95 0%, rgba(11,17,32,0) 60%),
    #070b14;
}
.landing-inner { max-width: 860px; width: 100%; text-align: center; }
.landing-badge {
  display: inline-block; font-size: 12px; letter-spacing: 2px; color: #93c5fd;
  border: 1px solid rgba(147,197,253,.35); border-radius: 999px; padding: 5px 14px; margin-bottom: 22px;
  animation: landingUp .7s .05s both;
}
.landing-title { font-size: clamp(30px, 5vw, 54px); line-height: 1.22; margin: 0 0 16px; font-weight: 800; letter-spacing: 1px; animation: landingUp .7s .15s both; }
.landing-title em { font-style: normal; color: #60a5fa; }
.landing-sub { font-size: clamp(13px, 1.6vw, 16px); color: #94a3b8; margin: 0 0 34px; animation: landingUp .7s .25s both; }
.landing-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 34px; }
.feature-card {
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); border-radius: 14px;
  padding: 16px 12px; text-align: left; transition: transform .25s, border-color .25s;
  animation: landingUp .7s both; animation-delay: .35s;
}
.feature-card:nth-child(2) { animation-delay: .45s; }
.feature-card:nth-child(3) { animation-delay: .55s; }
.feature-card:nth-child(4) { animation-delay: .65s; }
.feature-card:hover { transform: translateY(-4px); border-color: rgba(96,165,250,.6); }
.feature-icon { font-size: 22px; display: block; margin-bottom: 8px; }
.feature-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: #e2e8f0; }
.feature-desc { font-size: 12px; line-height: 1.6; color: #94a3b8; }
.landing-cta {
  font-size: 16px; font-weight: 700; color: #0b1120; border: none; border-radius: 999px;
  padding: 15px 36px; cursor: pointer; background: linear-gradient(135deg, #93c5fd, #60a5fa);
  box-shadow: 0 10px 30px rgba(59,130,246,.4); transition: transform .2s, box-shadow .2s;
  animation: landingUp .7s .75s both;
}
.landing-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(59,130,246,.55); }
.landing-cta span { margin-left: 6px; }
.landing-note { margin: 16px 0 0; font-size: 12px; color: #64748b; animation: landingUp .7s .85s both; }
@keyframes landingUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media screen and (max-width: 900px) {
  .landing { padding: 28px 14px; }
  .landing-features { grid-template-columns: repeat(2, 1fr); }
}
@media screen and (max-width: 480px) {
  .landing-features { gap: 8px; }
  .feature-card { padding: 12px 10px; }
  .landing-cta { width: 100%; padding: 14px 20px; }
}
