/* ============================================================
   锦囊 · 本地效率工具箱  —  Design System
   ============================================================ */

:root {
  --bg: #f4f5f8;
  --bg2: #eceef2;
  --card: #ffffff;
  --card2: #f8f9fb;
  --text: #1a1d23;
  --text2: #5b6472;
  --text3: #9aa2af;
  --border: #e5e8ee;
  --border2: #d5d9e2;
  --accent: #4f5ae8;
  --accent2: #4348d8;
  --accent-weak: rgba(79, 90, 232, 0.09);
  --accent-weak2: rgba(79, 90, 232, 0.16);
  --green: #16a34a;
  --green-weak: rgba(22, 163, 74, 0.1);
  --red: #dc3551;
  --red-weak: rgba(220, 53, 81, 0.08);
  --orange: #ea8a0c;
  --orange-weak: rgba(234, 138, 12, 0.1);
  --blue: #2080f0;
  --blue-weak: rgba(32, 128, 240, 0.09);
  --violet: #8b5cf6;
  --teal: #0d9488;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 8px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 8px 30px rgba(16, 24, 40, 0.16);
  --radius: 12px;
  --radius-sm: 9px;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --sans: -apple-system, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei",
    "PingFang SC", "Noto Sans SC", sans-serif;
  --sidebar-w: 234px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #101217;
  --bg2: #16181f;
  --card: #191c24;
  --card2: #1f232d;
  --text: #e7e9ee;
  --text2: #a3aab8;
  --text3: #6b7280;
  --border: #272c37;
  --border2: #333a48;
  --accent: #7c86f5;
  --accent2: #8f98f7;
  --accent-weak: rgba(124, 134, 245, 0.12);
  --accent-weak2: rgba(124, 134, 245, 0.2);
  --green: #34d399;
  --green-weak: rgba(52, 211, 153, 0.12);
  --red: #f8717e;
  --red-weak: rgba(248, 113, 126, 0.12);
  --orange: #fbbf24;
  --orange-weak: rgba(251, 191, 36, 0.12);
  --blue: #60a5fa;
  --blue-weak: rgba(96, 165, 250, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 34px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ---------- reset & base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
::selection { background: var(--accent-weak2); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

kbd {
  font-family: var(--sans);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--border2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card2);
  color: var(--text2);
  white-space: nowrap;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; }

/* ---------- app layout ---------- */
.app { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--border);
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
}
.brand-logo {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(79, 90, 232, 0.35);
}
.brand-logo svg { width: 19px; height: 19px; }
.brand-text { line-height: 1.25; }
.brand-text b { font-size: 15.5px; letter-spacing: 0.5px; display: block; }
.brand-text span { font-size: 11px; color: var(--text3); }

#nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  color: var(--text3);
  padding: 16px 8px 5px;
  display: flex; align-items: center; gap: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: none; background: none;
  border-radius: 8px;
  font: inherit; font-size: 13.5px;
  color: var(--text2);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav-item svg { width: 16.5px; height: 16.5px; flex: none; opacity: 0.85; }
.nav-item:hover { background: var(--bg2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.nav-item .nav-count { margin-left: auto; font-size: 11px; color: var(--text3); }

button.nav-cat {
  width: 100%;
  border: none; background: none;
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 1px;
  color: var(--text3);
  cursor: pointer;
  text-align: left;
  transition: color 0.12s;
}
button.nav-cat:hover { color: var(--accent); }

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-foot .ver { font-size: 11px; color: var(--text3); margin-left: auto; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 54px; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 72%, transparent);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.crumb { font-size: 13.5px; color: var(--text3); display: flex; align-items: center; gap: 6px; min-width: 0; }
.crumb b { color: var(--text); font-weight: 600; }
.crumb .sep { opacity: 0.6; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

#view { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--card);
  color: var(--text);
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.05s;
  user-select: none;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--card2); border-color: var(--text3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }
.btn.danger:hover { background: var(--red-weak); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--bg2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: none;
  border-radius: 8px; border: none; background: transparent;
  color: var(--text2); cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--bg2); color: var(--text); }
.icon-btn.starred { color: var(--orange); }
.icon-btn.starred svg { fill: currentColor; }

.input, .textarea, select.input {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font: inherit; font-size: 13.5px;
  padding: 7px 11px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.textarea.mono, .input.mono, .mono { font-family: var(--mono); }
.input::placeholder, .textarea::placeholder { color: var(--text3); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text2); }
.field .hint { font-size: 11.5px; color: var(--text3); line-height: 1.5; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 980px) {
  .grid2 { grid-template-columns: 1fr; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .grid3, .grid4 { grid-template-columns: 1fr; }
}

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text2); cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

input[type="range"] { accent-color: var(--accent); cursor: pointer; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; color: var(--text2); }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 34px; height: 20px; flex: none;
  background: var(--border2); border-radius: 10px;
  position: relative; transition: background 0.15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }

/* ---------- cards & tool pages ---------- */
.tool-wrap { padding: 26px 34px 70px; max-width: 1180px; margin: 0 auto; }
.tool-head { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.tool-head .icon-tile { width: 44px; height: 44px; }
.tool-head .icon-tile svg { width: 22px; height: 22px; }
.tool-head h1 { font-size: 21px; }
.tool-head .desc { font-size: 13px; color: var(--text2); margin-top: 1px; }
.tool-head .star-btn { margin-left: auto; }
.tool-head .badge { margin-left: auto; }

.icon-tile {
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
}
.icon-tile svg { width: 20px; height: 20px; }
.tile-text { background: var(--accent-weak); color: var(--accent); }
.tile-crypto { background: rgba(139, 92, 246, 0.11); color: var(--violet); }
.tile-convert { background: rgba(13, 148, 136, 0.11); color: var(--teal); }
.tile-media { background: var(--orange-weak); color: var(--orange); }
.tile-life { background: var(--green-weak); color: var(--green); }
[data-theme="dark"] .tile-crypto { color: #b39aff; }
[data-theme="dark"] .tile-convert { color: #2dd4bf; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card > h3 { font-size: 14.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card > h3 svg { width: 16px; height: 16px; color: var(--text3); }
.card .sub { font-size: 12.5px; color: var(--text3); margin: -8px 0 12px; }

.panel {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 18px; box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { font-size: 12.5px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat-card .stat-sub { font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.stat-value.pos { color: var(--green); }
.stat-value.neg { color: var(--red); }

/* home */
.home { padding: 34px 38px 80px; max-width: 1180px; margin: 0 auto; }
.home-hero { margin-bottom: 8px; }
.home-hero h1 { font-size: 28px; letter-spacing: 0.3px; }
.home-hero .date { color: var(--text2); font-size: 13.5px; margin-top: 4px; }
.home-hero .privacy-tip {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--green);
  background: var(--green-weak);
  padding: 5px 12px; border-radius: 999px;
}
.home-hero .privacy-tip svg { width: 14px; height: 14px; }
.home-search { margin: 22px 0 8px; position: relative; max-width: 560px; cursor: pointer; }
.home-search .ph {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px;
  background: var(--card); border: 1px solid var(--border2); border-radius: 13px;
  color: var(--text3); font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.home-search:hover .ph { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.home-search svg { width: 17px; height: 17px; }
.home-search kbd { margin-left: auto; }
.home section { margin-top: 30px; }
.sec-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 13px; scroll-margin-top: 10px; }
.sec-title h2 { font-size: 16px; }
.sec-title .cnt { font-size: 12px; color: var(--text3); }
.sec-title.sec-flash h2 { animation: sec-flash 1.4s ease-out; }
@keyframes sec-flash {
  0% { color: var(--accent); }
  100% { color: var(--text); }
}

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 13px; }
.tool-card {
  position: relative;
  display: flex; flex-direction: column; gap: 9px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 17px 17px 15px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.tool-card .name { font-size: 14.5px; font-weight: 600; }
.tool-card .d { font-size: 12.5px; color: var(--text2); line-height: 1.55; min-height: 2.6em; }
.tool-card .fav {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text3); cursor: pointer;
  opacity: 0; transition: opacity 0.12s, color 0.12s, background 0.12s;
}
.tool-card .fav svg { width: 15px; height: 15px; }
.tool-card:hover .fav, .tool-card .fav.on { opacity: 1; }
.tool-card .fav:hover { background: var(--bg2); color: var(--orange); }
.tool-card .fav.on { color: var(--orange); }
.tool-card .fav.on svg { fill: currentColor; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 13px;
  border-radius: 999px;
  background: var(--card); border: 1px solid var(--border2);
  font-size: 13px; color: var(--text2); cursor: pointer;
  transition: all 0.12s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.chip svg { width: 14px; height: 14px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.static { cursor: default; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); max-height: 480px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; color: var(--text2);
  background: var(--card2);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
  white-space: nowrap;
}
.table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--card2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
.table .muted { color: var(--text3); }
.table .ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: var(--bg2); color: var(--text2);
  white-space: nowrap;
}
.badge.green { background: var(--green-weak); color: var(--green); }
.badge.red { background: var(--red-weak); color: var(--red); }
.badge.orange { background: var(--orange-weak); color: var(--orange); }
.badge.blue { background: var(--blue-weak); color: var(--blue); }
.badge.accent { background: var(--accent-weak); color: var(--accent); }

/* ---------- code & output ---------- */
.code-box {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 420px;
  overflow: auto;
  margin: 0;
}
.code-box.scroll { max-height: 340px; }

.out-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; }
.out-head .t { font-size: 12.5px; font-weight: 600; color: var(--text2); }
.out-head .spacer { flex: 1; }

.diff-line { display: flex; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }
.diff-line .ln { flex: none; width: 44px; text-align: right; padding-right: 10px; color: var(--text3); user-select: none; font-size: 11.5px; }
.diff-line .sign { flex: none; width: 18px; text-align: center; user-select: none; }
.diff-line .code { flex: 1; word-break: break-all; white-space: pre-wrap; }
.diff-line.add { background: var(--green-weak); color: var(--green); }
.diff-line.del { background: var(--red-weak); color: var(--red); }
.diff-line.add .ln, .diff-line.del .ln { color: inherit; opacity: 0.6; }

mark.rx { background: var(--accent-weak2); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px var(--accent-weak2); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab {
  padding: 7px 14px; font-size: 13.5px; font-weight: 500;
  color: var(--text2); background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- drop zone ---------- */
.drop {
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.drop svg { width: 26px; height: 26px; margin-bottom: 6px; opacity: 0.7; }
.drop b { display: block; font-size: 14px; color: var(--text2); margin-bottom: 2px; }

/* ---------- palette ---------- */
.palette-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 18, 25, 0.4);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
.palette-mask.hidden { display: none; }
.palette {
  width: 580px; max-width: calc(100vw - 40px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop-in 0.14s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(0.985); } }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.palette-input svg { width: 17px; height: 17px; color: var(--text3); flex: none; }
.palette-input input {
  flex: 1; border: none; background: none; font: inherit; font-size: 15px;
  color: var(--text); outline: none;
}
.palette-input input::placeholder { color: var(--text3); }
.palette-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.palette-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px; cursor: pointer;
}
.palette-item.sel, .palette-item:hover { background: var(--accent-weak); }
.palette-item .icon-tile { width: 30px; height: 30px; border-radius: 8px; }
.palette-item .icon-tile svg { width: 15px; height: 15px; }
.palette-item .pi-name { font-size: 13.5px; font-weight: 550; }
.palette-item .pi-desc { font-size: 11.5px; color: var(--text3); }
.palette-item .pi-cat { margin-left: auto; font-size: 11px; color: var(--text3); }
.palette-empty { padding: 30px; text-align: center; color: var(--text3); font-size: 13px; }
.palette-foot {
  display: flex; gap: 14px; padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text3);
}
.palette-foot span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- toast ---------- */
#toasts {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 200; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 500;
  padding: 9px 16px; border-radius: 10px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.18s ease-out;
  max-width: 70vw;
}
[data-theme="dark"] .toast { background: #2c313d; color: #e7e9ee; }
.toast svg { width: 15px; height: 15px; flex: none; }
.toast.ok svg { color: #4ade80; }
.toast.err svg { color: #f8717e; }
.toast.out { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- misc ---------- */
.tool-tip {
  margin-top: 22px;
  font-size: 12px; color: var(--text3);
  display: flex; gap: 7px; align-items: flex-start;
  line-height: 1.6;
}
.tool-tip svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }

.empty { text-align: center; color: var(--text3); padding: 40px 10px; font-size: 13px; }
.empty svg { width: 30px; height: 30px; opacity: 0.5; margin-bottom: 8px; }

.divider { height: 1px; background: var(--border); margin: 18px 0; border: none; }

.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

.legend { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-row .name { color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-row .val { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.legend-row .pct { color: var(--text3); font-size: 11px; width: 44px; text-align: right; }

.strength-bar { height: 6px; border-radius: 3px; background: var(--bg2); overflow: hidden; }
.strength-bar > div { height: 100%; border-radius: 3px; transition: width 0.2s, background 0.2s; }

.pw-row { font-family: var(--mono); font-size: 17px; letter-spacing: 0.5px; background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; word-break: break-all; line-height: 1.7; }

.timer-ring { position: relative; width: 230px; height: 230px; margin: 0 auto; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring .ttime { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-ring .ttime b { font-size: 44px; font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: 1px; }
.timer-ring .ttime span { font-size: 12.5px; color: var(--text2); margin-top: 2px; }

.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qr-wrap canvas { border-radius: 10px; box-shadow: var(--shadow); }

.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv-item { display: flex; align-items: center; gap: 10px; }
.kv-item .k { flex: none; width: 88px; font-size: 12.5px; font-weight: 600; color: var(--text2); }
.kv-item .v { flex: 1; min-width: 0; }

.chart-tip {
  position: fixed; z-index: 90; pointer-events: none;
  background: var(--text); color: var(--bg);
  font-size: 12px; padding: 5px 10px; border-radius: 7px;
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap; box-shadow: var(--shadow);
  display: none;
}
[data-theme="dark"] .chart-tip { background: #2c313d; color: #e7e9ee; }

.settings-row { display: flex; align-items: center; gap: 16px; padding: 13px 0; }
.settings-row + .settings-row { border-top: 1px solid var(--border); }
.settings-row .info { flex: 1; min-width: 0; }
.settings-row .info b { font-size: 13.5px; display: block; }
.settings-row .info span { font-size: 12.5px; color: var(--text3); }

.about-logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(79, 90, 232, 0.35);
}
.about-logo svg { width: 28px; height: 28px; }

.fade-in { animation: fade-in 0.18s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .tool-wrap, .home { padding: 20px 18px 60px; }
}
