/* ==========================================================================
   本地工具箱 · 全站样式（移动优先）
   目录：1) 变量与基础 2) Hero 3) 搜索 4) 分类 chips 5) 卡片网格
        6) 工具页 7) 表单/按钮/面板 8) 结果区/表格 9) Toast/遮罩
        10) 打印 11) 响应式
   ========================================================================== */

/* ---------------- 1) 变量与基础 ---------------- */
:root {
  --bg: #f4f6fb;
  --bg-soft: #eef1f9;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e6eaf3;
  --primary: #4f6df5;
  --primary-2: #8b6cf6;
  --primary-grad: linear-gradient(135deg, #5b7cfa 0%, #8b6cf6 55%, #b06bf5 100%);
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 22px rgba(31, 36, 48, 0.07);
  --shadow-hover: 0 14px 34px rgba(79, 109, 245, 0.20);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

/* 全局兜底：[hidden] 一律隐藏。作者样式（如 .overlay{display:flex}）会覆盖浏览器
   UA 的 [hidden]{display:none}，必须显式声明，否则 #cd-overlay 等常驻元素无法隐藏。 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
button { font-family: inherit; }
a { color: var(--primary); }

.main { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }

/* ---------------- 2) Hero ---------------- */
.hero {
  position: relative;
  background: var(--primary-grad);
  color: #fff;
  padding: 34px 16px 40px;
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(91, 124, 250, 0.28);
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}
.hero::before {
  content: "";
  position: absolute;
  left: -40px; bottom: -70px;
  width: 180px; height: 180px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 50%;
}
.hero-inner { position: relative; max-width: 1180px; margin: 0 auto; z-index: 1; }
.brand {
  font-size: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
}
.brand-icon { font-size: 30px; }
.tagline {
  margin-top: 8px;
  font-size: 13.5px;
  opacity: 0.94;
  max-width: 640px;
}

/* ---------------- 3) 搜索 ---------------- */
.search-wrap {
  position: relative;
  margin-top: 18px;
  max-width: 560px;
}
.search-icon {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.8;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 13px 42px 13px 42px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(31, 36, 48, 0.14);
  outline: none;
}
.search-input::placeholder { color: #9aa2b3; }
.search-input:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), 0 8px 22px rgba(31, 36, 48, 0.18); }
.search-clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none; border-radius: 50%;
  background: #eef1fb; color: #6b7280;
  font-size: 13px; cursor: pointer;
}
.search-clear:hover { background: #e0e6fa; color: #333; }

/* ---------------- 4) 分类 chips ---------------- */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 16px 2px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.chip:hover { border-color: #cfd8f5; color: var(--primary); }
.chip.active {
  background: var(--primary-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(91, 124, 250, 0.35);
}

/* ---------------- 5) 卡片网格 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 16px 14px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  min-height: 132px;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #d8e0fb; }
.card:active { transform: translateY(-1px) scale(0.99); }
.card::before {
  content: "";
  position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: var(--primary-grad);
  opacity: 0; transition: opacity 0.2s ease;
}
.card:hover::before { opacity: 1; }
.card-icon {
  font-size: 26px;
  line-height: 1;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--bg-soft);
  margin-bottom: 10px;
}
.card-title { font-size: 15px; font-weight: 700; }
.card-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot { margin-top: auto; padding-top: 10px; }
.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef1fb;
  color: #5b6b9e;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 50px 0;
  font-size: 15px;
}

/* ---------------- 6) 工具页 ---------------- */
.tool-page { padding-top: 18px; max-width: 920px; margin: 0 auto; animation: fadeUp 0.28s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.back-btn { margin-bottom: 14px; }
.tool-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.tool-head-icon {
  font-size: 30px;
  width: 54px; height: 54px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--bg-soft);
}
.tool-head-title { font-size: 19px; }
.tool-head-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tool-head-meta .tag { margin-top: 8px; }
.tool-body { margin-top: 16px; }

/* ---------------- 7) 表单 / 按钮 / 面板 ---------------- */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel + .panel { margin-top: 14px; }
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: #3b4252; margin-bottom: 6px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.check-item { display: inline-flex; align-items: center; gap: 8px; margin: 4px 14px 4px 0; cursor: pointer; user-select: none; }
.check-label { font-size: 13.5px; }
.checkbox { width: 17px; height: 17px; accent-color: var(--primary); }

.input, .textarea, select.input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfcff;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  font-family: inherit;
}
.input:focus, .textarea:focus, select.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 109, 245, 0.14);
  background: #fff;
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.input-file {
  width: 100%;
  font-size: 13.5px;
  padding: 9px 10px;
  border: 1px dashed #c9d2ee;
  border-radius: var(--radius-sm);
  background: #fbfcff;
  cursor: pointer;
}
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > * { flex: 1 1 160px; min-width: 0; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s;
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(91, 124, 250, 0.28);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(91, 124, 250, 0.36); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: #fff;
  color: #47506b;
  border-color: var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: #f5f7fd; border-color: #cfd8f5; box-shadow: none; }
.btn-soft {
  background: #eef1fb;
  color: #4a558c;
  box-shadow: none;
}
.btn-soft:hover { background: #e3e8f9; box-shadow: none; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f6d2d2; box-shadow: none; }
.btn-danger:hover { background: #fef2f2; border-color: #f0b4b4; box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.tabs { display: flex; gap: 6px; background: var(--bg-soft); padding: 5px; border-radius: 12px; margin-bottom: 16px; }
.tab {
  flex: 1;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.16s ease;
}
.tab.active { background: #fff; color: var(--primary); box-shadow: 0 3px 10px rgba(31, 36, 48, 0.08); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------- 8) 结果区 / 表格 / 提示条 ---------------- */
.result-box {
  background: #f7f9ff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 44px;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.stat-num { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.img-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fafbff;
  display: block;
}
.img-preview.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #adb5c7;
  font-size: 13px;
}
.qr-canvas-wrap {
  display: flex;
  justify-content: center;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 120px;
  align-items: center;
}

.progress-wrap { margin-top: 12px; }
.progress-bar {
  width: 100%; height: 8px;
  background: #e6eaf5;
  border-radius: 999px;
  overflow: hidden;
}
.progress-inner {
  height: 100%; width: 0%;
  background: var(--primary-grad);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.progress-text { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.notice {
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.55;
}
.notice-info { background: #eef3ff; color: #3a4a86; border: 1px solid #dbe4fb; }
.notice-warn { background: #fff7e8; color: #946200; border: 1px solid #fbe3b8; }
.notice-error { background: #fef2f2; color: #b02525; border: 1px solid #f6d2d2; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 8px 8px; border-bottom: 1px solid var(--border); text-align: left; }
table.tbl th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #fafbff; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl input.input { padding: 6px 8px; font-size: 13px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.totals { display: flex; flex-wrap: wrap; gap: 10px; }
.totals .stat { flex: 1 1 100px; }

/* Markdown 预览 */
.md-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: 200px;
  overflow-wrap: break-word;
}
.md-preview h1 { font-size: 22px; margin: 8px 0; }
.md-preview h2 { font-size: 19px; margin: 8px 0; }
.md-preview h3 { font-size: 16px; margin: 8px 0; }
.md-preview p { margin: 8px 0; }
.md-preview ul, .md-preview ol { padding-left: 22px; margin: 8px 0; }
.md-preview code { background: #f1f3fa; padding: 2px 5px; border-radius: 5px; font-family: var(--mono); font-size: 13px; }
.md-preview pre { background: #1f2430; color: #e6e9f2; padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.md-preview pre code { background: none; color: inherit; padding: 0; }
.md-preview blockquote { margin: 8px 0; padding: 6px 14px; border-left: 4px solid #cfd8f5; color: #5a6275; background: #fafbff; }
.md-preview table { border-collapse: collapse; }
.md-preview th, .md-preview td { border: 1px solid var(--border); padding: 5px 9px; }
.md-preview img { max-width: 100%; }
.md-preview a { color: var(--primary); }
.md-split { display: grid; grid-template-columns: 1fr; gap: 12px; }
.editor { min-height: 320px; font-family: var(--mono); font-size: 13.5px; }

/* 出题纸 */
.quiz-sheet { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; }
.quiz-q { padding: 7px 0; font-size: 15px; border-bottom: 1px dashed #eef1f8; }
.quiz-ans { color: var(--primary); font-weight: 700; }

/* 拼音结果 */
.py-list { display: flex; flex-direction: column; gap: 8px; }
.py-item { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.py-char { font-size: 26px; line-height: 1; width: 34px; text-align: center; }
.py-info { flex: 1; }
.py-pinyin { font-size: 15px; font-weight: 700; color: var(--primary); }
.py-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.py-words { margin-top: 4px; }

/* ---------------- 8.5) 场景入口 / 小工具抽屉 ---------------- */
.scenes { margin-top: 24px; }
.scene { margin-bottom: 32px; scroll-margin-top: 16px; }
.scene-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.scene-head-icon {
  font-size: 25px; width: 46px; height: 46px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.scene-head-text { flex: 1; min-width: 0; }
.scene-head-title { font-size: 18px; }
.scene-head-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.scene-head-count {
  font-size: 12px; color: var(--muted); background: #fff;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.card-hot {
  display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #ff7a45, #ff4d4f); border-radius: 6px; padding: 1px 6px; vertical-align: 2px;
}

.drawer {
  margin-top: 6px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.drawer-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 18px; background: transparent; border: none; cursor: pointer;
  font-size: 15px; font-weight: 700; color: var(--text); font-family: inherit;
}
.drawer-toggle:hover { background: #f8faff; }
.drawer-count { color: var(--muted); font-weight: 500; font-size: 13px; }
.drawer-arrow { color: var(--muted); transition: transform 0.2s ease; }
.drawer-toggle.open .drawer-arrow { transform: rotate(180deg); }
.drawer-body { padding: 0 18px 18px; animation: fadeUp 0.24s ease; }
.search-results { margin-top: 24px; }
.search-head { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ---------------- 8.6) 通用控件：投放区 / 滑块 / 分步 / 缩略图 ---------------- */
.drop-zone {
  position: relative; border: 2px dashed #c9d2ee; border-radius: var(--radius);
  background: #fbfcff; padding: 26px 18px; text-align: center; cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: #f3f6ff; }
.drop-zone .input-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-icon { font-size: 30px; line-height: 1; }
.drop-title { font-size: 14px; font-weight: 600; margin-top: 8px; }
.drop-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.range-wrap { display: flex; align-items: center; gap: 12px; }
.range { flex: 1; accent-color: var(--primary); min-width: 0; }
.range-val {
  min-width: 52px; text-align: right; font-size: 13.5px; font-weight: 700;
  color: var(--primary); font-variant-numeric: tabular-nums;
}
.hint-line { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.step { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 700; margin-bottom: 12px; }
.step-no {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary-grad); color: #fff;
  font-size: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}

.thumb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb {
  position: relative; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #fff; cursor: grab; transition: box-shadow 0.16s ease;
}
.thumb:hover { box-shadow: var(--shadow-hover); }
.thumb.dragging { opacity: 0.5; }
.thumb.over { outline: 2px solid var(--primary); outline-offset: 1px; }
.thumb img { display: block; width: 100%; height: 96px; object-fit: cover; background: #f3f5fb; }
.thumb-idx {
  position: absolute; left: 5px; top: 5px; background: rgba(31, 36, 48, 0.72);
  color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 6px;
}
.thumb-ops { position: absolute; right: 4px; top: 4px; display: flex; gap: 4px; }
.thumb-op {
  width: 22px; height: 22px; border: none; border-radius: 6px; background: rgba(31, 36, 48, 0.72);
  color: #fff; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.thumb-op:hover { background: rgba(31, 36, 48, 0.92); }
.thumb-name {
  font-size: 11px; color: var(--muted); padding: 4px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.page-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 12px; }
.page-thumb { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.page-thumb img { display: block; width: 100%; background: #fff; }
.page-thumb.blank { border-color: #f4c7c7; }
.page-thumb.dropped { opacity: 0.38; }
.page-badge {
  position: absolute; left: 6px; bottom: 6px; font-size: 11px;
  background: rgba(31, 36, 48, 0.72); color: #fff; border-radius: 6px; padding: 1px 7px;
}
.page-thumb.blank .page-badge { background: rgba(239, 68, 68, 0.9); }
.page-tools { display: flex; gap: 6px; position: absolute; right: 5px; top: 5px; }
.page-tools button {
  width: 22px; height: 22px; border: none; border-radius: 6px;
  background: rgba(31, 36, 48, 0.72); color: #fff; font-size: 11px; cursor: pointer; padding: 0;
}

/* 证件照 */
.idp-stage {
  display: flex; justify-content: center; padding: 14px;
  background: #f3f5fb; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.idp-canvas { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 6px 18px rgba(31, 36, 48, 0.14); background: #fff; }
.idp-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.spec-chip {
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  cursor: pointer; text-align: left; font-size: 12.5px; transition: all 0.16s ease; font-family: inherit;
}
.spec-chip:hover { border-color: #cfd8f5; }
.spec-chip.active { border-color: var(--primary); background: #eef2ff; color: var(--primary); font-weight: 700; box-shadow: 0 4px 12px rgba(91, 124, 250, 0.18); }
.spec-chip small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; font-size: 11px; }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.color-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.color-dot.active { box-shadow: 0 0 0 3px var(--primary); }

/* 计算器 */
.calc-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.calc-out .stat-num { font-size: 20px; }

/* ---------------- 9) Toast / 遮罩 ---------------- */
.toast-wrap {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  z-index: 9999;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}
.toast {
  background: rgba(31, 36, 48, 0.94);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.26s ease, transform 0.26s ease;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-ok { background: rgba(22, 163, 74, 0.96); }
.toast-error { background: rgba(239, 68, 68, 0.96); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 26, 38, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(2px);
}
.overlay-box {
  background: #fff;
  padding: 24px 30px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  min-width: 160px;
}
.overlay-box p { margin-top: 12px; font-size: 14px; color: #47506b; }
.spinner {
  width: 34px; height: 34px;
  margin: 0 auto;
  border: 3px solid #e6eaf5;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.noscript {
  background: #fef2f2;
  color: #b02525;
  padding: 16px;
  text-align: center;
  font-size: 14px;
}

/* ---------------- 页脚 ---------------- */
.footer {
  text-align: center;
  padding: 26px 16px 40px;
  color: var(--muted);
  font-size: 12.5px;
}
.footer-sub { margin-top: 5px; opacity: 0.8; }
.footer .beian {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.footer .beian:hover { color: var(--primary, #5b7cfa); background: rgba(91, 124, 250, 0.08); }

/* ---------------- 10) 打印 ---------------- */
/* 打印作业稿：每张图占满一页 A4 */
@page { size: A4; margin: 0; }
.print-sheet { display: block; width: 100%; page-break-after: always; break-after: page; }
.print-sheet:last-child { page-break-after: auto; break-after: auto; }

@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area {
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    box-shadow: none;
    border: none;
    padding: 0;
  }
  .no-print { display: none !important; }
}

/* ---------------- 11) 响应式 ---------------- */
@media (min-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) {
  body { font-size: 15.5px; }
  .brand { font-size: 30px; }
  .hero { padding: 46px 16px 52px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .md-split { grid-template-columns: 1fr 1fr; }
  .md-split .editor { min-height: 420px; }
  .md-preview { min-height: 420px; }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .hero { padding: 60px 16px 64px; }
  .card { min-height: 150px; }
}
