/* ════════════════════════════════════════════════════════════
   爸妈影院 · 家庭电视墙
   设计语言：温暖客厅 / 朱柿红点缀 / 红绿灯语义
   ════════════════════════════════════════════════════════════ */

:root {
  --bg: #faf6ef;
  --ink: #2b241b;
  --ink-2: #6e6353;
  --ink-3: #a49682;
  --card: #ffffff;
  --card-border: #ece2d2;
  --tile: #f7efe2;
  --accent: #d64524;
  --accent-deep: #b23318;
  --accent-soft: #fdeae4;
  --ok: #188a4c;
  --ok-soft: #e5f5eb;
  --warn: #a36a06;
  --warn-soft: #fdf1dc;
  --err: #d8383f;
  --err-soft: #fde9e9;
  --sk-a: #f3ecdf;
  --sk-b: #ebe2d0;
  --shadow-1: 0 1px 2px rgba(43, 36, 27, .04), 0 10px 30px -14px rgba(43, 36, 27, .22);
  --shadow-2: 0 2px 6px rgba(43, 36, 27, .06), 0 24px 48px -18px rgba(43, 36, 27, .32);
  --radius: 22px;
  --glow-1: rgba(255, 176, 105, .16);
  --glow-2: rgba(214, 69, 36, .05);
  --topbar-bg: rgba(250, 246, 239, .82);
}

@media (prefers-color-scheme: dark) {
  :root:not(.theme-light):not(.theme-dark) {
    --bg: #161310;
    --ink: #ede4d6;
    --ink-2: #ab9d8c;
    --ink-3: #7a6f60;
    --card: #201b16;
    --card-border: #322a22;
    --tile: #2b241d;
    --accent: #ff7a52;
    --accent-deep: #ff9271;
    --accent-soft: rgba(255, 122, 82, .16);
    --ok: #3cc276;
    --ok-soft: rgba(60, 194, 118, .14);
    --warn: #e0a33c;
    --warn-soft: rgba(224, 163, 60, .13);
    --err: #ff6f66;
    --err-soft: rgba(255, 111, 102, .13);
    --sk-a: #221d18;
    --sk-b: #2c261f;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 32px -14px rgba(0, 0, 0, .55);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 26px 52px -18px rgba(0, 0, 0, .7);
    --glow-1: rgba(255, 140, 80, .07);
    --glow-2: rgba(255, 122, 82, .04);
    --topbar-bg: rgba(22, 19, 16, .82);
  }
}

/* 手动主题覆盖 */
:root.theme-dark {
  --bg: #161310;
  --ink: #ede4d6;
  --ink-2: #ab9d8c;
  --ink-3: #7a6f60;
  --card: #201b16;
  --card-border: #322a22;
  --tile: #2b241d;
  --accent: #ff7a52;
  --accent-deep: #ff9271;
  --accent-soft: rgba(255, 122, 82, .16);
  --ok: #3cc276;
  --ok-soft: rgba(60, 194, 118, .14);
  --warn: #e0a33c;
  --warn-soft: rgba(224, 163, 60, .13);
  --err: #ff6f66;
  --err-soft: rgba(255, 111, 102, .13);
  --sk-a: #221d18;
  --sk-b: #2c261f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 32px -14px rgba(0, 0, 0, .55);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 26px 52px -18px rgba(0, 0, 0, .7);
  --glow-1: rgba(255, 140, 80, .07);
  --glow-2: rgba(255, 122, 82, .04);
  --topbar-bg: rgba(22, 19, 16, .82);
}
:root.theme-light { /* 显式浅色，变量同默认 */ }

/* ═══════════ 基础 ═══════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }
html.font-big { font-size: 18.5px; }

body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
    "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 560px at 12% -8%, var(--glow-1), transparent 62%),
    radial-gradient(760px 520px at 105% 6%, var(--glow-2), transparent 58%);
}

::selection { background: var(--accent-soft); }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.app {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 22px calc(30px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main { flex: 1; }

/* ═══════════ 顶栏 ═══════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--shadow-1);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 1.1rem; font-weight: 800; letter-spacing: .02em; }
.brand-slogan { font-size: .78rem; color: var(--ink-3); letter-spacing: .06em; }

.topbar-actions { display: flex; gap: 9px; }
.icon-btn {
  min-width: 44px; min-height: 44px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--card-border);
  display: grid; place-items: center;
  font-weight: 700; font-size: .95rem;
  color: var(--ink-2);
  transition: all .2s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 主题按钮：按当前模式显示对应图标 */
:root:not(.theme-dark) .ico-sun { display: none; }
:root.theme-dark .ico-moon,
:root:not(.theme-light) .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) .ico-moon { display: none; }
  :root:not(.theme-light) .ico-sun { display: block; }
}
:root.theme-dark .ico-sun { display: block; }
:root.theme-light .ico-sun { display: none; }
:root.theme-light .ico-moon { display: block; }

/* ═══════════ 开屏问候 ═══════════ */
.hero { text-align: center; padding: 34px 8px 8px; }
.hero-date {
  display: inline-block;
  font-size: .86rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 16px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.hero-title {
  font-size: clamp(1.65rem, 4.6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: .015em;
  margin: 14px 0 8px;
}
.hero-title .hl {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}
.hero-title .hl::after {
  content: '';
  position: absolute;
  left: -2%; right: -2%; bottom: .08em;
  height: .34em;
  background: var(--accent-soft);
  border-radius: 4px;
  z-index: -1;
  transform: rotate(-1deg);
}
.hero-sub { font-size: .95rem; color: var(--ink-2); }
.hero-sub em { font-style: normal; color: var(--accent); font-weight: 700; }

.hero-stats {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .86rem;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 7px 15px;
  font-variant-numeric: tabular-nums;
}
.pill b { color: var(--ink); font-weight: 800; }
.pill-dot { width: 9px; height: 9px; border-radius: 50%; }
.pill-ok .pill-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pill-try .pill-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.pill-wait .pill-dot { background: var(--warn); animation: blink 1.1s infinite; }
.pill-rest .pill-dot { background: var(--err); }

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .92rem;
  border-radius: 999px;
  padding: 10px 22px;
  min-height: 44px;
  box-shadow: 0 6px 18px -6px var(--accent);
  transition: all .2s ease;
}
.refresh-btn:hover { background: var(--accent-deep); transform: translateY(-2px); }
.refresh-btn:active { transform: translateY(0) scale(.97); }
.refresh-btn:disabled { opacity: .65; cursor: wait; transform: none; }
.refresh-btn.running .ico-refresh { animation: spin 1s linear infinite; }

.hero-hint {
  min-height: 1.4em;
  margin-top: 12px;
  font-size: .82rem;
  color: var(--ink-3);
}

/* ═══════════ 卡片墙 ═══════════ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding: 22px 0 8px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-1);
  animation: cardIn .5s cubic-bezier(.22, 1, .36, 1) backwards;
  animation-delay: var(--d, 0s);
  transition: transform .25s cubic-bezier(.34, 1.4, .64, 1), box-shadow .25s ease, border-color .25s ease, opacity .4s ease;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.card.st-checking { pointer-events: none; }
.card.st-offline { pointer-events: none; opacity: .52; filter: grayscale(.45); }

.card.st-online, .card.st-unknown { cursor: pointer; }
.card.st-online:hover, .card.st-unknown:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}
.card.st-online:hover {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--card-border));
}
.card.st-unknown:hover {
  border-color: color-mix(in srgb, var(--warn) 50%, var(--card-border));
}
.card.st-online:active,
.card.st-unknown:active,
.card.card-pressed { transform: translateY(-1px) scale(.985); }

/* 顶部状态细线 */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 18px; right: 18px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: transparent;
  transition: background .3s ease;
}
.card.st-online::before { background: linear-gradient(90deg, transparent, var(--ok), transparent); }
.card.st-unknown::before { background: linear-gradient(90deg, transparent, var(--warn), transparent); }
.card.st-offline::before { background: linear-gradient(90deg, transparent, var(--err), transparent); }

.card-top { display: flex; align-items: center; gap: 14px; }

.site-logo {
  width: 54px; height: 54px;
  border-radius: 16px;
  background: var(--tile);
  border: 1px solid var(--card-border);
  display: grid; place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.site-logo img {
  width: 32px; height: 32px;
  object-fit: contain;
  border-radius: 4px;
}
.site-logo .logo-emoji { font-size: 1.7rem; line-height: 1; }

.site-info { flex: 1; min-width: 0; }
.site-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.badge-type {
  font-size: .68rem;
  font-weight: 600;
  color: var(--ink-3);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 1.5px 7px;
  letter-spacing: .05em;
  transform: translateY(-1px);
}
.badge-fast {
  font-size: .68rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 9px;
  animation: cardIn .4s ease backwards;
}
.site-desc {
  font-size: .82rem;
  color: var(--ink-3);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.go {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--tile);
  color: var(--ink-2);
  display: grid; place-items: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: all .25s cubic-bezier(.34, 1.4, .64, 1);
}
.card.st-online:hover .go {
  background: var(--accent);
  color: #fff;
  transform: rotate(-45deg) scale(1.08);
}
.card.st-checking .go,
.card.st-offline .go { visibility: hidden; }

.card-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 650;
  border-top: 1px dashed var(--card-border);
  padding-top: 13px;
}

/* ── 红绿灯 LED（--led 决定呼吸光颜色）── */
.led {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
  transition: background .3s ease;
}
.card.st-checking .led { animation: blink 1.1s infinite; }
.card.st-online .led {
  --led: var(--ok);
  background: var(--ok);
  animation: ledBreathe 2.4s ease-in-out infinite;
}
.card.st-unknown .led {
  --led: var(--warn);
  background: var(--warn);
  animation: ledBreathe 2.4s ease-in-out infinite;
}
.card.st-offline .led { background: var(--err); }

@keyframes ledBreathe {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--led) 20%, transparent), 0 0 10px var(--led); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--led) 10%, transparent), 0 0 20px var(--led); }
}

.st-text { letter-spacing: .02em; }
.card.st-online .st-text { color: var(--ok); }
.card.st-unknown .st-text { color: var(--warn); }
.card.st-offline .st-text { color: var(--err); }
.card.st-checking .st-text { color: var(--ink-3); font-weight: 500; }

.latency {
  font-size: .78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2.5px 10px;
  font-variant-numeric: tabular-nums;
}
.latency.lat-ok { background: var(--ok-soft); color: var(--ok); }
.latency.lat-mid { background: var(--warn-soft); color: var(--warn); }
.latency.lat-slow { background: var(--err-soft); color: var(--err); }

.lat-cache-hint { font-size: .72rem; color: var(--ink-3); font-weight: 500; }

/* 空状态 */
.empty-pool {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
  font-size: .95rem;
}
.empty-pool .big { font-size: 2.4rem; display: block; margin-bottom: 12px; }

/* 骨架屏 */
.skeleton {
  min-height: 148px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: linear-gradient(100deg, var(--sk-a) 30%, var(--sk-b) 50%, var(--sk-a) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.6s infinite linear;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -20% 0; }
}

/* ═══════════ 帮助卡 ═══════════ */
.help-card {
  margin: 26px 0 10px;
  border: 1.5px dashed var(--card-border);
  border-radius: 20px;
  padding: 22px 26px;
}
.help-title { font-size: 1.02rem; font-weight: 800; margin-bottom: 14px; }
.help-steps { list-style: none; display: grid; gap: 11px; }
.help-steps li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: .92rem;
  color: var(--ink-2);
}
.help-steps b { color: var(--ink); }
.step-num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  transform: translateY(4px);
}

/* ═══════════ 页脚 ═══════════ */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 4px 6px;
  border-top: 1px solid var(--card-border);
  margin-top: 26px;
  font-size: .78rem;
  color: var(--ink-3);
}
.install-btn {
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  padding: 6px 15px;
  font-weight: 600;
  transition: all .2s ease;
}
.install-btn:hover { background: var(--accent-soft); }
.footer-version { font-variant-numeric: tabular-nums; user-select: none; }

/* ═══════════ 管理面板 ═══════════ */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(24, 18, 12, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
/* 作者 display:flex 会压过 hidden 属性，必须显式关掉 */
.admin-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }

.admin-sheet {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 26px;
  box-shadow: var(--shadow-2);
  padding: 24px 26px 28px;
  animation: sheetIn .3s cubic-bezier(.22, 1, .36, 1);
}
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(26px) scale(.98); }
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.admin-head h2 { font-size: 1.15rem; font-weight: 800; }
.admin-close {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--tile);
  font-size: .95rem;
  color: var(--ink-2);
  transition: all .2s;
}
.admin-close:hover { color: var(--err); background: var(--err-soft); }

.admin-login-tip { font-size: .88rem; color: var(--ink-2); margin-bottom: 14px; }
.admin-login-tip code, .admin-static-tip code {
  background: var(--tile);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: .82em;
}
.admin-login-form { display: flex; gap: 10px; }
.admin-login-form input { flex: 1; }
.admin-login-err { color: var(--err); font-size: .84rem; margin-top: 10px; }
.admin-static-tip { font-size: .84rem; color: var(--warn); margin-top: 12px; }

.admin-tabs {
  display: flex;
  gap: 6px;
  background: var(--tile);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 18px;
}
.admin-tab {
  flex: 1;
  padding: 9px 0;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 650;
  color: var(--ink-2);
  transition: all .2s;
}
.admin-tab.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.ov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.ov-item {
  background: var(--tile);
  border-radius: 14px;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ov-label { font-size: .76rem; color: var(--ink-3); }
.ov-value { font-size: 1.02rem; font-weight: 750; font-variant-numeric: tabular-nums; }

.ov-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  border-radius: 12px;
  padding: 11px 20px;
  transition: all .2s;
  min-height: 44px;
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:disabled { opacity: .6; cursor: wait; }

.ov-run-result {
  background: var(--tile);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: .82rem;
  color: var(--ink-2);
  margin-bottom: 16px;
  white-space: pre-wrap;
  font-family: ui-monospace, Consolas, monospace;
  max-height: 180px;
  overflow-y: auto;
}

.admin-sub { font-size: .92rem; font-weight: 800; margin: 18px 0 10px; }
.admin-sub-note { font-size: .74rem; font-weight: 500; color: var(--ink-3); }
.admin-empty { font-size: .84rem; color: var(--ink-3); padding: 8px 0; }

.health-rows { display: grid; gap: 2px; }
.health-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px dashed var(--card-border);
  font-size: .82rem;
}
.health-row:last-child { border-bottom: none; }
.hr-name { font-weight: 700; white-space: nowrap; min-width: 5.5em; }
.hr-url {
  flex: 1; min-width: 0; color: var(--ink-3); font-size: .74rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hr-tag {
  font-size: .68rem; border-radius: 6px; padding: 1px 7px; font-weight: 650;
  background: var(--ok-soft); color: var(--ok); white-space: nowrap;
}
.hr-tag.warn { background: var(--warn-soft); color: var(--warn); }
.hr-tag.bad { background: var(--err-soft); color: var(--err); }
.hr-time { color: var(--ink-3); font-size: .74rem; white-space: nowrap; }
.hr-home { font-size: .9rem; }

.ov-log { display: grid; gap: 10px; }
.ov-log-item {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: .8rem;
  color: var(--ink-2);
}
.ov-log-item .log-time { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.log-line { display: flex; gap: 6px; flex-wrap: wrap; }
.log-tag {
  border-radius: 6px;
  padding: 1px 7px;
  font-size: .74rem;
  font-weight: 650;
}
.log-tag.t-add { background: var(--ok-soft); color: var(--ok); }
.log-tag.t-del { background: var(--err-soft); color: var(--err); }
.log-tag.t-chg { background: var(--warn-soft); color: var(--warn); }
.log-tag.t-ok { background: var(--ok-soft); color: var(--ok); }

.site-rows { display: grid; gap: 2px; }
.site-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--card-border);
  font-size: .86rem;
}
.site-row:last-child { border-bottom: none; }
.site-row .sr-name { font-weight: 700; white-space: nowrap; }
.site-row .sr-url {
  flex: 1;
  min-width: 0;
  color: var(--ink-3);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-tier {
  font-size: .68rem;
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 650;
  background: var(--tile);
  color: var(--ink-3);
}
.sr-tier.core { background: var(--accent-soft); color: var(--accent); }

.btn-mini {
  border: 1px solid var(--card-border);
  border-radius: 9px;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 650;
  color: var(--ink-2);
  background: var(--card);
  transition: all .2s;
  white-space: nowrap;
}
.btn-mini:hover { color: var(--accent); border-color: var(--accent); }
.btn-mini.danger:hover { color: var(--err); border-color: var(--err); background: var(--err-soft); }

.add-form { display: grid; gap: 10px; }
.add-form-row { display: flex; gap: 10px; }
.add-form-row select { width: 130px; }
.add-form input, .add-form select, .admin-login-form input {
  background: var(--tile);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-size: .88rem;
  color: var(--ink);
  min-width: 0;
  width: 100%;
}
.add-form input:focus, .add-form select:focus, .admin-login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.add-form-tip { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }

.bl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px dashed var(--card-border);
  font-size: .86rem;
}
.bl-item:last-child { border-bottom: none; }
.bl-name { font-weight: 700; white-space: nowrap; }
.bl-id { color: var(--ink-3); font-size: .76rem; }
.bl-strikes { display: flex; gap: 4px; }
.bl-strike-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--tile);
  border: 1px solid var(--card-border);
}
.bl-strike-dot.on { background: var(--err); border-color: var(--err); }
.bl-until { flex: 1; text-align: right; color: var(--warn); font-size: .78rem; min-width: 0; }

/* ═══════════ Toast ═══════════ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  font-size: .86rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 11px 22px;
  box-shadow: var(--shadow-2);
  animation: toastIn .3s cubic-bezier(.22, 1, .36, 1);
  max-width: 86vw;
  text-align: center;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 14px); }
}

/* ═══════════ 动画 ═══════════ */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════ 响应式 ═══════════ */
@media (max-width: 680px) {
  .app { padding: 0 14px calc(24px + env(safe-area-inset-bottom)); }
  .topbar-inner { padding: 10px 14px; }
  .brand-slogan { display: none; }
  .hero { padding-top: 24px; }
  .hero-stats { gap: 7px; }
  .grid { grid-template-columns: 1fr; gap: 13px; }
  .help-card { padding: 18px 20px; }
  .admin-overlay { padding: 0; align-items: flex-end; }
  .admin-sheet {
    width: 100%;
    max-height: 92vh;
    border-radius: 26px 26px 0 0;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  }
  .ov-grid { grid-template-columns: 1fr; }
  .add-form-row { flex-direction: column; }
  .add-form-row select { width: 100%; }
}

/* ═══════════ 减少动态 ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
