:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --ink: #171717;
  --muted: #737373;
  --line: #e5e5e5;
  --line-light: #f0f0f0;
  --brand: #171717;
  --brand-2: #2563eb;
  --accent: #10b981;
  --danger: #dc2626;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --mono: 'JetBrains Mono', 'Roboto Mono', 'Consolas', monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Heiti SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.hidden { display: none !important; }

/* 滚动条 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a3a3a3; }

/* ============ 首页 ============ */
.home {
  height: 100%;
  overflow: auto;
  background: linear-gradient(180deg, #f8f9ff 0%, #f0f2f8 40%, #fafafa 100%);
  position: relative;
}
/* 顶部装饰光晕 */
.home::before {
  content: '';
  position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 360px;
  background: radial-gradient(ellipse, rgba(37,99,235,.07) 0%, transparent 70%);
  pointer-events: none;
}
.home-hero {
  text-align: center;
  padding: 56px 20px 20px;
  position: relative;
}
.brand-big {
  font-size: 30px; font-weight: 800; color: var(--ink);
  letter-spacing: .5px;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand-big .brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-2), #7c3aed);
  color: #fff; font-size: 22px;
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}
.home-hero h1 {
  font-size: 24px; margin: 16px 0 10px; color: var(--ink);
  font-weight: 700; letter-spacing: -.3px;
}
.home-hero p {
  font-size: 14px; color: var(--muted); max-width: 520px; margin: 0 auto;
  line-height: 1.8;
}
.home-hero strong { color: var(--brand-2); font-weight: 600; }

/* ============ 三条入口卡片 ============ */
.entry-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 780px;
  margin: 12px auto 24px;
  padding: 0 20px;
}
.entry-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 22px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s, border-color .22s;
  animation: cardFadeUp .45s ease both;
}
.entry-card:nth-child(1) { animation-delay: .08s; }
.entry-card:nth-child(2) { animation-delay: .16s; }
.entry-card:nth-child(3) { animation-delay: .24s; }
@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 卡片顶部彩色条 */
.entry-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--brand-2);
  opacity: 0;
  transition: opacity .22s;
}
.entry-card:nth-child(1)::before { background: linear-gradient(90deg, #2563eb, #7c3aed); }
.entry-card:nth-child(2)::before { background: linear-gradient(90deg, #0ea5e9, #06b6d4); }
.entry-card:nth-child(3)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.entry-card:hover::before { opacity: 1; }

.entry-card:hover {
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  transform: translateY(-4px);
}
.entry-card:active { transform: translateY(-1px); transition-duration: .08s; }

.entry-icon {
  width: 60px; height: 60px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: #f0f4ff;
  color: var(--brand-2);
  transition: transform .22s, background .22s, color .22s, box-shadow .22s;
}
.entry-card:nth-child(1) .entry-icon { background: #eef2ff; color: #4f46e5; }
.entry-card:nth-child(2) .entry-icon { background: #ecfeff; color: #0891b2; }
.entry-card:nth-child(3) .entry-icon { background: #ecfdf5; color: #059669; }

.entry-card:hover .entry-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.entry-card:nth-child(1):hover .entry-icon { background: #4f46e5; color: #fff; }
.entry-card:nth-child(2):hover .entry-icon { background: #0891b2; color: #fff; }
.entry-card:nth-child(3):hover .entry-icon { background: #059669; color: #fff; }

.entry-icon svg { width: 28px; height: 28px; stroke-width: 1.8; }

.entry-title {
  font-size: 16px; font-weight: 700; color: var(--ink);
  margin-bottom: 6px;
  transition: color .15s;
}
.entry-card:hover .entry-title { color: var(--brand-2); }

.entry-desc {
  font-size: 12.5px; color: var(--muted); line-height: 1.65;
}

/* 卡片底部箭头提示 */
.entry-card::after {
  content: '→';
  position: absolute; bottom: 14px; right: 18px;
  font-size: 16px; color: #d4d4d4;
  opacity: 0; transform: translateX(-6px);
  transition: opacity .2s, transform .2s;
}
.entry-card:hover::after { opacity: 1; transform: translateX(0); }

/* ============ 模板画廊区 ============ */
.tpl-gallery-section {
  max-width: 880px;
  margin: 0 auto 28px;
  padding: 0 20px;
  animation: fadeSlideIn .3s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.gallery-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding: 0 4px;
}
.gallery-back-btn {
  font-size: 13px; padding: 6px 14px;
  display: inline-flex; align-items: center; gap: 4px;
}
.gallery-title {
  font-size: 16px; font-weight: 700; color: var(--ink);
}

/* ============ 草稿继续条 ============ */
.draft-resume {
  max-width: 780px;
  margin: 0 auto 20px;
  padding: 0 20px;
  animation: cardFadeUp .4s ease both;
  animation-delay: .3s;
}
.draft-resume-inner {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.draft-resume-text { font-size: 13px; color: var(--muted); }
.draft-resume-inner .btn { padding: 7px 20px; font-size: 13px; }

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tpl-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.tpl-card:hover {
  border-color: var(--brand-2);
  box-shadow: 0 4px 16px rgba(37,99,235,.08);
  transform: translateY(-2px);
}
.tpl-card .thumb {
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fafafa;
  aspect-ratio: 720 / 460;
  display: flex; align-items: center; justify-content: center;
}
.tpl-card .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tpl-card.is-blank .thumb::after { content: "空白"; color: #d4d4d4; font-size: 18px; font-weight: 700; }
.tpl-card.continue .thumb.cont { color: var(--brand-2); font-weight: 700; font-size: 18px; }
.tpl-name { font-weight: 600; margin: 10px 4px 8px; font-size: 13.5px; color: var(--ink); }
.tpl-card .use-btn {
  margin-top: auto;
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 8px;
  text-align: center;
  transition: all .15s;
}
.tpl-card .use-btn:hover {
  background: var(--brand-2);
  color: #fff;
  border-color: var(--brand-2);
}
.home-foot { text-align: center; color: #a3a3a3; font-size: 12px; padding: 16px 0 48px; letter-spacing: .3px; }

/* ============ 路径引导覆盖层 ============ */
.guide-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: guideFadeIn .25s ease;
}
@keyframes guideFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.guide-modal {
  background: #fff; border-radius: 16px;
  padding: 32px 28px 28px;
  max-width: 480px; width: 92%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  animation: guideSlideUp .3s ease;
}
@keyframes guideSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.guide-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 22px; color: #a3a3a3;
  cursor: pointer; padding: 4px 8px; line-height: 1;
  transition: color .15s;
}
.guide-close:hover { color: var(--ink); }

/* 步骤指示器 */
.guide-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 20px;
}
.guide-step {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  background: #e5e7eb; color: #9ca3af;
  transition: all .2s;
}
.guide-step.active { background: var(--brand-2); color: #fff; }
.guide-step.done { background: var(--accent); color: #fff; }
.guide-step-line { width: 32px; height: 2px; background: #e5e7eb; }

.guide-title {
  font-size: 18px; font-weight: 700; color: var(--ink);
  text-align: center; margin-bottom: 10px;
}
.guide-desc {
  font-size: 13px; color: var(--muted); line-height: 1.8;
  text-align: center; margin-bottom: 20px;
}
.guide-desc p { margin: 0 0 4px; }
.guide-sub { font-size: 12px; color: #a3a3a3; }

.guide-action {
  display: block; width: 100%; padding: 10px;
  font-size: 14px; text-align: center;
}

/* 上传区域 */
.guide-upload-area {
  border: 2px dashed #d1d5db; border-radius: 12px;
  padding: 32px 20px; text-align: center;
  cursor: pointer; color: #9ca3af;
  transition: border-color .2s, background .2s, color .2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.guide-upload-area:hover,
.guide-upload-area.dragover {
  border-color: var(--brand-2); background: #f0f4ff; color: var(--brand-2);
}
.guide-upload-hint { font-size: 11px; color: #c4c4c4; }

/* 预览 */
.guide-preview {
  text-align: center; margin: 16px 0;
  animation: guideFadeIn .3s ease;
}
.guide-preview img {
  max-width: 100%; max-height: 180px;
  border-radius: 8px; border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.guide-preview-label {
  font-size: 12px; color: var(--muted); margin-top: 8px;
}

/* 底部按钮组 */
.guide-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px;
}
.guide-actions .btn { flex: 1; text-align: center; padding: 9px 12px; }

/* ============ 编辑器布局 ============ */
.editor { height: 100%; display: flex; flex-direction: column; overflow: hidden; }

/* 顶部栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 16px; height: 48px;
  background: var(--brand);
  color: #fff; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand .logo { font-size: 18px; cursor: pointer; user-select: none; }
.brand .title { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.brand .sub { font-size: 11px; opacity: .5; font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.action-group { display: flex; align-items: center; gap: 2px; }
.action-divider { width: 1px; height: 20px; background: rgba(255,255,255,.15); flex-shrink: 0; }
.icon-btn { padding: 5px 8px; font-size: 15px; line-height: 1; min-width: 32px; text-align: center; }
.top-actions .icon-btn { color: #fff; background: transparent; border-color: rgba(255,255,255,.15); }
.top-actions .icon-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }
.top-actions .icon-btn:disabled { opacity: .3; }
.top-actions .btn-danger.icon-btn:hover { background: rgba(220,38,38,.2); border-color: rgba(220,38,38,.5); color: #fca5a5; }
.bg-pick {
  display: flex; align-items: center; gap: 5px; font-size: 12px;
  background: rgba(255,255,255,.08); padding: 4px 8px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s;
}
.bg-pick:hover { background: rgba(255,255,255,.15); }
.bg-pick input[type=color] { width: 22px; height: 18px; border: none; background: none; cursor: pointer; padding: 0; }

/* 按钮 */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 5px 12px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s; white-space: nowrap; font-weight: 500;
}
.btn:hover { background: #f5f5f5; border-color: #a3a3a3; }
.btn:active { background: #ebebeb; }
.btn.block { display: block; width: 100%; margin-bottom: 6px; text-align: left; }
.btn-primary { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .35; cursor: default; pointer-events: none; }

/* 三栏 */
.layout { flex: 1; display: grid; grid-template-columns: 200px 1fr 240px; min-height: 0; }

.toolbar { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 12px; overflow-y: auto; }
.tool-group, .tool-section { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line-light); }
.tool-group:last-child, .tool-section:last-child { border-bottom: none; padding-bottom: 0; }
.tool-label { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: .5px; }

/* 添加元素 2列网格 */
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.add-btn { padding: 8px 6px !important; font-size: 12px !important; text-align: center; margin-bottom: 0 !important; display: flex !important; align-items: center; justify-content: center; gap: 3px; }

/* 折叠式操作提示 */
.hints-collapse { border-bottom: none !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }
.hints-collapse > summary { cursor: pointer; list-style: none; display: flex; align-items: center; user-select: none; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .5px; padding: 4px 0; margin-top: 4px; }
.hints-collapse > summary::-webkit-details-marker { display: none; }
.hints-collapse > summary::after { content: '▸'; margin-left: auto; font-size: 10px; transition: transform .15s; }
.hints-collapse[open] > summary::after { transform: rotate(90deg); }
.hints-collapse .hint { margin-top: 6px; margin-bottom: 8px; }
.hints-collapse .hint ul { margin: 0; padding-left: 15px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.toolbar .hint ul { margin: 0; padding-left: 15px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.select {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 6px; background: #fff; color: var(--ink);
  transition: border-color .12s;
}
.select:focus { border-color: var(--brand-2); outline: none; }
.add-row { display: flex; gap: 6px; align-items: stretch; }
.add-row .select { width: auto; flex: 1 1 auto; margin-bottom: 0; min-width: 0; }
.add-row .btn { white-space: nowrap; }

/* 画布 */
.stage {
  display: flex; flex-direction: column; min-width: 0;
  background:
    linear-gradient(45deg, #ededed 25%, transparent 25%) -10px 0,
    linear-gradient(-45deg, #ededed 25%, transparent 25%) -10px 0,
    linear-gradient(45deg, transparent 75%, #ededed 75%),
    linear-gradient(-45deg, transparent 75%, #ededed 75%);
  background-size: 16px 16px; background-color: #f5f5f5;
}
.tabs { display: flex; align-items: flex-end; gap: 4px; padding: 8px 14px 0; border-bottom: 1px solid var(--line); }
.tab {
  border: 1px solid var(--line); border-bottom: none; background: #fff; padding: 7px 18px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: 13px; cursor: pointer; color: var(--muted);
  transition: background .12s, color .12s; font-weight: 500; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); background: #f5f5f5; }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.canvas-host { flex: 1; display: block; overflow: auto; padding: 16px; min-height: 0; text-align: center; }
.canvas-frame { display: none; width: -moz-fit-content; width: fit-content; margin: 0 auto; }
.canvas-frame.active { display: block; }
.canvas-wrap { position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04); display: inline-block; border-radius: 1px; }

/* 缩放控制 */
.zoom-ctl {
  margin-left: auto; display: flex; align-items: center; gap: 1px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1px 3px;
}
.zoom-ctl button {
  border: none; background: none; cursor: pointer; font-size: 14px; line-height: 1;
  padding: 4px 8px; border-radius: 3px; color: var(--ink); font-family: inherit;
  transition: background .1s;
}
.zoom-ctl button:hover { background: var(--line-light); }
.zoom-ctl #zoom-val { min-width: 44px; text-align: center; font-size: 11px; color: var(--muted); user-select: none; }

.stage-foot { padding: 6px 14px; font-size: 11px; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line-light); letter-spacing: .2px; }

/* 属性面板 */
.props { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.props-head {
  padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--ink); display: flex; align-items: center;
  background: #fafafa;
}
.prop-body { padding: 14px; overflow-y: auto; flex: 1; }
.empty-tip { color: var(--muted); font-size: 13px; line-height: 1.8; text-align: center; margin-top: 28px; }
.empty-icon { font-size: 24px; margin-bottom: 6px; opacity: .5; }
.empty-hint { font-size: 11px; color: #a3a3a3; line-height: 1.6; margin-top: 4px; }
/* ── 属性面板：分区布局 ── */
.sel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line-light);
}
.sel-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--brand-2); color: #fff; font-size: 12px; font-weight: 700;
  line-height: 1; flex-shrink: 0;
}
.sel-label { font-size: 13px; font-weight: 600; color: var(--ink); }

.prop-section { margin-bottom: 6px; }
.section-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin: 10px 0 8px; padding-bottom: 5px;
  border-bottom: 1px solid var(--line-light);
}
.section-title.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* 开关 */
.toggle-switch { position: relative; display: inline-block; width: 34px; height: 18px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #d4d4d4; border-radius: 18px; transition: .2s;
}
.toggle-slider::before {
  content: ""; position: absolute; height: 14px; width: 14px;
  left: 2px; bottom: 2px; background: #fff; border-radius: 50%; transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--brand-2); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* 颜色 hex 显示 */
.color-hex { font-size: 11px; color: var(--muted); font-family: var(--mono); letter-spacing: .3px; }

/* 滑块 + 数值 */
.range-row { display: flex; align-items: center; gap: 8px; }
.range-row input[type=range] { flex: 1; margin: 0; accent-color: var(--brand-2); }
.range-val { font-size: 11px; color: var(--muted); font-family: var(--mono); min-width: 32px; text-align: right; }

/* 文字内容 textarea */
.field textarea.text-content { min-height: 64px; }

/* 阴影折叠 */
.shadow-controls.collapsed { display: none; }

/* 操作区 */
.actions { display: flex; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-light); }
.actions .btn { flex: 1; text-align: center; font-size: 12px; }
.btn-secondary {
  background: #f5f5f5; color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 500;
  transition: all .12s;
}
.btn-secondary:hover { background: #ebebeb; border-color: #a3a3a3; }

.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.field input[type=text], .field input[type=number], .field textarea, .field select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; color: var(--ink);
  transition: border-color .15s;
  background: #fff;
}
.field input[type=text]:focus, .field input[type=number]:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand-2); outline: none;
}
.field textarea { resize: vertical; min-height: 56px; }
.field input[type=range] { width: 100%; margin: 4px 0; accent-color: var(--brand-2); }
.row { display: flex; gap: 8px; }
.row > .field { flex: 1; }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row input[type=color] {
  width: 36px; height: 30px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 2px; background: #fff; cursor: pointer; flex-shrink: 0;
}
.color-row input[type=color]:hover { border-color: var(--brand-2); }
.toggle-group { display: flex; gap: 4px; }
.toggle-group button {
  flex: 1; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm);
  padding: 6px 0; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all .12s;
}
.toggle-group button:hover { border-color: #a3a3a3; background: #fafafa; }
.toggle-group button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.btn-grid .btn { text-align: center; margin: 0; font-size: 12px; padding: 6px 8px; }
.divider { height: 1px; background: var(--line-light); margin: 14px 0; }

/* 阴影控制面板 */
.shadow-controls { background: #f8f9fa; border-radius: 6px; padding: 10px; }
.shadow-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.shadow-row:last-child { margin-bottom: 0; }
.shadow-label { font-size: 11px; color: var(--muted); min-width: 50px; font-weight: 500; }
.shadow-val { font-size: 11px; color: var(--muted); min-width: 35px; text-align: right; font-family: var(--mono); }
.shadow-row input[type=range] { flex: 1; margin: 0; }
.shadow-row .color-row { flex: 1; }

/* 底部导出 */
.exportbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: #fafafa; border-top: 1px solid var(--line);
}
.exp-label { font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.exp-note { font-size: 12px; color: var(--muted); margin-left: auto; }
.exportbar .select { width: auto; margin: 0; font-size: 12px; }

/* Toast */
.toast {
  position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff; padding: 8px 18px; border-radius: var(--radius); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 预设图片面板 ============ */
.preset-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  animation: iconFadeIn .15s ease;
}
.preset-panel {
  background: var(--panel); border-radius: var(--radius-lg);
  width: 520px; max-width: 92vw; max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  animation: iconSlideUp .2s ease;
}
.preset-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px; border-bottom: 1px solid var(--line);
}
.preset-panel-title { font-size: 15px; font-weight: 600; }
.preset-panel-actions { display: flex; align-items: center; gap: 8px; }
.preset-upload-btn {
  font-size: 12px !important; padding: 4px 12px !important;
  border-radius: 20px !important; border: 1px dashed var(--brand-2) !important;
  color: var(--brand-2) !important; background: transparent !important;
  cursor: pointer; transition: all .15s;
}
.preset-upload-btn:hover {
  background: var(--brand-2) !important; color: #fff !important;
  border-style: solid !important;
}
.preset-panel-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--muted); line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.preset-panel-close:hover { background: var(--line-light); color: var(--ink); }
.preset-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 14px 18px; overflow-y: auto; flex: 1;
}
.preset-item {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); cursor: pointer; transition: all .12s;
  border: 2px solid transparent; position: relative; overflow: hidden;
  background: var(--bg);
}
.preset-item:hover { border-color: var(--brand-2); transform: scale(1.02); }
.preset-item img {
  width: 100%; height: 100%; object-fit: contain; padding: 4px;
}
.preset-item-del {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(220,53,69,.85); color: #fff; border: none;
  font-size: 13px; line-height: 20px; text-align: center;
  cursor: pointer; opacity: 0; transition: opacity .12s;
  padding: 0;
}
.preset-item:hover .preset-item-del { opacity: 1; }
.preset-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 18px; color: var(--muted); text-align: center;
}
.preset-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.preset-empty p { margin: 4px 0; font-size: 14px; }
.preset-empty-hint { font-size: 12px; color: var(--muted); opacity: .7; }

@media (max-width: 768px) {
  .preset-panel { width: 96vw; max-height: 75vh; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 12px; }
}

/* ============ 图标选择面板 ============ */

@media (max-width: 920px) {
  .layout { grid-template-columns: 160px 1fr 200px; }
  .exp-note { display: none; }
}

/* ============ 移动端 ≤768px ============ */
.mobile-menu-btn {
  display: none; background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; padding: 6px 10px; line-height: 1;
}
.mobile-props-toggle {
  display: none; position: fixed; z-index: 40;
  bottom: 68px; right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand-2); color: #fff; border: none;
  font-size: 17px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  align-items: center; justify-content: center;
}
.mobile-props-toggle:active { opacity: .8; }
.mobile-props-toggle.has-sel { background: var(--accent); animation: mpulse 2s infinite; }
@keyframes mpulse {
  0%,100% { box-shadow: 0 2px 8px rgba(0,0,0,.2); }
  50% { box-shadow: 0 2px 16px rgba(16,185,129,.4); }
}
.mobile-props-close { display: none; }
.mobile-backdrop { display: none; }

@media (max-width: 768px) {
  .layout { display: block; }

  .topbar { padding: 6px 10px; gap: 6px; flex-wrap: nowrap; height: 44px; }
  .brand { flex-shrink: 0; }
  .brand .title { font-size: 14px; white-space: nowrap; }
  .brand .sub { display: none; }
  .mobile-menu-btn { display: none !important; }
  .top-actions { gap: 3px; overflow-x: auto; -webkit-overflow-scrolling: touch; flex: 1; min-width: 0; }
  .top-actions .btn { padding: 4px 6px; font-size: 12px; flex-shrink: 0; }
  .icon-btn { padding: 5px 7px; font-size: 14px; min-width: 30px; }
  .action-divider { height: 16px; }
  .bg-pick { font-size: 11px; padding: 3px 5px; flex-shrink: 0; }
  .bg-pick input[type=color] { width: 20px; height: 16px; }

  .toolbar {
    position: fixed; left: 0; right: 0; bottom: 52px;
    z-index: 50; background: var(--panel);
    border-top: 1px solid var(--line);
    padding: 6px 8px;
    display: flex; flex-direction: row; gap: 6px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    max-height: none; height: auto; width: auto;
    transform: none !important;
  }
  .toolbar.mobile-panel-open { transform: none !important; }
  .toolbar .tool-group, .toolbar .tool-section {
    display: flex; flex-direction: row; gap: 4px; align-items: center;
    margin-bottom: 0; flex-shrink: 0;
  }
  .toolbar .tool-label { display: none; }
  .toolbar .tool-group .hint, .toolbar .tool-section .hint { display: none; }
  .toolbar .hints-collapse { display: none; }
  .toolbar .add-grid { display: flex; flex-direction: row; gap: 4px; }
  .toolbar .add-btn { padding: 6px 8px !important; font-size: 11px !important; min-height: 34px; }
  .toolbar .select { width: auto; min-width: 90px; margin-bottom: 0; padding: 6px 8px; font-size: 12px; min-height: 34px; }
  .toolbar .btn.block {
    width: auto; margin-bottom: 0; padding: 6px 10px; font-size: 12px;
    min-height: 34px; white-space: nowrap; text-align: center;
    display: flex; align-items: center; justify-content: center;
  }

  .props {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 100; background: var(--panel);
    transform: translateY(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    border-top: 1px solid var(--line);
    border-left: none;
    height: 55vh; max-height: 480px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.1);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .props.mobile-panel-open { transform: translateY(0); }
  .props-head {
    position: sticky; top: 0; background: var(--panel); z-index: 1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-top: 20px; min-height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-bottom: 1px solid var(--line);
  }
  .props-head::before {
    content: ''; position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%); width: 32px; height: 4px;
    background: var(--line); border-radius: 2px;
  }
  .mobile-props-close {
    display: block; position: absolute; top: 14px; right: 12px;
    background: none; border: none; font-size: 18px; color: var(--muted);
    cursor: pointer; padding: 4px 8px; z-index: 2; line-height: 1;
  }
  .prop-body { padding: 12px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .prop-body .field input,
  .prop-body .field textarea,
  .prop-body .field select { padding: 10px; font-size: 14px; min-height: 38px; }
  .prop-body .btn { min-height: 38px; padding: 8px 10px; font-size: 13px; }
  .prop-body .toggle-group button { padding: 10px 0; font-size: 15px; }
  .prop-body .color-row input[type=color] { width: 40px; height: 34px; }

  .mobile-props-toggle { display: flex; }

  .mobile-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.3); z-index: 99;
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .mobile-backdrop.show { opacity: 1; pointer-events: auto; }

  .stage { min-height: 0; display: flex; flex-direction: column; }
  .tabs { padding: 6px 10px 0; gap: 4px; flex-shrink: 0; }
  .tab { padding: 7px 12px; font-size: 13px; min-height: 36px; }
  .canvas-host { flex: 1; min-height: 0; padding: 8px; display: flex; align-items: flex-start; justify-content: center; overflow: auto; }
  .canvas-frame { margin: 0 auto; }
  .canvas-frame.active { display: block; }
  .stage-foot { display: none; }
  .zoom-ctl { padding: 1px; gap: 0; }
  .zoom-ctl button { padding: 6px 8px; font-size: 15px; min-width: 32px; min-height: 30px; }
  .zoom-ctl #zoom-val { font-size: 11px; min-width: 38px; }

  .exportbar { padding: 6px 8px; gap: 6px; flex-wrap: wrap; }
  .exp-label { display: none; }
  .exportbar .select { display: none; }
  .exp-note { display: none; }
  .exportbar .btn { flex: 1; min-width: 0; text-align: center; padding: 8px 4px; font-size: 12px; min-height: 38px; }

  .toast { bottom: 110px; font-size: 13px; padding: 8px 14px; }

  .home-hero { padding: 28px 16px 12px; }
  .brand-big { font-size: 22px; gap: 8px; }
  .brand-big .brand-icon { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
  .home-hero h1 { font-size: 18px; margin: 10px 0 8px; }
  .home-hero p { font-size: 13px; }
  .entry-cards { grid-template-columns: 1fr; gap: 12px; padding: 0 16px 20px; max-width: 360px; }
  .entry-card { padding: 22px 18px 18px; }
  .entry-card::after { display: none; }
  .entry-icon { width: 52px; height: 52px; border-radius: 14px; }
  .entry-icon svg { width: 24px; height: 24px; }
  .entry-title { font-size: 15px; }
  .entry-desc { font-size: 12.5px; }
  .tpl-gallery-section { padding: 0 16px; }
  .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tpl-card { padding: 8px; }
  .tpl-name { font-size: 13px; margin: 8px 2px 6px; }
  .draft-resume { padding: 0 16px; }
  .draft-resume-inner { flex-direction: column; gap: 10px; text-align: center; }
  .guide-modal { padding: 24px 18px 20px; border-radius: 14px; }
  .guide-title { font-size: 16px; }
  .guide-desc { font-size: 12.5px; }
  .guide-upload-area { padding: 24px 16px; }
  .guide-actions { flex-wrap: wrap; }
  .guide-actions .btn { min-height: 38px; }

}
