/* =========================================================
   三柒的小窝 · 新版界面
   1) 设计令牌 / 主题
   2) 背景层（照片 + 极光 + 颗粒）
   3) 顶栏 / 主区 / 卡片 / 侧栏
   4) 抽屉 / 搜索面板 / 灯箱 / 播放器 / 欢迎页 / Toast
   5) 响应式与动效降级
   ========================================================= */

/* ---------- 1. 令牌 ---------- */
:root {
  --bg: #070910;
  --text: #e8ecf6;
  --muted: #94a0b4;
  --dim: #6b7688;
  --line: rgba(255, 255, 255, .14);
  --line-strong: rgba(255, 255, 255, .16);
  --panel: rgba(10, 14, 24, .58);
  --panel-2: rgba(22, 28, 44, .72);
  --panel-hover: rgba(18, 24, 38, .72);
  --brand-1: #7c6cff;
  --brand-2: #22d3ee;
  --brand-3: #f472b6;
  --ok: #34d399;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --veil-a: rgba(7, 9, 16, .60);
  --veil-b: rgba(7, 9, 16, .92);
  --aurora-op: .52;
  --photo-op: .62;
  --photo-blur: 16px;
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22, .68, .3, 1);
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html[data-theme="light"] {
  --veil-a: rgba(255, 255, 255, .30);
  --veil-b: rgba(238, 241, 248, .80);
  --aurora-op: .42;
  --photo-op: .55;
  --photo-blur: 18px;
  --bg: #eef1f8;
  --text: #0e1526;
  --muted: #57627a;
  --dim: #7b869c;
  --line: rgba(14, 21, 38, .09);
  --line-strong: rgba(14, 21, 38, .16);
  --panel: rgba(255, 255, 255, .86);
  --panel-2: rgba(255, 255, 255, .95);
  --panel-hover: rgba(255, 255, 255, .98);
  --shadow: 0 18px 50px rgba(30, 41, 80, .16);
}

@media (prefers-color-scheme: light) {
  html[data-theme="auto"] {
    --veil-a: rgba(255, 255, 255, .30);
    --veil-b: rgba(238, 241, 248, .80);
    --aurora-op: .42;
    --photo-op: .55;
  --photo-blur: 18px;
    --bg: #eef1f8;
    --text: #0e1526;
    --muted: #57627a;
    --dim: #7b869c;
    --line: rgba(14, 21, 38, .09);
    --line-strong: rgba(14, 21, 38, .16);
    --panel: rgba(255, 255, 255, .86);
    --panel-2: rgba(255, 255, 255, .95);
    --panel-hover: rgba(255, 255, 255, .98);
    --shadow: 0 18px 50px rgba(30, 41, 80, .16);
  }
}

/* ---------- 基础 ---------- */
/* div 上设了 display 会覆盖 [hidden]，这里显式兜底 */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; display: block; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
kbd {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .78em;
  padding: .15em .45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel-2);
}
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; border-radius: 8px; }

/* ---------- 2. 背景 ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-photo {
  position: absolute; inset: -12%;
  background-size: cover; background-position: center;
  opacity: var(--photo-op);
  filter: blur(var(--photo-blur)) saturate(112%);
  transform: scale(1.06);
}
/* 不再叠加任何蒙版，只保留虚化后的照片 */
.bg-veil { display: none; }
.bg-aurora { position: absolute; inset: 0; filter: blur(80px); opacity: var(--aurora-op); }
.bg-aurora i {
  position: absolute; display: block; border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift 26s ease-in-out infinite alternate;
}
.bg-aurora i:nth-child(1) { width: 46vw; height: 46vw; left: -8vw; top: -10vw; background: radial-gradient(circle, rgba(124,108,255,.55), transparent 65%); }
.bg-aurora i:nth-child(2) { width: 40vw; height: 40vw; right: -6vw; top: 4vh; background: radial-gradient(circle, rgba(34,211,238,.42), transparent 65%); animation-delay: -8s; }
.bg-aurora i:nth-child(3) { width: 36vw; height: 36vw; left: 32vw; bottom: -18vw; background: radial-gradient(circle, rgba(244,114,182,.34), transparent 65%); animation-delay: -15s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, 4vh, 0) scale(1.12); }
}
.bg-grain {
  position: absolute; inset: 0; opacity: .05; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.7) .5px, transparent .5px);
  background-size: 3px 3px;
}

/* ---------- 3. 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px clamp(16px, 4vw, 40px);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-avatar {
  width: 40px; height: 40px; border-radius: 13px;
  background-size: cover; background-position: center;
  border: 1px solid var(--line-strong);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  flex: none;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: .2px; white-space: nowrap; }
.brand-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.chip-live i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(52,211,153,.7); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
  70% { box-shadow: 0 0 0 7px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border-radius: 11px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); transition: .25s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.i-moon { display: none; }
html[data-theme="light"] .i-sun { display: none; }
html[data-theme="light"] .i-moon { display: block; }
@media (prefers-color-scheme: light) {
  html[data-theme="auto"] .i-sun { display: none; }
  html[data-theme="auto"] .i-moon { display: block; }
}

/* ---------- 主区 ---------- */
.wrap {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 40px) 56px;
}

/* Hero */
.hero { padding: 8px 0 0; }
.hero-left { min-width: 0; }
.hero-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end; gap: 14px 24px;
  margin-top: 18px;
}
.hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 0; }
.hero-tags {
  display: grid;
  grid-auto-flow: column;                    /* 先竖着填满两行，再往右长 */
  grid-template-rows: repeat(2, minmax(0, max-content));
  grid-auto-columns: max-content;
  justify-content: start;
  gap: 8px; align-content: end;
  overflow-x: auto; scrollbar-width: none;
  max-width: 100%;
}
.hero-tags::-webkit-scrollbar { display: none; }
.hero-user {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12.5px; color: #f2f7ff; font-weight: 500;
  margin-bottom: 4px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand-2) 35%, transparent);
  background: var(--panel);
  text-shadow: 0 0 12px rgba(34, 211, 238, .6), 0 0 22px rgba(124, 108, 255, .35);
}
.hero-user svg { width: 13px; height: 13px; color: var(--brand-2); stroke-width: 1.8; }
.hero-clock {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  text-align: right; color: var(--muted); font-variant-numeric: tabular-nums;
}
.hero-clock b { display: block; font-size: 30px; font-weight: 700; letter-spacing: .02em; color: var(--text); line-height: 1.15; }
.hero-clock span { font-size: 12px; }
.clock-weather {
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--text);
  border: 1px solid var(--line); background: var(--panel); width: fit-content;
}
.clock-weather .cw-icon { font-size: 14px; line-height: 1; }
.clock-weather .cw-temp { font-variant-numeric: tabular-nums; font-weight: 600; }
.clock-weather .cw-desc { color: var(--muted); }
.clock-weather .cw-city { color: var(--dim); font-size: 11px; }
.hero-hello {
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: #e4ecff; margin-bottom: 10px;
  text-shadow: 0 0 12px rgba(124, 108, 255, .85), 0 0 30px rgba(34, 211, 238, .45);
}
.hero-title {
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.05; letter-spacing: -.02em; font-weight: 800;
  background: linear-gradient(100deg, var(--brand-1) 0%, var(--brand-3) 45%, var(--brand-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 30px rgba(124,108,255,.25));
}
.hero-sub { margin-top: 10px; color: var(--muted); font-size: 15px; letter-spacing: .04em; }
html[data-theme="light"] .hero-hello {
  color: #2f3d5a;
  text-shadow: 0 1px 10px rgba(255,255,255,.95), 0 0 22px rgba(124,108,255,.28);
}
html[data-theme="light"] .hero-sub { text-shadow: 0 1px 12px rgba(255,255,255,.9); }
html[data-theme="light"] .panel-head h2 { color: #2b3852; text-shadow: 0 1px 10px rgba(255,255,255,.9); }
html[data-theme="light"] .footer { color: #33405c; text-shadow: 0 1px 10px rgba(255,255,255,.92); }
html[data-theme="light"] .panel-note { color: #4a5876; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.stat {
  min-width: 104px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; gap: 2px;
  backdrop-filter: blur(10px);
}
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat-wide b { background: linear-gradient(90deg, var(--brand-2), var(--brand-1)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 公告 */
.notice {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 18px; margin: 14px 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand-1) 14%, transparent), transparent 60%), var(--panel);
  backdrop-filter: blur(12px);
}
.notice-label {
  flex: none; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; color: var(--brand-2);
  border: 1px solid color-mix(in srgb, var(--brand-2) 40%, transparent);
  background: color-mix(in srgb, var(--brand-2) 10%, transparent);
}
.notice-body { font-size: 13.5px; color: var(--muted); }
.notice-body p { margin: 0; }
.notice-body strong { color: var(--text); font-weight: 600; }

/* 布局 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 20px; align-items: start; }
.col-main { display: grid; gap: 20px; min-width: 0; }

/* 分类卡 */
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
.cat {
  position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 14px;
  padding: 18px 18px 42px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
  backdrop-filter: blur(14px);
  cursor: pointer; transition: .3s var(--ease);
  overflow: hidden;
}
.cat::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 10% 0%, color-mix(in srgb, var(--brand-1) 22%, transparent), transparent 55%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.cat:hover, .cat:focus-visible { transform: translateY(-4px); border-color: var(--line-strong); background: var(--panel-hover); box-shadow: var(--shadow); }
.cat:hover::after { opacity: 1; }
.cat:active { transform: translateY(-1px) scale(.995); }
.cat-icon { width: 46px; height: 46px; display: grid; place-items: center; }
.cat-icon svg { width: 34px; height: 34px; stroke: none; fill: currentColor; color: var(--text); opacity: .95; }
.cat-icon svg *, .cat-icon svg path { fill: currentColor !important; stroke: none !important; opacity: 1; }
.cat-main h2 { font-size: 16px; font-weight: 650; letter-spacing: .01em; }
.cat-main p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.cat-peek { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cat-peek span { font-size: 11px; color: var(--muted); border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 2px 9px; }
.cat-peek .peek-empty { color: var(--dim); border-style: dashed; }
.cat-count {
  position: absolute; right: 16px; bottom: 14px;
  font-size: 11px; color: var(--muted); letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.cat-arrow {
  position: absolute; top: 18px; right: 16px; color: var(--dim);
  opacity: 0; transform: translateX(-4px); transition: .3s var(--ease);
}
.cat-arrow svg { width: 16px; height: 16px; }
.cat:hover .cat-arrow { opacity: 1; transform: none; }

/* 侧栏面板 */
.side { display: grid; gap: 14px; }
.panel {
  padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
  backdrop-filter: blur(14px);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head h2 {
  font-size: 13px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: #dce7ff;
  text-shadow: 0 0 10px rgba(34, 211, 238, .55), 0 0 22px rgba(124, 108, 255, .3);
}
.panel-note { font-size: 11.5px; color: #b7c4dc; text-shadow: 0 0 10px rgba(34, 211, 238, .3); }

/* 可滚动区域底部淡出，提示还能往下滚 */
.scroll-fade.is-scrollable {
  -webkit-mask-image: linear-gradient(180deg, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 88%, transparent 100%);
}


/* 时间线 / 访客列表：隐藏系统滚动条，靠底部淡出提示可滚动 */
.timeline, .visitors {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* 旧 Edge */
}
.timeline::-webkit-scrollbar,
.visitors::-webkit-scrollbar { display: none; width: 0; height: 0; }


/* 其余内部滚动容器：一样不显示系统滚动条 */
.drawer-body, .palette-list {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.drawer-body::-webkit-scrollbar,
.palette-list::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* 时间线 */
.timeline {
  list-style: none; margin: 0; padding: 0 0 0 14px; position: relative;
  max-height: 300px; overflow-y: auto;
}
.timeline::before { content: ""; position: absolute; left: 3px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.timeline li { position: relative; padding: 0 0 14px 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -14px; top: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--brand-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 12%, transparent);
}
.tl-date { display: block; font-size: 11px; color: var(--brand-2); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tl-text { display: block; font-size: 13px; color: var(--text); line-height: 1.5; }

/* 标签 */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  transition: .22s var(--ease);
}
.tag:hover { color: var(--text); border-color: color-mix(in srgb, var(--brand-1) 50%, transparent); transform: translateY(-1px); }
.tag.active { color: #fff; background: linear-gradient(120deg, var(--brand-1), var(--brand-2)); border-color: transparent; }

/* 访客 */
.visitors { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.visitors li { display: grid; grid-template-columns: 84px minmax(0,1fr) auto; gap: 6px; font-size: 11.8px; color: var(--muted); align-items: baseline; }
.visitors .ip { color: var(--text); }
.visitors .area { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visitors .ago { color: var(--dim); font-size: 10.5px; white-space: nowrap; }
.visitors b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.visitors .ip { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }

/* 快捷入口 */
.quick { margin-top: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 10px; }
.quick-item {
  display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel);
  transition: .25s var(--ease); cursor: pointer;
}
.quick-item:hover { background: var(--panel-hover); border-color: var(--line-strong); transform: translateY(-2px); }
.quick-item img { width: 24px; height: 24px; border-radius: 6px; flex: none; }
.quick-item span > b { display: block; font-size: 13.5px; font-weight: 600; }
.quick-item span > small { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.qi-ico { width: 24px; height: 24px; display: grid; place-items: center; color: var(--brand-2); flex: none; }
.qi-ico svg { width: 19px; height: 19px; }

/* 页脚 */
.footer {
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 12.5px; color: #c9d6ee;
  text-shadow: 0 0 12px rgba(124, 108, 255, .5), 0 0 26px rgba(34, 211, 238, .22);
}
.footer .dot { opacity: .45; }
.footer .kbd-hint { color: #aebbd4; }
.kbd-hint { margin-left: auto; }

/* ---------- 4. 浮层 ---------- */
/* 分类浮窗（居中玻璃卡片） */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 6, 12, .55);
  backdrop-filter: blur(5px);
  animation: fade .22s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed; z-index: 70;
  left: 50%; top: 50%;
  width: min(720px, 92vw);
  max-height: min(78vh, 720px);
  display: flex; flex-direction: column;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand-1) 10%, transparent), transparent 34%),
    color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  opacity: 0;
  transform: translate(-50%, -46%) scale(.96);
  pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  overflow: hidden;
}
.drawer.open { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.drawer::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-3) 45%, var(--brand-2));
  opacity: .9;
}
.drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px 14px;
}
.drawer-head h2 { font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.drawer-count {
  font-size: 11.5px; color: var(--muted);
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.drawer-head .icon-btn { margin-left: auto; }


.drawer-body {
  padding: 10px 22px 22px; overflow: auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.entry {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel);
  text-align: left; transition: .22s var(--ease);
}
.entry:hover {
  background: var(--panel-hover);
  border-color: color-mix(in srgb, var(--brand-2) 40%, transparent);
  transform: translateY(-2px);
}
.entry-ico {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; background: var(--panel-2); color: var(--brand-2); flex: none;
}
.entry-ico svg { width: 16px; height: 16px; }
.entry-main { flex: 1; min-width: 0; }
.entry-main b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-tag {
  font-size: 10.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--dim); flex: none;
}
.drawer-empty { grid-column: 1 / -1; padding: 34px 0; text-align: center; color: var(--dim); font-size: 13px; }

@media (max-width: 640px) {
  .drawer { width: 92vw; max-height: 76vh; border-radius: 18px; }
  .drawer-head { padding: 14px 15px 9px; gap: 9px; }
  .drawer-head h2 { font-size: 17px; }
  .drawer-count { font-size: 10.5px; padding: 2px 8px; }
  .drawer-body { grid-template-columns: minmax(0, 1fr); padding: 2px 12px 13px; gap: 8px; }
  .entry { padding: 12px 13px; border-radius: 12px; gap: 10px; }
  .entry-main b { font-size: 13.5px; }
  .entry-ico { width: 28px; height: 28px; border-radius: 8px; }
  .entry-ico svg { width: 14px; height: 14px; }
  .entry-tag { font-size: 10px; padding: 2px 8px; }
  .drawer-head .icon-btn { width: 32px; height: 32px; }
}

/* 搜索面板 */
.palette {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: start center; padding-top: 12vh;
  background: rgba(4, 6, 12, .55); backdrop-filter: blur(6px);
  animation: fade .2s var(--ease);
}
.palette-box {
  width: min(620px, 92vw);
  border-radius: 18px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(24px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 74vh;
  animation: pop .22s var(--ease);
}
@keyframes pop { from { transform: translateY(-8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.palette-input svg { width: 17px; height: 17px; color: var(--dim); }
.palette-input input { flex: 1; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; outline: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1 1 auto; }
.palette-list li {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font-size: 13.5px;
}
.palette-list li.active { background: var(--panel-2); }
.palette-list li .p-ico { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--panel-2); color: var(--brand-2); flex: none; }
.palette-list li .p-ico svg { width: 13px; height: 13px; }
.palette-list li small { margin-left: auto; color: var(--dim); font-size: 11.5px; }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--dim); }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 95;
  display: grid; place-items: center; padding: 24px;
  background: rgba(3, 5, 10, .82); backdrop-filter: blur(8px);
  animation: fade .2s var(--ease);
}
.lightbox figure { margin: 0; text-align: center; max-height: 100%; }
.lightbox img { max-height: 74vh; width: auto; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.55); background: #fff; }
.lightbox figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* 音乐 */
.music-panel {
  position: fixed; z-index: 80; right: 20px; bottom: 20px;
  width: min(380px, calc(100vw - 40px));
  padding: 14px; border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  animation: pop .25s var(--ease);
}
.music-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.music-head h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.music-panel { max-height: min(76vh, 640px); display: flex; flex-direction: column; }

/* 正在播放 */
.mp-now { display: flex; align-items: center; gap: 12px; padding: 6px 2px 12px; }
.mp-disc {
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; color: var(--brand-2);
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 50% 50%, var(--panel-2), var(--panel));
  background-size: cover; background-position: center;
}
.mp-disc.has-pic { color: transparent; }
.mp-disc.has-pic::after { content: ""; }
.mp-meta { min-width: 0; }
.mp-meta b { display: block; font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-meta span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }

/* 进度 */
.mp-progress { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.mp-track {
  flex: 1; height: 4px; border-radius: 999px; background: var(--line-strong);
  position: relative; cursor: pointer;
}
.mp-track i {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  border-radius: 999px; background: linear-gradient(90deg, var(--brand-2), var(--brand-1));
}

/* 控制按钮 */
.mp-ctrl { display: flex; align-items: center; gap: 10px; padding: 12px 2px 10px; }
.mp-btn {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  transition: .2s var(--ease);
}
.mp-btn:hover { background: var(--panel-hover); border-color: var(--line-strong); }
.mp-btn svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.mp-play { width: 42px; height: 42px; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); border: 0; color: #0a0e18; }
.mp-play svg { width: 17px; height: 17px; }
.mp-play .i-pause { display: none; }
.mp-play.is-playing .i-play { display: none; }
.mp-play.is-playing .i-pause { display: block; }
.mp-play.is-loading { opacity: .6; }
.mp-play.is-loading svg { animation: mp-pulse 1s ease-in-out infinite; }
@keyframes mp-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.mp-mode { font-size: 14px; line-height: 1; }
.mp-vol { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.mp-vol svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; color: var(--dim); }
.mp-vol input[type="range"] {
  width: 74px; height: 4px; -webkit-appearance: none; appearance: none;
  background: var(--line-strong); border-radius: 999px; outline: none;
}
.mp-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--text); cursor: pointer;
}
.mp-vol input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--text); }

/* 歌单 */
.mp-list {
  list-style: none; margin: 0; padding: 0; overflow-y: auto;
  max-height: 240px; border-top: 1px solid var(--line);
  scrollbar-width: none;
}
.mp-list::-webkit-scrollbar { display: none; }
.mp-list li {
  display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: 8px;
  align-items: center; padding: 8px 6px; border-radius: 10px;
  font-size: 13px; cursor: pointer; color: var(--muted);
}
.mp-list li:hover { background: var(--panel-hover); }
.mp-list li.on { color: var(--text); background: var(--panel-2); }
.mp-list .mp-n { font-size: 11px; color: var(--dim); text-align: center; }
.mp-list .mp-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-list li.on .mp-t { color: var(--brand-2); }
.mp-list .mp-a { font-size: 11px; color: var(--dim); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-hint { display: block !important; text-align: center; color: var(--dim); cursor: default; padding: 16px 6px !important; }


/* 欢迎页 */
.welcome {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px;
  background: radial-gradient(80% 60% at 50% 30%, rgba(124,108,255,.22), transparent 70%), rgba(5, 7, 14, .78);
  backdrop-filter: blur(16px);
  animation: fade .35s var(--ease);
}
.welcome-card {
  width: min(430px, 92vw); text-align: center;
  padding: 36px 30px 28px; border-radius: 24px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  backdrop-filter: blur(24px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .55);
  animation: pop .4s var(--ease);
}
.welcome-logo { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; margin: 0 auto 18px; border: 1px solid var(--line-strong); }
.welcome-card h2 { font-size: 26px; font-weight: 750; letter-spacing: .01em; }
.welcome-card p { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.welcome-btn {
  margin-top: 22px; padding: 11px 34px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: #fff;
  background: linear-gradient(120deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 12px 30px rgba(124, 108, 255, .35);
  transition: .25s var(--ease);
}
.welcome-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(124, 108, 255, .45); }
.welcome-card small { display: block; margin-top: 18px; font-size: 11.5px; color: var(--dim); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 110; padding: 10px 20px; border-radius: 999px;
  font-size: 13px; color: var(--text);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4);
  animation: toastIn .28s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }

/* ---------- 5. 响应式 ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side .panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  /* 背景更虚一点，撑满屏幕 */
  :root { --photo-blur: 22px; --photo-op: .60; }

  body { font-size: 14px; }
  .wrap { padding: 16px 14px 36px; }
  .chip-hide-sm, .brand-text small, .kbd-hint { display: none; }

  /* Hero：标签不显示，统计挤成一行 */
  .hero { padding: 4px 0 0; }
  .hero-row { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
  .hero-tags { display: none; }
  .hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 16px; }
  .stat { min-width: 0; padding: 8px 9px; border-radius: 12px; gap: 1px; }
  .stat b { font-size: 16.5px; }
  .stat span { font-size: 9.5px; letter-spacing: -.01em; }
  .hero-clock { align-items: flex-start; text-align: left; gap: 2px; }
  .hero-clock b { font-size: 25px; }
  .hero-user { font-size: 11.5px; padding: 4px 10px; margin-bottom: 2px; }

  /* 卡片：一行两个，图标在上，文字在下 */
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat {
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 10px 21px; border-radius: 13px;
    min-height: 86px; gap: 4px;
  }
  .cat-icon { width: 26px; height: 26px; }
  .cat-icon svg { width: 22px; height: 22px; }
  .cat-main h2 { font-size: 13.5px; line-height: 1.3; }
  .cat-main p {
    font-size: 10.5px; margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cat-arrow { display: none; }
  .cat-peek { display: none; }
  .cat-count { font-size: 10px; padding: 2px 7px; right: 9px; bottom: 8px; }
  .cat-arrow { width: 22px; height: 22px; right: 8px; bottom: 8px; }

  .notice { padding: 9px 12px; margin: 10px 0 13px; gap: 9px; border-radius: 13px; }
  .notice-body { font-size: 12px; }
  .notice-label { font-size: 10px; padding: 2px 8px; }

  /* 侧栏面板 */
  .side { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .panel { padding: 13px 14px; border-radius: 14px; }
  .panel-head { margin-bottom: 8px; }
  .timeline { max-height: 220px; }
  .visitors { max-height: 220px; }

  /* 快捷入口：两列小格子 */
  .quick { margin-top: 0; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quick-item { padding: 9px 11px; gap: 9px; border-radius: 12px; }
  .quick-item b { font-size: 12.5px; }
  .quick-item small { font-size: 10.5px; }
  .qi-ico { width: 28px; height: 28px; border-radius: 9px; }
  .qi-ico svg { width: 14px; height: 14px; }

  .footer { margin-top: 22px; padding-top: 14px; font-size: 11.5px; }
  .palette { padding-top: 6vh; }
  .music-panel { right: 10px; left: 10px; bottom: 10px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* 播放器加载状态 */
.music-state {
  padding: 18px 4px 6px; font-size: 13px; color: var(--muted); text-align: center;
}
.music-state[hidden] { display: none; }
.mp-retry {
  margin-left: 6px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel-2);
  color: var(--text); font: inherit; font-size: 12px; cursor: pointer;
}
.mp-retry:hover { background: var(--panel-hover); }
