/* ============================================================
 * 窝窝头工具箱 - HarmonyOS 7 风格样式
 * 设计语言: 鸿蒙无序美学(流体渐变光晕) + 卡片化 elevation 阴影
 *           + 胶囊控件 + 大圆角 + HarmonyOS Sans SC 字体栈
 * 强调色采用鸿蒙蓝梯度，分类色用鸿蒙 vibrant 色板
 * ============================================================ */
:root {
  /* HarmonyOS 语义色 */
  --bg: #F2F3F5;            /* 鸿蒙浅灰背景 */
  --card: #FFFFFF;          /* 卡片表面 */
  --fill: #EDEEF1;          /* 填充/输入框 */
  --label: #1A1A1C;         /* 主文字 */
  --label-2: #5A5A60;       /* 次级文字 */
  --label-3: #8A8A90;       /* 三级文字 */
  --sep: rgba(0, 0, 0, 0.06);      /* 极淡分隔线 */
  --accent: #2B6CFF;        /* 品牌强调(鸿蒙蓝) */
  --accent-2: #5B9CFF;
  --accent-press: #1E5AE8;
  --grad: linear-gradient(135deg, #5B9CFF 0%, #2B6CFF 100%);  /* 鸿蒙蓝梯度 */
  --grad-cool: linear-gradient(135deg, #2EC5FF 0%, #2B6CFF 100%);
  --radius: 18px;           /* 鸿蒙大圆角 */
  --radius-sm: 12px;
  --radius-pill: 999px;
  /* elevation 阴影(鸿蒙用层叠阴影表达深度，而非发丝线) */
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 16px 38px rgba(43, 108, 255, 0.18), 0 6px 14px rgba(0, 0, 0, 0.08);
  --nav-h: 58px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "HarmonyOS Sans SC", "HarmonyOS Sans", "PingFang SC",
    "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--label);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}
/* 鸿蒙「流体光晕」装饰: 两枚模糊径向渐变，固定背景，不抢内容 */
body::before, body::after {
  content: ''; position: fixed; z-index: -1; border-radius: 50%;
  filter: blur(90px); opacity: 0.26; pointer-events: none;
}
body::before {
  width: 460px; height: 460px; top: -140px; right: -90px;
  background: radial-gradient(circle, #5B9CFF, transparent 70%);
}
body::after {
  width: 420px; height: 420px; bottom: -120px; left: -80px;
  background: radial-gradient(circle, #2EC5FF, transparent 70%);
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏(毛玻璃 + elevation) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.04);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 7px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.brand-logo { font-size: 22px; }
.brand-name b { color: var(--accent); font-weight: 800; }
.top-nav { display: flex; gap: 4px; font-size: 14px; }
.top-nav a {
  color: var(--label-2); padding: 7px 14px; border-radius: var(--radius-pill);
  transition: background .15s, color .15s;
}
.top-nav a:hover { background: var(--fill); color: var(--label); }
.top-nav a.active { color: #fff; background: var(--grad); font-weight: 600; box-shadow: 0 4px 12px rgba(43, 108, 255, 0.30); }
.search-box { margin-left: auto; position: relative; }
.search-box input {
  width: 250px; height: 38px; padding: 0 38px 0 16px; border: 0;
  border-radius: var(--radius-pill); background: var(--fill); font-size: 14px;
  outline: none; color: var(--label); transition: box-shadow .15s, background .15s;
}
.search-box input::placeholder { color: var(--label-3); }
.search-box input:focus { background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent); }
.search-ico { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .5; pointer-events: none; }

/* ---------- 首页布局: 左栏 + 主区 ---------- */
.home-wrap {
  display: grid; grid-template-columns: 224px minmax(0, 1fr);
  gap: 28px; align-items: start; padding: 24px 20px 48px; max-width: 1180px; margin: 0 auto;
}
/* 左栏快捷分类 */
.side-nav {
  position: sticky; top: calc(var(--nav-h) + 16px);
  display: flex; flex-direction: column; gap: 3px;
  background: var(--card); border: 1px solid var(--sep); border-radius: 20px;
  padding: 10px; box-shadow: var(--shadow);
}
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; color: var(--label); font-size: 14px; transition: background .15s;
}
.side-link:hover { background: var(--fill); }
.side-link.active { background: color-mix(in srgb, var(--accent) 14%, white); color: var(--accent); font-weight: 600; }
.side-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.side-ico { width: 18px; text-align: center; font-size: 15px; }
.side-name { white-space: nowrap; }
.side-count { margin-left: auto; color: var(--label-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.side-link.active .side-count { color: var(--accent); }
.side-sep { height: 1px; background: var(--sep); margin: 6px 4px; }

.home-main { min-width: 0; }
.home-title-row { margin: 2px 0 18px; }
.home-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.home-sub { color: var(--label-2); margin: 6px 0 0; font-size: 14px; }
.search-info { color: var(--label-3); font-size: 13px; margin: 0 0 14px; min-height: 0; }
.search-info:not(:empty) { min-height: 18px; }

/* 热门标签云(首页) */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 22px; }
.tag-cloud .tc-lab { width: 100%; font-size: 13px; color: var(--label-3); margin-bottom: 2px; }
.tag-cloud a {
  font-size: 13px; color: var(--label); background: var(--card); border: 1px solid var(--sep);
  padding: 6px 14px; border-radius: var(--radius-pill); transition: all .15s; box-shadow: var(--shadow);
}
.tag-cloud a:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); transform: translateY(-1px); }
.tag-count { color: var(--label-3); font-size: 11px; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* 分类分组 */
.cat-section { margin-bottom: 30px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.cat-section.hidden { display: none; }
.cat-section-head { display: flex; align-items: center; gap: 9px; margin: 0 0 13px; }
.cat-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cat-section-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.cat-section-count { color: var(--label-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.cat-section-more { margin-left: auto; color: var(--accent); font-size: 13px; padding: 4px 10px; border-radius: 8px; font-weight: 600; }
.cat-section-more:hover { background: color-mix(in srgb, var(--accent) 12%, white); }

/* ---------- 工具卡片(鸿蒙 elevation) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.tool-card {
  position: relative; display: block; background: var(--card);
  border: 1px solid var(--sep); border-radius: var(--radius); padding: 13px 13px 11px;
  box-shadow: var(--shadow); transition: transform .28s cubic-bezier(.22,.61,.36,1), box-shadow .28s cubic-bezier(.22,.61,.36,1), border-color .25s ease;
  overflow: hidden; will-change: transform;
}
.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px -16px rgba(43, 108, 255, 0.40), 0 8px 20px -10px rgba(0, 0, 0, 0.10);
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: #fff;
}
.tool-card:active { transform: translateY(-2px) scale(0.99); }
.tool-card.hidden { display: none; }
.tool-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, white);
  margin-bottom: 8px; transition: transform .28s cubic-bezier(.22,.61,.36,1), background .25s ease;
}
.tool-card:hover .tool-icon { transform: translateY(-2px) scale(1.08); background: color-mix(in srgb, var(--accent) 24%, white); }
/* 自定义线性图标(替代 emoji 观感) —— 在各容器中统一尺寸 */
.ico { display: block; }
.tool-icon .ico { width: 18px; height: 18px; }
.tool-head-icon .ico { width: 30px; height: 30px; }
.brand-logo .ico { width: 26px; height: 26px; }
.page-title .ico { width: 26px; height: 26px; vertical-align: -5px; margin-right: 6px; }
.cat-icon .ico { width: 30px; height: 30px; }

/* ---------- 首页首屏 · 每日关注 ---------- */
.daily {
  margin-top: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
  border: 1px solid var(--sep);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
}
.daily-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.daily-title { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.daily-title::before {
  content: ''; display: inline-block; width: 4px; height: 16px; border-radius: 4px;
  background: var(--grad); margin-right: 9px; vertical-align: -2px;
}
.daily-date { color: var(--label-3); font-size: 13px; }
.daily-refresh {
  margin-left: auto; width: 30px; height: 30px; border: 1px solid var(--sep); background: var(--card);
  border-radius: 50%; cursor: pointer; color: var(--label-2); font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: transform .4s, color .15s, border-color .15s;
}
.daily-refresh:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, white); }
.daily-refresh:active { transform: rotate(180deg); }
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.daily-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--sep); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.daily-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--accent) 35%, white); }
.daily-ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: #fff; background: var(--grad-cool); box-shadow: 0 6px 16px rgba(43,108,255,0.28);
}
.daily-ico .ico { width: 22px; height: 22px; }
.daily-body { min-width: 0; flex: 1; }
.daily-card-title { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; }
.daily-preview { margin: 4px 0 5px; font-size: 12px; color: var(--label-2); }
.daily-hint { color: var(--label-3); }
.dp-item {
  display: block; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 2px 0; transition: color .12s;
}
.dp-item:hover { color: var(--accent); }
.dp-rank {
  display: inline-block; min-width: 15px; margin-right: 7px; font-weight: 800; font-size: 11px; color: var(--accent);
}
.daily-src { font-size: 11.5px; color: var(--label-3); }
.daily-card:hover .daily-src { color: var(--accent); }

/* ---------- 缺口补充工具样式 ---------- */
.wf-total { font-size: 13px; color: var(--label-2); margin-bottom: 8px; }
.wf-list { max-height: 320px; overflow: auto; border: 1px solid var(--sep); border-radius: var(--radius-sm); padding: 6px 10px; }
.wf-row { display: grid; grid-template-columns: 90px 44px 1fr; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.wf-w { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-c { color: var(--label-3); text-align: right; }
.wf-bar { height: 7px; border-radius: 999px; background: linear-gradient(90deg, #5B9CFF, #2B6CFF); }

.sudoku { display: grid; grid-template-columns: repeat(9, 32px); grid-template-rows: repeat(9, 32px); border: 2px solid #333; width: max-content; }
.sudoku b { display: flex; align-items: center; justify-content: center; font-size: 17px; border: 1px solid var(--sep); }
.sudoku b:nth-child(3n) { border-right: 2px solid #555; }
.sudoku b:nth-child(n+19):nth-child(-n+27), .sudoku b:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid #555; }
.sudoku b.g { color: var(--label-3); }
.sudoku b.s { color: var(--accent); font-weight: 800; }

.ruler { position: relative; height: 56px; background: #fff; border: 1px solid var(--sep); border-radius: 8px; overflow-x: auto; margin-top: 6px; }
.ruler i { position: absolute; top: 0; width: 1px; height: 12px; background: #666; }
.ruler i.mid { height: 18px; }
.ruler i.major { height: 30px; background: #111; }
.ruler b { position: absolute; top: 32px; font-size: 10px; color: var(--label-2); transform: translateX(-50%); }

.db-bar { height: 10px; background: var(--fill); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.db-bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .1s linear; }
.tool-name { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; line-height: 1.3; }
.tool-desc { color: var(--label-2); font-size: 12px; margin-top: 4px; min-height: 30px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.tool-tags span { font-size: 10.5px; color: var(--label-2); background: var(--fill); padding: 2px 7px; border-radius: var(--radius-pill); cursor: pointer; transition: background .15s, color .15s; }
.tool-tags span:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, white); }
.fav-btn {
  position: absolute; top: 9px; right: 9px; border: none; background: transparent;
  font-size: 16px; color: #C7C7CC; cursor: pointer; line-height: 1; padding: 2px;
  transition: color .15s, transform .08s;
}
.fav-btn:hover { color: var(--accent); }
.fav-btn:active { transform: scale(0.9); }
.fav-btn.active { color: var(--accent); }

/* ---------- 分类页(旧宫格, 保留兼容) ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-card { background: var(--card); border: 1px solid var(--sep); border-radius: var(--radius); padding: 22px 16px; text-align: center; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.cat-icon { font-size: 32px; }
.cat-name { font-weight: 700; margin-top: 8px; font-size: 15px; }
.cat-count { color: var(--label-3); font-size: 13px; margin-top: 2px; }

/* ---------- 工具页 ---------- */
.tool-page { padding: 22px 0 44px; }
.crumb { color: var(--label-3); font-size: 13px; margin: 4px 0 6px; }
.crumb a:hover { color: var(--accent); }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0 20px; }
.tool-head {
  display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--card);
  border: 1px solid var(--sep); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow);
}
.tool-head-icon {
  font-size: 30px; width: 56px; height: 56px; border-radius: 16px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, white);
}
.tool-title { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.tool-sub { margin: 3px 0 0; color: var(--label-2); font-size: 14px; }
.tool-tags-row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool-tags-row .lab { font-size: 12px; color: var(--label-3); margin-right: 2px; }
.tag-link { display: inline-block; font-size: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, white); padding: 4px 12px; border-radius: var(--radius-pill); text-decoration: none; transition: background .15s; }
.tag-link:hover { background: color-mix(in srgb, var(--accent) 18%, white); }
.fav-toggle {
  margin-left: auto; border: 1px solid var(--accent); color: var(--accent); background: #fff;
  padding: 9px 18px; border-radius: var(--radius-pill); cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.fav-toggle:hover { background: color-mix(in srgb, var(--accent) 10%, white); box-shadow: 0 4px 12px rgba(43, 108, 255, 0.16); }
.fav-toggle.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(43, 108, 255, 0.32); }

.tool-body { background: var(--card); border: 1px solid var(--sep); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

/* 详情页工具文字介绍：低调分组卡，不打扰操作区 */
.tool-intro { margin: 0 0 16px; }
.tool-intro-inner { background: var(--fill); border-radius: var(--radius-sm); padding: 14px 16px; }
.tool-intro-label { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; }
.tool-intro-inner p { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--label); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--label); }
.in, .tool-body textarea, .tool-body input[type=text], .tool-body input:not([type=checkbox]):not([type=range]):not([type=color]) {
  width: 100%; border: 1px solid var(--sep); border-radius: 12px; padding: 10px 12px; font-size: 14px;
  font-family: inherit; outline: none; background: #fff; color: var(--label); transition: box-shadow .15s, border-color .15s;
}
.in:focus, textarea:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea { resize: vertical; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.row label { font-size: 13px; color: var(--label-2); display: flex; align-items: center; gap: 5px; }
.btn {
  border: none; background: var(--grad); color: #fff; padding: 10px 18px; border-radius: 12px;
  cursor: pointer; font-size: 14px; font-weight: 600; transition: transform .08s, filter .15s, box-shadow .15s;
  box-shadow: 0 4px 12px rgba(43, 108, 255, 0.28);
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(0.97); }
.btn.small { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn.ghost { background: var(--fill); color: var(--label); box-shadow: none; }
.btn.ghost:hover { background: #E2E3E7; }
.btn.cool { background: var(--grad-cool); box-shadow: 0 4px 12px rgba(24, 160, 251, 0.25); }
select { border: 1px solid var(--sep); border-radius: 12px; padding: 9px 12px; font-size: 14px; background: #fff; color: var(--label); outline: none; }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

/* 输出区 */
.out-wrap { position: relative; }
.out { background: var(--fill); font-size: 13px; border: 1px solid var(--sep); }
.btn-copy {
  position: absolute; top: 8px; right: 8px; border: 1px solid var(--sep); background: #fff;
  padding: 4px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; color: var(--accent); font-weight: 600;
}
.btn-copy:hover { background: color-mix(in srgb, var(--accent) 8%, white); }
.result { margin-top: 8px; }
.ok { color: #15a05a; font-weight: 600; margin-bottom: 8px; }
.err { color: #e23a1f; font-weight: 600; margin-bottom: 8px; }
.preview { background: var(--fill); border: 1px solid var(--sep); border-radius: 12px; padding: 12px; font-size: 13px; white-space: pre-wrap; word-break: break-all; margin-bottom: 10px; }
.preview mark { background: #FFD58A; padding: 0 2px; border-radius: 3px; }

/* 键值结果卡(手机号/WHOIS/翻译等) */
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.kv > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; background: var(--fill); border-radius: 12px; }
.kv span { color: var(--label-2); font-size: 13px; white-space: nowrap; }
.kv b { font-weight: 600; text-align: right; word-break: break-all; }
.ocr-progress { margin: 6px 0 12px; font-size: 14px; color: var(--label-2); }
.hint { margin-top: 12px; color: var(--label-2); font-size: 12.5px; line-height: 1.7; }
.in-file { font-size: 14px; }
.ocr-canvas { max-width: 100%; border: 1px solid var(--sep); border-radius: 12px; margin-top: 12px; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } }

/* 统计网格 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-grid > div { background: var(--fill); border-radius: 12px; padding: 12px; text-align: center; }
.stat-grid b { display: block; font-size: 20px; color: var(--accent); font-weight: 800; }
.stat-grid span { font-size: 12px; color: var(--label-2); }

/* 占位 */
.placeholder { text-align: center; padding: 40px 20px; }
.ph-emoji { font-size: 46px; }
.placeholder h3 { margin: 12px 0 8px; font-weight: 700; }
.placeholder p { color: var(--label-2); font-size: 14px; }

/* 计算器 */
.calc { max-width: 280px; }
.calc .disp { text-align: right; font-size: 26px; font-family: ui-monospace, monospace; margin-bottom: 12px; background: var(--fill); border-radius: 12px; padding: 12px; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ck { height: 46px; border: 1px solid var(--sep); background: #fff; border-radius: 12px; font-size: 18px; cursor: pointer; transition: background .12s; }
.ck:hover { background: var(--fill); }
.ck:active { background: #E2E3E7; }
.ck[data-k="="] { background: var(--grad); color: #fff; border-color: transparent; }

/* 颜色/渐变/阴影预览 */
.swatch { height: 60px; border-radius: 12px; margin-top: 12px; border: 1px solid var(--sep); }
.grad-preview, .shadow-preview { height: 120px; border-radius: 12px; margin-top: 12px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--sep); }
.shadow-box { width: 120px; height: 80px; background: #fff; border-radius: 12px; }
.palette-out .pal-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; }
.pal-bars { display: flex; gap: 6px; }
.pal-bar { padding: 8px 12px; border-radius: 8px; color: #fff; font-size: 12px; cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.winners { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.winners span { background: var(--grad); color: #fff; padding: 6px 14px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; }
.cd-display, .pomo-time { font-size: 40px; font-weight: 800; text-align: center; font-family: ui-monospace, monospace; color: var(--accent); margin: 12px 0; }

/* 区块标题(工具页相关) */
.section { padding: 26px 0; }
.section-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 16px; }
.related { margin-top: 8px; }

/* 标签详情页 */
.tag-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.tag-head .pill { font-size: 13px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, white); padding: 4px 12px; border-radius: var(--radius-pill); font-weight: 600; }
.rel-tags { margin: 18px 0 6px; font-size: 13px; color: var(--label-3); }
.rel-tags a { display: inline-block; margin: 4px 6px 0 0; font-size: 12.5px; color: var(--label-2); background: var(--fill); padding: 5px 12px; border-radius: var(--radius-pill); transition: all .15s; }
.rel-tags a:hover { color: var(--accent); }

/* 空态 */
.empty { text-align: center; color: var(--label-2); padding: 50px 20px; line-height: 1.9; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(16px);
  background: rgba(26,26,28,.92); color: #fff; padding: 10px 20px; border-radius: var(--radius-pill);
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 页脚 */
.site-footer { border-top: 1px solid var(--sep); margin-top: 30px; padding: 22px 0; text-align: center; color: var(--label-3); font-size: 13px; }
.site-footer a { color: var(--label-2); }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .tool-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 980px) {
  .tool-grid, .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .home-wrap { grid-template-columns: 1fr; gap: 16px; }
  .side-nav {
    position: sticky; top: var(--nav-h); z-index: 40; flex-direction: row; gap: 6px;
    overflow-x: auto; padding: 8px; scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-link { flex: none; white-space: nowrap; padding: 8px 12px; }
  .side-count { display: none; }
  .side-sep { display: none; }
  .top-nav { display: none; }
}
@media (max-width: 680px) {
  .tool-grid, .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .search-box input { width: 150px; }
  .home-title { font-size: 25px; }
  .tool-head { flex-wrap: wrap; }
  .fav-toggle { margin-left: 0; }
  .tool-body { padding: 16px; }
}

/* ===== 补充工具 UI 组件 ===== */
.dtable { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.dtable th, .dtable td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--sep); }
.dtable thead th { background: var(--fill); font-weight: 600; color: var(--label-2); }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable td:last-child, .dtable th:last-child { text-align: right; }
.dtable td { word-break: break-all; font-variant-numeric: tabular-nums; }

.preview-img { max-width: 100%; border-radius: 12px; margin-top: 8px; display: block; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin-top: 8px; }
.color-card { background: var(--card); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .15s; border: 1px solid var(--sep); box-shadow: var(--shadow); }
.color-card:hover { transform: translateY(-2px); }
.color-card .sw { height: 64px; }
.color-card .cn { padding: 8px 10px 2px; font-size: 13px; font-weight: 700; }
.color-card .ch { padding: 0 10px 10px; font-size: 11px; color: var(--label-2); letter-spacing: .4px; }

.tz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; margin-top: 8px; }
.tz { background: var(--card); border-radius: 16px; padding: 14px; text-align: center; border: 1px solid var(--sep); box-shadow: var(--shadow); }
.tz .tzn { font-weight: 700; }
.tz .tzt { font-size: 22px; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.tz .tzd { font-size: 11px; color: var(--label-2); }

.grid-9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 360px; margin-top: 10px; }
.grid-cell { display: block; }
.grid-cell img { width: 100%; display: block; border-radius: 4px; }

.border-demo { background: var(--card); border: 1px solid var(--sep); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.stopwatch { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ===== QQ 补充工具 UI 组件 ===== */
.muted { color: var(--label-2); font-size: 12.5px; line-height: 1.6; margin: 6px 0 0; }

/* 选项卡 */
.tabs { display: inline-flex; gap: 4px; background: var(--fill); padding: 3px; border-radius: 12px; margin-bottom: 14px; }
.tab { border: 0; background: transparent; padding: 7px 16px; border-radius: 9px; font-size: 13px; color: var(--label-2); cursor: pointer; transition: all .15s; }
.tab.active { background: var(--card); color: var(--accent); box-shadow: var(--shadow); font-weight: 700; }

/* 大字结果 */
.big-result { font-size: 26px; font-weight: 800; padding: 16px 0; color: var(--accent); text-align: center; }
.dtable .sum td { font-weight: 700; background: var(--fill); }

/* 颜文字 / 标签 网格 */
.emoji-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { background: var(--card); border: 1px solid var(--sep); border-radius: 12px; padding: 8px 12px; font-size: 16px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow); }
.chip:hover { background: var(--fill); transform: translateY(-1px); }

.garbage-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.g-group { font-size: 13px; line-height: 1.8; }
.g-group b { color: var(--accent); margin-right: 6px; }
.tag { display: inline-block; background: var(--fill); border-radius: 8px; padding: 2px 8px; margin: 2px 3px 2px 0; font-size: 12px; color: var(--label-2); }

/* 手持弹幕 */
.led-stage { margin-top: 14px; background: #000; border-radius: 16px; min-height: 160px; display: flex; align-items: center; overflow: hidden; }
.led-text { white-space: nowrap; font-size: 56px; font-weight: 800; padding-left: 100%; animation: led-scroll linear infinite; }
@keyframes led-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }

@media (max-width: 680px) {
  .big-result { font-size: 22px; }
  .led-text { font-size: 40px; }
}

@media (max-width: 680px) { .dtable { font-size: 12px; } .tz-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 多媒体 / 思维导图 等新增 UI ---------- */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.img-cell { background: var(--card); border: 1px solid var(--sep); border-radius: 14px; padding: 10px; text-align: center; box-shadow: var(--shadow); }
.img-cell img { max-width: 100%; border-radius: 8px; display: block; margin: 0 auto 6px; }
.btn-mini { display: inline-block; padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, white); border-radius: 10px; text-decoration: none; }
.btn-mini:hover { background: color-mix(in srgb, var(--accent) 18%, white); }
.mm-wrap { margin-top: 10px; border: 1px solid var(--sep); border-radius: 14px; padding: 8px; background: var(--card); box-shadow: var(--shadow); }
.mm-wrap svg { display: block; }
pre.raw { white-space: pre-wrap; word-break: break-all; background: var(--fill); border-radius: 12px; padding: 12px; font-size: 12px; line-height: 1.6; max-height: 280px; overflow: auto; margin-top: 6px; border: 1px solid var(--sep); }

/* ============ 第二波工具专属样式 ============ */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label); }
.chip-sub { display: block; font-size: 11px; color: var(--label); font-weight: 400; }
.chip.copied { background: color-mix(in srgb, var(--accent) 15%, white); border-color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.emoji-cat h4 { margin: 16px 0 0; font-size: 14px; color: var(--label); }
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.tbl th, .tbl td { border: 1px solid var(--sep); padding: 7px 9px; text-align: left; }
.tbl th { background: var(--fill); font-weight: 700; }
.tbl tbody tr:nth-child(even) { background: color-mix(in srgb, var(--fill) 55%, white); }
.tp-stage { height: 220px; overflow: hidden; border: 1px solid var(--sep); border-radius: 14px; background: #14161c; color: #fff; padding: 16px; margin-top: 10px; }
.tp-text { line-height: 1.7; white-space: pre-wrap; font-weight: 600; }
.mt-beat { display: flex; justify-content: center; align-items: center; height: 80px; margin-top: 14px; }
.mt-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--fill); border: 2px solid var(--sep); transition: all .08s; }
.mt-dot.on { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.dc-result { font-size: 28px; font-weight: 800; color: var(--accent); text-align: center; margin: 18px 0 6px; }
.dc-sub { text-align: center; color: var(--label); font-size: 13px; }
.resume-paper { max-width: 680px; margin: 12px auto; background: #fff; color: #222; border: 1px solid var(--sep); border-radius: 12px; padding: 28px; }
.rv-head h2 { margin: 0 0 4px; }
.rv-contact, .rv-intent { font-size: 13px; color: #555; }
.rv-intent { color: var(--accent); }
.rv-sec { margin-top: 16px; }
.rv-sec h4 { margin: 0 0 6px; border-left: 3px solid var(--accent); padding-left: 8px; }
.rv-body { font-size: 14px; line-height: 1.7; }
.sv-box { border: 1px solid var(--sep); border-radius: 12px; padding: 16px; background: var(--fill); display: flex; justify-content: center; margin-top: 8px; }
.sv-box svg { max-width: 100%; height: auto; }
.hr-frame { width: 100%; height: 320px; border: 1px solid var(--sep); border-radius: 12px; margin-top: 10px; background: #fff; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* ============ 第三波工具专属样式（P0 补齐） ============ */
.kin-hint { font-size: 12px; color: var(--label); }
.poem-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.poem-item { border: 1px solid var(--sep); background: var(--fill); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.poem-item:hover { border-color: var(--accent); color: var(--accent); }
.poem-card { margin-top: 10px; padding: 16px; border: 1px solid var(--sep); border-radius: 14px; background: var(--fill); }
.poem-h { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.poem-meta { font-size: 12px; color: var(--label); font-weight: 400; margin-left: 8px; }
.poem-body { font-size: 16px; line-height: 2; letter-spacing: 1px; }
.type-src { background: var(--fill); border: 1px solid var(--sep); border-radius: 10px; padding: 12px; line-height: 1.9; font-size: 15px; color: var(--label); margin-bottom: 10px; }
.hear-list { display: flex; flex-direction: column; gap: 8px; }
.hear-row { display: flex; gap: 8px; align-items: center; }
.hear-yes.on, .hear-no.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.rr-stage { height: 90px; overflow: hidden; background: repeating-linear-gradient(90deg,#222 0 18px,#444 18px 36px); border-radius: 12px; display: flex; align-items: center; margin: 8px 0; }
.rr-bar { width: 100px; height: 60px; background: linear-gradient(90deg,#0af,#0ff); opacity: .85; }
.rr-fps { font-size: 13px; margin: 4px 0; }
.td-box { border: 1px solid var(--sep); border-radius: 10px; padding: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; max-height: 360px; overflow: auto; }
.td-line { white-space: pre-wrap; padding: 1px 6px; }
.td-add { background: color-mix(in srgb, #2ecc71 18%, white); }
.td-del { background: color-mix(in srgb, #e74c3c 18%, white); }
.td-eq { color: var(--label); }
.cc-prev { height: 60px; border-radius: 12px; border: 1px solid var(--sep); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; margin: 10px 0; }
.bs-stage { display: flex; align-items: center; justify-content: center; padding: 32px; margin: 10px 0; background: var(--fill); border-radius: 14px; }
.bs-box { width: 120px; height: 120px; background: #fff; border-radius: 14px; }
.bank-luhn { font-family: ui-monospace, Menlo, monospace; }
