/* app.css — md2html 工具壳样式
   主题：浅色磨砂玻璃（参考 macOS Sequoia 风格）
   纯视觉换皮：布局/尺寸/类名钩子保持不变，JS 零改动。 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ═══ 中性文字色（Slate 实色，叠在任何玻璃表面对比度可预测） ═══ */
  --ink-1: #0F172A;  /* 品牌、强强调 */
  --ink-2: #1E293B;  /* 正文、按钮文字、卡片名 */
  --ink-3: #475569;  /* 二级文字、设置项 label、分区小标 */
  --ink-4: #94A3B8;  /* 三级文字、hint、placeholder、描述（≥14px） */
  --ink-4-strong: #64748B; /* <14px 的辅助文字，需 ≥4.5:1 */
  --ink-on-primary: #FFFFFF;

  /* ═══ 表面层级（3 档玻璃 + 1 档彩色实体面） ═══ */
  /* 面板层：顶栏、左侧栏、预览头部（最薄玻璃） */
  --surface-1:        rgba(255, 255, 255, 0.55);
  --surface-1-border: rgba(255, 255, 255, 0.45);
  /* 控件层：卡片、按钮、输入框（浮在面板上） */
  --surface-2:        rgba(255, 255, 255, 0.72);
  --surface-2-hover:  rgba(255, 255, 255, 0.82);
  --surface-2-border: rgba(255, 255, 255, 0.60);
  /* 模态层：弹窗、空状态（最白最实） */
  --surface-3:        rgba(255, 255, 255, 0.88);
  --surface-3-border: rgba(255, 255, 255, 0.75);

  --glass-blur: blur(22px) saturate(170%);
  --glass-blur-strong: blur(30px) saturate(180%);

  /* ═══ 主色蓝（加深至 WCAG AA：白字对比度 ≥4.5:1） ═══ */
  --accent-400: #5A92F5;  /* 渐变顶 / hover */
  --accent-500: #3B76E8;  /* 主色 */
  --accent-600: #2F68D1;  /* active / 渐变底 */
  --accent-50:  rgba(59, 118, 232, 0.10);  /* 选中底、hover 底 */
  --accent-100: rgba(59, 118, 232, 0.18);  /* 上传区 hover 外发光 */
  --accent-200: rgba(59, 118, 232, 0.40);  /* 虚线边框 */
  --accent-ring: rgba(59, 118, 232, 0.28); /* focus ring */

  /* ═══ 功能色 ═══ */
  --danger:  #E5484D;
  --warn:    #F5A524;
  --success: #30A46C;
  --info:    var(--accent-500);

  /* ═══ 阴影（统一 Slate-900 色相） ═══ */
  --ui-radius: 16px;
  --ui-radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255,255,255,0.70);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255,255,255,0.70);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255,255,255,0.70);
  --shadow-accent: 0 6px 18px rgba(59, 118, 232, 0.35), inset 0 1px 0 rgba(255,255,255,0.35);
  --shadow-selected: 0 0 0 1px var(--accent-500), 0 8px 22px rgba(59,118,232,0.20), inset 0 1px 0 rgba(255,255,255,0.60);

  /* ═══ 深色浮层（tooltip / toast / modal 遮罩） ═══ */
  --overlay-soft:   rgba(15, 23, 42, 0.20);
  --overlay-strong: rgba(15, 23, 42, 0.82);
  --overlay-border: rgba(255, 255, 255, 0.10);

  /* ── 旧 token 名向后兼容（组件内尚未替换的引用保持生效） ── */
  --ui-surface: var(--surface-1);
  --ui-surface-strong: var(--surface-3);
  --ui-surface-soft: var(--surface-1);
  --ui-fill: var(--surface-2);
  --ui-fill-hover: var(--surface-2-hover);
  --ui-border: var(--surface-2-border);
  --ui-border-soft: var(--surface-1-border);
  --ui-text: var(--ink-2);
  --ui-text-2: var(--ink-3);
  --ui-text-3: var(--ink-4-strong);
  --ui-accent: var(--accent-500);
  --ui-accent-hover: var(--accent-600);
  --ui-accent-light: var(--accent-50);
  --ui-danger: var(--danger);
  --ui-warn: var(--warn);
  --ui-success: var(--success);
  --ui-shadow: var(--shadow-sm);
  --ui-shadow-md: var(--shadow-md);
  --ui-shadow-card: var(--shadow-sm);
  --ui-shadow-accent: var(--shadow-accent);
  --ui-brand-cyan: var(--accent-500);

  /* ── 字体家族：西文在前，中文系统栈在后 ── */
  --font-ui: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* 品牌字与 UI 同家族，靠字重/字距区分，不再引入第二族 */
  --font-brand: var(--font-ui);

  /* ── 字号音阶（大三度 1.25 比例，基准 13.5px） ── */
  --fs-micro: 10px;   /* badge、极小标记 */
  --fs-label: 11px;   /* 区块小标 uppercase、辅助 hint、卡片描述 */
  --fs-body:  13.5px; /* 正文基准：设置项、卡片名、上传说明 */
  --fs-button:14px;   /* 按钮、预览头标题 */
  --fs-brand: 15px;   /* 顶栏品牌名 */

  /* ── 字重 ── */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;

  /* ── 字距 ── */
  --ls-tight: -0.02em;  /* 品牌名、大标题 */
  --ls-normal: 0;
  --ls-wide:   0.08em;  /* uppercase 小标签 */

  /* ── 行高 ── */
  --lh-tight: 1.3;
  --lh-normal:1.5;
  --lh-loose: 1.65;
}

html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ui-text);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  background-color: #E8EFF9;
  background-image:
    radial-gradient(ellipse 65% 50% at 82% -10%, rgba(188, 210, 255, 0.55), rgba(188, 210, 255, 0) 62%),
    radial-gradient(ellipse 55% 48% at -10% 12%, rgba(205, 222, 250, 0.50), rgba(205, 222, 250, 0) 58%),
    radial-gradient(ellipse 60% 50% at 110% 108%, rgba(248, 198, 168, 0.45), rgba(248, 198, 168, 0) 62%),
    radial-gradient(ellipse 55% 50% at -12% 110%, rgba(244, 178, 195, 0.40), rgba(244, 178, 195, 0) 60%),
    linear-gradient(160deg, #E3ECF9 0%, #EDF1F9 40%, #F8E8E8 78%, #FAE6D9 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* ── 顶栏 ────────────────────────────────────────── */
.topbar {
  height: 52px;
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--surface-1-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar__logo {
  width: 36px;
  height: 36px;
  display: block;
}
.topbar__title {
  font-family: var(--font-brand);
  font-size: var(--fs-brand);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}
.topbar__title-arrow {
  color: var(--accent-500);
}
.topbar__actions {
  display: flex;
  gap: 8px;
}

/* ── 按钮 ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--ui-fill);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ui-text);
  font-size: 13px;
  font-weight: var(--fw-medium);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.12s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2-hover); border-color: rgba(255,255,255,0.85); }
.btn:active { transform: scale(0.98); }
.btn--primary {
  /* 白字对比度：顶部 #3570DC ≈ 4.5:1，底部 #2F68D1 ≈ 5.1:1（WCAG AA） */
  background: linear-gradient(180deg, #3570DC, var(--accent-600));
  border-color: rgba(47, 104, 209, 0.55);
  color: var(--ink-on-primary);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-accent);
}
.btn--primary:hover {
  background: linear-gradient(180deg, var(--accent-600), #2559BC);
  border-color: rgba(47, 104, 209, 0.65);
}
.btn--large { height: 34px; padding: 0 16px; font-size: 13px; font-weight: var(--fw-medium); }
.btn--primary.btn--large { font-weight: var(--fw-semibold); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn:disabled:hover {
  background: var(--ui-fill);
  border-color: var(--ui-border);
}
.btn--primary:disabled:hover {
  background: linear-gradient(180deg, var(--accent-400), var(--accent-600));
  border-color: rgba(59, 118, 232, 0.50);
}

/* ── 主体布局 ─────────────────────────────────────── */
.workspace {
  display: flex;
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
  overflow: hidden;
}
.panel-left {
  width: 420px;
  min-width: 360px;
  border-right: 1px solid var(--surface-1-border);
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.panel-right {
  flex: 1;
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── 可折叠区块 ───────────────────────────────────── */
.panel-section__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: none;
  border: none;
  padding: 0 0 10px;
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
}
.panel-section__title {
  font-size: var(--fs-button);
  font-weight: var(--fw-semibold);
  color: var(--ink-2);
  letter-spacing: var(--ls-tight);
}
.panel-section__chevron {
  color: var(--ink-3);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.panel-section.collapsed .panel-section__chevron {
  transform: rotate(-90deg);
}
.panel-section__body {
  min-width: 0;
}
.panel-section.collapsed .panel-section__body {
  display: none;
}

/* ── 上传区 ──────────────────────────────────────── */
.upload-zone {
  position: relative;
  display: block;
  border: 1.5px dashed var(--accent-200);
  border-radius: var(--ui-radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.60);
  overflow: hidden;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-500);
  background: var(--accent-50);
  box-shadow: 0 0 0 4px var(--accent-100);
}
.upload-zone__input {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
/* ── 玻璃质感裸图标（造型本身为玻璃材质，无矩形容器） ── */
.upload-zone__icon {
  line-height: 0;
  margin-bottom: 12px;
}
.upload-zone__icon svg,
.empty-state__icon svg {
  display: block;
  overflow: visible;
  filter:
    drop-shadow(0 5px 8px rgba(96, 149, 238, 0.14))
    drop-shadow(0 12px 22px rgba(15, 23, 42, 0.10));
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), filter 0.3s;
}
.upload-zone__icon svg { width: 46px; height: 46px; margin: 0 auto; }
.upload-zone:hover .upload-zone__icon svg,
.upload-zone.drag-over .upload-zone__icon svg {
  transform: translateY(-3px);
  filter:
    drop-shadow(0 8px 12px rgba(96, 149, 238, 0.22))
    drop-shadow(0 18px 30px rgba(15, 23, 42, 0.14));
}
.upload-zone__text { font-size: var(--fs-micro); font-weight: var(--fw-regular); color: var(--ink-4-strong); }
.upload-zone__hint { font-size: var(--fs-micro); font-weight: var(--fw-regular); color: var(--ink-4-strong); margin-top: 4px; }
.upload-zone__filename {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  color: var(--accent-600);
  margin-top: 6px;
}
.upload-paste {
  display: inline-flex;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-600);
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  font-family: var(--font-ui);
  cursor: pointer;
}
.upload-paste:hover {
  color: var(--accent-600);
  text-decoration: underline;
}

/* ── 模板卡片：毛玻璃横向卡（图标 + 名称/介绍 + 标准 MD 下载） ── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.tpl-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border-radius: var(--ui-radius);
  background: var(--surface-2);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--surface-2-border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
  user-select: none;
  outline: none;
}
/* 顶部高光条，强化玻璃质感 */
.tpl-card::before {
  content: "";
  position: absolute;
  top: 0; left: 10px; right: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  border-radius: 2px;
  pointer-events: none;
}
.tpl-card:hover {
  background: var(--surface-2-hover);
  border-color: rgba(255,255,255,0.85);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tpl-card.selected {
  border-color: var(--accent-500);
  background: linear-gradient(135deg, rgba(59,118,232,0.08), rgba(59,118,232,0.04));
  box-shadow: var(--shadow-selected);
}
.tpl-card__icon {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-50);
  color: var(--accent-500);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.tpl-card.selected .tpl-card__icon {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-400));
  color: #fff;
  box-shadow: var(--shadow-accent);
}
/* 选中对勾角标 */
.tpl-card__icon-check {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent-500)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>")
    center/9px no-repeat;
  border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 6px rgba(59,118,232,0.4);
  display: none;
}
.tpl-card.selected .tpl-card__icon-check { display: block; }

.tpl-card__info {
  flex: 1;
  min-width: 0;
}
.tpl-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tpl-card__name {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  color: var(--ink-2);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tpl-card__desc {
  font-size: var(--fs-label);
  color: var(--ink-4-strong);
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 标准 MD 下载 pill（独立链接，不参与卡片选中） */
.tpl-card__download {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: var(--fw-medium);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), inset 0 1px 0 rgba(255,255,255,0.7);
}
.tpl-card__download:hover {
  background: var(--accent-50);
  border-color: rgba(59,118,232,0.3);
  color: var(--accent-600);
  transform: scale(1.03);
}
.tpl-card__download:active { transform: scale(0.96); }
.tpl-card__download:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.tpl-card__download svg { width: 12px; height: 12px; }

/* 兼容：样式卡内的「待建设」徽章沿用旧类名 */
.card__badge {
  display: inline-block;
  font-size: var(--fs-micro);
  font-weight: var(--fw-medium);
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.60);
  color: var(--ink-4-strong);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   样式网格：横向单列卡片
   统一骨架：左封面（主题化微缩插画）｜右信息（名称/介绍/配色）
   每张卡片通过 .sc-<id> 主题层改写 --p/--s/--ink/--line 与封面
   ═══════════════════════════════════════════════════════════ */
.style-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* ── 样式分类：每组标题即单独的收起/展开开关 ─────────── */
.style-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.style-group__header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% + 16px);
  margin: 0 -8px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.style-group__header:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--ink-2);
}
.style-group__title {
  flex: none;
}
.style-group__line {
  flex: 1;
  height: 1px;
  background: var(--surface-2-border);
}
.style-group__count {
  font-size: 10.5px;
  font-weight: var(--fw-medium);
  color: var(--ink-4-strong);
  background: rgba(255, 255, 255, 0.60);
  border-radius: 999px;
  padding: 1px 7px;
}
/* 收起时才显示的当前选中项，避免选中结果被折叠藏起来 */
.style-group__current {
  display: none;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 10em;
  align-items: center;
  gap: 4px;
  padding: 1px 7px 1px 6px;
  border-radius: 999px;
  background: var(--accent-50);
  color: var(--accent-600);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  overflow: hidden;
}
.style-group__current-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.style-group__current::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-500);
}
.style-group.collapsed .style-group__current {
  display: inline-flex;
}
.style-group__chevron {
  flex: none;
  color: var(--ink-4-strong);
  transition: transform 0.2s ease, color 0.16s ease;
}
.style-group__header:hover .style-group__chevron {
  color: var(--ink-3);
}
.style-group.collapsed .style-group__chevron {
  transform: rotate(-90deg);
}
.style-group__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}
.style-group.collapsed .style-group__grid {
  display: none;
}

/* —— 卡片统一骨架（布局对所有主题严格一致） —— */
.style-card {
  --p: #ffffff;          /* 封面底色 */
  --s: #ffffff;          /* 信息区底色 */
  --ink: #111111;        /* 信息区墨色 */
  --line: rgba(15,23,42,.12);
  --card-radius: 13px;
  position: relative;
  display: flex;
  height: 96px;
  border-radius: var(--card-radius);
  background: var(--p);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease;
}
.style-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.style-card.selected {
  box-shadow: var(--shadow-selected);
}
.style-card.selected::after {
  content: "";
  position: absolute;
  top: 6px; left: 6px;
  z-index: 6;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-500)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center/10px no-repeat;
}
.style-card--disabled {
  opacity: .45;
  cursor: not-allowed;
}
.style-card--disabled:hover {
  transform: none;
  box-shadow: none;
}

/* 左侧封面：固定 100px 宽、全高，主题插画在此绘制 */
.style-card__canvas {
  position: relative;
  flex: none;
  width: 100px;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--card-radius) - 1px) 0 0 calc(var(--card-radius) - 1px);
}
/* 右侧信息：名称 1 行 / 介绍 2 行 / 色条贴底 */
.style-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 10px 14px 11px 12px;
  background: var(--s);
}
/* 名称行：左侧样式名，右侧累计下载次数 */
.style-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.style-card__name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.style-card__downloads {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(127,127,127,.14);
  color: var(--ink);
  opacity: .72;
  font-size: 10.5px;
  font-weight: var(--fw-medium);
  line-height: 1.35;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: opacity .16s ease;
}
.style-card:hover .style-card__downloads,
.style-card.selected .style-card__downloads {
  opacity: .9;
}
.style-card__downloads-icon {
  width: 10px;
  height: 10px;
  flex: none;
}
.style-card__mood {
  font-size: var(--fs-label);
  line-height: 1.42;
  height: 31.24px;
  color: var(--ink);
  opacity: .62;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.style-card__swatches {
  display: flex;
  gap: 3px;
  margin-top: auto;
  padding-top: 4px;
}
.style-card__sw {
  flex: 1;
  height: 9px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.style-card .card__badge {
  position: static;
  align-self: flex-start;
  margin-top: 3px;
  background: rgba(127,127,127,.16);
  color: var(--ink);
}

/* 封面通用元素基类 */
.style-card__canvas .cv-line,
.style-card__canvas .cv-bar,
.style-card__canvas .cv-rule { position: absolute; }

/* ───────────────────────────────────────────────────────────
   27 个主题封面（色板直接复用主题 swatches）
   ─────────────────────────────────────────────────────────── */

/* 1 ArtDeco：黑金扇形金线 + 菱形 */
.sc-art-deco { --p:#1C1A14; --s:#241F16; --ink:#F2E9D8; --line:#C9A24B55;
  background: radial-gradient(ellipse 130% 100% at 50% 115%, #3A3120 0%, #1C1A14 62%); }
.sc-art-deco .cv-sun {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-46%);
  width:78px; height:78px; border-radius:50%;
  background: repeating-conic-gradient(from 0deg, #C9A24B 0deg 2.5deg, transparent 2.5deg 14deg);
  -webkit-mask: radial-gradient(circle, transparent 0 30%, #000 31% 46%, transparent 47%);
          mask: radial-gradient(circle, transparent 0 30%, #000 31% 46%, transparent 47%);
}
.sc-art-deco .cv-diamond { position:absolute; left:50%; top:7px; transform:translateX(-50%) rotate(45deg); width:10px; height:10px; border:1.4px solid #C9A24B; }
.sc-art-deco .cv-diamond::after { content:""; position:absolute; inset:2px; background:#C9A24B; }
.sc-art-deco .cv-line { left:15px; right:15px; height:1px; background:linear-gradient(90deg,transparent,#C9A24B,transparent); }
.sc-art-deco .cv-line--a { bottom:8px; } .sc-art-deco .cv-line--b { top:23px; opacity:.5; }

/* 2 学院风：深色木墙 + 黄铜铭牌 */
.sc-academia { --p:#2E2A21; --s:#38322A; --ink:#E8DCC0; --line:#B89B5E55; background:linear-gradient(160deg,#342E24,#24201A); }
.sc-academia .cv-plate {
  position:absolute; inset:9px 12px; border:1px solid #B89B5E99;
  display:grid; place-items:center;
  box-shadow: inset 0 0 0 4px #B89B5E33;
}
.sc-academia .cv-plate::before, .sc-academia .cv-plate::after {
  content:""; position:absolute; width:6px; height:6px; border:1px solid #B89B5E; transform:rotate(45deg); background:#2E2A21;
}
.sc-academia .cv-plate::before { top:-3.5px; left:50%; margin-left:-3px; }
.sc-academia .cv-plate::after { bottom:-3.5px; left:50%; margin-left:-3px; }
.sc-academia .cv-serif { font-family:Georgia,"Noto Serif SC",serif; font-style:italic; font-weight:700; font-size:32px; color:#E8DCC0; line-height:1; }
.sc-academia .cv-sub { position:absolute; bottom:15px; font-family:Georgia,serif; font-size:6px; letter-spacing:.26em; color:#B89B5E; }

/* 3 新中式：宣纸 + 竖排书法 + 朱砂印 + 墨山 */
.sc-neo-chinese { --p:#F5F1E8; --s:#FBF7EC; --ink:#2F3E46; --line:#2F3E4622;
  background:#F5F1E8; background-image:radial-gradient(rgba(47,62,70,.05) 1px,transparent 1px); background-size:5px 5px; }
.sc-neo-chinese .cv-seal {
  position:absolute; top:8px; right:9px; width:20px; height:20px;
  background:#8C3B2E; color:#F5F1E8; display:grid; place-items:center;
  font-family:"Noto Serif SC",serif; font-weight:700; font-size:10px;
  box-shadow: inset 0 0 0 1.3px #F5F1E8, inset 0 0 0 2.6px #8C3B2E;
}
.sc-neo-chinese .cv-vtext { position:absolute; top:8px; left:9px; writing-mode:vertical-rl; font-family:"Noto Serif SC",serif; font-weight:700; font-size:9px; letter-spacing:.34em; color:#2F3E46; }
.sc-neo-chinese .cv-sun { position:absolute; bottom:30px; right:17px; width:9px; height:9px; border-radius:50%; background:#8C3B2E; opacity:.85; }
.sc-neo-chinese .cv-mount { position:absolute; bottom:0; left:0; right:0; height:44px; }
.sc-neo-chinese .cv-mount path { fill:#2F3E46; }
.sc-neo-chinese .cv-mount .m2 { fill:#5B7A6E; opacity:.85; }

/* 4 编辑杂志：大 serif Aa + 红色刊名线 */
.sc-editorial { --p:#FFFFFF; --s:#F5F2F0; --ink:#111111; --line:#E5E5E5; }
.sc-editorial .cv-aa { position:absolute; left:6px; bottom:-9px; font-family:Georgia,"Noto Serif SC",serif; font-weight:700; font-size:50px; line-height:1; color:#111; }
.sc-editorial .cv-kicker { position:absolute; top:8px; right:10px; font-size:6.5px; letter-spacing:.22em; font-weight:700; color:#C8432B; }
.sc-editorial .cv-mast { position:absolute; top:19px; right:10px; width:32px; }
.sc-editorial .cv-mast i { display:block; height:1.6px; background:#111; margin-bottom:3px; }
.sc-editorial .cv-mast i:nth-child(2){ width:75%; } .sc-editorial .cv-mast i:nth-child(3){ width:88%; height:1px; opacity:.5; }
.sc-editorial .cv-rule { left:10px; right:10px; bottom:8px; height:2px; background:#C8432B; }

/* 5 瑞士国际主义：网格 + 红块 */
.sc-swiss { --p:#FFFFFF; --s:#FFFFFF; --ink:#111111; --line:#D9D9D9;
  background-image: linear-gradient(#0000000A 1px,transparent 1px),linear-gradient(90deg,#0000000A 1px,transparent 1px);
  background-size: 12px 12px; }
.sc-swiss .cv-block { position:absolute; top:0; bottom:0; right:0; width:24px; background:#E63946; }
.sc-swiss .cv-big { position:absolute; left:8px; top:7px; font-weight:800; font-size:32px; line-height:.9; letter-spacing:-.04em; color:#111; }
.sc-swiss .cv-row { position:absolute; left:9px; bottom:13px; width:44px; height:3.5px; background:#111; box-shadow:0 -6px 0 #111; }

/* 6 渐变网格：柔粉淡蓝光斑 */
.sc-gradient-mesh { --p:#FFF9F3; --s:rgba(255,255,255,.86); --ink:#3B3340; --line:#FFFFFF;
  background:
    radial-gradient(circle at 80% 15%, #FFD6E8 0, transparent 48%),
    radial-gradient(circle at 10% 90%, #CFE8FF 0, transparent 52%),
    radial-gradient(circle at 55% 60%, #FFF3C8 0, transparent 44%),
    #FFF9F3; }
.sc-gradient-mesh .cv-card {
  position:absolute; inset:20px 22px; border-radius:10px; background:rgba(255,255,255,.66);
  border:1px solid rgba(255,255,255,.9);
  box-shadow: 0 8px 20px rgba(120,90,130,.12);
}
.sc-gradient-mesh .cv-card::before { content:""; position:absolute; top:10px; left:10px; right:10px; height:5px; border-radius:3px; background:linear-gradient(90deg,#E9B8D3,#A9CDF0); opacity:.7; }
.sc-gradient-mesh .cv-card::after { content:""; position:absolute; bottom:10px; left:10px; width:30px; height:3px; border-radius:2px; background:#3B334033; }

/* 7 双色分割：藏蓝/琥珀硬边 */
.sc-duotone { --p:#E8F1F8; --s:#FFFFFF; --ink:#14213D; --line:#14213D22; }
.sc-duotone .cv-half { position:absolute; inset:0; background:#14213D; clip-path: polygon(0 0,100% 0,100% 56%,0 80%); }
.sc-duotone .cv-disc { position:absolute; left:50%; top:48%; transform:translate(-50%,-50%); width:30px; height:30px; border-radius:50%; background:#FCA311; box-shadow:0 0 0 4px #E8F1F8; }
.sc-duotone .cv-word { position:absolute; bottom:7px; left:10px; font-family:Georgia,serif; font-weight:700; font-style:italic; font-size:13px; color:#14213D; }

/* 8 北欧极简 */
.sc-nordic-minimal { --p:#FFFFFF; --s:#F2F2F0; --ink:#2B2B2B; --line:#D9D2C5; }
.sc-nordic-minimal .cv-circle { position:absolute; top:18px; left:50%; transform:translateX(-50%); width:32px; height:32px; border-radius:50%; border:1.3px solid #2B2B2B; }
.sc-nordic-minimal .cv-circle::after { content:""; position:absolute; inset:8px; border-radius:50%; background:#D9D2C5; }
.sc-nordic-minimal .cv-line { position:absolute; bottom:15px; left:24%; right:24%; height:1px; background:#8A8A8A; }
.sc-nordic-minimal .cv-dot { position:absolute; bottom:11px; left:50%; transform:translateX(-50%); width:4px; height:4px; border-radius:50%; background:#2B2B2B; }
.sc-nordic-minimal .cv-name { position:absolute; top:7px; left:10px; font-size:7px; letter-spacing:.28em; color:#8A8A8A; }

/* 9 单色极简：纯黑框线 */
.sc-mono-minimal { --p:#F2F2F2; --s:#FFFFFF; --ink:#000000; --line:#0000001A; }
.sc-mono-minimal .cv-frame { position:absolute; inset:10px; border:1px solid #000; }
.sc-mono-minimal .cv-bar { position:absolute; left:10px; background:#000; }
.sc-mono-minimal .cv-bar--a { top:10px; width:20px; height:22px; }
.sc-mono-minimal .cv-bar--b { top:37px; width:20px; height:3px; opacity:.4; }
.sc-mono-minimal .cv-bar--c { top:46px; width:30px; height:3px; opacity:.4; }
.sc-mono-minimal .cv-dot { position:absolute; right:13px; bottom:13px; width:8px; height:8px; border-radius:50%; background:#000; box-shadow:-11px 0 0 #000, -22px 0 0 #D9D9D9; }

/* 10 复古报纸：米黄纸 + 报头分栏 */
.sc-vintage-news { --p:#F5F1E8; --s:#FBF8F0; --ink:#1A1A1A; --line:#1A1A1A26;
  background-image:radial-gradient(rgba(0,0,0,.045) 1px,transparent 1px); background-size:4px 4px; }
.sc-vintage-news .cv-masthead { position:absolute; top:6px; left:9px; right:9px; text-align:center; font-family:Georgia,"Noto Serif SC",serif; font-weight:900; font-size:13px; color:#1A1A1A; padding-bottom:2px; border-bottom:2px solid #1A1A1A; }
.sc-vintage-news .cv-date { position:absolute; top:23px; left:9px; right:9px; text-align:center; font-size:6px; letter-spacing:.12em; color:#8C1F1F; border-bottom:1px solid #1A1A1A; padding-bottom:2px; }
.sc-vintage-news .cv-cols { position:absolute; top:32px; bottom:6px; left:9px; right:9px; display:flex; gap:5px; }
.sc-vintage-news .cv-cols i { flex:1; background:repeating-linear-gradient(#1A1A1A 0 1px,transparent 1px 4.5px); opacity:.55; }
.sc-vintage-news .cv-cols i:first-child { border-right:1px solid #1A1A1A55; padding-right:5px; }

/* 11 手写笔记本：横线纸 + 胶带 */
.sc-handwritten { --p:#FFFDF5; --s:#FFFFFF; --ink:#2C4A6E; --line:#C7D8E8;
  background: repeating-linear-gradient(transparent 0 16px, #C7D8E8 16px 17px), #FFFDF5; }
.sc-handwritten .cv-tape { position:absolute; top:-5px; left:50%; transform:translateX(-50%) rotate(-3deg); width:40px; height:12px; background:#FFE9A8CC; border-left:1px dashed #FFE9A8; border-right:1px dashed #FFE9A8; }
.sc-handwritten .cv-write { position:absolute; top:30px; left:16px; font-family:"ZCOOL KuaiLe",cursive; color:#2C4A6E; font-size:14px; transform:rotate(-2deg); }
.sc-handwritten .cv-write2 { position:absolute; top:49px; left:24px; font-family:"ZCOOL KuaiLe",cursive; color:#5A4A1E; opacity:.75; font-size:10px; transform:rotate(-1.5deg); }
.sc-handwritten .cv-margin { position:absolute; top:0; bottom:0; left:24px; width:1px; background:#E89A9A; }

/* 12 中古风：羊皮纸 + 花体首字 + 缠枝 */
.sc-medieval { --p:#E8DCC4; --s:#F2E9D8; --ink:#5A4326; --line:#C97B4A44; background:radial-gradient(circle at 50% 40%, #F2E9D8, #E0D1B2); color:#A0673A; }
.sc-medieval .cv-border { position:absolute; inset:7px; border:1.3px solid #A0673A88; }
.sc-medieval .cv-border::before { content:""; position:absolute; inset:2.5px; border:1px solid #A0673A55; }
.sc-medieval .cv-drop { position:absolute; top:10px; left:12px; width:20px; height:20px; background:#6B7A4F; color:#F2E9D8; display:grid; place-items:center; font-family:Georgia,serif; font-weight:700; font-style:italic; font-size:14px; }
.sc-medieval .cv-lines { position:absolute; left:38px; right:12px; top:12px; }
.sc-medieval .cv-lines i { display:block; height:1.3px; background:#5A432666; margin-bottom:5px; }
.sc-medieval .cv-flourish { position:absolute; bottom:9px; left:50%; transform:translateX(-50%); width:48px; height:8px; }

/* 13 Risograph：套色错位 + 网点 */
.sc-risograph { --p:#F3EDE2; --s:#F3EDE2; --ink:#2B2420; --line:#2B242033;
  background-image:radial-gradient(#2B242018 1px,transparent 1px); background-size:5px 5px; }
.sc-risograph .cv-circle { position:absolute; width:38px; height:38px; border-radius:50%; top:16px; left:13px; background:#E4572E; mix-blend-mode:multiply; }
.sc-risograph .cv-circle2 { position:absolute; width:38px; height:38px; border-radius:50%; top:25px; left:28px; background:#2E6F8E; mix-blend-mode:multiply; opacity:.85; }
.sc-risograph .cv-word { position:absolute; bottom:8px; left:10px; font-family:Georgia,serif; font-weight:900; font-style:italic; font-size:16px; color:#2B2420; }
.sc-risograph .cv-word::before { content:attr(data-t); position:absolute; left:1.5px; top:0; color:#F2A541; z-index:-1; }

/* 14 孟菲斯：黑底撞色几何 */
.sc-memphis { --p:#141414; --s:#1E1E1E; --ink:#FFFFFF; --line:#FFFFFF22; }
.sc-memphis .cv-tri { position:absolute; top:8px; left:10px; width:0; height:0; border-left:11px solid transparent; border-right:11px solid transparent; border-bottom:18px solid #FFD93D; }
.sc-memphis .cv-zig { position:absolute; top:31px; left:9px; width:30px; height:9px; background:repeating-linear-gradient(135deg,#4D96FF 0 4px,transparent 4px 9px); }
.sc-memphis .cv-ring { position:absolute; top:9px; right:11px; width:17px; height:17px; border-radius:50%; border:3px solid #FF6B6B; }
.sc-memphis .cv-dotgrid { position:absolute; bottom:8px; left:10px; width:22px; height:22px; background:radial-gradient(#6BCB77 1.8px,transparent 2.2px); background-size:6px 6px; }
.sc-memphis .cv-squiggle { position:absolute; bottom:11px; right:9px; width:26px; height:10px; color:#FFD93D; }
.sc-memphis .cv-pop { position:absolute; bottom:9px; left:50%; transform:translateX(-50%); font-family:"ZCOOL KuaiLe",cursive; font-size:10px; color:#fff; }

/* 15 粗野主义：粗框 + 黄底 + 硬阴影感 */
.sc-brutalism { --p:#FFFFFF; --s:#FFFFFF; --ink:#111111; --line:#111111; box-shadow: inset 0 0 0 1px #111; }
.sc-brutalism .cv-box { position:absolute; inset:7px; border:2.5px solid #111; background:#FFD93D; }
.sc-brutalism .cv-big { position:absolute; left:9px; bottom:4px; font-weight:900; font-size:27px; line-height:.85; color:#111; letter-spacing:-.03em; }
.sc-brutalism .cv-tag { position:absolute; top:10px; right:9px; background:#FF5D5D; color:#111; font-weight:900; font-size:7.5px; padding:2px 5px; border:2px solid #111; transform:rotate(4deg); }

/* 16 黏土风：软糯 3D 黏土 */
.sc-claymorphism { --p:#FFF3E9; --s:#FFEEE5; --ink:#6B4A3A; --line:#FFFFFFAA; background:linear-gradient(150deg,#FFE3D8,#FFF3E9 55%,#E7F5FF); }
.sc-claymorphism .cv-blob { position:absolute; border-radius:46% 54% 52% 48% / 52% 46% 54% 48%; }
.sc-claymorphism .b1 { width:40px; height:40px; left:12px; top:28px; background:#FF9FB2;
  box-shadow: inset -6px -7px 12px #E0708C88, inset 5px 6px 10px #FFD0DC, 0 8px 16px #E0708C55; }
.sc-claymorphism .b2 { width:28px; height:28px; right:13px; top:13px; background:#8DC7F5; border-radius:50%;
  box-shadow: inset -5px -6px 10px #5B9CCF88, inset 4px 5px 8px #CFE8FF, 0 6px 12px #5B9CCF44; }
.sc-claymorphism .b3 { width:19px; height:19px; right:13px; bottom:13px; background:#B8E8C9; border-radius:50%;
  box-shadow: inset -4px -4px 8px #7FBE9688, inset 3px 4px 7px #E3F8EA, 0 5px 10px #7FBE9644; }

/* 17 柔粉软 UI：软糖圆角 */
.sc-soft-pink { --p:#EEF2F7; --s:#FFFFFF; --ink:#3D4451; --line:#FFFFFF; background:linear-gradient(160deg,#F6F8FC,#E9EFF6); }
.sc-soft-pink .cv-gummy { position:absolute; border-radius:14px; }
.sc-soft-pink .g1 { width:38px; height:38px; left:13px; top:17px; background:linear-gradient(160deg,#FFE3EB,#FFC9D8);
  box-shadow: inset 0 2px 3px #FFFFFF, 0 6px 14px #F4A8BF66; transform:rotate(-8deg); }
.sc-soft-pink .g2 { width:25px; height:25px; right:14px; top:12px; background:linear-gradient(160deg,#DCEEFF,#BBDDFE);
  box-shadow: inset 0 2px 3px #FFFFFF, 0 6px 14px #93C5F566; }
.sc-soft-pink .g3 { width:17px; height:17px; right:38px; bottom:14px; border-radius:50%; background:linear-gradient(160deg,#D7F5E4,#B5EACB);
  box-shadow: inset 0 2px 3px #FFFFFF, 0 5px 10px #8FD8B055; }

/* 18 等距 3D */
.sc-isometric-3d { --p:#F0F4F8; --s:#FFFFFF; --ink:#1E293B; --line:#E2E8F0; background:linear-gradient(#E6EDF5,#F7FAFD); }
.sc-isometric-3d .cv-iso { position:absolute; left:50%; top:48px; transform:translateX(-50%); }
.sc-isometric-3d .cube { position:absolute; width:24px; }
.sc-isometric-3d .cube i { position:absolute; display:block; }
.sc-isometric-3d .cube .top { width:24px; height:14px; background:#93C5FD; clip-path:polygon(50% 0,100% 25%,50% 50%,0 25%); }
.sc-isometric-3d .cube .left { width:12px; height:28px; left:0; top:14px; background:#3B82F6; clip-path:polygon(0 0,50% -25%,50% 75%,0 100%); }
.sc-isometric-3d .cube .right { width:12px; height:28px; left:12px; top:14px; background:#2563EB; clip-path:polygon(50% -25%,100% 0,100% 100%,50% 75%); }
.sc-isometric-3d .cube--pink { transform:translate(18px,-11px); }
.sc-isometric-3d .cube--pink .top { background:#FBCFE8; }
.sc-isometric-3d .cube--pink .left { background:#F472B6; }
.sc-isometric-3d .cube--pink .right { background:#DB2777; }
.sc-isometric-3d .cube--blue { transform:translate(-18px,4px) scale(.75); }
.sc-isometric-3d .cv-shadow { position:absolute; bottom:9px; left:50%; transform:translateX(-50%); width:62px; height:8px; background:radial-gradient(ellipse,#1E293B22,transparent 70%); }

/* 19 Bento：色块拼盘 */
.sc-bento { --p:#F4F4F6; --s:#FFFFFF; --ink:#111111; --line:#E8E8ED; background:#F4F4F6; }
.sc-bento .cv-bento { position:absolute; inset:8px; display:grid; grid-template-columns:1.5fr 1fr; grid-template-rows:1fr 1fr; gap:4px; }
.sc-bento .cv-bento i { border-radius:6px; display:block; }
.sc-bento .b-a { grid-row:1/3; background:#6366F1; box-shadow:inset 0 1px 0 #FFFFFF33; }
.sc-bento .b-b { background:#FFFFFF; border:1px solid #E8E8ED; position:relative; }
.sc-bento .b-b::after { content:""; position:absolute; width:12px; height:5px; border-radius:2.5px; background:#111; left:7px; top:8px; box-shadow:0 8px 0 #C7C7D1; }
.sc-bento .b-c { background:#111; box-shadow:inset 0 1px 0 #FFFFFF22; }

/* 20 像素风：马赛克网格 + 像素角色 */
.sc-pixel { --p:#2D1B4E; --s:#3A2560; --ink:#F2E9FF; --line:#FFFFFF22;
  background:#2D1B4E;
  background-image: linear-gradient(#00000020 1px,transparent 1px),linear-gradient(90deg,#00000020 1px,transparent 1px);
  background-size:8px 8px; }
.sc-pixel .cv-coins { position:absolute; top:8px; left:9px; display:flex; gap:3px; }
.sc-pixel .cv-coins i { width:6px; height:6px; background:#FFD93D; box-shadow:0 0 0 1px #B8860B; }
.sc-pixel .cv-hero { position:absolute; right:10px; top:10px; width:40px; height:40px; shape-rendering:crispEdges; }
.sc-pixel .cv-name { position:absolute; bottom:7px; left:9px; font-family:"Press Start 2P",monospace; font-size:6.5px; color:#FF6B9D; text-shadow:1.5px 1.5px 0 #1A0E33; background:#1A0E3388; padding:2px 3px; }

/* 21 蓝图：工程网格 + 青白线稿 */
.sc-blueprint { --p:#15304F; --s:#1E3A5F; --ink:#E8F1F8; --line:#9CC8E833;
  background-color:#15304F; color:#9CC8E8;
  background-image: linear-gradient(#9CC8E818 1px,transparent 1px),linear-gradient(90deg,#9CC8E818 1px,transparent 1px),linear-gradient(#9CC8E82E 1px,transparent 1px),linear-gradient(90deg,#9CC8E82E 1px,transparent 1px);
  background-size:9px 9px,9px 9px,45px 45px,45px 45px; }
.sc-blueprint .cv-schema { position:absolute; inset:0; }
.sc-blueprint .cv-name { position:absolute; bottom:6px; left:9px; font-family:"JetBrains Mono",monospace; font-size:6.5px; letter-spacing:.1em; color:#9CC8E8; }

/* 22 HUD 机甲：切角框 + 准星 + 刻度 */
.sc-hud-mech { --p:#0A0E14; --s:#141C26; --ink:#DCE5EB; --line:#4FD1C533; background:radial-gradient(circle at 50% 120%, #1B2733, #0A0E14 70%); color:#4FD1C5; }
.sc-hud-mech .cv-frame { position:absolute; inset:7px;
  clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);
  border:1px solid #4FD1C566; }
.sc-hud-mech .cv-cross { position:absolute; left:50%; top:46%; transform:translate(-50%,-50%); width:30px; height:30px; border:1px solid #4FD1C5; border-radius:50%; opacity:.85; }
.sc-hud-mech .cv-cross::before,.sc-hud-mech .cv-cross::after { content:""; position:absolute; background:#4FD1C5; }
.sc-hud-mech .cv-cross::before { left:50%; top:-7px; width:1px; height:44px; }
.sc-hud-mech .cv-cross::after { top:50%; left:-7px; height:1px; width:44px; }
.sc-hud-mech .cv-ticks { position:absolute; top:0; left:0; right:0; height:3px; background:repeating-linear-gradient(90deg,#4FD1C5 0 3px,transparent 3px 8px); opacity:.7; }
.sc-hud-mech .cv-name { position:absolute; bottom:6px; left:10px; font-family:"JetBrains Mono",monospace; font-size:6.5px; color:#4FD1C5; letter-spacing:.16em; }
.sc-hud-mech .cv-id { position:absolute; bottom:6px; right:9px; font-family:"JetBrains Mono",monospace; font-size:6.5px; color:#8B98A8; }

/* 23 赛博朋克：霓虹故障 + 透视网格 */
.sc-cyberpunk { --p:#0a0c10; --s:#12151c; --ink:#dfe7f2; --line:#00F0FF33; background:linear-gradient(#0a0c10 55%, #140A14 100%); }
.sc-cyberpunk .cv-grid { position:absolute; left:-20%; right:-20%; bottom:0; height:34px;
  background: repeating-linear-gradient(90deg,#00F0FF33 0 1px,transparent 1px 11px),repeating-linear-gradient(#00F0FF33 0 1px,transparent 1px 7px);
  transform:perspective(140px) rotateX(48deg); transform-origin:bottom; }
.sc-cyberpunk .cv-neon { position:absolute; top:20px; left:0; right:0; text-align:center; font-weight:900; font-size:15px; letter-spacing:.08em; color:#00F0FF; text-shadow:0 0 6px #00F0FF88, 1.5px 0 0 #FF2D78; }
.sc-cyberpunk .cv-neon small { display:block; font-size:6px; letter-spacing:.34em; color:#ffc857; text-shadow:0 0 6px #ffc85788; margin-top:3px; }
.sc-cyberpunk .cv-slash { position:absolute; top:7px; right:9px; width:12px; height:12px; background:#ffc857; clip-path:polygon(0 0,100% 0,100% 30%,30% 100%,0 100%); }

/* 24 蒸汽波：条纹落日 + 紫粉网格 */
.sc-vaporwave { --p:#1E0B36; --s:#2A1147; --ink:#FFE6F7; --line:#FF71CE33; background:linear-gradient(#2B0B54 0%,#6B2D8F 55%,#1E0B36 100%); }
.sc-vaporwave .cv-sun { position:absolute; top:8px; left:50%; transform:translateX(-50%); width:38px; height:38px; border-radius:50%;
  background:linear-gradient(#FFFB96,#FF71CE);
  -webkit-mask:repeating-linear-gradient(#000 0 3.5px,transparent 3.5px 6px);
          mask:repeating-linear-gradient(#000 0 3.5px,transparent 3.5px 6px); }
.sc-vaporwave .cv-vgrid { position:absolute; left:-20%; right:-20%; bottom:0; height:26px;
  background:repeating-linear-gradient(90deg,#01CDFE66 0 1px,transparent 1px 10px),repeating-linear-gradient(#01CDFE66 0 1px,transparent 1px 6px);
  transform:perspective(120px) rotateX(50deg); transform-origin:bottom; }
.sc-vaporwave .cv-name { position:absolute; bottom:8px; left:0; right:0; text-align:center; font-family:"Noto Serif SC",serif; font-style:italic; font-size:7.5px; letter-spacing:.24em; color:#FF71CE; text-shadow:0 0 4px #1E0B36, 0 0 7px #FF71CE; background:rgba(30,11,54,.5); padding:2px 0; }

/* 25 极光霓虹：极光光带 + 星空 */
.sc-aurora-neon { --p:#0B1026; --s:#121833; --ink:#E9E6FF; --line:#7C3AED44; background:#0B1026; }
.sc-aurora-neon .cv-band { position:absolute; left:-20%; right:-20%; height:40px; border-radius:50%; filter:blur(6px); opacity:.85; }
.sc-aurora-neon .ab1 { top:-6px; background:linear-gradient(90deg,transparent,#22D3EE,#7C3AED,transparent); transform:rotate(-9deg); }
.sc-aurora-neon .ab2 { top:20px; background:linear-gradient(90deg,transparent,#F472B6,#22D3EE,transparent); transform:rotate(7deg) scaleX(.8); opacity:.6; }
.sc-aurora-neon .cv-stars { position:absolute; inset:0; background:radial-gradient(#fff 1px,transparent 1.3px) 0 0/16px 16px, radial-gradient(#fff 1px,transparent 1.3px) 8px 6px/21px 21px; opacity:.5; }
.sc-aurora-neon .cv-name { position:absolute; bottom:7px; left:10px; font-family:"Noto Serif SC",serif; letter-spacing:.22em; font-size:8px; color:#E9E6FF; text-shadow:0 0 7px #7C3AED; }

/* 26 玻璃拟态：光斑 + 磨砂玻璃片 */
.sc-glassmorphism { --p:#0D1029; --s:#1A1F44; --ink:#EAF0FF; --line:#FFFFFF26;
  background: radial-gradient(circle at 78% 12%, #4CC9F0 0, transparent 44%),radial-gradient(circle at 12% 92%, #764BA2 0, transparent 50%),linear-gradient(135deg,#161A4A,#0D1029); }
.sc-glassmorphism .cv-glass { position:absolute; border-radius:11px; background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.30);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px rgba(0,0,0,.25); }
.sc-glassmorphism .g-a { inset:14px 24px 16px 26px; }
.sc-glassmorphism .g-b { width:28px; height:28px; right:11px; bottom:9px; border-radius:50%; }
.sc-glassmorphism .g-c { width:19px; height:19px; left:11px; top:9px; border-radius:7px; background:rgba(255,255,255,.22); }
.sc-glassmorphism .cv-lines { position:absolute; left:34px; top:23px; width:32px; }
.sc-glassmorphism .cv-lines i { display:block; height:3px; border-radius:2px; background:#fff; opacity:.75; margin-bottom:4px; }
.sc-glassmorphism .cv-lines i:nth-child(2){ width:70%; opacity:.5; }
.sc-glassmorphism .cv-lines i:nth-child(3){ width:45%; opacity:.35; }

/* 27 Y2K 千禧：金属 chrome 字 + 果冻泡泡 */
.sc-y2k { --p:#F2F2F7; --s:#FFFFFF; --ink:#5B3FD1; --line:#FFFFFF; background:linear-gradient(160deg,#D9E6FF,#FFF0F8 55%,#E2FBFF); }
.sc-y2k .cv-chrome {
  position:absolute; top:27px; left:0; right:0; text-align:center;
  font-weight:900; font-style:italic; font-size:21px; letter-spacing:-.02em;
  background:linear-gradient(180deg,#E9E4FF 0%,#B7C6F5 30%,#3D2A8F 50%,#6E5CD0 62%,#F3F6FF 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 1px 0 #FFFFFF) drop-shadow(0 1.5px 0 #5446A8) drop-shadow(0 3px 5px #7A5CFF66);
}
.sc-y2k .cv-bubble { position:absolute; border-radius:50%; border:1.5px solid #FFFFFF;
  background:radial-gradient(circle at 32% 28%,#FFFFFFAA,#FF9EC7 55%,#C56BE8);
  box-shadow:0 3px 8px #C56BE855, inset 0 -3px 5px #9A4BC955; }
.sc-y2k .bb1 { width:19px; height:19px; left:14px; bottom:11px; }
.sc-y2k .bb2 { width:12px; height:12px; right:16px; bottom:31px;
  background:radial-gradient(circle at 32% 28%,#FFFFFFAA,#9EE9FF 55%,#4FB6E8);
  box-shadow:0 3px 8px #4FB6E855, inset 0 -3px 5px #2E86BC55; }
.sc-y2k .cv-star { position:absolute; color:#7A5CFF; font-size:11px; }
.sc-y2k .st1 { top:8px; left:12px; } .sc-y2k .st2 { top:10px; right:12px; font-size:8px; color:#FF7DB3; }


/* ── 设置区 ──────────────────────────────────────── */
.setting-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.setting-label {
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--ink-2);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ── 问号提示 ─────────────────────────────────────── */
.hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--ink-4-strong);
  cursor: help;
  outline: none;
}
.hint:hover,
.hint:focus {
  color: var(--accent-500);
}
.hint__icon {
  display: block;
  flex: none;
}
.hint__tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: -8px;
  transform: translateY(4px);
  width: max-content;
  max-width: 240px;
  padding: 7px 10px;
  background: var(--overlay-strong);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  border: 1px solid var(--overlay-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 200;
}
.hint__tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 10px;
  border: 5px solid transparent;
  border-top-color: var(--overlay-strong);
}
.hint:hover .hint__tip,
.hint:focus .hint__tip,
.hint:focus-within .hint__tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.setting-input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--surface-2-border);
  border-radius: 10px;
  font-size: var(--fs-body);
  font-family: var(--font-ui);
  background: var(--surface-2);
  color: var(--ink-2);
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.05);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.setting-input::placeholder { color: var(--ink-4-strong); }
.setting-input:focus {
  outline: none;
  border-color: var(--accent-500);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

/* ── 开关（iOS 风格） ────────────────────────────── */
.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle input {
  /* 不能用 0×0：那样复选框会从无障碍树里消失。
     让它覆盖整个开关并透明，既保留键盘/读屏可达性，也不影响外观。 */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.toggle__track {
  position: absolute;
  inset: 0;
  background: rgba(148, 163, 184, 0.45);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.22s;
}
.toggle__track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(15,23,42,0.25);
  transition: transform 0.22s cubic-bezier(0.3, 0.9, 0.4, 1.2);
}
.toggle input:checked + .toggle__track {
  background: var(--accent-500);
}
.toggle input:checked + .toggle__track::after {
  transform: translateX(18px);
}
.toggle input:focus-visible + .toggle__track {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ── 预览区 ──────────────────────────────────────── */
.preview-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 16px;
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--surface-1-border);
  flex-shrink: 0;
}
.preview-header__lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* ── 设置面板收起 / 展开 ─────────────────────────── */
.panel-left {
  transition: width 0.24s ease, min-width 0.24s ease, max-height 0.24s ease, padding 0.24s ease, opacity 0.16s ease;
}
.workspace.panel-collapsed .panel-left {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-3);
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.panel-toggle:hover {
  color: var(--accent-500);
  background: var(--accent-50);
}
.panel-toggle:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 1px;
}
.panel-toggle svg {
  transition: transform 0.24s ease;
}
.workspace.panel-collapsed .panel-toggle svg {
  transform: scaleX(-1);
}
.preview-header__title {
  font-size: var(--fs-button);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  color: var(--ink-2);
}
.preview-header__tools {
  display: flex;
  gap: 6px;
}
.preview-header__btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--surface-2-border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: var(--fw-medium);
  font-family: var(--font-ui);
  cursor: pointer;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.preview-header__btn:hover { background: var(--surface-2-hover); }
.preview-header__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.preview-header__btn:disabled:hover {
  background: var(--surface-2);
}

.preview-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  padding: 16px;
  gap: 0;
}
.preview-iframe {
  flex: 1;
  border: 1px solid var(--surface-2-border);
  border-radius: var(--ui-radius);
  width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: var(--shadow-md);
}

/* ── 生成报告 ────────────────────────────────────── */
.report__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: var(--fs-label);
  line-height: var(--lh-normal);
  color: var(--ink-3);
}
.report__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.report__dot--error { background: var(--danger); }
.report__dot--warn { background: var(--warn); }
.report__dot--info { background: var(--info); }
.report__dot--success { background: var(--success); }

/* ── 弹窗 ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-soft);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.modal-overlay[hidden] {
  display: none;
}
.modal {
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  background: var(--surface-3);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
  border: 1px solid var(--surface-3-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-1-border);
  flex-shrink: 0;
}
.modal__title {
  font-size: var(--fs-button);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  color: var(--ink-1);
}
.modal__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-3);
  transition: background 0.15s, color 0.15s;
}
.modal__close:hover {
  background: var(--surface-2);
  color: var(--ink-1);
}
.modal__body {
  padding: 14px 16px;
  overflow-y: auto;
}
.paste-textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--surface-2-border);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  line-height: var(--lh-loose);
  color: var(--ink-2);
  background: var(--surface-2);
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.05);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.paste-textarea:focus {
  outline: none;
  border-color: var(--accent-500);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
/* 确认类弹窗：更窄、正文更紧凑 */
.modal--confirm {
  max-width: 380px;
}
.modal__text {
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-3);
}

/* ── 空状态 ──────────────────────────────────────── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-4-strong);
  background: var(--surface-3);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--surface-3-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--shadow-md);
}
.empty-state__icon { line-height: 0; }
.empty-state__icon svg { width: 54px; height: 54px; margin: 0 auto; }
.empty-state__text { font-size: var(--fs-button); font-weight: var(--fw-regular); color: var(--ink-4-strong); }

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  max-width: min(90vw, 640px);
  text-align: center;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--overlay-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--overlay-border);
  color: #fff;
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  box-shadow: 0 12px 32px rgba(15,23,42,0.32);
  transform: translate(-50%, -24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), opacity 0.3s;
  z-index: 1000;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ── 玻璃面板滚动条 ──────────────────────────────── */
.panel-left::-webkit-scrollbar,
.modal__body::-webkit-scrollbar,
.paste-textarea::-webkit-scrollbar { width: 8px; height: 8px; }
.panel-left::-webkit-scrollbar-thumb,
.modal__body::-webkit-scrollbar-thumb,
.paste-textarea::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.32);
  border-radius: 8px;
}
.panel-left::-webkit-scrollbar-thumb:hover,
.modal__body::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.48);
}
.panel-left::-webkit-scrollbar-track,
.modal__body::-webkit-scrollbar-track { background: transparent; }

/* ── 响应式 ──────────────────────────────────────── */
@media (max-width: 900px) {
  .workspace { flex-direction: column; }
  .panel-left {
    width: 100%;
    min-width: 0;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--surface-1-border);
  }
  /* 收起时高度必须一起收掉，否则纵向布局会留下 45vh 空白带 */
  .workspace.panel-collapsed .panel-left {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
  }
  .preview-container { padding: 10px; }
}

/* ── 无 backdrop-filter 降级：提高不透明度保证可读（仍保持 3 档层级） ── */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar, .panel-left, .preview-header { background: rgba(255,255,255,0.82); }
  /* 样式卡片为实色主题底，不走毛玻璃兜底（否则深色封面会被刷白） */
  .tpl-card, .btn, .preview-header__btn, .setting-input, .paste-textarea { background: rgba(255,255,255,0.92); }
  .empty-state { background: rgba(255,255,255,0.94); }
  .modal { background: rgba(255,255,255,0.98); }
}


/* ── 无障碍工具类 / 焦点可见 ─────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.upload-zone:focus-within {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
}
.tpl-card:focus-visible,
.style-card:focus-visible,
.style-group__header:focus-visible,
.btn:focus-visible,
.preview-header__btn:focus-visible,
.modal__close:focus-visible,
.upload-paste:focus-visible,
.panel-section__header:focus-visible,
.paste-textarea:focus-visible,
.setting-input:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
