/* ============================================================
   乐酷工具 · 前台设计系统
   设计语言: 现代渐变 / 卡片化 / 圆角 / 明暗双主题 / 多主色
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --primary-rgb: 99, 102, 241;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  --bg: #f4f5fb;
  --bg-soft: #eceef8;
  --card: #ffffff;
  --card-2: #f8f9ff;
  --text: #1b1f2e;
  --text-2: #5d6478;
  --text-3: #969db3;
  --border: #e6e8f2;
  --border-strong: #d5d9ea;
  --shadow-sm: 0 2px 8px rgba(27, 31, 46, .05);
  --shadow: 0 8px 28px rgba(27, 31, 46, .07);
  --shadow-hover: 0 16px 40px rgba(var(--primary-rgb), .18);
  --ring: 0 0 0 3px rgba(var(--primary-rgb), .18);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --header-h: 64px;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  --primary: #818cf8;
  --primary-2: #a78bfa;
  --primary-rgb: 129, 140, 248;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 60%, #a855f7 100%);
  --bg: #0d0f17;
  --bg-soft: #131624;
  --card: #171a27;
  --card-2: #1d2131;
  --text: #e9ebf4;
  --text-2: #a3a9c0;
  --text-3: #6d7490;
  --border: #262b3d;
  --border-strong: #343a52;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow: 0 8px 28px rgba(0, 0, 0, .4);
  --shadow-hover: 0 16px 40px rgba(var(--primary-rgb), .22);
}

/* 主题色变体 */
:root[data-color="violet"] { --primary:#8b5cf6; --primary-2:#a855f7; --primary-rgb:139,92,246; }
:root[data-color="blue"]   { --primary:#3b82f6; --primary-2:#06b6d4; --primary-rgb:59,130,246; }
:root[data-color="cyan"]   { --primary:#06b6d4; --primary-2:#3b82f6; --primary-rgb:6,182,212; }
:root[data-color="green"]  { --primary:#10b981; --primary-2:#14b8a6; --primary-rgb:16,185,129; }
:root[data-color="orange"] { --primary:#f97316; --primary-2:#f43f5e; --primary-rgb:249,115,22; }
:root[data-color="rose"]   { --primary:#f43f5e; --primary-2:#ec4899; --primary-rgb:244,63,94; }

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

/* 背景装饰光斑 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 300px at 12% -4%, rgba(var(--primary-rgb), .12), transparent 60%),
    radial-gradient(700px 340px at 88% -8%, rgba(var(--primary-rgb), .10), transparent 60%);
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-2); }
img { max-width: 100%; }
::selection { background: rgba(var(--primary-rgb), .25); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: .3px; }
.brand:hover { color: var(--text); }
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--gradient);
  display: grid; place-items: center;
  color: #fff; font-size: 19px;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), .35);
}
.brand-logo-img {
  object-fit: contain;
  padding: 3px;
  flex: none;
}
.brand-name { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.header-nav { display: flex; align-items: center; gap: 6px; }
.header-nav a {
  padding: 7px 13px; border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 500;
}
.header-nav a:hover { color: var(--primary); background: rgba(var(--primary-rgb), .09); }
.header-nav a.active { color: var(--primary); background: rgba(var(--primary-rgb), .12); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  cursor: pointer;
  transition: all .2s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- 首页 Hero ---------- */
.hero { padding: 58px 0 34px; text-align: center; }
.hero-title {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 14px;
  letter-spacing: .5px;
}
.hero-title .grad {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--text-2); font-size: 16px; max-width: 620px; margin: 0 auto 28px; }

/* 搜索框 */
.search-wrap { max-width: 560px; margin: 0 auto 12px; position: relative; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 20px;
  box-shadow: var(--shadow);
  transition: all .25s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: var(--ring), var(--shadow); }
.search-box svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.search-box input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 15px; color: var(--text); padding: 9px 0; min-width: 0;
}
.search-box input::placeholder { color: var(--text-3); }
.search-count { flex: none; font-size: 12px; color: var(--text-3); padding-right: 8px; }
.search-clear {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--bg-soft); color: var(--text-2);
  cursor: pointer; font-size: 14px; display: none; place-items: center;
}
.search-clear.show { display: grid; }

/* 公告 */
.announce {
  max-width: 720px; margin: 14px auto 0;
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(var(--primary-rgb), .08);
  border: 1px solid rgba(var(--primary-rgb), .22);
  color: var(--text-2);
  border-radius: 12px; padding: 10px 16px; font-size: 13.5px;
  text-align: left;
}
.announce svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--primary); }

/* 分类筛选 */
.cat-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 26px 0 6px; }
.cat-chip {
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.cat-chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.cat-chip.active {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), .3);
}

/* ---------- 工具网格 ---------- */
.tools-section { padding: 10px 0 30px; }
.cat-block { margin-bottom: 30px; }
.cat-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gradient); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .15); }
.cat-title { font-size: 17px; font-weight: 800; margin: 0; }
.cat-count { font-size: 12.5px; color: var(--text-3); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}
.tool-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
.tool-card::after {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity .25s;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}
.tool-card:hover::after { opacity: 1; }
.tool-card-top { display: flex; align-items: center; justify-content: space-between; }
.tool-icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 23px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .16), rgba(var(--primary-rgb), .06));
  border: 1px solid rgba(var(--primary-rgb), .16);
  transition: transform .25s;
}
.tool-card:hover .tool-icon { transform: scale(1.08) rotate(-4deg); }
.tool-views { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.tool-views svg { width: 13px; height: 13px; }
.tool-name { font-size: 15.5px; font-weight: 700; margin: 0; }
.tool-desc {
  font-size: 13px; color: var(--text-2); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tool-tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-3);
}
.tool-card .go { position: absolute; right: 16px; bottom: 14px; opacity: 0; transform: translateX(-6px); transition: all .25s; color: var(--primary); }
.tool-card:hover .go { opacity: 1; transform: translateX(0); }
.tool-card .go svg { width: 17px; height: 17px; }

/* 空状态 */
.empty-tip { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-tip .empty-icon { font-size: 44px; margin-bottom: 10px; }

/* ---------- 工具页 ---------- */
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-3); padding: 22px 0 8px; flex-wrap: wrap; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--primary); }
.crumbs svg { width: 12px; height: 12px; }

.tool-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 18px; flex-wrap: wrap; }
.tool-head .tool-icon { width: 58px; height: 58px; font-size: 28px; border-radius: 16px; }
.tool-head-info { flex: 1; min-width: 200px; }
.tool-head h1 { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.tool-head p { margin: 0; color: var(--text-2); font-size: 14px; }
.tool-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-3); align-items: center; }
.tool-meta .meta-item { display: flex; align-items: center; gap: 5px; }

.tool-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.ad-slot {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
  margin: 18px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  overflow: hidden;
}
.ad-slot .ad-label { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 6px; opacity: .7; }

.related-title { font-size: 16px; font-weight: 800; margin: 6px 0 14px; display: flex; align-items: center; gap: 8px; }

/* ---------- 工具通用组件 (.t-*) 供插件视图使用 ---------- */
.t-field { margin-bottom: 16px; }
.t-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.t-label .t-required { color: var(--primary); }

.t-input, .t-textarea, .t-select {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: all .2s;
  font-family: inherit;
}
.t-input:focus, .t-textarea:focus, .t-select:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: var(--card);
}
.t-input::placeholder, .t-textarea::placeholder { color: var(--text-3); }
.t-textarea { resize: vertical; min-height: 130px; line-height: 1.65; }
.t-textarea.mono, .t-input.mono, .t-result.mono { font-family: var(--mono); font-size: 13px; }

.t-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.t-row-between { justify-content: space-between; }
.t-grid { display: grid; gap: 14px; }
.t-grid-2 { grid-template-columns: 1fr 1fr; }
.t-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .t-grid-2, .t-grid-3 { grid-template-columns: 1fr; } }

.t-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px; font-weight: 600;
  background: var(--gradient);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(var(--primary-rgb), .28);
  transition: all .2s;
  font-family: inherit;
}
.t-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(var(--primary-rgb), .38); }
.t-btn:active { transform: translateY(0); }
.t-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.t-btn svg { width: 16px; height: 16px; }
.t-btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.t-btn-ghost:hover { color: var(--primary); border-color: var(--primary); box-shadow: none; }
.t-btn-sm { padding: 7px 13px; font-size: 13px; }
.t-btn-danger { background: linear-gradient(135deg, #f43f5e, #e11d48); box-shadow: 0 5px 14px rgba(244,63,94,.25); }
.t-btn-success { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 5px 14px rgba(16,185,129,.25); }

.t-result {
  position: relative;
  background: var(--card-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.7;
  font-family: var(--mono);
}
.t-result .t-result-copy {
  position: sticky; top: 0; float: right;
  margin: -6px -6px 0 0;
}
.t-result-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.t-result-title span { font-size: 13px; font-weight: 600; color: var(--text-2); }

.t-hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.t-divider { height: 1px; background: var(--border); margin: 18px 0; }

.t-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.t-tab {
  padding: 9px 16px; font-size: 14px; font-weight: 600;
  color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all .2s;
}
.t-tab:hover { color: var(--primary); }
.t-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.t-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(var(--primary-rgb), .12); color: var(--primary);
  font-weight: 600;
}
.t-badge-success { background: rgba(16,185,129,.12); color: #10b981; }
.t-badge-warn { background: rgba(249,115,22,.13); color: #f97316; }

.t-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.t-switch input { opacity: 0; width: 0; height: 0; }
.t-switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--border-strong);
  transition: all .25s; cursor: pointer;
}
.t-switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
  transition: all .25s;
}
.t-switch input:checked + .track { background: var(--gradient); }
.t-switch input:checked + .track::after { transform: translateX(20px); }

.t-checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.t-checkbox input { accent-color: var(--primary); width: 15px; height: 15px; }

.t-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t-table th, .t-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.t-table th { color: var(--text-3); font-weight: 600; font-size: 12.5px; background: var(--card-2); }
.t-table tr:hover td { background: rgba(var(--primary-rgb), .04); }

.t-stat { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 16px; }
.t-stat-item {
  flex: 1; min-width: 110px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}
.t-stat-item b { display: block; font-size: 20px; font-weight: 800; color: var(--primary); }
.t-stat-item span { font-size: 12px; color: var(--text-3); }

.t-drop {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  color: var(--text-3);
  cursor: pointer;
  transition: all .25s;
}
.t-drop:hover, .t-drop.dragover { border-color: var(--primary); color: var(--primary); background: rgba(var(--primary-rgb), .05); }
.t-drop svg { width: 34px; height: 34px; margin-bottom: 8px; opacity: .7; }
.t-drop.dragover { transform: scale(1.01); }

.t-color { display: flex; align-items: center; gap: 10px; }
.t-color input[type="color"] {
  width: 46px; height: 40px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card-2);
  padding: 3px; cursor: pointer;
}
.t-color input[type="text"] { flex: 1; }

.t-slider { width: 100%; accent-color: var(--primary); }
.t-range-row { display: flex; align-items: center; gap: 12px; }
.t-range-row output { font-weight: 700; color: var(--primary); min-width: 42px; text-align: right; font-size: 14px; }

.t-preview {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--card-2);
  min-height: 60px;
  overflow: auto;
}
.t-preview.markdown-body { font-size: 14.5px; line-height: 1.75; }
.t-preview.markdown-body h1, .t-preview.markdown-body h2, .t-preview.markdown-body h3 { margin-top: 18px; }
.t-preview.markdown-body pre {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; overflow: auto; font-family: var(--mono); font-size: 13px;
}
.t-preview.markdown-body code { font-family: var(--mono); background: rgba(var(--primary-rgb), .1); padding: 2px 5px; border-radius: 4px; font-size: .9em; }
.t-preview.markdown-body pre code { background: none; padding: 0; }
.t-preview.markdown-body blockquote { margin: 0; padding: 6px 14px; border-left: 3px solid var(--primary); color: var(--text-2); background: rgba(var(--primary-rgb), .06); border-radius: 0 8px 8px 0; }
.t-preview.markdown-body table { border-collapse: collapse; }
.t-preview.markdown-body th, .t-preview.markdown-body td { border: 1px solid var(--border); padding: 6px 10px; }
.t-preview.markdown-body img { max-width: 100%; }

.t-action-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.t-inline-label { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toast-in .25s ease;
  color: var(--text);
  max-width: 90vw;
}
.toast.success { border-color: rgba(16,185,129,.4); }
.toast.error { border-color: rgba(244,63,94,.45); }
.toast.success .toast-ico { color: #10b981; }
.toast.error .toast-ico { color: #f43f5e; }
.toast-ico { font-weight: 800; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10, 12, 22, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  max-height: 86vh; overflow: auto;
  padding: 26px;
  box-shadow: var(--shadow-hover);
  animation: modal-in .25s cubic-bezier(.4, 0, .2, 1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 26px 0 30px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}
.site-footer .footer-links { display: flex; gap: 16px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.site-footer a { color: var(--text-3); }
.site-footer a:hover { color: var(--primary); }
.site-footer .footer-brand { font-weight: 700; color: var(--text-2); }

/* ---------- 404 ---------- */
.err-page { text-align: center; padding: 90px 20px; }
.err-code {
  font-size: 88px; font-weight: 900; line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 2px;
}
.err-page h2 { font-size: 22px; margin: 14px 0 6px; }
.err-page p { color: var(--text-2); margin: 0 0 24px; }

/* ---------- 图像工具通用 ---------- */
.checker {
  background-image:
    conic-gradient(#c8cbd8 90deg, transparent 90deg 180deg, #c8cbd8 180deg 270deg, transparent 270deg),
    conic-gradient(#c8cbd8 90deg, transparent 90deg 180deg, #c8cbd8 180deg 270deg, transparent 270deg);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}
.img-stage {
  display: grid; place-items: center;
  background: var(--card-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow: hidden;
  position: relative;
  min-height: 120px;
}
.img-stage img, .img-stage canvas { max-width: 100%; max-height: 420px; border-radius: 8px; display: block; }

/* 裁剪器 */
.crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  touch-action: none;
}
.crop-stage img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }
.crop-overlay {
  position: absolute;
  background: transparent;
  pointer-events: none;
  box-shadow: 0 0 0 2000px rgba(10, 12, 22, .45);
}
.crop-box {
  position: absolute;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .7);
  cursor: move;
  box-sizing: border-box;
}
.crop-handle {
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 4px;
  box-sizing: border-box;
}
.crop-handle.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle.se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.crop-info { position: absolute; bottom: -26px; left: 0; font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* 画板 */
.draw-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; }
.draw-canvas-wrap { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; display: inline-block; }
.draw-canvas-wrap canvas { display: block; touch-action: none; cursor: crosshair; }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--border); cursor: pointer; padding: 0; }
.swatch.active { outline: 2.5px solid var(--primary); outline-offset: 1px; }

/* 批量处理列表 */
.batch-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--card-2); }
.batch-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.batch-item .status { font-size: 12px; color: var(--text-3); flex: none; }
.batch-item .status.done { color: #10b981; }
.batch-item .status.fail { color: #f43f5e; }
.batch-item .thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--card); border: 1px solid var(--border); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .hero { padding-top: 40px; }
  .header-nav a { display: none; }
  .tool-body { padding: 18px 16px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
}
