/* 拼豆图纸工坊 — 全局样式（奶油纸感 + 番茄红豆色） */
:root {
  --paper: #faf6ef;
  --card: #fffdf9;
  --ink: #2e2a25;
  --ink-soft: #6f675d;
  --ink-faint: #a79e91;
  --accent: #e8552f;
  --accent-deep: #c43e1d;
  --accent-soft: #fdeee9;
  --mint: #3d9b7a;
  --mint-soft: #e7f4ee;
  --honey: #f2a93b;
  --honey-soft: #fdf3e0;
  --line: #e7dfd2;
  --line-soft: #f0e9dd;
  --danger: #d4483c;
  --dot-color: rgba(232, 85, 47, 0.05);
  --header-bg: rgba(255, 253, 249, 0.92);
  --field-bg: #ffffff;
  --thumb-bg: #f3ece0;
  --toast-bg: #2e2a25;
  --toast-ink: #ffffff;
  --font-display: "ZCOOL KuaiLe", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow-sm: 0 1px 3px rgba(70, 55, 35, 0.08);
  --shadow-md: 0 6px 20px rgba(70, 55, 35, 0.10);
  --radius: 14px;
  --radius-sm: 9px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  background-image: radial-gradient(var(--dot-color) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
body.paper { background-color: var(--paper); }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.35; margin: 0 0 .5em; }
code { background: var(--line-soft); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
::selection { background: var(--accent-soft); }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 18px;
  height: 60px; display: flex; align-items: center; gap: 22px;
}
.logo { font-family: var(--font-display); font-size: 23px; color: var(--accent); display:flex; align-items:center;gap:7px; white-space:nowrap; }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  color: var(--ink-soft); padding: 7px 13px; border-radius: 9px;
  font-weight: 500; font-size: 14.5px;
}
.main-nav a:hover { background: var(--accent-soft); color: var(--accent-deep); text-decoration: none; }
.main-nav a.active { background: var(--accent); color: #fff; }
.header-user { display: flex; align-items: center; gap: 10px; }
.avatar-chip {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.user-name { font-size: 14px; font-weight: 500; }
.header-toggle { display: none; }
@media (max-width: 860px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; background: var(--card); border-bottom: 1px solid var(--line);
    padding: 10px 16px; gap: 2px; box-shadow: var(--shadow-md);
  }
  .header-toggle { display: inline-flex; }
  .user-name { display: none; }
}

/* ---------- 容器与卡片 ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 24px 18px 60px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 24px 18px 60px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-inner { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.section-title { font-size: 18px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content:""; width: 7px; height: 20px; border-radius: 4px; background: var(--accent); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 17px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: var(--font-body); transition: all .15s ease-out;
  text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.btn:hover { border-color: var(--accent); color: var(--accent-deep); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-mint { background: var(--mint); border-color: var(--mint); color: #fff; }
.btn-mint:hover { background: #328064; border-color: #328064; color:#fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { color: var(--danger); border-color: #f0d2ce; }
.btn-danger:hover { background: #fbeceb; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 38px; height: 38px; }

/* ---------- 表单 ---------- */
.form-label { display: block; font-size: 13.5px; font-weight: 500; margin: 0 0 6px; color: var(--ink-soft); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--field-bg); color: var(--ink);
  font-size: 14.5px; font-family: var(--font-body); transition: border-color .15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 84px; }
.field { margin-bottom: 15px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #d8cfc0; border-radius: 99px; transition: .2s; cursor: pointer; }
.slider::before { content:""; position:absolute; width:18px;height:18px;left:3px;top:3px;background:var(--field-bg);border-radius:50%;transition:.2s; }
.switch input:checked + .slider { background: var(--mint); }
.switch input:checked + .slider::before { transform: translateX(18px); }
input[type=range] { accent-color: var(--accent); width: 100%; }

/* ---------- 提示 ---------- */
.notice { padding: 11px 15px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.notice-info { background: var(--accent-soft); color: #8a3520; border: 1px solid #f6d5cb; }
.notice-ok { background: var(--mint-soft); color: #24654f; border: 1px solid #c4e4d6; }
.notice-warn { background: var(--honey-soft); color: #8a5e14; border: 1px solid #f3e0b8; }
.notice-error { background: #fbeceb; color: #96312a; border: 1px solid #f0d2ce; }

/* ---------- 徽标/标签 ---------- */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.badge-accent { background: var(--accent-soft); color: var(--accent-deep); }
.badge-mint { background: var(--mint-soft); color: var(--mint); }
.badge-honey { background: var(--honey-soft); color: #b07616; }
.badge-gray { background: var(--line-soft); color: var(--ink-soft); }

/* ---------- 网格 ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.toolbar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar-row .spacer { flex: 1; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-faint); }
.empty-state .emoji { font-size: 46px; display: block; margin-bottom: 12px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.data-table th { background: var(--paper); text-align: left; padding: 11px 14px; font-weight: 600; color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.data-table td { padding: 11px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:hover td { background: #fffaf3; }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(46,42,37,.45); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius); width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-head { padding: 17px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; display:flex; align-items:center; justify-content:space-between; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display:flex; justify-content:flex-end;gap:10px; }
.modal-close { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink-faint); line-height: 1; }
.modal-close:hover { color: var(--ink); }

/* ---------- 首页 hero ---------- */
.hero { text-align: center; padding: 54px 16px 36px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 48px); color: var(--ink); margin-bottom: 14px; }
.hero h1 .red { color: var(--accent); }
.hero p { color: var(--ink-soft); font-size: 16.5px; max-width: 620px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 16px; margin-top: 40px; }
.feature-card { padding: 22px 20px; text-align: center; }
.feature-card .ico { font-size: 34px; margin-bottom: 8px; }
.feature-card h3 { font-size: 16px; margin-bottom: 5px; }
.feature-card p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }

/* ---------- 图纸卡片 ---------- */
.pattern-card { overflow: hidden; transition: transform .15s, box-shadow .15s; cursor: pointer; display: flex; flex-direction: column; }
.pattern-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.pattern-thumb {
  aspect-ratio: 1/1; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23e7dfd2'/%3E%3C/svg%3E");
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pattern-thumb img, .pattern-thumb canvas { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.pattern-meta { padding: 12px 14px; }
.pattern-meta h3 { font-size: 15px; margin: 0 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pattern-stats { display: flex; gap: 10px; font-size: 12.5px; color: var(--ink-faint); flex-wrap: wrap; }

/* ---------- 认证页 ---------- */
.auth-wrap { max-width: 430px; margin: 46px auto; padding: 0 16px; }
.auth-card { padding: 30px 28px; }
.auth-logo { text-align: center; font-family: var(--font-display); font-size: 28px; color: var(--accent); margin-bottom: 4px; }
.auth-sub { text-align:center; color: var(--ink-soft); font-size:14px; margin-bottom: 22px; }
.auth-alt { text-align: center; margin-top: 16px; font-size: 14px; color: var(--ink-soft); }

/* ---------- 后台布局 ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; background: var(--card); border-right: 1px solid var(--line);
  padding: 18px 12px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .logo { font-size: 19px; padding: 4px 10px 16px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 10px; color: var(--ink-soft); font-size: 14.5px; margin-bottom: 2px; }
.admin-nav a:hover { background: var(--accent-soft); text-decoration: none; color: var(--accent-deep); }
.admin-nav a.active { background: var(--accent); color: #fff; }
.admin-nav .nav-sep { height: 1px; background: var(--line); margin: 12px 8px; }
.admin-main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.admin-head h1 { font-size: 22px; margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 18px 20px; }
.stat-card .num { font-family: var(--font-display); font-size: 32px; color: var(--accent); line-height: 1.1; }
.stat-card .lbl { font-size: 13.5px; color: var(--ink-soft); }
.admin-mobile-tab { display: none; }
@media (max-width: 860px) {
  .admin-side { position: fixed; left: -240px; z-index: 60; transition: left .2s; width: 230px; }
  .admin-side.open { left: 0; box-shadow: var(--shadow-md); }
  .admin-mobile-tab { display: inline-flex; }
  .admin-main { padding: 18px 14px 50px; }
}

/* ---------- 杂项 ---------- */
.spinner {
  width: 20px; height: 20px; border: 2.5px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.text-muted { color: var(--ink-faint); }
.text-sm { font-size: 13px; }
.text-right { text-align: right; }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.flex{display:flex}.items-center{align-items:center}.gap-8{gap:8px}.gap-12{gap:12px}.flex-wrap{flex-wrap:wrap}
.hidden{display:none!important}
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); display:inline-block; flex:none; }
.swatch-round { border-radius: 50%; }
.toast-host { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 18px; border-radius: 10px; background: var(--toast-bg); color: var(--toast-ink); font-size: 14px; box-shadow: var(--shadow-md); animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--mint); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 页面通用：标题栏 / 列表 / 卡片 ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.page { padding: 26px 20px 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-size: 27px; color: var(--ink); margin: 0 0 6px; }
.toolbar-line { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar-line .search-box { flex: 1; min-width: 220px; }
.toolbar-line .search-box .input { width: 100%; }

.pattern-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.pattern-card { padding: 0; overflow: hidden; cursor: pointer; text-decoration: none; color: inherit; display: block; }
.pattern-thumb {
  aspect-ratio: 1 / 1; background: var(--thumb-bg); display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 14px;
}
.pattern-thumb img { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.pattern-thumb canvas { image-rendering: pixelated; }
.pattern-meta { padding: 12px 14px 14px; }
.pattern-meta h3 { margin: 0 0 7px; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pattern-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.card-actions { display: flex; border-top: 1px solid var(--line-soft); }
.mini-btn {
  flex: 1; border: 0; background: transparent; padding: 10px 4px; font-size: 13px;
  color: var(--ink-soft); cursor: pointer; border-right: 1px solid var(--line-soft); font-family: var(--font-body);
}
.mini-btn:last-child { border-right: 0; }
.mini-btn:hover { background: var(--accent-soft); color: var(--accent-deep); }
.mini-btn.danger:hover { background: #fdebe7; color: var(--danger); }

.pager { display: flex; gap: 7px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.pager-btn {
  min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink-soft);
  text-decoration: none; font-size: 14px;
}
.pager-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge-honey { background: #fdf2dd; color: #9a6a14; }

/* ---------- 分享页 ---------- */
.share-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.share-main { padding: 20px; display: flex; flex-direction: column; align-items: center; }
.share-canvas-box { width: 100%; display: flex; justify-content: center; overflow: auto; }
.share-canvas-box canvas { max-width: 100%; }
.share-controls { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.share-title { font-family: var(--font-display); font-size: 22px; margin: 0 0 6px; }
.share-meta { display: flex; gap: 14px; margin-top: 12px; font-size: 13.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.gallery-hero { margin-bottom: 22px; }
@media (max-width: 900px) {
  .share-layout { grid-template-columns: 1fr; }
}

/* ---------- 管理后台补充 ---------- */
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-h1 { font-family: var(--font-display); font-size: 24px; margin: 0; }
.admin-card { padding: 20px; }
.admin-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; flex-wrap: wrap; }
.admin-card-head h3 { margin: 0; font-size: 16px; }
.admin-two-col { display: grid; grid-template-columns: 1fr; gap: 18px; }
.input-sm { width: auto !important; padding: 6px 10px !important; font-size: 13px !important; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.color-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); display: inline-block; vertical-align: middle; margin-right: 6px; }
.top-colors { display: flex; flex-direction: column; gap: 9px; }
.heat-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.heat-row .heat-bar { height: 10px; border-radius: 6px; }
.heat-row .heat-count { color: var(--ink-faint); font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-faint); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.admin-nav a { text-decoration: none; }
.admin-side { overflow-y: auto; }
.filter-line { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-line .input { width: auto; min-width: 140px; }
.thumb-sm { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--thumb-bg); image-rendering: pixelated; }
.heat-row { display: grid; grid-template-columns: 26px 64px 1fr 130px 52px; align-items: center; gap: 10px; }
.heat-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; }
.heat-name { font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat-cnt { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-faint); }

/* ================= 主题系统（后台可选） ================= */
/* 薄荷森林：清晨苗圃的苔绿工作台 */
[data-theme="forest"] {
  --paper: #f2f5ef;
  --card: #fbfdf9;
  --ink: #26302a;
  --ink-soft: #5d6b60;
  --ink-faint: #97a69b;
  --accent: #2e8b6b;
  --accent-deep: #1f6b50;
  --accent-soft: #e3f1ea;
  --honey: #dfa63c;
  --honey-soft: #faf2df;
  --line: #d8e0d3;
  --line-soft: #e9efe6;
  --dot-color: rgba(46, 139, 107, 0.06);
  --header-bg: rgba(251, 253, 249, 0.92);
  --thumb-bg: #e6ece2;
}
/* 蜜糖暖阳：午后晒台上的琥珀与奶油 */
[data-theme="honey"] {
  --paper: #fbf4e6;
  --card: #fffdf6;
  --ink: #33291c;
  --ink-soft: #6e6150;
  --ink-faint: #a99b85;
  --accent: #e07c12;
  --accent-deep: #b5600a;
  --accent-soft: #fcefe0;
  --mint: #4e9b6f;
  --mint-soft: #e6f2ea;
  --honey: #c07a20;
  --honey-soft: #f8ecd8;
  --line: #ebdfc8;
  --line-soft: #f4ebda;
  --dot-color: rgba(224, 124, 18, 0.06);
  --header-bg: rgba(255, 253, 246, 0.92);
  --thumb-bg: #f2e8d2;
}
/* 夜缝工坊：深夜工作台的暖调暗色 */
[data-theme="night"] {
  --paper: #221d18;
  --card: #2c2620;
  --ink: #f0e9de;
  --ink-soft: #b5aa9a;
  --ink-faint: #847a6d;
  --accent: #f0663c;
  --accent-deep: #ff9b6a;
  --accent-soft: #3a2a22;
  --mint: #4fb68d;
  --mint-soft: #24352d;
  --honey: #f2b04a;
  --honey-soft: #3a3020;
  --line: #3e3730;
  --line-soft: #352f29;
  --danger: #e86050;
  --dot-color: rgba(240, 102, 60, 0.07);
  --header-bg: rgba(34, 29, 24, 0.92);
  --field-bg: #221d18;
  --thumb-bg: #3a332c;
  --toast-bg: #f0e9de;
  --toast-ink: #2c2620;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
}
[data-theme="night"] .btn-primary { color: #fff; }
[data-theme="night"] .site-header { border-bottom-color: var(--line); }

/* ---------- 后台主题选择卡片 ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.theme-card {
  position: relative; border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 14px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
  text-align: left;
}
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.theme-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-card.selected::after {
  content: "✓ 当前"; position: absolute; top: 10px; right: 10px;
  background: var(--accent); color: #fff; font-size: 11.5px; padding: 2px 8px; border-radius: 99px;
}
.theme-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.theme-desc { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 10px; }
.theme-swatches { display: flex; gap: 6px; }
.theme-swatches i { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(0,0,0,.08); }
