/* ========== 全局变量 & 基础重置 ========== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --accent: #06b6d4;
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
  --shadow: 0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,0.12);
  --gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color:inherit; text-decoration:none; }
button { font-family:inherit; cursor:pointer; border:none; background:none; }
ul { list-style:none; }
input, select, textarea { font-family:inherit; font-size:14px; }
.section-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ========== 按钮 ========== */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 10px; }
.btn-primary { background: var(--gradient); color:#fff; box-shadow: 0 4px 14px rgba(37,99,235,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,99,235,0.4); }
.btn-outline { background:#fff; color:var(--text); border:1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-secondary { background: var(--text); color:#fff; }
.btn-secondary:hover { background: var(--text-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }
.arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ========== 导航 ========== */
.navbar {
  position: sticky; top:0; z-index:100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width:1200px; margin:0 auto; padding:0 24px;
  display:flex; align-items:center; justify-content:space-between;
  height: 68px;
}
.logo { display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none; }
.logo-icon {
  width:36px; height:36px;
  background: var(--gradient);
  border-radius: 10px;
  display:grid; place-items:center;
  color:#fff; font-size:18px; font-weight:700;
}
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.nav-links { display:flex; gap:36px; }
.nav-links a { color: var(--text-2); font-weight: 500; position:relative; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a.active::after {
  content:''; position:absolute; left:0; right:0; bottom:-24px;
  height:3px; background:var(--gradient); border-radius:2px;
}

/* ========== 导航栏登录态（js/auth.js 渲染） ========== */
.nav-auth { display:inline-flex; align-items:center; gap:10px; font-size:14px; }
.nav-auth .nav-login-link { color:var(--text-2); font-weight:500; text-decoration:none; }
.nav-auth .nav-login-link:hover { color:var(--primary); }
.nav-auth .btn-sm { padding:7px 16px; font-size:13px; }
.nav-auth .nav-username { color:var(--text-1); font-weight:600; cursor:pointer; }
.nav-auth .nav-username:hover { color:var(--primary); }
.nav-auth .nav-logout { color:#94a3b8; font-size:13px; text-decoration:none; }
.nav-auth .nav-logout:hover { color:#dc2626; }

/* ===== 导航头像 + 下拉菜单 ===== */
.nav-user-menu { position:relative; display:inline-flex; align-items:center; }
.nav-avatar-btn {
  display:flex; align-items:center; gap:8px; background:none; border:none;
  cursor:pointer; padding:4px 8px; border-radius:999px; transition:background .15s;
}
.nav-avatar-btn:hover { background:#f1f5f9; }
.nav-avatar {
  width:32px; height:32px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:700; color:#fff;
  background:linear-gradient(135deg, var(--primary, #2563eb), #06b6d4);
  box-shadow:0 1px 3px rgba(0,0,0,.12);
}
.nav-avatar-name { font-size:13px; font-weight:600; color:var(--text-1); max-width:100px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-caret { font-size:10px; color:#94a3b8; margin-top:1px; }
.nav-dropdown {
  display:none; position:absolute; top:calc(100% + 6px); right:0;
  min-width:200px; background:#fff; border:1px solid #e2e8f0;
  border-radius:12px; box-shadow:0 8px 28px rgba(0,0,0,.12);
  padding:6px; z-index:9999; animation:navFadeIn .15s ease;
}
.nav-dropdown.nav-dropdown-open { display:block; }
@keyframes navFadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.nav-dropdown-header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px 8px; border-bottom:1px solid #f1f5f9; margin-bottom:4px; }
.nav-dropdown-name { font-size:14px; font-weight:700; color:var(--text-1); }
.nav-dropdown-item {
  display:flex; align-items:center; gap:8px; padding:9px 12px;
  font-size:13.5px; color:var(--text-2); text-decoration:none;
  border-radius:8px; transition:background .12s, color .12s;
}
.nav-dropdown-item:hover { background:#f8fafc; color:var(--primary, #2563eb); }
.nav-dropdown-divider { height:1px; background:#f1f5f9; margin:4px 0; }
.nav-dropdown-logout:hover { color:#dc2626 !important; background:#fef2f2 !important; }

@media (max-width:768px) {
  .nav-avatar-name { display:none; }
  .nav-dropdown { position:fixed; top:60px; right:8px; left:8px; min-width:auto; }
}

.plan-badge { font-size:11px; padding:2px 8px; border-radius:999px; font-weight:600; white-space:nowrap; }
.plan-badge.plan-pro { background:linear-gradient(135deg,#f59e0b,#f97316); color:#fff; }
.plan-badge.plan-free { background:#f1f5f9; color:#64748b; }

/* ========== Hero 首页首屏 ========== */
.hero {
  background:
    radial-gradient(ellipse 60% 60% at 10% 0%, rgba(37,99,235,0.08), transparent),
    radial-gradient(ellipse 50% 50% at 90% 10%, rgba(6,182,212,0.08), transparent),
    linear-gradient(180deg, #ffffff, var(--bg));
  padding: 80px 0 100px;
  overflow:hidden;
}
.hero-content {
  max-width:1200px; margin:0 auto; padding:0 24px;
  display:grid; grid-template-columns: 1fr 1fr; gap:60px; align-items:center;
}
.hero-badge {
  display:inline-flex; align-items:center; gap:8px;
  padding: 8px 16px;
  background: rgba(37,99,235,0.08);
  border:1px solid rgba(37,99,235,0.15);
  color: var(--primary-dark);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 24px;
}
.hero-title {
  font-size: 56px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 20px;
}
.hero-desc {
  font-size: 18px;
  color: var(--text-2);
  margin-bottom: 36px;
  max-width: 520px;
}
.hero-actions { display:flex; gap:14px; margin-bottom: 48px; flex-wrap:wrap; }
.hero-stats {
  display:flex; align-items:center; gap:28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.stat-item { display:flex; flex-direction:column; gap:2px; }
.stat-num { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 15px; font-weight: 600; color: var(--text-2); }
.stat-divider { width:1px; height:20px; background: var(--border); }

.hero-right { position:relative; height: 520px; }
.hero-preview { position:relative; width:100%; height:100%; }
.preview-card {
  position:absolute;
  width: 300px;
  height: 400px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow:hidden;
  border: 1px solid var(--border);
}
.card-1 {
  top: 40px; left: 20px;
  transform: rotate(-6deg);
  background: linear-gradient(160deg, #eff6ff 0%, #fff 50%);
  z-index:3;
  display:flex; flex-direction:column; padding:28px; gap:12px;
}
.card-1::before {
  content:''; position:absolute; top:0; left:0; right:0; height:10px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
}
.card-1 .c-head { width:48px; height:48px; border-radius:50%; background: var(--gradient); margin-top:10px; }
.card-1 .c-line1 { width:60%; height:10px; background: var(--text); border-radius:4px; }
.card-1 .c-line2 { width:40%; height:8px; background: var(--text-3); border-radius:4px; }
.card-1 .c-divider { width:100%; height:1px; background: var(--border); margin:6px 0; }
.card-1 .c-block { display:flex; flex-direction:column; gap:6px; }
.card-1 .c-block .b-t { width:30%; height:10px; background: var(--primary); border-radius:3px; }
.card-1 .c-block .b-l1 { width:90%; height:7px; background: var(--text-2); border-radius:3px; }
.card-1 .c-block .b-l2 { width:75%; height:7px; background: var(--text-2); border-radius:3px; }
.card-1 .c-block .b-l3 { width:85%; height:7px; background: var(--text-2); border-radius:3px; }

.card-2 {
  top: 80px; right: 0;
  transform: rotate(5deg);
  background: #fff;
  z-index:2;
  display:grid; grid-template-columns: 100px 1fr;
  padding:0;
}
.card-2 .c-side { background: linear-gradient(180deg, #0f172a, #1e293b); display:flex; flex-direction:column; padding:20px 12px; gap:14px; }
.card-2 .c-side .av { width:60px; height:60px; border-radius:50%; background: rgba(255,255,255,0.2); align-self:center; border:3px solid rgba(255,255,255,0.3); }
.card-2 .c-side .d { width:100%; height:6px; background: rgba(255,255,255,0.2); border-radius:3px; }
.card-2 .c-side .d.s { width:60%; }
.card-2 .c-main { display:flex; flex-direction:column; padding:20px 16px; gap:10px; }
.card-2 .c-main .m-t { width:80%; height:10px; background: var(--text); border-radius:4px; }
.card-2 .c-main .m-l { width:100%; height:1px; background: var(--border); }
.card-2 .c-main .m-d { width:92%; height:7px; background: var(--text-2); border-radius:3px; }

.card-3 {
  bottom: 0; left: 50%;
  transform: translateX(-50%) rotate(2deg);
  background: linear-gradient(180deg, #f0fdf4, #fff);
  z-index:1;
  padding: 24px;
  display:flex; flex-direction:column; gap:12px;
}
.card-3::before {
  content:''; position:absolute; top:20px; left:20px; right:20px; height:90px;
  border: 2px dashed rgba(5,150,105,0.3);
  border-radius: 8px;
}
.card-3 .c-t1 { width:50%; height:12px; background: #059669; border-radius:4px; position:relative; z-index:2; }
.card-3 .c-t2 { width:35%; height:9px; background: var(--text-2); border-radius:3px; position:relative; z-index:2; margin-top: 86px; }
.card-3 .c-row { display:flex; gap:10px; }
.card-3 .c-row .r { flex:1; height:50px; border:1px solid var(--border); border-radius:6px; background:#fff; }

/* ========== Sections 通用 ========== */
.section-header { text-align:center; margin-bottom: 52px; }
.section-title { font-size: 40px; font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; }
.section-subtitle { font-size: 16px; color: var(--text-2); }
.features, .hot-templates, .guide { padding: 96px 0; }
.hot-templates { background: var(--bg-alt); }

/* ========== Features 特色功能 ========== */
.feature-grid {
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.feature-card {
  background: var(--card);
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all .3s ease;
  position:relative; overflow:hidden;
}
.feature-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background: var(--gradient); opacity:0; transition:opacity .3s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.feature-card:hover::before { opacity:1; }
.feature-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display:grid; place-items:center;
  font-size: 26px;
  margin-bottom: 20px;
}
.icon-1 { background: rgba(37,99,235,0.1); }
.icon-2 { background: rgba(6,182,212,0.1); }
.icon-3 { background: rgba(245,158,11,0.1); }
.icon-4 { background: rgba(16,185,129,0.1); }
.feature-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.feature-desc { color: var(--text-2); font-size: 14px; }

/* ========== 分类标签 ========== */
.category-chips {
  display:flex; gap: 10px; flex-wrap:wrap; justify-content:center;
  margin-bottom: 40px;
}
.chip {
  padding: 10px 22px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  transition: all .2s;
}
.chip:hover { border-color: var(--primary-light); color: var(--primary); }
.chip-active {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}

/* ========== 模板卡片 ========== */
.template-grid {
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.template-grid-large { grid-template-columns: repeat(4, 1fr); gap: 24px; }
.template-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow:hidden;
  border: 1.5px solid transparent;
  transition: all .3s ease;
  cursor:pointer;
  position:relative;
}
.template-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.template-thumb {
  aspect-ratio: 3 / 4.2;
  background: #fff;
  overflow:hidden;
  position:relative;
  display:flex;
  align-items:stretch;
  justify-content:stretch;
}
.template-thumb .thumb-inner {
  flex:1;
  margin: 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow:hidden;
  transform-origin: top center;
  transition: transform .4s;
}
.template-card:hover .thumb-inner { transform: scale(1.04); }
.template-tag {
  position:absolute; top:14px; left:14px; z-index:2;
  display:inline-flex; padding:4px 10px;
  background: rgba(0,0,0,0.6);
  color:#fff; font-size: 11px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.template-tag.free { background: rgba(16,185,129,0.9); }
.template-tag.pro { background: rgba(245,158,11,0.9); }
.template-info {
  padding: 18px 18px 20px;
  border-top: 1px solid var(--border);
}
.template-name {
  font-size: 15px; font-weight: 600;
  margin-bottom: 8px;
  display:flex; justify-content:space-between; align-items:center;
}
.template-uses { font-size: 12px; color: var(--text-3); }
.template-meta {
  display:flex; gap:8px; flex-wrap:wrap;
}
.template-meta .meta-tag {
  font-size: 11px; padding: 3px 8px;
  background: var(--bg-alt);
  color: var(--text-2);
  border-radius: 4px;
}
.view-all-wrap { text-align:center; margin-top: 48px; }

/* ========== Guide 指南 ========== */
.guide-steps {
  display:flex; align-items:center; justify-content:center;
  gap: 20px;
}
.step-item {
  flex: 1; max-width: 320px;
  background: var(--card);
  padding: 40px 28px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align:center;
  position:relative;
}
.step-num {
  position:absolute; top:-20px; left:50%; transform:translateX(-50%);
  width: 48px; height:48px;
  background: var(--gradient);
  color:#fff;
  border-radius: 50%;
  display:grid; place-items:center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 6px 16px rgba(37,99,235,0.35);
}
.step-icon { font-size: 48px; margin-bottom: 16px; }
.step-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.step-desc { color: var(--text-2); font-size: 14px; }
.step-arrow { font-size: 28px; color: var(--text-3); font-weight: 300; }

/* ========== CTA ========== */
.cta {
  padding: 100px 24px;
  background:
    radial-gradient(ellipse 50% 80% at 20% 50%, rgba(37,99,235,0.12), transparent),
    radial-gradient(ellipse 50% 80% at 80% 50%, rgba(6,182,212,0.12), transparent),
    linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color:#fff;
}
.cta-content {
  max-width: 720px;
  margin: 0 auto;
  text-align:center;
}
.cta h2 { font-size: 44px; font-weight: 800; line-height: 1.25; margin-bottom: 16px; letter-spacing: -1px; }
.cta p { font-size: 17px; color: rgba(255,255,255,0.7); margin-bottom: 36px; }

/* ========== Footer ========== */
.footer { background: #0b1220; color: rgba(255,255,255,0.7); padding: 64px 0 0; }
.footer-container {
  max-width:1200px; margin: 0 auto; padding: 0 24px;
  display:grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px;
}
.footer-col h4 { color:#fff; font-size: 15px; margin-bottom: 18px; }
.footer-col ul { display:flex; flex-direction:column; gap: 10px; }
.footer-col ul a { font-size: 13px; color: rgba(255,255,255,0.55); transition: color .2s; }
.footer-col ul a:hover { color: var(--primary-light); }
.footer-brand .logo { color:#fff; margin-bottom: 14px; }
.footer-brand p { font-size: 13px; line-height: 1.8; max-width: 300px; }
.footer-bottom {
  margin-top: 56px;
  padding: 24px;
  text-align:center;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}
.logo-en {
  font-size: 13px;
  font-weight: 400;
  color: inherit;
  opacity: 0.72;
  letter-spacing: 0;
  margin-left: 2px;
}
.copyright-row {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  margin-bottom: 8px;
}
.copyright-row-extra {
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.copyright-row-extra b { font-weight: 500; color: rgba(255,255,255,0.55); }
.copyright-row-extra .sep {
  display: inline-block;
  opacity: 0.5;
}

/* ========== 帮助 / 法律 通用页面 ========== */
.legal-wrap {
  background: var(--bg);
  min-height: calc(100vh - 68px);
}
.legal-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--text); font-weight: 500; }
.breadcrumb .sep { margin: 0 8px; opacity: .5; }
.legal-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}
.legal-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 88px;
}
.legal-sidebar h4 {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  padding: 6px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.legal-sidebar ul { display: flex; flex-direction: column; }
.legal-sidebar li a {
  display: block;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-2);
  border-radius: 8px;
  transition: all .15s;
}
.legal-sidebar li a:hover { background: var(--bg-alt); color: var(--text); }
.legal-sidebar li a.active {
  background: linear-gradient(90deg, rgba(37,99,235,.12), rgba(37,99,235,.04));
  color: var(--primary);
  font-weight: 600;
}
.legal-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
  line-height: 1.8;
  color: var(--text);
}
.legal-content .doc-meta {
  color: var(--text-2);
  font-size: 13px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.legal-content h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 0 0 10px;
}
.legal-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 36px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}
.legal-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 22px 0 10px;
  color: var(--text);
}
.legal-content p {
  font-size: 14.5px;
  color: var(--text);
  margin: 0 0 14px;
}
.legal-content ul, .legal-content ol {
  padding-left: 22px;
  margin: 0 0 16px;
}
.legal-content li {
  font-size: 14.5px;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.75;
}
.legal-content strong { color: var(--text); font-weight: 600; }
.legal-content .tip-box {
  background: linear-gradient(90deg, rgba(37,99,235,.06), rgba(37,99,235,.02));
  border: 1px solid rgba(37,99,235,.15);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-2);
  margin: 16px 0;
}
.legal-content .form-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: center;
}
.legal-content .form-row label { font-size: 14px; font-weight: 500; color: var(--text); }
.legal-content .form-row input,
.legal-content .form-row textarea,
.legal-content .form-row select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border .15s;
}
.legal-content .form-row textarea { min-height: 140px; resize: vertical; }
.legal-content .form-row input:focus,
.legal-content .form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.legal-content .faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: #fff;
}
.legal-content .faq-q {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 8px;
}
.legal-content .faq-q::before {
  content: 'Q. ';
  color: var(--primary);
  font-weight: 700;
}
.legal-content .faq-a {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.75;
}
.legal-content .faq-a::before {
  content: 'A. ';
  color: var(--primary);
  font-weight: 600;
}
@media (max-width: 900px) {
  .legal-grid { grid-template-columns: 1fr; }
  .legal-sidebar { position: static; }
  .legal-content { padding: 28px 22px; }
  .legal-content .form-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ========== 模板库页面 ========== */
.templates-page { padding: 40px 0 80px; }
.templates-header { text-align:center; margin-bottom: 40px; }
.templates-header h1 { font-size: 36px; font-weight: 800; letter-spacing: -1px; margin-bottom: 8px; }
.templates-header p { color: var(--text-2); font-size: 15px; }
.filters-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.filter-group { margin-bottom: 16px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-label { font-size: 13px; color: var(--text-2); margin-bottom: 10px; font-weight: 500; }
.filter-options { display:flex; gap:8px; flex-wrap:wrap; }
.opt {
  padding: 7px 16px;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  transition: all .15s;
}
.opt:hover { background: var(--bg-alt); color: var(--text); }
.opt-active {
  background: rgba(37,99,235,0.1);
  color: var(--primary-dark);
  border-color: rgba(37,99,235,0.2);
  font-weight: 500;
}
.templates-meta {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom: 20px;
  font-size: 14px; color: var(--text-2);
}
.meta-sort select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:#fff;
  cursor:pointer;
}
.empty-state { text-align:center; padding: 80px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text-2); margin-bottom: 20px; }

/* ========== 编辑器页面 ========== */
.editor-body { background: var(--bg); overflow:hidden; height:100vh; }
.editor-layout {
  display:grid;
  /* 原 360px/1fr/320px：左栏扩到 400px 输入区更宽敞，简历预览 794px 在 1600 屏 1fr 仍够放（≥850px），
     1440 屏及以下会自动缩减到 ~380/≥794/290，依然能工作（见下方 @media 1600/1440）。
     不影响任何功能：只是 grid 列宽参数变化，无 JS 依赖。 */
  grid-template-columns: 400px 1fr 320px;
  height:100vh;
}
/* 中档分辨率（1440p~1600p）：适当收窄两栏，保证中间预览区 ≥810px（794px A4 + 16px 边距仍居中） */
@media (max-width: 1600px) {
  .editor-layout { grid-template-columns: 380px 1fr 300px; }
}
@media (max-width: 1440px) {
  .editor-layout { grid-template-columns: 370px 1fr 290px; }
}
.editor-panel {
  background:#fff;
  border-right: 1px solid var(--border);
  display:flex; flex-direction:column;
  overflow:hidden;
}
.editor-right { border-right:none; border-left:1px solid var(--border); }
.panel-header {
  padding: 14px 18px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px;
  flex-shrink:0;
}
.back-btn {
  color: var(--text-2);
  font-size: 13px;
  padding:6px 10px;
  border-radius:6px;
  transition: background .2s;
}
.back-btn:hover { background: var(--bg-alt); color: var(--text); }
.panel-title { font-size: 15px; font-weight: 600; flex:1; text-align:right; }
.editor-right .panel-title { text-align:left; }

.panel-tabs {
  /* 胶囊分段控件：外层灰色容器 → 选中项白底+阴影浮现，视觉上像「一个切换器」而不是「一排按钮」。
     纯 CSS 重写，不碰 HTML（保留 3 个 button.tab-btn / .tab-active class，无任何 JS 改动）。 */
  display:flex; gap:2px;
  padding: 4px;
  margin: 10px 18px;
  background: #f1f5f9;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink:0;
}
.tab-btn {
  flex:1;
  padding: 9px 10px;
  font-size: 13px;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 500;
  transition: all .18s ease;
  display:flex; align-items:center; justify-content:center; gap:5px;
  white-space:nowrap;
}
.tab-btn:hover { color: var(--text); background: rgba(255,255,255,0.5); }
.tab-active {
  background:#fff !important;
  color: var(--primary-dark) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08), 0 0 0 1px rgba(15,23,42,0.04);
}

.panel-scroll, .tips-scroll {
  flex:1; overflow-y:auto;
  padding: 16px;
  /* 板块卡片化后，容器内边距从 18→16（卡片自己带 padding，不需要外层挤太多） */
}
.panel-scroll::-webkit-scrollbar, .tips-scroll::-webkit-scrollbar { width:6px; }
.panel-scroll::-webkit-scrollbar-thumb, .tips-scroll::-webkit-scrollbar-thumb { background:#d1d5db; border-radius:3px; }

.tab-content { display:none; }
.tab-content-active { display:block; }

/* 表单：板块卡片化
   —— 核心改动：.form-group 从「行距块」升级成「独立卡片」
   结构未变：.form-group > (.form-label + 内容节点)，零 DOM/JS 改动
   通过 ::before 伪元素给 .form-label 画 3px 主题色竖条（与简历预览中板块标题左竖条呼应），
   不额外写 style，用 --theme-color CSS 变量（#resumePage 和 inlineStylesForExport 已在使用同名变量，
   此处编辑器侧栏另写一个兜底：若没有 --theme-color 就取主色蓝） */
.form-group {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 14px 14px 12px;
  margin-bottom: 14px;
  transition: border-color .18s, box-shadow .18s;
}
.form-group:hover {
  border-color: var(--border);
  box-shadow: 0 2px 6px rgba(15,23,42,0.04);
}
.form-label {
  display:flex; align-items:center; justify-content:space-between;
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 12px;
  padding-left: 12px;
  position: relative;
  line-height: 1.3;
}
/* 左侧 3px 彩色竖条：跟随用户主题色（style.css 中 .resume-page 设置了 --theme-color）
   若侧栏拿不到变量，则兜底用主色蓝 */
.form-label::before {
  content: '';
  position: absolute;
  left: 0; top: 1px; bottom: 1px;
  width: 3px;
  border-radius: 3px;
  background: var(--theme-color, #2563eb);
}
.form-label .tip-btn {
  /* 从「蓝色填充 pill」改成「图标式小按钮」，与卡片头部更搭，仍可点击 */
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.form-label .tip-btn:hover {
  color: var(--primary);
  background: rgba(37,99,235,0.06);
  border-color: rgba(37,99,235,0.12);
}
.form-input, .form-textarea, .form-select {
  width:100%;
  box-sizing: border-box;
  /* 从 10/12 + 13px → 12/14 + 14px：高度从 ~40px 升到 ~44px，告别「紧凑输入框」感 */
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background:#fff;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-input::placeholder, .form-textarea::placeholder, .form-select::placeholder {
  color: #94a3b8;  /* 原靠默认浅灰，现明确指定 + 字号更柔和 */
  font-size: 13.5px;
}
.form-input:hover, .form-textarea:hover, .form-select:hover {
  border-color: #cbd5e1;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline:none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.08);
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.65;
  /* 为字数计数器预留右下 58px 空间，避免计数器叠在文字上（见 .char-counter） */
  padding-bottom: 30px;
}
/* 带字数计数器的文本域：右下角角标，位置绝对，父节点为 form-group（相对定位已有 .form-label::before 写 position:relative，
   但 form-group 自身非 relative，补一个，避免计数器飘到整个页面） */
.form-group { position: relative; }
.char-counter {
  position: absolute;
  right: 22px;
  bottom: 16px;
  font-size: 11px;
  color: var(--text-3);
  background: rgba(255,255,255,0.9);
  padding: 1px 7px;
  border-radius: 4px;
  pointer-events: none;
  line-height: 1.6;
  transition: color .15s;
}
.char-counter.warn { color: var(--warning); }
.char-counter.ok { color: var(--success); }
/* 非 textarea 的 char-counter 放在 form-group 底部（板块标题/条目描述等） */
.form-input ~ .char-counter, .item-desc-area ~ .char-counter {
  bottom: 8px;
}

.form-row { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* 求职意向三件套（意向城市/期望薪资/入职时间）：窄侧栏下 3 列略挤时自动换行 */
.form-row-3 { display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 1500px) { .form-row-3 { grid-template-columns: 1fr 1fr; } }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; line-height: 1.5; }

/* ------- 编辑器「基本信息」头像上传控件 ------- */
.avatar-uploader-wrap {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(124,58,237,0.05));
  border: 1px solid rgba(37,99,235,0.15);
}
.avatar-preview-box {
  position: relative;
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.avatar-preview-box .av-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.avatar-preview-box .av-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
}
.avatar-preview-box .av-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .18s;
  backdrop-filter: blur(2px);
}
.avatar-preview-box:hover .av-mask { opacity: 1; }
.avatar-actions {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.avatar-actions .av-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.avatar-actions .av-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
  line-height: 1.4;
}
.avatar-actions .av-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.avatar-actions .av-hint {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.45;
  margin-top: 7px;
}

.section-block {
  /* 板块卡片化后，form-group 外层已用 #f8fafc，这里改为白底 + 轻描边，层次变「灰卡-白块-白条目」：
     原 var(--bg) 会让 .section-block 在灰卡中消失在背景里。 */
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  cursor: grab;
  transition: all .2s;
}
.section-block.dragging { opacity:0.5; border-color: var(--primary); }
.section-block.drag-over { border-color: var(--primary); background: rgba(37,99,235,0.05); }
.section-block-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 12px;
}
.section-block-title {
  display:flex; align-items:center; gap:8px;
  font-weight: 600; font-size: 13px;
}
.drag-handle { color: var(--text-3); cursor:grab; font-size: 16px; line-height:1; }
.section-actions { display:flex; gap:4px; }
.icon-btn {
  width: 28px; height:28px;
  display:grid; place-items:center;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
  transition: all .15s;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--text); }
.icon-btn.danger:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

.item-card {
  background:#fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  position: relative;  /* 为条目内部的 char-counter / icon-btn 提供定位锚 */
  overflow: visible;
}
.item-header {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom: 8px;
}
.item-title { font-size: 12px; font-weight: 600; color: var(--text-2); }
.add-item-btn {
  width:100%; padding: 10px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13px;
  transition: all .15s;
  display:flex; align-items:center; justify-content:center; gap:6px;
}
.add-item-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(37,99,235,0.04); }

/* ====== 条目卡片折叠手风琴 ======
   结构：.item-card[.collapsed]
           > .item-header（可点击，含折叠箭头+标题+摘要+操作按钮）
               .ic-chevron  折叠箭头
               .ic-title-group ( .item-title + .item-summary )
               .section-actions ( ↑ ↓ ✕ )
           > .item-body ( max-height 过渡，折叠时 0 )
*/
.item-card {
  /* 覆盖原 padding：折叠后 header 区域更紧凑 */
  padding: 0;
  overflow: hidden;
}
.item-header {
  margin-bottom: 0;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid transparent;
  transition: border-color .18s, background .18s;
}
.item-header:hover { background: #f8fafc; }
.item-card:not(.collapsed) > .item-header {
  border-bottom-color: var(--border);
  background: #fbfcfd;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.ic-chevron {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--text-3);
  font-size: 11px;
  border-radius: 5px;
  transition: transform .2s ease, background .18s, color .18s;
  flex-shrink: 0;
}
.item-header:hover .ic-chevron { background: var(--bg-alt); color: var(--text-2); }
.item-card:not(.collapsed) .ic-chevron { transform: rotate(90deg); color: var(--primary); }

.ic-title-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ic-title-group .item-title { font-size: 13px; color: var(--text); }
.item-summary {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.item-card:not(.collapsed) .item-summary { display: none; }
.item-card.collapsed .item-summary { display: block; }

/* body 折叠过渡：用 max-height + padding 过渡，内容不超过 1500 足够 */
.item-body {
  max-height: 1600px;
  padding: 12px;
  overflow: hidden;
  transition: max-height .26s ease, padding .24s ease, opacity .2s ease;
  opacity: 1;
}
.item-card.collapsed > .item-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}
/* 阻止 ↑↓✕ 按钮冒泡触发折叠 */
.ic-actions { display:flex; gap: 2px; }
.ic-actions .icon-btn { pointer-events: auto; }

/* ====== 完成度徽章 + 顶部仪式感 ====== */
.panel-header {
  padding: 12px 16px;
}
/* 返回按钮升级：图标化 + 描边轻胶囊 */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: all .18s ease;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.back-btn::before {
  content: "↩";   /* 轻量返回图标 */
  font-size: 14px;
  line-height: 1;
  transform: translateY(-1px);
}
.back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37,99,235,0.04);
  box-shadow: 0 1px 4px rgba(37,99,235,0.1);
}

/* 完成度徽章：环形进度 + 百分比 */
.panel-title-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.editor-right .panel-title-wrap { justify-content: flex-start; }

.completion-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  font-size: 12px;
  flex-shrink: 0;
}
.cb-ring {
  --p: 0;      /* 0-100, 由 JS 设置 */
  --c: var(--primary);
  width: 28px; height: 28px;
  border-radius: 50%;
  background:
    conic-gradient(var(--c) calc(var(--p) * 1%), #eef2f7 0);
  display: grid; place-items: center;
  transition: background .4s ease;
}
.cb-ring::after {
  content: "";
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
}
.cb-text { display:flex; flex-direction:column; line-height:1.2; }
.cb-pct {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.cb-label {
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: .2px;
}
/* 完成度三档色：低红 / 中橙 / 高绿 */
.completion-badge.low  .cb-ring { --c: #ef4444; }
.completion-badge.low  .cb-pct  { color: #ef4444; }
.completion-badge.mid  .cb-ring { --c: #d97706; }
.completion-badge.mid  .cb-pct  { color: #d97706; }
.completion-badge.high .cb-ring { --c: #059669; }
.completion-badge.high .cb-pct  { color: #059669; }

/* 样式设置 */
.style-group { margin-bottom: 24px; }
.style-group h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.color-picker-wrap { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.color-picker-wrap input[type="color"] {
  width: 40px; height: 40px;
  border: none; border-radius: 8px;
  cursor:pointer; background:none;
}
.color-presets { display:flex; gap:8px; flex-wrap:wrap; }
.color-dot {
  width: 28px; height:28px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  transition: all .15s;
}
.color-dot:hover { transform: scale(1.15); box-shadow: 0 0 0 2px var(--primary); }
.slider-wrap { display:flex; align-items:center; gap: 12px; }
.slider-wrap input[type="range"] { flex:1; accent-color: var(--primary); }
.slider-wrap span { font-size: 12px; color: var(--text-2); min-width: 40px; text-align:right; }
.slider-label { font-size: 12px; color: var(--text-2); }

/* 板块管理 */
.section-manager .sec-row {
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.section-manager .sec-left { display:flex; align-items:center; gap: 10px; }
.section-manager .sec-name { font-size: 13px; font-weight: 500; }
.section-manager .sec-toggle {
  width: 40px; height: 22px;
  background: var(--text-3);
  border-radius: 999px;
  position:relative;
  cursor:pointer;
  transition: background .2s;
}
.section-manager .sec-toggle::after {
  content:''; position:absolute;
  top: 2px; left: 2px;
  width:18px; height:18px;
  background:#fff; border-radius:50%;
  transition: left .2s;
}
.section-manager .sec-toggle.on { background: var(--primary); }
.section-manager .sec-toggle.on::after { left: 20px; }

/* ---- 模块管理：重命名 / ↑↓ 小按钮 + 自定义板块角标 + 新增卡片 ---- */
.section-manager .sec-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 8px;
  flex-shrink: 0;
}
.sec-icon-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .15s;
  line-height: 1;
  padding: 0;
}
.sec-icon-btn:hover {
  background: rgba(37,99,235,0.1);
  color: var(--primary);
  transform: translateY(-1px);
}
.sec-icon-btn-off {
  opacity: .32;
  cursor: not-allowed;
  pointer-events: none;
}
.sec-tag-custom {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  color: #7c3aed;
  background: rgba(124,58,237,0.1);
  border-radius: 999px;
  vertical-align: middle;
  letter-spacing: .3px;
}
.sec-add-card {
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(124,58,237,0.06));
  border: 1.5px dashed rgba(99,102,241,0.35) !important;
  gap: 10px;
  color: #4f46e5;
  cursor: pointer;
  transition: all .18s;
}
.sec-add-card:hover {
  border-color: rgba(99,102,241,0.7) !important;
  background: linear-gradient(135deg, rgba(37,99,235,0.09), rgba(124,58,237,0.1));
  transform: translateY(-1px);
}
.sec-add-card .btn { pointer-events: auto; }

/* 预览区域 */
.editor-preview-wrap {
  display:flex; flex-direction:column;
  overflow:hidden;
  background: var(--bg-alt);
}
.preview-toolbar {
  background:#fff;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  display:flex; justify-content:space-between; align-items:center;
  flex-shrink:0;
}
.zoom-controls { display:flex; align-items:center; gap: 12px; }
.zoom-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 18px;
  transition: all .15s;
}
.zoom-btn:hover { background: var(--bg-alt); color: var(--text); }
#zoomValue { font-size: 13px; font-weight: 500; color: var(--text-2); min-width: 50px; text-align:center; }
.preview-actions { display:flex; gap:8px; flex-wrap:wrap; }

.preview-scroll {
  flex:1;
  overflow:auto;
  padding: 30px 20px;
  display:flex; justify-content:center;
  align-items:flex-start;
}
.preview-scroll::-webkit-scrollbar { width:10px; height:10px; }
.preview-scroll::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:5px; }
.preview-scroll::-webkit-scrollbar-track { background: transparent; }
.preview-viewport { transform-origin: top center; }

/* 分页指示器：预览区下方提示当前内容页数 */
.page-indicator {
  margin: 0 20px 20px;
  padding: 10px 18px;
  border-radius: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(124,58,237,0.08));
  border: 1px solid rgba(37,99,235,0.18);
  color: #1e40af;
}
.page-indicator.warn {
  background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(249,115,22,0.1));
  border-color: rgba(239,68,68,0.25);
  color: #b91c1c;
}
.page-indicator.ok {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(6,182,212,0.08));
  border-color: rgba(16,185,69,0.2);
  color: #047857;
}

/* ------- 编辑器预览区「分页切分位置」红色虚线指示器 ------- */
.page-split-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 0;
  border-top: 2px dashed rgba(239, 68, 68, 0.75);
  z-index: 9999;
  pointer-events: none;   /* 不阻挡用户点击/编辑简历内容 */
  box-sizing: border-box;
  /* 微小动画，提示用户注意 */
  animation: psl-blink 2.4s ease-in-out infinite;
}
@keyframes psl-blink {
  0%,100% { border-top-color: rgba(239,68,68,0.75); opacity: 0.9; }
  50%     { border-top-color: rgba(239,68,68,0.35); opacity: 0.6; }
}
.page-split-line .psl-label {
  position: absolute;
  right: 12px;
  top: -14px;            /* 标签挂在虚线正上方，居中覆盖线端 */
  transform: translateY(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(239,68,68,0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(239,68,68,0.35);
  pointer-events: none;
}
/* 响应式：手机端预览宽度压缩时，标签字号再小一点 */
@media (max-width: 960px) {
  .page-split-line .psl-label { font-size: 10px; padding: 3px 8px; right: 8px; }
}

/* 简历页面 A4 比例 */
.resume-page {
  width: 794px;
  min-height: 1123px;
  background: #fff;
  box-shadow: 0 4px 24px rgba(15,23,42,0.1);
  padding: var(--page-padding, 40px);
  position:relative;
  color: var(--resume-text, #1e293b);
  font-size: var(--resume-font-size, 14px);
  font-family: var(--resume-font-family, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif);
  line-height: var(--resume-line-height, 1.65);
  overflow: hidden;
  /* ========== 派生间距变量：全部与行间距/字号成比例（调 1 个变量 = 所有间距同步缩放） ========== */
  --sec-gap: calc(var(--resume-line-height, 1.65) * 1.3em);   /* 板块之间 = 1.3 行高 */
  --item-gap: calc(var(--resume-line-height, 1.65) * 0.85em); /* r-item 之间 = 0.85 行高 */
  --bul-gap: calc(var(--resume-line-height, 1.65) * 0.22em); /* bullet 之间 = 0.22 行高 */
  --side-gap: calc(var(--resume-line-height, 1.65) * 1.6em); /* 侧栏块之间 = 1.6 行高 */
  --sec-title-mb: calc(var(--resume-line-height, 1.65) * 0.6em); /* 板块标题下间距 = 0.6 行高 */
  --item-title-mb: calc(var(--resume-line-height, 1.65) * 0.2em); /* item 标题下间距 */
  --item-desc-mt: calc(var(--resume-line-height, 1.65) * 0.35em); /* item 描述上间距 */
  --side-item-mb: calc(var(--resume-line-height, 1.65) * 0.45em); /* 侧栏条目下间距 */
}
.resume-page::after {
  content:'';
  position:absolute; inset:0;
  background-repeat:repeat;
  opacity: 0;
  pointer-events:none;
}
.resume-page.watermark::after {
  background-image: repeating-linear-gradient(
    -30deg,
    transparent 0px,
    transparent 80px,
    rgba(0,0,0,0.04) 80px,
    rgba(0,0,0,0.04) 82px
  );
  opacity: 1;
}
.resume-page.watermark::before {
  content: '快简 QuickRésumé · 免费版水印';
  position:absolute;
  bottom: 20px; right: 20px;
  font-size: 11px;
  color: rgba(0,0,0,0.2);
  z-index: 10;
}

/* 简历模板样式 1 - 简约蓝 */
.tpl-elegant .r-header { display:flex; align-items:center; gap:24px; padding-bottom:24px; border-bottom: 3px solid var(--theme-color, #2563eb); margin-bottom: 24px; }
.tpl-elegant .r-avatar { width:80px; height:80px; border-radius: 50%; background: var(--theme-color, #2563eb); display:grid; place-items:center; color:#fff; font-size: 28px; font-weight: 700; flex-shrink:0; }
.tpl-elegant .r-name { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.tpl-elegant .r-title { color: var(--theme-color, #2563eb); font-weight: 600; margin-bottom: 10px; }
.tpl-elegant .r-contact { display:flex; gap:16px; flex-wrap:wrap; font-size: 12px; color: var(--text-2); }
.tpl-elegant .r-contact span { display:inline-flex; align-items:center; gap:4px; }
.tpl-elegant .r-section { margin-bottom: var(--sec-gap); }
.tpl-elegant .r-sec-title {
  font-size: 1.15em; font-weight: 700;
  color: var(--theme-color, #2563eb);
  padding-bottom: 0.4em; border-bottom: 2px solid var(--theme-color, #2563eb);
  margin-bottom: var(--sec-title-mb);
  display:flex; align-items:center; gap:8px;
}
.tpl-elegant .r-item { margin-bottom: var(--item-gap); }
.tpl-elegant .r-item-header { display:flex; justify-content:space-between; align-items:baseline; margin-bottom: var(--item-title-mb); }
.tpl-elegant .r-item-title { font-weight: 700; font-size: 1.05em; }
.tpl-elegant .r-item-sub { color: var(--text-2); font-size: 0.95em; }
.tpl-elegant .r-item-time { font-size: 0.88em; color: var(--text-3); }
.tpl-elegant .r-item-desc { color: var(--text-2); margin-top: var(--item-desc-mt); }
.tpl-elegant .r-item-desc ul { list-style:disc; padding-left: 1.4em; display:flex; flex-direction:column; gap: var(--bul-gap); }
.tpl-elegant .r-tags { display:flex; gap: 0.4em; flex-wrap:wrap; }
.tpl-elegant .r-tag {
  display:inline-block; padding: 0.2em 0.7em;
  background: rgba(37,99,235,0.08);
  color: var(--theme-color, #2563eb);
  border-radius: 4px; font-size: 0.88em;
}
.tpl-elegant .skill-row { margin-bottom: 0.75em; }
.tpl-elegant .skill-name { display:flex; justify-content:space-between; font-size: 0.95em; margin-bottom: 0.3em; }
.tpl-elegant .skill-bar { height: 6px; background: #f1f5f9; border-radius: 3px; overflow:hidden; }
.tpl-elegant .skill-fill { height: 100%; background: var(--theme-color, #2563eb); border-radius: 3px; }

/* 模板 2 - 双栏深色 */
.tpl-dual { display:grid; grid-template-columns: 230px 1fr; padding: 0 !important; min-height: 1123px; }
.tpl-dual .r-sidebar {
  background: var(--theme-color, #0f172a);
  color: rgba(255,255,255,0.9);
  padding: calc(var(--resume-line-height, 1.65) * 2.5em) calc(var(--resume-line-height, 1.65) * 1.5em);
  display:flex; flex-direction:column;
  gap: var(--side-gap);
  /* 关键：让侧栏延伸到当页页底，预览用固定 1123px（= A4 @96dpi，避免 100vh 取屏幕高度污染预览高度参照系）
     打印阶段由 @media print body.t-dual-auto .r-sidebar 独立设置 min-height:297mm 物理单位，两边对齐 */
  height: 100%;
  align-self: stretch;
  min-height: 1123px;
}
.tpl-dual .r-main { padding: calc(var(--resume-line-height, 1.65) * 2.5em) calc(var(--resume-line-height, 1.65) * 2.2em); }
.tpl-dual .r-avatar { width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,0.15); border: 3px solid rgba(255,255,255,0.3); display:grid; place-items:center; font-size: 2.5em; font-weight: 700; margin: 0 auto; }
.tpl-dual .r-name { color: #fff; font-size: 1.6em; font-weight: 800; text-align:center; margin-top: 0.6em; }
.tpl-dual .r-title { text-align:center; color: rgba(255,255,255,0.7); margin-top: 0.3em; font-size: 0.95em; }
.tpl-dual .r-sec-title-s {
  font-size: 1em; font-weight: 700;
  color: #fff;
  padding-bottom: 0.55em;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  margin-bottom: var(--sec-title-mb);
}
.tpl-dual .r-s-item { font-size: 0.9em; margin-bottom: var(--side-item-mb); color: rgba(255,255,255,0.8); display:flex; align-items:center; gap: 6px; }
.tpl-dual .r-name-2 { font-size: 2.2em; font-weight: 800; letter-spacing: -1px; color: var(--text); }
.tpl-dual .r-name-2 span { color: var(--theme-color, #0f172a); }
.tpl-dual .r-line { height: 4px; background: var(--theme-color, #0f172a); width: 4.5em; margin: 0.9em 0 1.8em; border-radius: 2px; }
.tpl-dual .r-sec-title {
  font-size: 1.25em; font-weight: 700;
  color: var(--text);
  display:flex; align-items:center; gap: 0.75em;
  margin-bottom: var(--sec-title-mb);
}
.tpl-dual .r-sec-title::before { content:''; width: 6px; height: 1.3em; background: var(--theme-color, #0f172a); border-radius: 3px; }
.tpl-dual .r-section { margin-bottom: var(--sec-gap); }
.tpl-dual .r-item { margin-bottom: var(--item-gap); padding-left: 1.15em; border-left: 2px solid var(--border); position:relative; }
.tpl-dual .r-item::before { content:''; position:absolute; left:-7px; top:0.4em; width:12px; height:12px; border-radius:50%; background: var(--theme-color, #0f172a); }
.tpl-dual .r-item-title { font-weight: 700; font-size: 1.1em; margin-bottom: var(--item-title-mb); }
.tpl-dual .r-item-sub { color: var(--text-2); font-size: 0.95em; margin-bottom: var(--item-title-mb); }
.tpl-dual .r-item-time { font-size: 0.88em; color: var(--text-3); float: right; }
.tpl-dual .r-item-desc { color: var(--text-2); margin-top: var(--item-desc-mt); font-size: 0.95em; }
.tpl-dual .r-item-desc ul { list-style:none; display:flex; flex-direction:column; gap: var(--bul-gap); }
.tpl-dual .r-item-desc li::before { content:'▸ '; color: var(--theme-color, #0f172a); margin-right:4px; }
.tpl-dual .skill-item { margin-bottom: 0.7em; }
.tpl-dual .skill-item .s-name { font-size: 0.9em; margin-bottom: 0.3em; color: rgba(255,255,255,0.8); }
.tpl-dual .skill-item .s-bar { height: 5px; background: rgba(255,255,255,0.1); border-radius: 3px; }
.tpl-dual .skill-item .s-fill { height:100%; background: #fff; border-radius: 3px; }
.tpl-dual .r-tags { display:flex; gap:0.35em; flex-wrap:wrap; }
.tpl-dual .r-tag {
  display:inline-block; padding: 0.2em 0.65em;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  border-radius: 3px; font-size: 0.88em;
}

/* ============================================================
 *  Dual 模板 screen/print 统一布局：解锁 min-height 让内容自然撑开
 *  编辑器预览 body 加 t-dual-auto，让预览布局 = print 媒体布局
 *  这样 /api/cuts 在 print 媒体下测的 cutYs 直接画在预览上就是对的
 * ============================================================ */
body.t-dual-auto .resume-page.tpl-dual,
body.t-dual-auto .resume-page.tpl-dual * {
  min-height: auto !important;
  height: auto !important;
  page-break-inside: auto !important;
  break-inside: auto !important;
}
/* 例外：固定尺寸元素不能被 height:auto 覆盖 */
body.t-dual-auto .resume-page.tpl-dual .r-avatar {
  width: 100px !important;
  height: 100px !important;
  min-height: 100px !important;
}
body.t-dual-auto .resume-page.tpl-dual {
  width: 794px;
  min-height: auto;
  height: auto;
}
body.t-dual-auto .tpl-dual .r-sidebar {
  min-height: 1123px; /* A4 一页高度，多页时自然撑开 */
  align-self: stretch;
}

/* 模板 3 - 创意风格 */
.tpl-creative { padding: 0 !important; }
.tpl-creative .r-top {
  background: linear-gradient(135deg, var(--theme-color, #7c3aed), #06b6d4);
  color: #fff;
  padding: 44px 50px 40px;
  position:relative;
  overflow:hidden;
}
.tpl-creative .r-top::after {
  content:''; position:absolute; right:-40px; bottom:-80px;
  width: 200px; height:200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.tpl-creative .r-top::before {
  content:''; position:absolute; right: 40px; top: -30px;
  width: 120px; height:120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.tpl-creative .r-hero { position:relative; z-index:2; display:flex; align-items:center; gap: 28px; }
.tpl-creative .r-avatar {
  width: 90px; height: 90px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
  display:grid; place-items:center;
  color:#fff;
  font-size: 30px; font-weight: 700;
  border: 3px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(4px);
}
.tpl-creative .r-name { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.tpl-creative .r-title { font-size: 16px; opacity: 0.9; margin-bottom: 12px; }
.tpl-creative .r-contact { display:flex; gap: 20px; flex-wrap:wrap; font-size: 13px; opacity: 0.9; }
.tpl-creative .r-contact span { display:inline-flex; align-items:center; gap:5px; }
.tpl-creative .r-content { padding: 34px 50px; }
.tpl-creative .r-section { margin-bottom: var(--sec-gap); }
.tpl-creative .r-sec-title {
  display:inline-flex; align-items:center; gap: 0.7em;
  font-size: 1.15em; font-weight: 700;
  padding: 0.4em 1em;
  background: linear-gradient(90deg, rgba(124,58,237,0.1), transparent);
  border-left: 4px solid var(--theme-color, #7c3aed);
  margin-bottom: var(--sec-title-mb);
  color: var(--text);
}
.tpl-creative .r-item {
  background: var(--bg);
  padding: 1em 1.1em;
  border-radius: 10px;
  margin-bottom: var(--item-gap);
  border-left: 3px solid var(--theme-color, #7c3aed);
}
.tpl-creative .r-item-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom: 4px; flex-wrap:wrap; gap: 4px; }
.tpl-creative .r-item-title { font-weight: 700; }
.tpl-creative .r-item-time { font-size: 12px; color: var(--text-3); }
.tpl-creative .r-item-sub { color: var(--text-2); font-size: 13px; }
.tpl-creative .r-item-desc { color: var(--text-2); margin-top: 6px; font-size: 13px; }
.tpl-creative .r-item-desc ul { list-style:none; display:flex; flex-direction:column; gap:3px; }
.tpl-creative .r-item-desc li { position:relative; padding-left: 14px; }
.tpl-creative .r-item-desc li::before { content:'✦'; position:absolute; left:0; color: var(--theme-color, #7c3aed); font-size: 10px; top: 3px; }
.tpl-creative .r-tags { display:flex; gap: 6px; flex-wrap:wrap; }
.tpl-creative .r-tag {
  display:inline-block; padding: 4px 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(6,182,212,0.1));
  color: var(--theme-color, #7c3aed);
  border-radius: 999px; font-size: 12px;
  border: 1px solid rgba(124,58,237,0.15);
}
.tpl-creative .skills-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.tpl-creative .skill-row {}
.tpl-creative .skill-name { display:flex; justify-content:space-between; font-size: 13px; margin-bottom: 5px; }
.tpl-creative .skill-bar { height: 7px; background: #eef2ff; border-radius: 4px; overflow:hidden; }
.tpl-creative .skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--theme-color, #7c3aed), #06b6d4);
  border-radius: 4px;
}

/* ============================================================
 *  新增模板样式：modern / classic / banner
 * ============================================================ */

/* ----- 模板 modern：浅色侧栏 + 主题色点缀 ----- */
.tpl-modern { display:grid; grid-template-columns: 220px 1fr; padding: 0 !important; }
.tpl-modern .r-sidebar {
  background: #f8fafc;
  border-right: 3px solid var(--theme-color, #4f46e5);
  padding: 32px 20px;
  display:flex; flex-direction:column; gap: var(--side-gap, 16px);
}
.tpl-modern .r-avatar-wrap { text-align:center; margin-bottom: 8px; }
.tpl-modern .r-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--theme-color, #4f46e5); display:grid; place-items:center; color:#fff; font-size: 26px; font-weight: 700; margin: 0 auto; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.tpl-modern .r-name { text-align:center; font-size: 1.15em; font-weight: 800; color: var(--text); }
.tpl-modern .r-title { text-align:center; font-size: 0.9em; color: var(--theme-color, #4f46e5); margin-top: 2px; }
.tpl-modern .r-side-block { margin-top: 10px; }
.tpl-modern .r-sec-title-s { font-size: 0.85em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #e2e8f0; }
.tpl-modern .r-s-item { font-size: 0.85em; color: var(--text-2); margin-bottom: 5px; line-height: 1.5; }
.tpl-modern .r-s-tags { display:flex; flex-wrap:wrap; gap: 4px; }
.tpl-modern .r-s-tag { display:inline-block; padding: 2px 8px; background: rgba(79,70,229,0.08); color: var(--theme-color, #4f46e5); border-radius: 4px; font-size: 0.8em; }
.tpl-modern .skill-item { margin-bottom: 8px; }
.tpl-modern .skill-item .s-name { display:flex; justify-content:space-between; font-size: 0.8em; margin-bottom: 3px; color: var(--text-2); }
.tpl-modern .skill-item .s-bar { height: 4px; background: #e2e8f0; border-radius: 2px; }
.tpl-modern .skill-item .s-fill { height:100%; background: var(--theme-color, #4f46e5); border-radius: 2px; }
.tpl-modern .r-main { padding: 32px 36px; }
.tpl-modern .r-section { margin-bottom: var(--sec-gap, 16px); }
.tpl-modern .r-sec-title { font-size: 1.1em; font-weight: 700; color: var(--theme-color, #4f46e5); margin-bottom: var(--sec-title-mb, 10px); padding-bottom: 6px; border-bottom: 2px solid var(--theme-color, #4f46e5); }
.tpl-modern .r-item { margin-bottom: var(--item-gap, 12px); }
.tpl-modern .r-item-header { display:flex; justify-content:space-between; align-items:baseline; margin-bottom: 3px; flex-wrap:wrap; }
.tpl-modern .r-item-title { font-weight: 700; font-size: 1em; }
.tpl-modern .r-item-sub { color: var(--text-2); font-size: 0.9em; }
.tpl-modern .r-item-time { font-size: 0.85em; color: var(--text-3); }
.tpl-modern .r-item-desc { color: var(--text-2); margin-top: 4px; font-size: 0.9em; }
.tpl-modern .r-item-desc ul { list-style:disc; padding-left: 1.4em; display:flex; flex-direction:column; gap: 2px; }

/* ----- 模板 classic：居中页眉 + 衬线 + 横线分隔 ----- */
.tpl-classic { padding: 0 !important; }
.tpl-classic .r-header { text-align:center; padding: 40px 50px 24px; border-bottom: 2px solid var(--theme-color, #1e293b); margin-bottom: 28px; }
.tpl-classic .r-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--theme-color, #1e293b); display:grid; place-items:center; color:#fff; font-size: 22px; font-weight: 700; margin: 0 auto 12px; }
.tpl-classic .r-name { font-size: 30px; font-weight: 700; font-family: 'Georgia', 'Noto Serif SC', serif; letter-spacing: 1px; margin-bottom: 4px; }
.tpl-classic .r-title { font-size: 15px; color: var(--theme-color, #1e293b); font-style: italic; margin-bottom: 8px; }
.tpl-classic .r-contact { font-size: 12px; color: var(--text-2); }
.tpl-classic .r-body { padding: 0 50px 40px; }
.tpl-classic .r-section { margin-bottom: var(--sec-gap, 18px); }
.tpl-classic .r-sec-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; text-align:center; color: var(--theme-color, #1e293b); margin-bottom: 12px; position:relative; padding: 0 60px; }
.tpl-classic .r-sec-title::before, .tpl-classic .r-sec-title::after { content:''; position:absolute; top:50%; width: 50px; height: 1px; background: var(--text-3); }
.tpl-classic .r-sec-title::before { left: 0; }
.tpl-classic .r-sec-title::after { right: 0; }
.tpl-classic .r-sec-text { color: var(--text-2); line-height: 1.9; font-size: 14px; }
.tpl-classic .r-item { margin-bottom: var(--item-gap, 12px); }
.tpl-classic .r-item-line { display:flex; align-items:baseline; gap: 4px; flex-wrap:wrap; margin-bottom: 2px; }
.tpl-classic .r-item-title { font-weight: 700; font-family: 'Georgia', 'Noto Serif SC', serif; font-size: 15px; }
.tpl-classic .r-item-sub { color: var(--text-2); font-size: 13px; }
.tpl-classic .r-item-time { font-size: 12px; color: var(--text-3); margin-left: auto; font-style: italic; }
.tpl-classic .r-item-desc { color: var(--text-2); margin-top: 4px; }
.tpl-classic .r-item-desc ul { list-style:disc; padding-left: 1.6em; display:flex; flex-direction:column; gap: 2px; font-size: 13px; }
.tpl-classic .skill-row { display:flex; flex-wrap:wrap; gap: 8px; }
.tpl-classic .r-skill { display:inline-block; padding: 4px 12px; border: 1px solid var(--text-3); border-radius: 3px; font-size: 13px; color: var(--text-2); }
.tpl-classic .r-tags { display:flex; gap: 8px; flex-wrap:wrap; }
.tpl-classic .r-tag { display:inline-block; padding: 4px 12px; border: 1px solid var(--theme-color, #1e293b); color: var(--theme-color, #1e293b); border-radius: 3px; font-size: 13px; }

/* ----- 模板 banner：色块横幅 + 双列内容 ----- */
.tpl-banner { padding: 0 !important; }
.tpl-banner .r-banner { background: var(--theme-color, #0d9488); padding: 32px 50px; position:relative; overflow:hidden; }
.tpl-banner .r-banner::after { content:''; position:absolute; right:-30px; bottom:-60px; width: 160px; height:160px; border-radius:50%; background: rgba(255,255,255,0.06); }
.tpl-banner .r-banner-inner { position:relative; z-index:2; display:flex; align-items:center; gap: 20px; }
.tpl-banner .r-avatar { width: 64px; height: 64px; border-radius: 12px; background: rgba(255,255,255,0.2); display:grid; place-items:center; color:#fff; font-size: 22px; font-weight:700; border: 2px solid rgba(255,255,255,0.3); flex-shrink:0; }
.tpl-banner .r-banner-info { flex:1; }
.tpl-banner .r-name { color:#fff; font-size: 26px; font-weight:800; margin-bottom: 2px; }
.tpl-banner .r-title { color: rgba(255,255,255,0.85); font-size: 14px; }
.tpl-banner .r-banner-contact { display:flex; flex-direction:column; gap: 4px; font-size: 12px; color: rgba(255,255,255,0.9); }
.tpl-banner .r-content { display:grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 28px 40px; }
.tpl-banner .r-col { padding: 0 16px; }
.tpl-banner .r-col:first-child { border-right: 1px solid var(--border); }
.tpl-banner .r-section { margin-bottom: var(--sec-gap, 16px); }
.tpl-banner .r-sec-title { font-size: 0.9em; font-weight:700; text-transform:uppercase; letter-spacing:1px; color: var(--theme-color, #0d9488); margin-bottom: var(--sec-title-mb, 10px); padding-bottom: 4px; border-bottom: 2px solid var(--theme-color, #0d9488); }
.tpl-banner .r-item { margin-bottom: var(--item-gap, 12px); }
.tpl-banner .r-item-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom: 2px; flex-wrap:wrap; }
.tpl-banner .r-item-title { font-weight:700; font-size: 1em; }
.tpl-banner .r-item-time { font-size: 0.85em; color: var(--text-3); }
.tpl-banner .r-item-sub { color: var(--text-2); font-size: 0.9em; margin-bottom: 2px; }
.tpl-banner .r-item-desc { color: var(--text-2); margin-top: 4px; font-size: 0.9em; }
.tpl-banner .r-item-desc ul { list-style:none; display:flex; flex-direction:column; gap: 2px; }
.tpl-banner .r-item-desc li { position:relative; padding-left: 12px; }
.tpl-banner .r-item-desc li::before { content:'·'; position:absolute; left:0; color: var(--theme-color, #0d9488); font-weight:bold; }
.tpl-banner .skills-grid { display:grid; grid-template-columns: 1fr; gap: 10px; }
.tpl-banner .skill-name { display:flex; justify-content:space-between; font-size: 0.9em; margin-bottom: 3px; }
.tpl-banner .skill-bar { height: 5px; background: #f1f5f9; border-radius: 3px; overflow:hidden; }
.tpl-banner .skill-fill { height:100%; background: var(--theme-color, #0d9488); border-radius: 3px; }
.tpl-banner .r-tags { display:flex; gap: 6px; flex-wrap:wrap; }
.tpl-banner .r-tag { display:inline-block; padding: 3px 10px; background: rgba(13,148,136,0.08); color: var(--theme-color, #0d9488); border-radius: 4px; font-size: 0.85em; }

/* ========== 求职意向信息条（全模板共享） ========== */
/* 固定浅灰底 + 主题色左边框；不使用 color-mix 等新函数，兼容所有浏览器 */
.r-intent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 4px solid var(--theme-color, #2563eb);
  border-radius: 6px;
  margin-bottom: var(--sec-gap, 16px);
  page-break-inside: avoid;
  break-inside: avoid;
}
.r-intent-item { font-size: 0.95em; color: var(--text); min-width: 0; overflow-wrap: break-word; word-break: break-all; }
.r-intent-item b { color: var(--theme-color, #2563eb); font-weight: 700; margin-right: 2px; }
/* classic 模板（衬线居中风）：去底色，改为上下细线 + 居中 */
.tpl-classic .r-intent {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  text-align: center;
}

/* Tips Panel */
.tip-card {
  background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(6,182,212,0.04));
  border: 1px solid rgba(37,99,235,0.12);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.tip-green {
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(34,197,94,0.04));
  border-color: rgba(16,185,129,0.18);
}
.tip-card .tip-icon { font-size: 22px; margin-bottom: 6px; }
.tip-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.tip-card p { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.tip-list { display:flex; flex-direction:column; gap: 6px; }
.tip-list li { font-size: 13px; color: var(--text-2); padding-left: 18px; position:relative; }
.tip-list li::before { content:'✓'; position:absolute; left:0; color: var(--success); font-weight: 700; }

/* Modal */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  display:grid; place-items:center;
  z-index: 999;
  backdrop-filter: blur(4px);
}
.modal-box {
  background:#fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 520px;
  width: calc(100% - 48px);
  box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-body { margin-bottom: 22px; max-height: 320px; overflow-y: auto; }
.check-item {
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 10px;
  display:flex; gap: 10px; align-items:flex-start;
}
.check-item .c-icon { font-size: 18px; flex-shrink:0; }
.check-item.ok { background: rgba(16,185,129,0.08); }
.check-item.warn { background: rgba(245,158,11,0.08); }
.check-item.err { background: rgba(239,68,68,0.08); }
.check-text { font-size: 13px; }
.check-text b { color: var(--text); font-weight: 600; }
.check-text span { color: var(--text-2); display:block; margin-top: 2px; }
.modal-actions { display:flex; justify-content:flex-end; gap: 10px; }

/* 模板缩略图内页预览 */
.thumb-inner.t-elegant { padding: 10px 8px; display:flex; flex-direction:column; gap: 5px; background:#fff; }
.thumb-inner.t-elegant .th-h { height: 2px; background: var(--primary); margin-bottom: 4px; }
.thumb-inner.t-elegant .th-r1 { display:flex; gap: 6px; align-items:center; margin-bottom: 3px; }
.thumb-inner.t-elegant .th-a { width: 14px; height:14px; border-radius: 50%; background: var(--primary); flex-shrink:0; }
.thumb-inner.t-elegant .th-n1 { width: 50%; height:4px; background: var(--text); border-radius: 1px; }
.thumb-inner.t-elegant .th-n2 { width: 70%; height:3px; background: var(--text-3); border-radius: 1px; }
.thumb-inner.t-elegant .th-line { height:1.5px; background: var(--primary); margin: 4px 0; }
.thumb-inner.t-elegant .th-t { width: 30%; height:3px; background: var(--primary); border-radius: 1px; margin-bottom: 3px; }
.thumb-inner.t-elegant .th-d { width: 90%; height:2px; background: var(--text-2); border-radius: 1px; margin-bottom: 1px; }
.thumb-inner.t-elegant .th-d.s { width: 70%; }
.thumb-inner.t-elegant .th-d.t { width: 85%; }

.thumb-inner.t-dual { display:grid; grid-template-columns: 1fr 2fr; padding:0; background:#fff; }
.thumb-inner.t-dual .th-s { background: #0f172a; display:flex; flex-direction:column; gap: 4px; padding: 8px 5px; }
.thumb-inner.t-dual .th-av { width:20px; height:20px; border-radius:50%; background: rgba(255,255,255,0.2); align-self:center; margin: 4px 0; }
.thumb-inner.t-dual .th-sl { height:2px; background: rgba(255,255,255,0.2); border-radius: 1px; }
.thumb-inner.t-dual .th-sl.s { width: 70%; }
.thumb-inner.t-dual .th-m { display:flex; flex-direction:column; gap: 3px; padding: 8px 6px; }
.thumb-inner.t-dual .th-mt { width: 80%; height:4px; background: var(--text); border-radius: 1px; }
.thumb-inner.t-dual .th-mb { width: 15%; height: 2px; background: #0f172a; border-radius: 1px; }
.thumb-inner.t-dual .th-md { width: 92%; height:2px; background: var(--text-2); border-radius: 1px; }

.thumb-inner.t-creative { padding:0; background:#fff; display:flex; flex-direction:column; }
.thumb-inner.t-creative .th-top { height: 28%; background: linear-gradient(135deg, #7c3aed, #06b6d4); padding: 6px 8px; display:flex; align-items:center; gap: 6px; }
.thumb-inner.t-creative .th-ava { width: 18px; height: 18px; border-radius: 4px; background: rgba(255,255,255,0.25); }
.thumb-inner.t-creative .th-txt { flex:1; display:flex; flex-direction:column; gap: 2px; }
.thumb-inner.t-creative .th-l1 { width: 70%; height: 3px; background: #fff; border-radius: 1px; }
.thumb-inner.t-creative .th-l2 { width: 50%; height: 2px; background: rgba(255,255,255,0.7); border-radius: 1px; }
.thumb-inner.t-creative .th-btm { flex:1; padding: 6px 8px; display:flex; flex-direction:column; gap: 3px; }
.thumb-inner.t-creative .th-sec { width: 30%; height: 3px; background: #7c3aed; border-radius: 1px; }
.thumb-inner.t-creative .th-box { background: #f8fafc; padding: 3px; border-radius: 2px; border-left: 2px solid #7c3aed; display:flex; flex-direction:column; gap: 1px; }
.thumb-inner.t-creative .th-box .b1 { width: 70%; height: 2px; background: var(--text); border-radius: 1px; }
.thumb-inner.t-creative .th-box .b2 { width: 90%; height: 1.5px; background: var(--text-2); border-radius: 1px; }

/* ---------- 真实模板封面图（替换原 CSS 假色块） ---------- */
.thumb-inner .tpl-cover-img {
  /* 【关键修复】绝对定位脱离父容器 flex/grid 文档流，
     原 .thumb-inner.t-dual 有 display:grid grid-template-columns:1fr 2fr（老假色块用），
     如果 img 是普通子元素会被塞进左侧 1/3 cell，导致「视觉偏左溢出、右边空」。
     改成 absolute + 父容器 position:relative 后，无论父是 grid/flex/block，
     img 永远端端正正贴满 thumb-inner 的 0,0 位置，宽高 100%。 */
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover;
  object-position: top center;
  background: #fff;
}

/* hover 时图片跟着放大（容器已经有 transform:scale(1.04)，这里平滑过渡避免闪烁） */
.thumb-inner {
  position: relative;
  will-change: transform;
}
.thumb-inner .tpl-cover-img {
  transition: filter .3s ease;
}
.template-card:hover .tpl-cover-img {
  /* 图片本身做轻微锐化/提亮，和外层 1.04 放大叠加，增强 hover 质感 */
  filter: brightness(1.04) saturate(1.06);
}

/* 响应式 */
@media (max-width: 960px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-right { height: 360px; order: -1; }
  .hero-title { font-size: 40px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .template-grid, .template-grid-large { grid-template-columns: repeat(2, 1fr); }
  .footer-container { grid-template-columns: 1fr 1fr; }
  .guide-steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); }
  .editor-layout { grid-template-columns: 1fr; height:auto; }
  .editor-body { overflow:auto; height:auto; }
  .editor-panel { max-height: 70vh; }
  .resume-page { width: 100%; max-width: 520px; }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .template-grid, .template-grid-large { grid-template-columns: 1fr; }
  .footer-container { grid-template-columns: 1fr; gap: 28px; }
  .nav-links { display:none; }
  .hero-title { font-size: 32px; }
  .hero-stats { flex-direction:column; align-items:flex-start; gap: 16px; }
  .stat-divider { display:none; }
}
