/* =========================================================
   DevKit · 开发者工具箱
   设计参考：蓝紫渐变 + Inter 字体 + 大圆角柔和阴影
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --violet: #764ba2;
  --indigo: #667eea;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;

  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-card: #ffffff;
  --bg-code: #f6f8fb;

  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;

  --border: #e6ebf2;
  --border-2: #eef2f7;

  --grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --grad-soft: linear-gradient(135deg, #eef2ff 0%, #f5f0fb 100%);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 6px 16px -4px rgba(15, 23, 42, .10), 0 2px 6px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 18px 40px -12px rgba(37, 99, 235, .22), 0 6px 14px -6px rgba(15, 23, 42, .08);
  --shadow-xl: 0 28px 60px -20px rgba(76, 63, 160, .28);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --nav-h: 66px;
  --maxw: 1200px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --bg-soft: #0f1526;
  --bg-card: #141b2e;
  --bg-code: #0e1424;
  --text: #e8edf7;
  --text-2: #a7b3c9;
  --text-3: #6b7891;
  --border: #232c42;
  --border-2: #1c2437;
  --primary-soft: #1b2a4a;
  --grad-soft: linear-gradient(135deg, #171f36 0%, #1e1b3a 100%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, .5);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .6);
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: #c7d2fe; color: #1e1b4b; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* =========================================================
   导航栏
   ========================================================= */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.navbar.scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 20px -12px rgba(15,23,42,.25); }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.16rem; letter-spacing: -.2px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 6px 14px -6px rgba(102,126,234,.8);
}
.brand-mark.small { width: 28px; height: 28px; border-radius: 8px; }
.brand-mark svg { width: 19px; height: 19px; }
.brand-mark.small svg { width: 16px; height: 16px; }
.brand-text em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  position: relative; padding: 8px 14px; border-radius: var(--r-full);
  color: var(--text-2); font-size: .93rem; font-weight: 500; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-soft); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-card); display: grid; place-items: center; cursor: pointer;
  color: var(--text-2); transition: all .2s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-burger { display: none; }
html[data-theme="light"] .ico-sun, html[data-theme="dark"] .ico-moon { display: none; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative; padding: calc(var(--nav-h) + 78px) 0 96px;
  background: var(--grad); overflow: hidden; color: #fff; text-align: center;
}
/* 工具箱页等二级页面使用的精简头图 */
.hero-sm { padding: calc(var(--nav-h) + 52px) 0 60px; }
.hero-sm .hero-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.hero-sm .hero-sub { margin-bottom: 26px; }
/* 精简头图只有 3 项统计，用 3 列网格才能左右对称 */
.hero-sm .hero-stats { grid-template-columns: repeat(3, 1fr); max-width: 580px; margin-top: 40px; }
.hero-grid-bg {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.085) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 78%);
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; }
.hero-glow.g1 { width: 380px; height: 380px; background: #a78bfa; top: -120px; left: -60px; }
.hero-glow.g2 { width: 320px; height: 320px; background: #38bdf8; bottom: -140px; right: -40px; }
.hero-inner { position: relative; z-index: 2; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: var(--r-full); font-size: .84rem; font-weight: 500;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); margin-bottom: 24px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.25); }

.hero-title {
  font-size: clamp(2.1rem, 5.4vw, 3.7rem); font-weight: 800; line-height: 1.12;
  letter-spacing: -1.4px; margin-bottom: 20px;
  text-shadow: 0 2px 24px rgba(0,0,0,.14);
}
.hero-title .grad {
  background: linear-gradient(100deg, #fff 10%, #e0d4ff 50%, #a5d8ff 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: clamp(1rem, 2.1vw, 1.16rem); color: rgba(255,255,255,.88); max-width: 680px; margin: 0 auto 34px; line-height: 1.75; }

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: var(--r-full); border: 1px solid transparent;
  font-size: .95rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .2s, box-shadow .25s, background .2s, border-color .2s, color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(.975); }
.btn-primary { background: #fff; color: var(--primary-dark); box-shadow: 0 14px 30px -10px rgba(0,0,0,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -12px rgba(0,0,0,.4); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.22); transform: translateY(-2px); }
.btn-soft { background: var(--bg-soft); color: var(--text-2); border-color: var(--border); }
.btn-soft:hover { color: var(--primary); border-color: var(--primary); }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 10px 22px -10px rgba(102,126,234,.85); }
.btn-grad:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(102,126,234,.95); }
.btn-sm { padding: 8px 16px; font-size: .85rem; border-radius: var(--r-md); }
.btn-block { width: 100%; }

.hero-stats {
  margin-top: 54px; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; max-width: 720px; margin-left: auto; margin-right: auto;
}
.stat {
  padding: 16px 10px; border-radius: var(--r-lg);
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.stat strong { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -.5px; }
.stat span { font-size: .79rem; color: rgba(255,255,255,.78); }

/* =========================================================
   通用 Section
   ========================================================= */
.section { padding: 86px 0; }
.section.is-hidden { display: none; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; margin-bottom: 46px; }
.eyebrow {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: 2.2px;
  color: var(--primary); background: var(--primary-soft); padding: 5px 13px;
  border-radius: var(--r-full); margin-bottom: 14px;
}
.section-title { font-size: clamp(1.7rem, 3.6vw, 2.35rem); font-weight: 700; letter-spacing: -.8px; margin-bottom: 12px; }
.section-sub { color: var(--text-2); font-size: 1.02rem; max-width: 620px; margin: 0 auto; }
.section-acts { margin-top: 22px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* =========================================================
   工具箱
   ========================================================= */
.tool-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.search-box {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: 46px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-full);
  box-shadow: var(--shadow-xs); transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.search-box svg { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.search-box input { flex: 1; border: none; outline: none; background: transparent; height: 100%; }
.search-box input::placeholder { color: var(--text-3); }
.tool-count { font-size: .88rem; color: var(--text-3); white-space: nowrap; }
.tool-count span { color: var(--primary); font-weight: 700; }

.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tool-card {
  position: relative; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px 20px 20px;
  box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s, border-color .25s;
}
.tool-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--grad); opacity: 0; transition: opacity .25s;
}
.tool-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.tool-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.14), var(--shadow-md); }
.tool-card .t-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 14px; color: #fff; background: var(--grad);
  box-shadow: 0 8px 18px -10px rgba(102,126,234,.95);
}
.tool-card .t-ico svg { width: 22px; height: 22px; }
.tool-card h3 { font-size: 1.02rem; font-weight: 650; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.tool-card p { font-size: .855rem; color: var(--text-2); line-height: 1.6; }
.t-arrow {
  position: absolute; right: 16px; top: 22px; color: var(--text-3);
  opacity: 0; transform: translateX(-6px); transition: all .25s;
}
.t-arrow svg { width: 17px; height: 17px; }
.tool-card:hover .t-arrow { opacity: 1; transform: translateX(0); color: var(--primary); }
.t-empty { grid-column: 1/-1; text-align: center; color: var(--text-3); padding: 46px 0; }

/* ---------- 工具工作台 ---------- */
.workspace {
  margin-top: 26px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: wsIn .35s cubic-bezier(.2,.8,.3,1);
}
@keyframes wsIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ws-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid var(--border-2);
  background: var(--grad-soft); flex-wrap: wrap;
}
.ws-title { display: flex; align-items: center; gap: 14px; }
.ws-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--grad); color: #fff; flex-shrink: 0; }
.ws-icon svg { width: 20px; height: 20px; }
.ws-title h3 { font-size: 1.08rem; font-weight: 650; }
.ws-title p { font-size: .83rem; color: var(--text-2); }
.ws-body { padding: 24px 22px 26px; }

/* ---------- 表单控件 ---------- */
.field-label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: 8px; letter-spacing: .2px; }
textarea, .input, select {
  width: 100%; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-code); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s; font-size: .9rem; resize: vertical;
}
textarea { font-family: var(--mono); line-height: 1.62; min-height: 190px; }
textarea:focus, .input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); background: var(--bg-card); }
textarea::placeholder, .input::placeholder { color: var(--text-3); }
select { cursor: pointer; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.col { flex: 1; min-width: 220px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.opts { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 14px; }
.opt { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--text-2); cursor: pointer; user-select: none; }
.opt input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.opt select { width: auto; padding: 6px 10px; font-size: .84rem; }

.stat-line { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: .82rem; color: var(--text-3); }
.stat-line b { color: var(--text); font-weight: 600; }

.hint { font-size: .8rem; color: var(--text-3); margin-top: 10px; line-height: 1.65; }
.hint code { font-family: var(--mono); background: var(--bg-code); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-2); font-size: .78rem; }

.msg { margin-top: 12px; padding: 11px 14px; border-radius: var(--r-md); font-size: .855rem; display: none; line-height: 1.6; }
.msg.show { display: block; }
.msg.ok { background: rgba(16,185,129,.1); color: #047857; border: 1px solid rgba(16,185,129,.28); }
.msg.err { background: rgba(239,68,68,.09); color: #b91c1c; border: 1px solid rgba(239,68,68,.26); }
html[data-theme="dark"] .msg.ok { color: #6ee7b7; }
html[data-theme="dark"] .msg.err { color: #fca5a5; }

/* JSON 输出着色 */
.code-out {
  font-family: var(--mono); font-size: .875rem; line-height: 1.65;
  background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px; min-height: 190px; max-height: 460px; overflow: auto;
  white-space: pre; tab-size: 2;
}
.tk-key { color: #7c3aed; } .tk-str { color: #059669; } .tk-num { color: #d97706; }
.tk-bool { color: #2563eb; } .tk-null { color: #94a3b8; }
html[data-theme="dark"] .tk-key { color: #c4b5fd; }
html[data-theme="dark"] .tk-str { color: #6ee7b7; }
html[data-theme="dark"] .tk-num { color: #fcd34d; }
html[data-theme="dark"] .tk-bool { color: #93c5fd; }

/* 结果列表 */
.kv-list { display: grid; gap: 8px; }
.kv {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 14px; background: var(--bg-code); border: 1px solid var(--border-2);
  border-radius: var(--r-md); font-size: .86rem;
}
.kv .k { color: var(--text-2); flex-shrink: 0; display: flex; align-items: center; gap: 7px; }
.kv .v { font-family: var(--mono); font-weight: 600; word-break: break-all; text-align: right; }
.kv .v.big { font-size: 1.05rem; color: var(--primary); }

.mini-btn {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-3);
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0; transition: all .2s;
}
.mini-btn:hover { color: var(--primary); border-color: var(--primary); }
.mini-btn svg { width: 14px; height: 14px; }

/* 时间戳大屏 */
.ts-live {
  text-align: center; padding: 26px 18px; border-radius: var(--r-lg);
  background: var(--grad); color: #fff; margin-bottom: 20px;
  box-shadow: 0 16px 34px -18px rgba(102,126,234,.95);
}
.ts-live .lbl { font-size: .82rem; opacity: .85; letter-spacing: .4px; }
.ts-live .num { font-family: var(--mono); font-size: clamp(1.7rem, 5vw, 2.5rem); font-weight: 700; letter-spacing: 1px; margin: 6px 0 3px; }
.ts-live .sub { font-size: .84rem; opacity: .85; }
.ts-live .btns { margin-top: 14px; display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.ts-live .btn-mini { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 7px 15px; border-radius: var(--r-full); font-size: .82rem; cursor: pointer; transition: background .2s; }
.ts-live .btn-mini:hover { background: rgba(255,255,255,.3); }

/* 密码 */
.pw-out {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: var(--bg-code); border: 1px dashed var(--border); border-radius: var(--r-md);
}
.pw-out .pw-text { flex: 1; font-family: var(--mono); font-size: 1.12rem; font-weight: 600; word-break: break-all; letter-spacing: .4px; }
.strength { margin-top: 14px; }
.strength-bar { height: 7px; border-radius: 999px; background: var(--border); overflow: hidden; }
.strength-fill { height: 100%; width: 0; border-radius: 999px; transition: width .35s, background .35s; }
.strength-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-3); margin-top: 8px; }
.range-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
input[type="range"] { flex: 1; accent-color: var(--primary); height: 5px; cursor: pointer; }
.range-val { font-family: var(--mono); font-weight: 700; color: var(--primary); min-width: 46px; text-align: right; }

/* 颜色转换 */
.color-preview { height: 110px; border-radius: var(--r-md); border: 1px solid var(--border); margin-bottom: 16px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.swatch { height: 54px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; position: relative; transition: transform .2s; }
.swatch:hover { transform: translateY(-3px); }
.swatch span { position: absolute; bottom: 5px; left: 0; right: 0; text-align: center; font-size: .62rem; font-family: var(--mono); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }

/* =========================================================
   今日速览
   ========================================================= */
.dash-grid { display: grid; grid-template-columns: 1fr 1.06fr; gap: 22px; align-items: stretch; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-md); overflow: hidden;
  display: flex; flex-direction: column;
}
.card-body { flex: 1; min-height: 0; overflow-y: auto; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 20px; border-bottom: 1px solid var(--border-2); flex-wrap: wrap;
}
.card-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-head h3 { font-size: 1.02rem; font-weight: 650; }
.card-head p { font-size: .79rem; color: var(--text-3); }
.card-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.card-ico svg { width: 19px; height: 19px; }
.ico-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.ico-teal { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.ico-amber { background: linear-gradient(135deg, #fbbf24, #d97706); }
.ico-rose { background: linear-gradient(135deg, #fb7185, #be123c); }
.ico-violet { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.city-form { display: flex; gap: 8px; }

/* 天气卡整行铺开时的两栏骨架 */
.wx-grid { display: grid; grid-template-columns: 1fr; gap: 0 30px; }
.wx-col { min-width: 0; }
.city-form input { width: 132px; height: 36px; padding: 0 12px; border-radius: var(--r-md); font-size: .85rem; }

/* 天气 */
.weather-body { padding: 22px 20px 24px; }
.wx-main { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.wx-icon { width: 84px; height: 84px; flex-shrink: 0; display: grid; place-items: center; }
.wx-icon img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0,0,0,.14)); }
.wx-temp { font-size: 3.1rem; font-weight: 700; line-height: 1; letter-spacing: -2px; }
.wx-temp sup { font-size: 1.3rem; font-weight: 500; vertical-align: super; letter-spacing: 0; }
.wx-meta { color: var(--text-2); font-size: .93rem; margin-top: 6px; font-weight: 500; }
.wx-place { font-size: .84rem; color: var(--text-3); margin-top: 3px; }
.wx-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-self: flex-start; }
.wx-tag { font-size: .76rem; padding: 5px 11px; border-radius: var(--r-full); background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
html[data-theme="dark"] .wx-tag { color: #bfdbfe; }

.wx-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.metric { padding: 12px 10px; border-radius: var(--r-md); background: var(--bg-code); border: 1px solid var(--border-2); text-align: center; }
.metric .m-lbl { font-size: .72rem; color: var(--text-3); margin-bottom: 4px; }
.metric .m-val { font-size: .95rem; font-weight: 650; font-family: var(--mono); }

.wx-forecast { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.fc-day {
  text-align: center; padding: 12px 6px; border-radius: var(--r-md);
  background: var(--bg-code); border: 1px solid var(--border-2); transition: all .2s;
}
.fc-day:hover { border-color: var(--primary); transform: translateY(-3px); background: var(--primary-soft); }
.fc-day .d { font-size: .74rem; color: var(--text-3); margin-bottom: 5px; }
.fc-day .i { font-size: 1.15rem; margin-bottom: 4px; line-height: 1; }
.fc-day .t { font-size: .8rem; font-weight: 650; }
.fc-day .t small { color: var(--text-3); font-weight: 400; }

.wx-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--text-3); padding-top: 14px; border-top: 1px dashed var(--border); }
.wx-advice {
  margin-bottom: 16px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--grad-soft); border: 1px solid var(--border-2); font-size: .85rem; color: var(--text-2); line-height: 1.65;
}
.wx-advice b { color: var(--text); }

/* 资讯 */
.news-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  padding: 6px 14px; border-radius: var(--r-full); border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text-2); font-size: .8rem; font-weight: 500; cursor: pointer; transition: all .2s;
  white-space: nowrap;
}
.chip:hover { color: var(--primary); border-color: var(--primary); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 14px -8px rgba(102,126,234,.95); }

/* =========================================================
   历史上的今天
   ========================================================= */
.history-body { padding: 18px 20px 6px; }
.hist-item { display: grid; grid-template-columns: 60px 16px 1fr; gap: 10px; }
.hist-year {
  font-family: var(--mono); font-size: .9rem; font-weight: 700; color: var(--primary);
  text-align: right; padding-top: 1px; letter-spacing: -.3px;
}
.hist-rail { position: relative; }
.hist-rail::before {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  top: 10px; bottom: -16px; width: 2px; background: var(--border); border-radius: 2px;
}
.hist-item:last-child .hist-rail::before { display: none; }
.hist-dot {
  position: absolute; left: 50%; top: 5px; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%; z-index: 1;
  box-shadow: 0 0 0 3px var(--bg-card);
}
.hist-dot.ev { background: #3b82f6; }
.hist-dot.bt { background: #10b981; }
.hist-dot.dt { background: #94a3b8; }
.hist-main { padding-bottom: 18px; min-width: 0; }
.hist-title { font-size: .9rem; font-weight: 600; line-height: 1.58; color: var(--text); }
.hist-tag {
  display: inline-block; font-size: .67rem; font-weight: 700; letter-spacing: .3px;
  padding: 1px 7px; border-radius: 6px; margin-right: 7px; vertical-align: 1.5px;
}
.hist-tag.ev { background: rgba(59,130,246,.13); color: #1d4ed8; }
.hist-tag.bt { background: rgba(16,185,129,.13); color: #047857; }
.hist-tag.dt { background: rgba(100,116,139,.15); color: #475569; }
html[data-theme="dark"] .hist-tag.ev { color: #93c5fd; }
html[data-theme="dark"] .hist-tag.bt { color: #6ee7b7; }
html[data-theme="dark"] .hist-tag.dt { color: #cbd5e1; }
.hist-desc {
  font-size: .82rem; color: var(--text-2); line-height: 1.68; margin-top: 5px; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .2s;
}
.hist-desc:hover { color: var(--text); }
.hist-desc.open { -webkit-line-clamp: unset; display: block; }
.hist-link {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .76rem; font-weight: 500; color: var(--primary); margin-top: 6px;
}
.hist-link svg { width: 12px; height: 12px; }
.hist-link:hover { text-decoration: underline; }

/* =========================================================
   每日古诗词
   ========================================================= */
.poem-body { padding: 26px 24px 20px; display: flex; flex-direction: column; }
/* 用 auto 外边距做垂直居中：内容过长时自动退化为顶部对齐，不会裁掉开头 */
.poem-inner { position: relative; margin: auto 0; }
/* 背景「诗」字水印：仅装饰，不参与朗读与复制 */
.poem-mark {
  position: absolute; right: -4px; top: -14px;
  font-size: 84px; font-weight: 700; line-height: 1;
  color: var(--primary); opacity: .06; pointer-events: none; user-select: none;
}
.poem-text {
  position: relative;
  font-size: 1.32rem; font-weight: 600; line-height: 2; letter-spacing: .5px;
  color: var(--text);
}
.poem-from {
  margin-top: 14px; font-size: .88rem; color: var(--text-2);
  font-family: var(--mono); letter-spacing: .2px;
}
.poem-note {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--bg-soft); border-left: 3px solid var(--primary);
  font-size: .84rem; line-height: 1.78; color: var(--text-2);
}
.poem-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-2);
}
.poem-tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.poem-tools { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.ptag {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
  background: var(--primary-soft); color: var(--primary-dark);
}
.ptag.ghost { background: var(--bg-soft); color: var(--text-3); font-weight: 500; }
html[data-theme="dark"] .ptag { color: #bfdbfe; }
html[data-theme="dark"] .ptag.ghost { color: var(--text-3); }

/* =========================================================
   每日历史人物
   ========================================================= */
.figure-body { padding: 20px 20px 18px; }
.fig-top { display: flex; align-items: center; gap: 14px; }
.fig-avatar {
  width: 54px; height: 54px; border-radius: 16px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  font-size: 1.5rem; font-weight: 600;
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
  box-shadow: 0 8px 18px -10px rgba(109, 40, 217, .9);
}
.fig-id { min-width: 0; }
.fig-id h4 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.2px; }
.fig-era {
  font-size: .78rem; color: var(--text-3); margin-top: 3px;
  font-family: var(--mono); letter-spacing: .2px;
}
.fig-role { display: inline-block; margin-top: 6px; font-size: .78rem; color: var(--primary-dark); font-weight: 500; }
html[data-theme="dark"] .fig-role { color: #bfdbfe; }
.fig-summary {
  margin-top: 16px; font-size: .88rem; line-height: 1.85; color: var(--text-2);
  text-align: justify;
}
.fig-quote {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--bg-soft); border-left: 3px solid #8b5cf6;
}
.fig-q { font-size: .92rem; font-weight: 600; line-height: 1.8; color: var(--text); }
.fig-qf { margin-top: 6px; font-size: .78rem; color: var(--text-3); text-align: right; }
.fig-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-2);
}
.fig-tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fig-tools { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

/* =========================================================
   每日英语
   ========================================================= */
.english-body { padding: 18px 20px 22px; }
.en-label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: .74rem; font-weight: 700; letter-spacing: 1px; color: var(--text-3);
}
.en-label span {
  font-size: .6rem; font-weight: 700; letter-spacing: 1.5px;
  color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 6px;
}
html[data-theme="dark"] .en-label span { color: #bfdbfe; }
.en-sentence { font-size: 1.11rem; font-weight: 600; line-height: 1.62; color: var(--text); letter-spacing: .1px; }
.en-trans { font-size: .88rem; color: var(--text-2); line-height: 1.72; margin-top: 8px; }
.en-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.en-author { font-size: .82rem; color: var(--text-3); font-style: italic; }
.en-tools { display: flex; gap: 7px; flex-shrink: 0; }
.en-divider { height: 1px; background: var(--border); margin: 20px 0; }
.en-word-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.en-word-head h4 {
  font-size: 1.42rem; font-weight: 700; letter-spacing: -.4px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.en-phon { font-family: var(--mono); font-size: .83rem; color: var(--text-3); }
.en-meaning { margin-top: 10px; font-size: .93rem; color: var(--text); font-weight: 500; line-height: 1.6; }
.en-pos {
  display: inline-block; font-family: var(--mono); font-size: .71rem; font-weight: 700;
  color: var(--primary); background: var(--primary-soft); padding: 2px 7px; border-radius: 6px; margin-right: 8px;
}
html[data-theme="dark"] .en-pos { color: #bfdbfe; }
.en-def { font-size: .83rem; color: var(--text-2); line-height: 1.7; margin-top: 9px; }
.en-ex {
  margin-top: 13px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--bg-code); border-left: 3px solid var(--primary);
}
.en-ex-en { font-size: .85rem; color: var(--text); line-height: 1.65; }
.en-ex-zh { font-size: .8rem; color: var(--text-3); margin-top: 5px; line-height: 1.6; }
.en-label .chip-mini { margin-left: auto; }

/* ---------- 迷你 chip / 星标态 ---------- */
.chip-mini { padding: 3px 9px; font-size: .7rem; border-radius: 7px; white-space: nowrap; }
.mini-btn.on { color: #f59e0b; border-color: #f59e0b; background: rgba(245,158,11,.09); }
.mini-btn.on svg { fill: rgba(245,158,11,.22); }
.actions select { width: auto; padding: 8px 12px; font-size: .85rem; }
.hint-text { font-size: .78rem; color: var(--text-3); align-self: center; margin-left: 2px; }

/* ---------- 查词 ---------- */
.dict-form {
  display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 12px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-code);
  transition: border-color .2s, box-shadow .2s;
}
.dict-form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); background: var(--bg-card); }
.dict-input-ico { display: grid; place-items: center; color: var(--text-3); flex-shrink: 0; }
.dict-input-ico svg { width: 16px; height: 16px; }
.dict-form input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: .91rem; padding: 7px 0;
}
.dict-result { margin-top: 15px; }
.dict-empty, .wb-empty { padding: 26px 14px; text-align: center; color: var(--text-3); font-size: .85rem; line-height: 1.75; }
.wb-empty-sub { font-size: .8rem; margin: 6px 0 14px; }

.dict-card {
  padding: 16px 17px; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: var(--bg-code);
}
.dc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dc-word { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.dc-word h4 { font-size: 1.42rem; font-weight: 700; letter-spacing: -.2px; }
.dc-form {
  font-size: .68rem; color: var(--text-3); background: var(--bg-soft);
  border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; white-space: nowrap;
}
.dc-acts { display: flex; gap: 6px; flex-shrink: 0; }
.dc-ph { font-family: var(--mono); font-size: .85rem; color: var(--text-3); margin-top: 5px; }
.dc-def { font-size: .82rem; color: var(--text-2); line-height: 1.7; margin-top: 9px; }

.dict-miss {
  padding: 15px 16px; border-radius: var(--r-lg); border: 1px dashed var(--border); background: var(--bg-code);
}
.dm-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.dm-hint { font-size: .8rem; color: var(--text-3); margin-top: 7px; line-height: 1.6; }
.dict-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 11px; }
.dict-sug { font-size: .8rem; color: var(--text-2); }

.dict-trans { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.dt-label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 9px;
  font-size: .74rem; font-weight: 700; letter-spacing: 1px; color: var(--text-3);
}
.dt-label span {
  font-size: .6rem; font-weight: 700; letter-spacing: 1.2px; color: var(--primary);
  background: var(--primary-soft); padding: 2px 8px; border-radius: 6px;
}
html[data-theme="dark"] .dt-label span { color: #bfdbfe; }
.dt-text { font-size: .92rem; color: var(--text); line-height: 1.78; }
.dt-body { transition: opacity .2s; }
.dt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }
.dt-tag { font-size: .72rem; color: var(--text-3); }
.dt-add { margin-top: 11px; }
.dt-err { font-size: .84rem; color: #ef4444; line-height: 1.6; }
.dt-hint { font-size: .78rem; color: var(--text-3); margin-top: 6px; line-height: 1.6; }
.dict-notice {
  padding: 10px 13px; border-radius: var(--r-md); margin-bottom: 12px;
  background: var(--primary-soft); color: var(--primary); font-size: .82rem;
}
html[data-theme="dark"] .dict-notice { color: #bfdbfe; }

.dict-loading { display: flex; align-items: center; gap: 9px; font-size: .83rem; color: var(--text-3); padding: 8px 0; }
.spinner {
  width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--primary); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 生词本 ---------- */
.wb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 15px; }
.wb-stat {
  text-align: center; padding: 11px 6px; border-radius: var(--r-md);
  background: var(--bg-code); border: 1px solid var(--border);
}
.wb-stat strong { display: block; font-size: 1.02rem; font-weight: 700; color: var(--primary); line-height: 1.3; }
.wb-stat span { font-size: .7rem; color: var(--text-3); margin-top: 2px; display: block; }

.wb-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: .78rem; color: var(--text-3); margin: 16px 0 10px;
}
.wb-head-acts { display: flex; gap: 6px; }
.wb-list .wb-item {
  padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--bg-code); margin-bottom: 9px;
}
.wb-top { display: flex; align-items: center; gap: 9px; }
.wb-top h5 { font-size: .98rem; font-weight: 600; color: var(--text); }
.wb-ph { font-family: var(--mono); font-size: .76rem; color: var(--text-3); }
.wb-acts { display: flex; gap: 5px; margin-left: auto; }
.wb-zh { font-size: .84rem; color: var(--text-2); line-height: 1.6; margin-top: 7px; }
.wb-ex { font-size: .78rem; color: var(--text-3); line-height: 1.6; margin-top: 5px; font-style: italic; }
.wb-ex.zh { font-style: normal; }

/* ---------- 练习测验 ---------- */
.quiz-bar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-code); border: 1px solid var(--border);
}
.quiz-title { font-size: .74rem; font-weight: 700; letter-spacing: 1px; color: var(--text-3); margin-right: 2px; }
.quiz-score { margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.q-prompt {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 12px;
}
.q-word { font-size: 1.34rem; font-weight: 700; letter-spacing: -.2px; }
.q-ph { font-family: var(--mono); font-size: .8rem; color: var(--text-3); }
.q-zh { font-size: 1.02rem; font-weight: 600; color: var(--text); }
.q-hint { font-family: var(--mono); font-size: .95rem; color: var(--text-3); letter-spacing: 2px; }
.q-options { display: grid; gap: 8px; }
.q-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 13px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--bg-card); font-size: .88rem; color: var(--text); cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.q-opt:hover { border-color: var(--primary); transform: translateX(2px); }
.q-opt-key {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--bg-code); border: 1px solid var(--border); font-size: .72rem; font-weight: 700; color: var(--text-3);
}
.q-opt.right { border-color: #16a34a; background: rgba(22,163,74,.1); }
.q-opt.right .q-opt-key { background: #16a34a; color: #fff; border-color: #16a34a; }
.q-opt.wrong { border-color: #ef4444; background: rgba(239,68,68,.08); opacity: .72; }
.q-opt.picked { opacity: 1; }
.q-input-form { display: flex; gap: 8px; margin: 12px 0 0; }
.q-input-form input { flex: 1; min-width: 0; }
.q-result { margin-top: 13px; }
.qr-verdict { font-size: .88rem; font-weight: 600; margin-bottom: 9px; }
.qr-verdict.ok { color: #16a34a; }
.qr-verdict.no { color: #ef4444; }
.qr-card {
  padding: 13px 15px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-code);
}
.qr-top { display: flex; align-items: center; gap: 9px; }
.qr-top h5 { font-size: 1.05rem; font-weight: 600; }
#qNext { margin-top: 11px; }

/* 骨架屏 */
.sk { background: linear-gradient(90deg, var(--border-2) 25%, var(--border) 37%, var(--border-2) 63%); background-size: 400% 100%; animation: shine 1.3s ease infinite; border-radius: 8px; }
.skeleton-block { display: grid; gap: 14px; }
.skeleton-list { display: grid; gap: 14px; }
.sk-lg { height: 74px; } .sk-md { height: 34px; }
.sk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sk-row .sk { height: 52px; }
.sk-line { height: 15px; } .sk-line.short { width: 62%; }
@keyframes shine { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* =========================================================
   英文翻译（工具箱 · tools.html#tool-translate）
   ========================================================= */
.tr-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-md); padding: 22px;
}
.tr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tr-pane {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-soft); border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: 14px;
}
.tr-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tr-lang { font-size: .78rem; font-weight: 650; color: var(--primary-dark); }
html[data-theme="dark"] .tr-lang { color: #bfdbfe; }
.tr-head-acts { display: flex; align-items: center; gap: 8px; }
.tr-select {
  width: auto; max-width: 160px; height: 34px; padding: 0 10px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  font-size: .82rem; cursor: pointer;
}
.tr-area {
  width: 100%; min-height: 190px; resize: vertical; font-size: .95rem; line-height: 1.75;
  font-family: var(--font);
  border-radius: var(--r-md); border: 1px solid var(--border); padding: 12px 14px;
  background: var(--bg-card); color: var(--text);
}
.tr-area:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tr-area[readonly] { background: var(--bg-code); }
.tr-out-wrap { position: relative; }
/* 用 [hidden] 控制显隐，避免 display 覆盖 hidden 属性导致遮罩无法关闭 */
.tr-loading {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-card); border-radius: var(--r-md);
  font-size: .84rem; color: var(--text-2);
}
.tr-loading:not([hidden]) { display: flex; }
.tr-pane-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: .78rem; color: var(--text-3);
}
.tr-quick { display: flex; gap: 7px; flex-wrap: wrap; }
.tr-hint { color: var(--primary-dark); font-weight: 600; }
html[data-theme="dark"] .tr-hint { color: #93c5fd; }
.tr-note { margin-top: 14px; font-size: .78rem; color: var(--text-3); line-height: 1.7; }
/* 单词命中离线词典时才有内容，避免未命中留下多余间距 */
#trDict:not(:empty) { margin-top: 16px; }

/* =========================================================
   关于
   ========================================================= */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  padding: 26px 22px; border-radius: var(--r-lg); background: var(--bg-card);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s;
}
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.f-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.f-ico svg { width: 21px; height: 21px; }
.feature h4 { font-size: 1rem; font-weight: 650; margin-bottom: 8px; }
.feature p { font-size: .86rem; color: var(--text-2); line-height: 1.7; }

/* =========================================================
   页脚 / 回到顶部 / Toast
   ========================================================= */
.footer { background: #0f172a; color: #94a3b8; padding: 44px 0; margin-top: 0; }
html[data-theme="dark"] .footer { background: #070b16; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #e2e8f0; font-weight: 650; }
.footer-note { font-size: .82rem; }
.footer-links { display: flex; gap: 20px; font-size: .85rem; }
.footer-links a:hover { color: #fff; }

/* ICP 备案 */
.footer-icp {
  display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px 16px;
  margin-top: 2px; padding-top: 16px; width: 100%; max-width: 460px;
  border-top: 1px solid rgba(148,163,184,.18);
}
html[data-theme="dark"] .footer-icp { border-top-color: rgba(148,163,184,.14); }
.icp-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: var(--r-full);
  background: rgba(148,163,184,.1); border: 1px solid rgba(148,163,184,.2);
  color: #cbd5e1; font-size: .82rem; letter-spacing: .02em;
  transition: all .22s;
}
.icp-link:hover { background: rgba(148,163,184,.2); color: #fff; border-color: rgba(148,163,184,.36); transform: translateY(-1px); }
.icp-icon { display: inline-flex; }
.icp-icon svg { width: 15px; height: 15px; }
.icp-copy { font-size: .78rem; color: #64748b; }
html[data-theme="dark"] .icp-copy { color: #556275; }
@media (max-width: 620px) {
  .footer-icp { flex-direction: column; gap: 8px; padding-top: 14px; }
  .icp-link { padding: 6px 12px; font-size: .78rem; }
}

.to-top {
  position: fixed; right: 24px; bottom: 26px; width: 44px; height: 44px; border-radius: 50%;
  border: none; background: var(--grad); color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 12px 26px -10px rgba(102,126,234,.95); opacity: 0; visibility: hidden;
  transform: translateY(12px); transition: all .28s; z-index: 90;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 19px; height: 19px; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 22px);
  background: #1e293b; color: #fff; padding: 11px 22px; border-radius: var(--r-full);
  font-size: .87rem; box-shadow: 0 18px 36px -14px rgba(0,0,0,.6);
  opacity: 0; visibility: hidden; transition: all .3s; z-index: 200; max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* =========================================================
   大整数精度（风险报告 + 修复方案）
   ========================================================= */
.tk-big { color: #e11d48; font-weight: 700; text-decoration: underline wavy rgba(225,29,72,.45); text-underline-offset: 3px; }
html[data-theme="dark"] .tk-big { color: #fb7185; }

.risk-box {
  margin-top: 12px; padding: 13px 15px; border-radius: var(--r-md);
  background: rgba(239,68,68,.06); border: 1px solid rgba(239,68,68,.24);
}
html[data-theme="dark"] .risk-box { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.26); }
.risk-head { display: flex; align-items: flex-start; gap: 9px; font-size: .84rem; color: var(--text-2); line-height: 1.6; }
.risk-head svg { width: 17px; height: 17px; flex-shrink: 0; color: #e11d48; margin-top: 2px; }
html[data-theme="dark"] .risk-head svg { color: #fb7185; }
.risk-head b { color: #e11d48; }
html[data-theme="dark"] .risk-head b { color: #fb7185; }
.risk-head code { font-family: var(--mono); font-size: .78rem; background: var(--bg-code); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border-2); }
.risk-head em { font-style: normal; font-weight: 600; }
.risk-head em.ok { color: #047857; }
.risk-head em.bad { color: #b91c1c; }
html[data-theme="dark"] .risk-head em.ok { color: #6ee7b7; }
html[data-theme="dark"] .risk-head em.bad { color: #fca5a5; }

.risk-list { margin-top: 10px; display: grid; gap: 6px; }
.risk-item {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) 16px minmax(0, 1fr) auto;
  align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 9px; background: var(--bg-code);
  border: 1px solid var(--border-2); font-family: var(--mono); font-size: .8rem;
}
.rk-path {
  color: var(--text-3); font-family: var(--font); font-size: .78rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rk-raw { color: #047857; font-weight: 700; word-break: break-all; }
html[data-theme="dark"] .rk-raw { color: #6ee7b7; }
.rk-arrow { color: var(--text-3); text-align: center; }
.rk-loss { color: #b91c1c; text-decoration: line-through; word-break: break-all; }
html[data-theme="dark"] .rk-loss { color: #fca5a5; }
.rk-delta { justify-self: end; font-size: .74rem; padding: 2px 8px; border-radius: 999px; background: rgba(239,68,68,.12); color: #b91c1c; white-space: nowrap; }
html[data-theme="dark"] .rk-delta { background: rgba(248,113,113,.14); color: #fca5a5; }
.risk-more { font-size: .78rem; color: var(--text-3); margin-top: 7px; }
.risk-tip { font-size: .79rem; color: var(--text-3); margin-top: 9px; line-height: 1.7; }
.risk-tip code, .fix-code { font-family: var(--mono); }
.risk-tip code { font-size: .76rem; background: var(--bg-code); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border-2); }

.fix-wrap { margin-top: 16px; display: grid; gap: 12px; }
.fix-block { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--bg-card); }
.fix-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
.fix-title { font-size: .84rem; font-weight: 650; color: var(--text); }
.fix-title small { font-weight: 400; color: var(--text-3); margin-left: 8px; font-size: .76rem; }
.fix-code {
  margin: 0; padding: 13px 15px; background: var(--bg-code); color: var(--text);
  font-size: .8rem; line-height: 1.7; white-space: pre; overflow-x: auto; max-height: 340px;
}
.fix-note { font-size: .8rem; color: var(--text-3); line-height: 1.75; margin-top: 12px; }
.fix-note b { color: var(--text-2); }

/* =========================================================
   二维码生成器
   ========================================================= */
.qr-preview {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 210px; padding: 14px; border-radius: var(--r-lg);
  background: var(--bg-code); border: 1px solid var(--border-2);
}
.qr-preview canvas { max-width: 100%; height: auto; display: block; image-rendering: pixelated; }
.qr-empty { font-size: .82rem; color: var(--text-3); }
.qr-tpls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.qr-opts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  margin-top: 16px; padding: 14px 16px;
  border-radius: var(--r-lg); background: var(--bg-soft); border: 1px solid var(--border);
}
.qr-opt { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-2); cursor: pointer; }
.qr-opt > span { white-space: nowrap; }
.qr-opt b { font-family: var(--mono); color: var(--primary); font-weight: 700; }
.qr-opt select { width: auto; padding: 6px 10px; font-size: .82rem; }
.qr-opt input[type="range"] { width: 110px; accent-color: var(--primary); cursor: pointer; }
.qr-opt input[type="color"] {
  width: 36px; height: 28px; padding: 2px; cursor: pointer;
  border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg-card);
}
.qr-opt input[type="file"] { font-size: .74rem; max-width: 156px; }

/* =========================================================
   响应式
   ========================================================= */
@media (min-width: 1081px) {
  /* 三行布局：
     第一行 每日古诗词 + 每日英语 —— 不锁死高度，由内容撑开并互相等高，
            避免考研长难句较长时被内部滚动截成半行；
     第二行 历史上的今天 + 每日历史人物 —— 锁定高度，条目多时内部滚动；
     第三行 实时天气整行铺开，内部左右两栏 */
  .dash-grid > .poem-card,
  .dash-grid > .english-card { height: auto; }
  .dash-grid > .history-card { height: 500px; }
  .dash-grid > .figure-card { height: 500px; }
  .dash-grid > .weather-card { grid-column: 1 / -1; height: auto; }
  .wx-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .english-body { max-height: none; }
  .wb-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .history-body { max-height: 460px; }
  /* 关于只剩三张卡，窄屏保持三列即可（≤620px 再降为单列） */
  /* 单列后卡片宽度充足，天气也可左右分栏 */
  .wx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .tr-grid { grid-template-columns: 1fr; }
  .tr-area { min-height: 150px; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px; gap: 2px; box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-burger { display: grid; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .wx-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .section { padding: 62px 0; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding: calc(var(--nav-h) + 52px) 0 66px; }
  .wx-forecast { grid-template-columns: repeat(3, 1fr); }
  .ws-head, .ws-body { padding-left: 16px; padding-right: 16px; }
  /* 城市表单独占一行，避免窄屏下查询按钮被卡片边缘裁切 */
  .card-head .city-form { width: 100%; }
  .city-form input { width: auto; flex: 1; min-width: 0; }
  .to-top { right: 16px; bottom: 18px; }
  .hist-item { grid-template-columns: 50px 14px 1fr; gap: 8px; }
  .hist-year { font-size: .82rem; }
  .en-sentence { font-size: 1.03rem; }
  /* 窄屏下天气两栏会挤在一起，改回单列 */
  .wx-grid { grid-template-columns: 1fr; }
  .poem-text { font-size: 1.14rem; line-height: 1.9; }
  .poem-mark { font-size: 62px; top: -8px; right: 0; }
  .fig-avatar { width: 46px; height: 46px; font-size: 1.28rem; border-radius: 14px; }
  .hero-sm { padding: calc(var(--nav-h) + 40px) 0 46px; }
  .qr-opts { gap: 10px 14px; padding: 12px; }
  .qr-opt input[type="range"] { width: 92px; }
  .qr-preview { min-height: 170px; padding: 10px; }
  .risk-item { grid-template-columns: auto minmax(0, 1fr); gap: 5px 9px; }
  .rk-arrow { display: none; }
  .rk-raw, .rk-loss { grid-column: 2; }
  .rk-delta { grid-column: 2; justify-self: start; }
  .fix-code { font-size: .74rem; }
  .fix-title small { display: block; margin-left: 0; }
  /* 卡片头的按钮组独占一行，避免窄屏被挤压截断 */
  .card-head { gap: 10px; }
  .card-head .news-tabs { width: 100%; justify-content: flex-start; }
  .card-head .chip { padding: 5px 11px; font-size: .76rem; }
  .qb-stats, .wb-stats { grid-template-columns: repeat(4, 1fr); }
  .dict-form { padding-left: 10px; }
  .q-word { font-size: 1.16rem; }
}
@media (max-width: 420px) {
  .tool-grid { grid-template-columns: 1fr; }
  .wx-main { flex-direction: column; align-items: flex-start; }
  .wx-tags { margin-left: 0; }
}
