/* ===== 云字体 yunziti.com · 在线造字 =====
   设计语言：宣纸 + 墨 + 印泥红。克制的东方工具感，不滥用渐变与玻璃。
   ========================================================= */

:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d6;
  --ink: #1a1714;
  --ink-2: #3a342c;
  --ink-soft: #6b6358;
  --ink-faint: #9b9286;
  --line: #d9cfba;
  --line-2: #c8bda3;
  --vermilion: #c8392f;       /* 印泥红 */
  --vermilion-d: #a82a21;
  --vermilion-l: #e7a59c;
  --gold: #b08442;
  --ok: #2f7d4f;
  --warn: #b8860b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(26,23,20,.04), 0 6px 22px -10px rgba(26,23,20,.18);
  --shadow-soft: 0 1px 0 rgba(26,23,20,.03), 0 3px 12px -8px rgba(26,23,20,.12);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 宣纸纹理 */
.paper-grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(rgba(120,100,70,.05) 1px, transparent 1px),
    radial-gradient(rgba(120,100,70,.04) 1px, transparent 1px);
  background-size: 6px 6px, 11px 11px;
  background-position: 0 0, 3px 3px;
  opacity: .7;
}
body > * { position: relative; z-index: 1; }

a { color: var(--vermilion-d); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 顶部导航 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,241,231,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.seal {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--vermilion); color: #fff7f0;
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 1px 2px rgba(168,42,33,.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.brand-sub { font-size: 11px; color: var(--ink-soft); letter-spacing: .14em; text-transform: uppercase; }
.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.topnav a:hover { color: var(--vermilion-d); text-decoration: none; }
.export-cluster { display: flex; gap: 8px; }

/* ===== 按钮 ===== */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius-sm);
  transition: transform .08s ease, background .15s, border-color .15s, color .15s;
  white-space: nowrap; line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--vermilion); color: #fff7f0; border-color: var(--vermilion); }
.btn-primary:hover:not(:disabled) { background: var(--vermilion-d); border-color: var(--vermilion-d); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--paper-2); border-color: var(--ink-faint); }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 10px; }
.btn-icon { padding: 6px 10px; font-size: 16px; line-height: 1; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btn-row .btn { flex: 1 1 auto; text-align: center; }

/* ===== Hero ===== */
.hero {
  max-width: 1320px; margin: 0 auto; padding: 64px 24px 40px;
}
.hero-inner { max-width: 820px; }
.kicker {
  display: inline-block; margin: 0 0 16px;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--vermilion-d); font-weight: 600;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5.4vw, 60px); line-height: 1.12; margin: 0 0 20px;
  font-weight: 700; letter-spacing: -.01em;
}
.ink-stroke {
  color: var(--vermilion);
  position: relative; white-space: nowrap;
}
.lede { font-size: 17px; color: var(--ink-2); max-width: 640px; margin: 0 0 28px; }
.hero-stats { display: flex; gap: 36px; margin: 0 0 30px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 26px; font-family: var(--serif); color: var(--ink); }
.hero-stats span { font-size: 12px; color: var(--ink-soft); }

/* ===== 通用区块 ===== */
.section-title {
  font-family: var(--serif); font-size: clamp(24px, 3vw, 32px);
  font-weight: 700; text-align: center; margin: 0 0 28px; letter-spacing: .02em;
  position: relative;
}
.section-title::after {
  content: ""; display: block; width: 44px; height: 3px; margin: 12px auto 0;
  background: var(--vermilion); border-radius: 2px;
}

/* ===== 三步 ===== */
.steps { max-width: 1100px; margin: 0 auto; padding: 24px 24px 56px; }
.step-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.step-grid li {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; box-shadow: var(--shadow-soft); position: relative;
}
.step-no {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  background: var(--paper); border: 1px solid var(--vermilion-l);
  color: var(--vermilion-d); font-family: var(--serif); font-weight: 700;
  border-radius: 50%; margin-bottom: 12px;
}
.step-grid h3 { margin: 0 0 8px; font-size: 17px; }
.step-grid p { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }

/* ===== 造字台 ===== */
.workbench { max-width: 1320px; margin: 0 auto; padding: 8px 24px 60px; }
.bench {
  display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 20px; align-items: start;
}
.bench-left, .bench-right { display: flex; flex-direction: column; gap: 18px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); overflow: hidden;
}
.card-head {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; font-size: 15px; font-weight: 600; user-select: none;
  border-bottom: 1px solid transparent; transition: background .12s;
}
.card-head::-webkit-details-marker { display: none; }
.card-head:hover { background: var(--paper); }
details[open] > .card-head { border-bottom-color: var(--line); }
.card-head::after { content: "▾"; margin-left: auto; color: var(--ink-faint); transition: transform .2s; }
details[open] > .card-head::after { transform: rotate(180deg); }
.card-idx {
  font-family: var(--serif); font-size: 12px; font-weight: 700; color: var(--vermilion-d);
  border: 1px solid var(--vermilion-l); border-radius: 4px; padding: 1px 6px;
}
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .slider-head label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hint { font-weight: 400; color: var(--ink-faint); font-size: 11px; margin-left: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 9px 11px; transition: border-color .15s, background .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--vermilion); background: #fff;
  box-shadow: 0 0 0 3px rgba(200,57,47,.12);
}
textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.muted { color: var(--ink-faint); font-size: 12px; }

/* 开关 */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track {
  width: 38px; height: 22px; flex: none; border-radius: 12px;
  background: var(--line-2); position: relative; transition: background .18s;
}
.track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .18s;
}
.switch input:checked + .track { background: var(--vermilion); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(200,57,47,.2); }
.switch-label { font-size: 14px; color: var(--ink-2); font-weight: 500; }

/* 滑块 */
.slider-field { display: flex; flex-direction: column; gap: 4px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; }
.slider-head output { font-family: var(--mono); font-size: 13px; color: var(--vermilion-d); font-weight: 700; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: var(--line); border-radius: 4px; margin: 4px 0 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--vermilion); border: 2px solid #fff; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--vermilion);
  border: 2px solid #fff; cursor: pointer;
}

/* 拖拽区 */
.dropzone {
  display: block; cursor: pointer; border: 1.5px dashed var(--line-2);
  border-radius: var(--radius); padding: 26px 18px; text-align: center;
  background: var(--paper); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--vermilion); background: #fdf4f2;
}
.dropzone-inner { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.dz-icon { font-size: 24px; color: var(--vermilion); }
.dz-title { margin: 0; font-weight: 600; font-size: 14px; }
.dz-sub { margin: 0; font-size: 12px; color: var(--ink-soft); }

/* ===== 工具栏与面板 ===== */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; }
.toolbar-right { margin-left: auto; }
.panel-title { margin: 0; font-size: 15px; font-weight: 600; }
.pill {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px;
  font-size: 12px; font-weight: 700; color: var(--vermilion-d);
  background: var(--paper); border: 1px solid var(--vermilion-l); border-radius: 11px;
  font-family: var(--mono);
}
.page-info { font-size: 13px; color: var(--ink-soft); font-family: var(--mono); min-width: 46px; text-align: center; }

.pending-list {
  padding: 16px; display: flex; flex-wrap: wrap; gap: 10px; min-height: 90px; align-content: flex-start;
}
.pending-list .empty { width: 100%; text-align: center; color: var(--ink-faint); font-size: 13px; padding: 18px 0; }
.pending-item {
  position: relative; width: 84px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); padding: 6px; display: flex; flex-direction: column; gap: 4px;
}
.pending-item canvas { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 4px; }
.pending-item .pi-label {
  font-size: 12px; text-align: center; color: var(--ink-2); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pending-item .pi-char-input {
  font-size: 13px; text-align: center; padding: 3px 4px; height: 26px;
}
.pending-item .pi-remove {
  position: absolute; top: -7px; right: -7px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--ink); color: #fff; border: 2px solid var(--paper);
  font-size: 11px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.pending-item .pi-status { font-size: 10px; text-align: center; color: var(--ok); }

/* 字形预览网格 */
.preview-card .glyph-grid { padding: 16px; min-height: 200px; }
.glyph-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px;
}
.glyph-cell {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; overflow: hidden; display: flex; flex-direction: column;
}
.glyph-cell canvas { width: 100%; aspect-ratio: 1; display: block; background: #fff; border-bottom: 1px solid var(--line); }
.glyph-cell .gc-label { text-align: center; font-size: 13px; padding: 5px 0; color: var(--ink-2); font-weight: 600; }
.glyph-cell.empty-grid .empty { grid-column: 1 / -1; }

/* 打字测试 */
.typing-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.type-input { font-size: 16px; padding: 12px 14px; }
.type-canvas { width: 100%; height: 160px; display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ===== 功能 ===== */
.features { max-width: 1100px; margin: 0 auto; padding: 24px 24px 60px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; box-shadow: var(--shadow-soft);
}
.f-icon {
  width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center;
  background: var(--paper); color: var(--vermilion-d); font-size: 20px; margin-bottom: 12px;
  border: 1px solid var(--vermilion-l);
}
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; font-size: 13px; color: var(--ink-2); }

/* ===== FAQ ===== */
.faq { max-width: 880px; margin: 0 auto; padding: 8px 24px 60px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-list details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0; box-shadow: var(--shadow-soft);
}
.faq-list summary {
  cursor: pointer; padding: 15px 18px; font-weight: 600; font-size: 15px; list-style: none;
  display: flex; align-items: center; gap: 10px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before {
  content: "＋"; color: var(--vermilion-d); font-weight: 700; transition: transform .2s;
}
.faq-list details[open] summary::before { content: "－"; }
.faq-list p { margin: 0; padding: 0 18px 16px; color: var(--ink-2); font-size: 14px; }

/* ===== 页脚 ===== */
.footer {
  text-align: center; padding: 30px 24px 40px; border-top: 1px solid var(--line);
  color: var(--ink-soft); font-size: 13px;
}
.footer p { margin: 0 0 4px; }

/* ===== Toast / 进度 ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff7f0; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 200; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--vermilion-d); }

.progress-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: min(420px, 90vw); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); z-index: 200;
}
.progress-inner { height: 8px; background: var(--paper-2); border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--vermilion); transition: width .15s; }
.progress-text { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); text-align: center; }
.hidden { display: none !important; }

/* ===== 响应式 ===== */
@media (max-width: 980px) {
  .bench { grid-template-columns: 1fr; }
  .step-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .topnav { display: none; }
  .export-cluster { margin-left: auto; }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 40px 18px 24px; }
  .workbench, .steps, .features, .faq { padding-left: 18px; padding-right: 18px; }
  .export-cluster .btn { padding: 8px 12px; font-size: 13px; }
  .brand-sub { display: none; }
}
/* ===== 悬浮客服按钮 ===== */
.kefu-fab {
  position: fixed; right: 22px; bottom: 28px; z-index: 60;
  display: flex; align-items: center; gap: 6px;
  padding: 12px 18px 12px 14px; border: none; border-radius: 999px;
  background: var(--vermilion); color: #fff7f0;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(168,42,33,.45), inset 0 0 0 2px rgba(255,255,255,.14);
  cursor: pointer; transition: transform .18s, box-shadow .18s;
}
.kefu-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(168,42,33,.55); }
.kefu-fab .kefu-icon { display: grid; place-items: center; line-height: 0; }
.kefu-fab:focus-visible { outline: 3px solid rgba(200,57,47,.4); outline-offset: 2px; }

.kefu-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,23,20,.5); backdrop-filter: blur(2px);
  animation: kefu-in .16s ease-out;
}
.kefu-modal[hidden] { display: none; }
.kefu-card {
  width: min(360px, calc(100vw - 48px));
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(26,23,20,.28);
  overflow: hidden; font-family: var(--sans);
}
.kefu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--vermilion); color: #fff7f0;
}
.kefu-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .04em; }
.kefu-close {
  width: 30px; height: 30px; border: none; background: rgba(255,255,255,.16);
  color: #fff; font-size: 20px; line-height: 1; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; transition: background .15s;
}
.kefu-close:hover { background: rgba(255,255,255,.28); }
.kefu-body { padding: 22px 22px 24px; }
.kefu-line { margin: 0 0 6px; color: var(--ink); font-size: 14px; line-height: 1.6; }
.kefu-wechat {
  margin: 4px 0 12px; text-align: center;
  font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 28px; letter-spacing: .06em; color: var(--vermilion-d);
  -webkit-user-select: all; user-select: all; cursor: text;
}
.kefu-tip { margin: 0; text-align: center; font-size: 12px; color: var(--ink-soft); }
@keyframes kefu-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 560px) {
  .kefu-fab { right: 14px; bottom: 18px; padding: 10px 14px 10px 11px; font-size: 13px; }
  .kefu-fab .kefu-label { display: none; }
  .kefu-wechat { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
