/* ============================================
   ChillType — Warm Minimal UI
   Design Tokens: modify here → reflected everywhere
   ============================================ */

/* ============================================================
   🎨 DESIGN TOKENS — 设计令牌
   Modify values here. All components reference these variables.
   修改此处即可全局生效，无需逐行查找。
   ============================================================ */

:root {
  /* --- 🖌️ Background 背景 --- */
  --bg:             #FAF8F5;   /* 页面底色 */
  --bg-rgb:         250, 248, 245;  /* bg RGB 分量，供 rgba() 使用 */
  --bg-alt:         #F2F1ED;   /* 次级底色 (交替区域) */
  --surface:        #ffffff;   /* 卡片/面板底色 */
  --surface-hover:  #f7f7f4;   /* 卡片悬停 */

  /* --- 🔤 Text 文字 --- */
  --text:           #1a1a18;   /* 正文 */
  --text-secondary: #5c5c57;   /* 次要文字 */
  --text-muted:     #8a8a84;   /* 弱化文字 */
  --text-inverse:   #ffffff;   /* 深色/彩色背景上的反白文字 */

  /* --- 📏 Border 边框 --- */
  --border:         #e4e4df;   /* 默认边框 */
  --border-strong:  #d0d0c9;   /* 强调边框 */

  /* --- 🎯 Accent 强调色 (暖陶土橙) --- */
  --accent:         #da7756;   /* 主强调色 */
  --accent-hover:   #c46648;   /* 悬停 */
  --accent-soft:    rgba(218, 119, 86, 0.08);  /* 柔和背景 */

  /* --- ✅ Semantic 语义色 --- */
  --success:        #1b7a3d;   /* 成功/免费 */
  --success-soft:   #e8f5ec;   /* 成功背景 */
  --danger:         #b42318;   /* 危险/错误 */
  --danger-soft:    rgba(180, 35, 24, 0.08);  /* 危险背景 */

  /* --- 🔠 Typography 字体 --- */
  --font-sans:      "GWM Sans UI", "PingFang SC", "Helvetica Neue", sans-serif;
  --font-display:   "GWM Sans UI", "Chill Round M", "PingFang SC", sans-serif;
  --font-body:      "GWM Sans UI", "PingFang SC", "Helvetica Neue", sans-serif;
  --font-mono:      "SF Mono", ui-monospace, Menlo, monospace;

  /* --- 📐 Spacing & Shape 间距与圆角 --- */
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-pill:    980px;
  --header-h:       56px;     /* 导航栏高度 */

  /* --- 🌓 Shadow 阴影 --- */
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg:      0 12px 40px rgba(0,0,0,0.08);
}

/* ============================================================
   🌙 DARK THEME — 暗色主题覆盖
   ============================================================ */
[data-theme="dark"] {
  --bg:             #141414;
  --bg-rgb:         20, 20, 20;
  --bg-alt:         #1a1a1a;
  --surface:        #1e1e1e;
  --surface-hover:  #252525;
  --text:           #f0ede8;
  --text-secondary: #a8a8a0;
  --text-muted:     #6e6e68;
  --text-inverse:   #111110;
  --border:         #2a2a26;
  --border-strong:  #3a3a34;
  --accent:         #e8896e;
  --accent-hover:   #f09a80;
  --accent-soft:    rgba(232, 137, 110, 0.12);
  --success:        #3ecf6e;
  --success-soft:   rgba(62, 207, 110, 0.12);
  --danger:         #f97066;
  --danger-soft:    rgba(249, 112, 102, 0.12);
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.2);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg:      0 12px 40px rgba(0,0,0,0.4);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  font-synthesis: none;
  overflow-x: hidden;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  z-index: 10000;
  transition: top 160ms ease;
}
.skip-link:focus {
  top: 8px;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  border-radius: var(--radius-md);
  border: none;
  transition: all 160ms ease-out;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); }

.btn-text {
  background: transparent;
  color: var(--accent);
  padding: 8px 10px;
}
.btn-text:hover { background: var(--accent-soft); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--text); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 13px; min-height: 32px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 28px; font-size: 16px; min-height: 48px; border-radius: var(--radius-md); }

/* ============ Tag / Eyebrow ============ */
.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-muted);
}

.tag-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-free {
  background: var(--success-soft);
  color: var(--success);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
}
.live-badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--success);
}

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(var(--bg-rgb), 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: none;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1001;
  flex-shrink: 0;
}
.logo-link img { height: 28px; width: auto; }
[data-theme="dark"] .logo-link img { filter: brightness(0) invert(1); opacity: 0.92; }

.logo-wordmark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}

nav#main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a.nav-link,
.nav-dropdown > button.nav-link {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: color 160ms ease, background 160ms ease;
}

nav a.nav-link:hover,
.nav-dropdown > button.nav-link:hover,
nav a.nav-link.active {
  color: var(--text);
  background: var(--bg-alt);
}

.nav-dropdown { position: relative; }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  z-index: 1100;
  box-shadow: var(--shadow-lg);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.nav-dropdown-menu a:hover { background: var(--bg-alt); }
.nav-dropdown-menu .font-en {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.search-btn,
.theme-cycle,
.cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background 160ms ease, color 160ms ease;
}
.search-btn:hover,
.theme-cycle:hover,
.cart-btn:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.cart-btn { position: relative; font-size: 1rem; }
.cart-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-count:empty { display: none; }

/* Theme Switcher — Single Circle Icon */
.appearance-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all 160ms ease;
  border: 1px solid transparent;
}
.appearance-switch:hover {
  color: var(--text);
  background: var(--bg-alt);
  border-color: var(--border);
}
.appearance-switch svg {
  width: 18px;
  height: 18px;
}

/* Language Switcher — Segmented Control */
.lang-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.lang-seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  transition: all 160ms ease;
}
.lang-seg:hover {
  color: var(--text);
}
.lang-seg.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 1001;
}
.mobile-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
}

/* ============ Pages ============ */
.page { display: none; min-height: calc(100vh - var(--header-h)); }
.page.active { display: block; }

.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { margin-bottom: 40px; }
.section-head.center { text-align: center; }
.section-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.section-head h2,
.section-head h3 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 12px;
}
.section-head p {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.5;
  max-width: 560px;
}
.section-head.center p { margin-left: auto; margin-right: auto; }

/* ============ Hero ============ */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}
.hero-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--text);
}
.hero h1 .accent { color: var(--accent); }
.hero .subtitle {
  font-size: clamp(17px, 2vw, 19px);
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 52ch;
  line-height: 1.5;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Name Strip */
.name-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.name-strip span::after {
  content: "\00b7";
  margin-left: 18px;
  opacity: 0.4;
}
.name-strip span:last-child::after { display: none; }
.name-strip span {
  flex-shrink: 0;
  white-space: nowrap;
}

/* WIP Spotlight */
.wip-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.wip-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.wip-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.wip-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.wip-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin-bottom: 6px;
}
.wip-title-en {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.wip-desc {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 17px;
  max-width: 44ch;
}
.wip-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.wip-specimen {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

/* Font Cards */
.featured-grid,
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.font-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: var(--shadow-sm);
}
.font-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.font-card .card-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.font-card .card-specimen {
  font-size: 1.5rem;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  word-break: break-word;
  min-height: 2em;
}
.font-card .card-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}
.font-card .card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.font-card .card-price {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.font-card .card-price.free { color: var(--success); }

/* Folder-style card (from fonts/ directory) */
.font-folder-card {
  position: relative;
}
.folder-header {
  margin-bottom: 12px;
}
.folder-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.folder-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.folder-specimen {
  font-size: 1.35rem;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  min-height: 1.8em;
  word-break: break-word;
  color: var(--text);
}
.folder-weights {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}
.weight-chip {
  display: inline-block;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.folder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.folder-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.folder-price.free {
  color: var(--success);
}
.section-cta {
  text-align: center;
  margin-top: 40px;
}

/* Catalog */
.catalog-header {
  padding: 48px 0 24px;
  border-bottom: 1px solid var(--border);
}
.catalog-header h2 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 500;
  line-height: 1.15;
}
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-btn {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all 160ms ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--border); }
.filter-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.catalog-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  background: var(--surface);
  min-width: 200px;
}
.catalog-search input {
  border: none; outline: none; background: transparent;
  width: 100%; font-size: 14px;
}
.catalog-search input::placeholder { color: var(--text-muted); }

/* Detail Page */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 32px;
  padding: 6px 0;
}
.detail-back:hover { color: var(--text); }
.detail-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: start;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.detail-info h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 8px;
}
.detail-info .designer {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.detail-info .detail-desc {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 17px;
}
.detail-features { list-style: none; margin-bottom: 20px; }
.detail-features li {
  padding: 6px 0;
  font-size: 15px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.detail-features li::before {
  content: "\2192 ";
  color: var(--accent);
}
.detail-price {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 20px;
}
.detail-preview-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.detail-preview-box .big {
  font-size: 3.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.detail-preview-box .family {
  font-size: 1.15rem;
  font-weight: 400;
  margin-top: 8px;
}
.detail-preview-box .meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}
.specimen-area { margin-top: 48px; padding-bottom: 48px; }
.specimen-area > h4 {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 16px;
}
.bg-switcher { display: flex; gap: 8px; margin-bottom: 16px; }
.bg-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: transform 150ms ease;
}
.bg-dot:hover { transform: scale(1.15); }
.bg-dot.active { outline: 2px solid var(--accent); outline-offset: 2px; }
.bg-dot.white { background: #fff; }
.bg-dot.black { background: #1a1a1a; }
.bg-dot.gray { background: #888; }
.bg-dot.blue { background: var(--accent); }
.specimen-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px 28px;
  min-height: 180px;
  transition: background 300ms ease, color 300ms ease;
}
.specimen-panel.bg-white { background: #fff; color: #1a1a1a; }
.specimen-panel.bg-black { background: #1a1a1a; color: var(--text-inverse); border-color: #1a1a1a; }
.specimen-panel.bg-gray { background: #666; color: var(--text-inverse); border-color: #666; }
.specimen-panel.bg-blue { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
.specimen-panel .size-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
  margin-bottom: 8px;
}
.specimen-panel .specimen-lg {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  word-break: break-word;
}
.specimen-panel .specimen-md {
  font-size: 1.15rem;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.6;
  margin-bottom: 20px;
  opacity: 0.9;
}
.specimen-panel .specimen-charset {
  font-size: 0.9rem;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.8;
  opacity: 0.6;
  word-break: break-all;
}

/* Cart */
.cart-empty { text-align: center; padding: 80px 0; }
.cart-empty h3 { font-size: 24px; margin-bottom: 8px; }
.cart-empty p { color: var(--text-muted); margin-bottom: 20px; }
.cart-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item .item-name { flex: 1; font-weight: 400; }
.cart-item .item-price { font-weight: 500; min-width: 56px; text-align: right; }
.cart-item .remove-btn {
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.cart-item .remove-btn:hover { color: var(--danger); background: var(--danger-soft); }
.cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 380px;
  margin-left: auto;
  box-shadow: var(--shadow-sm);
}
.cart-summary h3 { font-size: 17px; margin-bottom: 14px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 15px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.summary-row.total {
  border-bottom: none;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  padding-top: 12px;
}
.cart-summary .btn { width: 100%; margin-top: 14px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  margin: 20px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 21px; margin-bottom: 18px; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: border-color 160ms ease;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-card {
  text-align: center;
  padding: 36px 28px;
  max-width: 380px;
  width: 100%;
  margin: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.success-card .check {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--success);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin: 0 auto 18px;
}
.success-card h3 { font-size: 21px; margin-bottom: 6px; }
.success-card p { color: var(--text-secondary); margin-bottom: 18px; }

/* About */
.about-hero {
  padding: 64px 0 40px;
  max-width: 680px;
}
.about-hero h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 16px;
}
.about-hero .lead {
  font-size: 19px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.about-body {
  max-width: 680px;
  padding-bottom: 48px;
}
.about-body p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  font-size: 17px;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 48px 0;
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 200ms ease;
}
.about-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.about-card h4 {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 6px;
}
.about-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}
.about-contact {
  padding: 40px 0 64px;
  border-top: 1px solid var(--border);
}
.about-contact .label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.about-contact .email {
  font-size: 19px;
  font-weight: 400;
  color: var(--accent);
}

/* License / Custom / Tools pages */
.page-intro {
  padding: 56px 0 32px;
  max-width: 600px;
}
.page-intro h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 12px;
}
.page-intro p { color: var(--text-secondary); line-height: 1.6; font-size: 17px; }

.license-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 64px;
}
.license-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 200ms ease;
}
.license-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.license-card h3 {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 8px;
}
.license-card .price {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 12px;
}
.license-card .price span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}
.license-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
}
.license-card ul {
  list-style: none;
  margin-bottom: 20px;
}
.license-card li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.license-card li::before { content: "\2713 "; color: var(--success); }

.custom-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 56px;
}
.custom-step .num {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.custom-step h4 {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 6px;
}
.custom-step p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: var(--shadow-sm);
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--surface-hover);
}
.tool-card h3 {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 6px;
}
.tool-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Showcase */
.showcase-section {
  padding: 64px 0;
}
.showcase-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.showcase-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease;
}
.showcase-panel:hover {
  box-shadow: var(--shadow-md);
}
.showcase-panel.flash {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.showcase-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.showcase-panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.showcase-panel-title h4 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.showcase-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Controls Bar (weight + size + lang in one row) ── */
.showcase-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.showcase-size-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--border);
}
.showcase-size-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 160ms ease;
  padding: 0;
}
.showcase-size-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.weight-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.weight-btn {
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  transition: all 160ms ease;
}
.weight-btn:hover { color: var(--text); }
.weight-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.size-control {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}
.size-control label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 2px;
  background: var(--border-strong);
  border-radius: 1px;
  outline: none;
}
.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.size-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 38px;
}
.showcase-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: 3px;
  border: 1px solid var(--border);
}
.lang-tab {
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  transition: all 160ms ease;
}
.lang-tab:hover { color: var(--text); }
.lang-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ── Specimen Frame ── */
.specimen-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 28px 14px;
  margin-bottom: 10px;
}
.specimen-display {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 16px 0;
  min-height: 72px;
  overflow: hidden;
  word-break: break-word;
  color: var(--text);
}
.specimen-display .specimen-text {
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Specimen actions (copy + reset) */
.specimen-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.specimen-action-btn {
  padding: 4px 13px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 160ms ease;
}
.specimen-action-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.specimen-action-btn.copied {
  color: var(--success);
  border-color: var(--success);
  background: var(--success-soft);
}

/* ── Charset (always visible) ── */
.charset-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.charset-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.charset-content {
  margin-top: 4px;
}
.specimen-charset-row {
  padding: 12px 0 4px;
  font-size: 13px;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.8;
  opacity: 0.5;
  word-break: break-all;
}
.specimen-display .specimen-text.editable,
.specimen-lg.editable {
  outline: none;
  cursor: text;
  border-radius: var(--radius-sm);
}
.specimen-display .specimen-text.editable:focus,
.specimen-lg.editable:focus {
  background: var(--accent-soft);
}
.specimen-display .specimen-text.editable:empty::before,
.specimen-lg.editable:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

/* OpenType Feature Toggles (detail page) */
.ot-features {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ot-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 4px;
}
.ot-btn {
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 160ms ease;
}
.ot-btn:hover { color: var(--text); border-color: var(--border-strong); }
.ot-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* Specimen toolbar (detail page) */
.specimen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.edit-hint {
  font-size: 12px;
  color: var(--text-muted);
}
.specimen-reset-btn {
  padding: 4px 13px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 160ms ease;
}
.specimen-reset-btn:hover { color: var(--text); border-color: var(--border-strong); }
.detail-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.detail-controls .weight-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Loading indicator */
.loading-placeholder {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.loading-placeholder::before {
  content: "";
  display: block;
  width: 20px; height: 20px;
  margin: 0 auto 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Search Overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.search-overlay.open { display: flex; }
.search-panel {
  width: min(520px, calc(100% - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 17px;
}
.search-results { max-height: 340px; overflow-y: auto; }
.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 150ms ease;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--accent-soft); }
.search-result .name { font-weight: 500; }
.search-result .meta { font-size: 12px; color: var(--text-muted); }
.search-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  background: var(--bg-alt);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.footer-brand-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 26ch;
}
.footer-col h5 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
  transition: color 150ms ease;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-inverse);
  z-index: 5000;
  pointer-events: none;
  background: var(--text);
  opacity: 0;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), opacity 250ms ease;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { background: var(--success); }
.toast.info { background: var(--accent); }
.toast.error { background: var(--danger); }

/* Keyboard focus */
.font-card:focus-visible,
.search-result:focus-visible,
.tool-card:focus-visible,
.about-card:focus-visible,
.license-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}
.font-card:focus-visible { border-radius: var(--radius-lg); }

/* CJK Letter-spacing fix */
html[lang="zh"] .hero h1,
html[lang="zh"] .wip-title,
html[lang="zh"] .specimen-display .specimen-text,
html[lang="zh"] .display-1,
html[lang="zh"] .display-2,
html[lang="zh"] .display-3 {
  letter-spacing: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .detail-hero { grid-template-columns: 1fr; gap: 32px; }
  .wip-layout { grid-template-columns: 1fr; gap: 32px; }
  .license-grid { grid-template-columns: 1fr; }
  .custom-steps { grid-template-columns: 1fr 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .featured-grid,
  .catalog-grid { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
  .section { padding: 56px 0; }
}

@media (max-width: 720px) {
  nav#main-nav {
    position: fixed;
    top: 0; right: -100%;
    width: min(280px, 84%);
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 64px 14px 20px;
    gap: 2px;
    transition: right 200ms ease;
    overflow-y: auto;
  }
  nav#main-nav.open { right: 0; }
  nav#main-nav .nav-link,
  nav#main-nav .nav-dropdown > button.nav-link {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
  }
  .nav-dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: var(--bg);
    margin: 0 0 4px;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-actions {
    margin-left: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
  }
  .mobile-toggle { display: flex; }
  .hero { padding: 56px 0 56px; }
  .custom-steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cart-summary { max-width: 100%; }
  .showcase-controls-bar { flex-direction: column; align-items: stretch; }
  .showcase-size-group { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ============ Print ============ */
@media print {
  header, footer, .skip-link,
  .search-overlay, .toast, .error-banner,
  .modal-overlay, .success-overlay,
  .mobile-toggle, .nav-actions, .cart-btn,
  .bg-switcher, .specimen-actions, .specimen-toolbar, .ot-features,
  .detail-controls, .name-strip,
  .btn { display: none !important; }

  body { background: #fff; color: #000; font-size: 12pt; }
  .page { display: block !important; min-height: auto; }
  .page.active { display: block !important; }
  .container { max-width: 100%; padding: 0 16pt; }

  .specimen-panel {
    border: 1px solid #ccc;
    background: #fff !important;
    color: #000 !important;
    page-break-inside: avoid;
  }
  .specimen-panel .specimen-lg { font-size: 24pt !important; }
  .specimen-panel .specimen-md { font-size: 11pt !important; }
  .specimen-panel .specimen-charset { font-size: 9pt !important; }

  .font-card, .showcase-panel, .license-card,
  .about-card, .tool-card, .custom-step {
    box-shadow: none !important;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  a { color: #000; text-decoration: underline; }
  h1, h2, h3, h4 { page-break-after: avoid; }
}

/* ============================================================
   🎛️ TYPOGRAPHY ENGINE — 排版引擎 UI
   ============================================================ */

/* Toggle button */
.typo-engine-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all 160ms ease;
  margin-top: 10px;
  margin-bottom: 4px;
}
.typo-engine-toggle:hover {
  color: var(--text);
  background: var(--bg-alt);
  border-color: var(--border-strong);
}
.typo-engine-toggle-icon {
  font-size: 14px;
}

.typo-engine-section {
  margin-top: 14px;
  margin-bottom: 14px;
}

/* Collapsible panel */
.typo-engine-panel {
  overflow: hidden;
  transition: max-height 300ms ease, opacity 300ms ease, margin 300ms ease;
  max-height: 600px;
  opacity: 1;
  margin-top: 6px;
}
.typo-engine-panel.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

/* Controls container */
.typo-engine-controls {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}

/* Control group */
.typo-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.typo-control-group.typo-slider-group {
  gap: 4px;
}
.typo-control-group.typo-mode-switcher {
  flex-basis: 100%;
  margin-bottom: 4px;
}
.typo-control-group.typo-reset-group {
  flex-basis: 100%;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Label */
.typo-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 0;
}

/* Mode switcher buttons */
.typo-mode-btns {
  display: inline-flex;
  gap: 4px;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.typo-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 160ms ease;
  white-space: nowrap;
}
.typo-mode-btn:hover { color: var(--text); }
.typo-mode-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.typo-mode-icon {
  font-size: 13px;
  line-height: 1;
}
.typo-mode-label {
  font-size: 11px;
}

/* Segmented control */
.typo-segmented {
  display: inline-flex;
  gap: 2px;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.typo-seg-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 160ms ease;
  white-space: nowrap;
}
.typo-seg-btn:hover { color: var(--text); }
.typo-seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Slider */
.typo-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 2px;
  background: var(--border-strong);
  border-radius: 1px;
  outline: none;
}
.typo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.typo-val {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  white-space: nowrap;
}

/* Reset button */
.typo-reset-btn {
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 160ms ease;
}
.typo-reset-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg);
}

/* ── Waterfall display ── */
.waterfall-display {
  overflow: hidden;
  font-synthesis: none;
}
.waterfall-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
}
.waterfall-row:last-child { border-bottom: none; }
.waterfall-size-label {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 30px;
  text-align: right;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.waterfall-text {
  flex: 1;
  min-width: 0;
}

/* ── Paragraph display ── */
.paragraph-display {
  max-width: 680px;
  font-synthesis: none;
}
.paragraph-display[style*="vertical-rl"] {
  max-height: 480px;
  max-width: 100%;
  overflow-y: auto;
}
.para-heading {
  margin-bottom: 16px;
  font-synthesis: none;
}
.para-subheading {
  margin-bottom: 20px;
  font-synthesis: none;
}
.para-body {
  font-synthesis: none;
}
.para-body .para-block {
  margin: 0;
  padding: 0;
}
.para-caption {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-synthesis: none;
}

/* ── Glyph map display ── */
.glyphmap-display {
  font-synthesis: none;
}
.glyphmap-section {
  margin-bottom: 16px;
}
.glyphmap-section:last-child { margin-bottom: 0; }
.glyphmap-section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.glyphmap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.glyph-cell {
  width: 38px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: all 160ms ease;
}
.glyph-cell:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: scale(1.1);
}
.glyph-char {
  line-height: 1;
}

/* Responsive tweaks for typo engine */
@media (max-width: 720px) {
  .typo-engine-controls {
    gap: 8px 12px;
    padding: 12px 14px;
  }
  .typo-control-group {
    flex-basis: auto;
  }
  .typo-control-group.typo-mode-switcher {
    flex-basis: 100%;
  }
  .typo-slider { width: 56px; }
  .typo-mode-label { display: none; }
  .typo-mode-btn { padding: 6px 10px; }
  .waterfall-display { padding: 16px 14px; }
  .paragraph-display { padding: 24px 18px; }
  .glyphmap-grid { gap: 3px; }
  .glyph-cell { width: 32px; height: 36px; }
  .ws-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   🎛️ TYPOGRAPHY ENGINE — Enhanced Professional Styles
   ============================================================ */

/* ── Waterfall header/footer ── */
.waterfall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.waterfall-family {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.waterfall-weight {
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.waterfall-row-alt {
  background: var(--bg-alt);
}
.waterfall-size-unit {
  font-size: 9px;
  opacity: 0.6;
  margin-left: 1px;
}
.waterfall-footer {
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Weight Spectrum display ── */
.weightspectrum-display {
  font-synthesis: none;
}
.ws-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.ws-family {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.ws-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.ws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.ws-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 160ms ease;
  font-synthesis: none;
}
.ws-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.ws-item.ws-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.ws-weight-num {
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 2px;
}
.ws-weight-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.ws-sample {
  font-synthesis: none;
  word-break: break-word;
}

/* ── Glyph map hex labels ── */
.glyph-hex {
  display: block;
  font-size: 7px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: center;
  margin-top: 1px;
  letter-spacing: 0;
  opacity: 0.6;
}
.glyph-cell {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.glyph-cell:hover .glyph-hex {
  opacity: 1;
  color: var(--accent);
}
.glyphmap-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── Paragraph metadata ── */
.para-meta {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Responsive tweaks for enhanced modes ── */
@media (max-width: 720px) {
  .ws-grid { grid-template-columns: repeat(2, 1fr); }
  .ws-item { padding: 10px 8px; }
  .ws-sample { font-size: 20px !important; }
  .waterfall-header { flex-direction: column; gap: 4px; align-items: flex-start; }
  .glyph-hex { display: none; }
}

/* ============================================================
   ⱥ OpenType Feature Display — 排版引擎 OpenType 模式
   ============================================================ */

/* ── Header ── */
.ot-display {
  font-synthesis: none;
}
.ot-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.ot-family {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.ot-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Category ── */
.ot-category {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ot-category:last-child { margin-bottom: 0; }
.ot-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  background: var(--bg-alt);
  transition: background 150ms ease;
}
.ot-cat-header:hover {
  background: var(--bg-hover);
}
.ot-cat-caret {
  display: inline-block;
  font-size: 9px;
  color: var(--text-muted);
  transition: transform 200ms ease;
  line-height: 1;
}
.ot-cat-caret.open {
  transform: rotate(90deg);
}
.ot-cat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  flex: 1;
}
.ot-cat-count {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
}
.ot-cat-body {
  overflow: hidden;
  transition: max-height 300ms ease, opacity 200ms ease;
  max-height: 2000px;
  opacity: 1;
  padding: 0 12px;
}
.ot-cat-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 12px;
}
.ot-detecting {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.ot-empty {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Feature row ── */
.ot-feature-row {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.ot-feature-row:last-child { border-bottom: none; margin-bottom: 0; }

.ot-feature-info {
  min-width: 140px;
  flex-shrink: 0;
  padding-top: 4px;
}
.ot-feature-key {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  margin-right: 6px;
}
.ot-feature-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Compare block ── */
.ot-compare {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0 12px;
  flex: 1;
  min-width: 0;
  align-items: baseline;
}
.ot-compare-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 0;
  text-align: center;
}
.ot-compare-text {
  font-synthesis: none;
  word-break: break-word;
  color: var(--text);
  padding: 4px 0;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .ot-feature-row {
    flex-direction: column;
    gap: 8px;
  }
  .ot-compare {
    grid-template-columns: auto 1fr;
  }
  .ot-feature-info { min-width: 0; }
}
