/* ============================================================================
   随便做做 · ksniganma 的个人站 —— 样式表
   风格：浅色极简 + 大圆角 + 柔和阴影 + 毛玻璃；支持响应式与深色模式。
   字体：系统字体栈，不加载任何外部字体（离线可用，也不拖慢首屏）。
   ========================================================================== */

/* ----------------------------- 设计变量 ----------------------------- */
:root {
  --bg: #f5f6fa;
  --bg-grad-a: #f8f9fd;
  --bg-grad-b: #eceff8;

  --surface: rgba(255, 255, 255, 0.72);        /* 毛玻璃卡片底色 */
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-input: rgba(255, 255, 255, 0.86);

  --text: #12141c;
  --text-2: #5a6373;
  --text-3: #8b94a4;

  --line: rgba(17, 20, 30, 0.08);
  --line-strong: rgba(17, 20, 30, 0.14);

  --accent: #3b5bfd;
  --accent-2: #7b5cff;
  --accent-soft: rgba(59, 91, 253, 0.1);
  --ok: #1fbf7a;
  --warn: #f0a33b;
  --danger: #ef4d67;

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius: 16px;
  --radius-sm: 12px;

  --shadow-soft: 0 1px 2px rgba(18, 22, 34, 0.04), 0 14px 30px -14px rgba(18, 22, 34, 0.18);
  --shadow-lift: 0 2px 6px rgba(18, 22, 34, 0.05), 0 30px 54px -24px rgba(18, 22, 34, 0.3);
  --shadow-modal: 0 40px 100px -34px rgba(10, 14, 26, 0.5), 0 0 0 1px rgba(17, 20, 30, 0.06);

  --ease-out: cubic-bezier(0.22, 0.85, 0.24, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* 深色模式：同一套设计，仅替换色板 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090b10;
    --bg-grad-a: #0c0f16;
    --bg-grad-b: #06080c;

    --surface: rgba(255, 255, 255, 0.045);
    --surface-strong: rgba(28, 32, 42, 0.9);
    --surface-input: rgba(255, 255, 255, 0.05);

    --text: #eef1f7;
    --text-2: #a2abbd;
    --text-3: #7b8598;

    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);

    --accent: #7f96ff;
    --accent-2: #a68cff;
    --accent-soft: rgba(127, 150, 255, 0.14);

    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 34px -18px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 8px rgba(0, 0, 0, 0.45), 0 34px 60px -28px rgba(0, 0, 0, 0.85);
    --shadow-modal: 0 40px 100px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}

/* ----------------------------- 基础重置 ----------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 620px at 12% -8%, rgba(196, 208, 255, 0.5), transparent 62%),
    radial-gradient(900px 520px at 92% 4%, rgba(255, 214, 231, 0.42), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-a), var(--bg-grad-b));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ----------------------------- 背景层 ----------------------------- */
/* 三层结构：bg-photo（照片）→ bg-veil（柔光遮罩）→ blob（彩色光斑） */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* 照片层：铺满整屏，轻微模糊即可（有遮罩兜着，不需要糊成一片） */
.bg-photo {
  position: absolute;
  inset: -2%;
  background-image: url("/bg.jpg");
  background-repeat: no-repeat;
  background-position: 58% 44%;
  background-size: cover;
  filter: blur(1.2px) saturate(1.1) contrast(1.02);
  transform: scale(1.02);
}

/* 柔光遮罩：中间最轻（卡片自带毛玻璃），上下各收一点，保证标题和页脚可读 */
.bg-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(250, 251, 255, 0.34) 0%,
    rgba(249, 250, 254, 0.2) 22%,
    rgba(248, 249, 253, 0.14) 48%,
    rgba(247, 248, 252, 0.4) 100%
  );
}

@media (prefers-color-scheme: dark) {
  .bg-photo {
    filter: blur(2.5px) brightness(0.46) saturate(1.12);
  }

  .bg-veil {
    background:
      linear-gradient(
        180deg,
        rgba(8, 10, 15, 0.88) 0%,
        rgba(8, 10, 15, 0.7) 24%,
        rgba(8, 10, 15, 0.6) 52%,
        rgba(8, 10, 15, 0.88) 100%
      ),
      radial-gradient(1000px 560px at 50% -10%, rgba(60, 74, 120, 0.28), transparent 70%);
  }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.24;
}

.blob-a {
  width: 540px;
  height: 540px;
  top: -200px;
  left: -160px;
  background: radial-gradient(circle at 35% 35%, #c4d1ff, #eef3ff 72%);
  animation: drift 22s var(--ease-out) infinite alternate;
}

.blob-b {
  width: 460px;
  height: 460px;
  top: 90px;
  right: -180px;
  background: radial-gradient(circle at 60% 40%, #ffd9e8, #fff4f8 72%);
  animation: drift 26s var(--ease-out) 1.5s infinite alternate-reverse;
}

.blob-c {
  width: 620px;
  height: 620px;
  bottom: -340px;
  left: 34%;
  background: radial-gradient(circle at 50% 50%, #d9efff, #f2f8ff 72%);
  animation: drift 30s var(--ease-out) 0.8s infinite alternate;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(24px, -18px, 0) scale(1.08);
  }
}

@media (prefers-color-scheme: dark) {
  .blob {
    opacity: 0.28;
  }
  .blob-a {
    background: radial-gradient(circle at 35% 35%, #24357a, #0c1020 72%);
  }
  .blob-b {
    background: radial-gradient(circle at 60% 40%, #4a2340, #0d0a12 72%);
  }
  .blob-c {
    background: radial-gradient(circle at 50% 50%, #10314a, #0a1119 72%);
  }
}

/* ----------------------------- 页面容器 ----------------------------- */
.page {
  width: min(1040px, 100% - 48px);
  margin-inline: auto;
  padding-bottom: 56px;
}

/* ----------------------------- 顶部标题 ----------------------------- */
.hero {
  padding-block: clamp(52px, 9vh, 104px) clamp(8px, 2vh, 16px);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.title {
  font-size: clamp(2.7rem, 7.4vw, 4.3rem);
  font-weight: 720;
  line-height: 1.04;
  letter-spacing: -0.045em;
  background: linear-gradient(175deg, var(--text) 20%, var(--text-2) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin-top: 10px;
  padding-left: 2px;
  font-size: clamp(0.92rem, 2.4vw, 1.02rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

/* 直接压在照片上的文字，加一层极淡的白色光晕，复杂背景上也看得清 */
.subtitle,
.hero-desc {
  text-shadow:
    0 0 3px rgba(255, 255, 255, 0.92),
    0 1px 2px rgba(255, 255, 255, 0.8),
    0 2px 14px rgba(255, 255, 255, 0.55);
}

@media (prefers-color-scheme: dark) {
  .subtitle,
  .hero-desc {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  }
}

.hero-desc {
  max-width: 34em;
  margin-top: clamp(20px, 3vh, 28px);
  font-size: 0.97rem;
  line-height: 1.85;
  color: var(--text-2);
}

/* 在线状态小胶囊 */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-top: 8px;
  padding: 8px 14px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.4s ease, border-color 0.4s ease;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 0 rgba(31, 191, 122, 0.45);
  transition: background 0.4s ease;
}

.live-pill[data-state="online"] .live-dot {
  background: var(--ok);
  animation: pulse 2.4s var(--ease-out) infinite;
}

.live-pill[data-state="online"] .live-text {
  color: var(--text);
}

.live-pill[data-state="offline"] .live-dot {
  background: var(--danger);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 191, 122, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(31, 191, 122, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 191, 122, 0);
  }
}

/* ----------------------------- 区块标题 ----------------------------- */
.section {
  margin-top: clamp(40px, 6.5vh, 68px);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-left: 2px;
}

.section-head h2 {
  position: relative;
  padding-left: 14px;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform: translateY(-50%);
}

.section-note {
  padding: 4px 11px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  font-size: 0.78rem;
  color: #5d6879;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .section-note {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-3);
  }
}

/* ----------------------------- 链接卡片 ----------------------------- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out),
    border-color 0.4s ease, background 0.4s ease;
}

.link-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px 180px at 12% 0%, rgba(255, 255, 255, 0.55), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.link-card:hover::after {
  opacity: 1;
}

.link-card:active {
  transform: translateY(-1px) scale(0.995);
}

.card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 11px;
  border-radius: 15px;
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(18, 22, 34, 0.6);
}

.link-card[data-brand="bilibili"] .card-icon {
  background: linear-gradient(145deg, #ff92b2, #fb5d8b);
}

.link-card[data-brand="github"] .card-icon {
  background: linear-gradient(145deg, #4a5160, #16191f);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-title {
  font-size: 1.06rem;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.card-sub {
  font-size: 0.79rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-3);
  transition: transform 0.4s var(--ease-out), color 0.3s ease, border-color 0.3s ease,
    background 0.3s ease;
}

.link-card:hover .card-arrow {
  transform: translate(2px, -2px);
  color: var(--accent);
  border-color: rgba(59, 91, 253, 0.3);
  background: var(--accent-soft);
}

/* ----------------------------- 状态卡片 ----------------------------- */
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out),
    border-color 0.35s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-2);
}

.stat-extra {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  white-space: nowrap;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-height: 46px;
}

.stat-number {
  font-size: clamp(2rem, 4.6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-3);
}

.stat-value--text {
  min-height: 46px;
  align-items: center;
}

.stat-text {
  font-size: clamp(1.5rem, 3.6vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(160deg, var(--text) 30%, var(--accent-2) 165%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 进度条 */
.bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 20, 30, 0.06);
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .bar {
    background: rgba(255, 255, 255, 0.07);
  }
}

.bar--slim {
  height: 5px;
}

.bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px -2px rgba(59, 91, 253, 0.55);
  transition: width 0.9s var(--ease-out), background 0.5s ease;
}

.bar-fill--net {
  background: linear-gradient(90deg, #35c7c0, #3b5bfd 60%, #7b5cff);
  opacity: 0.85;
}

/* 数值偏高时换色，一眼看出压力 */
.bar-fill.is-warn {
  background: linear-gradient(90deg, #ffc46b, var(--warn));
  box-shadow: 0 0 12px -2px rgba(240, 163, 59, 0.55);
}

.bar-fill.is-danger {
  background: linear-gradient(90deg, #ff8fa1, var(--danger));
  box-shadow: 0 0 12px -2px rgba(239, 77, 103, 0.5);
}

.stat-foot {
  margin-top: auto;
  font-size: 0.76rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-foot.is-warn {
  color: var(--warn);
  white-space: normal;
}

/* 网络两行 */
.net-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.net-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.net-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-2);
}

.net-arrow {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.net-arrow.up {
  color: #1f9d8f;
  background: rgba(31, 157, 143, 0.12);
}

.net-arrow.down {
  color: var(--accent);
  background: var(--accent-soft);
}

.net-val {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ----------------------------- 管理员面板 ----------------------------- */
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-card {
  gap: 13px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-meta {
  font-size: 0.74rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* 进程 / 服务 切换 */
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(17, 20, 30, 0.06);
}

.segmented-btn {
  padding: 6px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.segmented-btn.is-active {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(18, 22, 34, 0.08);
}

.ghost-btn--sm {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
}

/* 进程 / 服务 列表 */
.inv-list {
  display: flex;
  flex-direction: column;
  max-height: 322px;
  padding: 6px 6px 6px 2px;
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.inv-list::-webkit-scrollbar {
  width: 6px;
}

.inv-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(17, 20, 30, 0.16);
}

.inv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 4px;
}

.inv-row + .inv-row {
  border-top: 1px solid rgba(17, 20, 30, 0.045);
}

.inv-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.inv-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-tag {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.inv-path {
  font-family: var(--mono);
  font-size: 0.71rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-value {
  flex: none;
  font-size: 0.78rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.inv-empty {
  padding: 20px 6px;
  font-size: 0.82rem;
  color: var(--text-3);
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(139, 148, 164, 0.16);
  color: var(--text-2);
  font-size: 0.71rem;
  font-weight: 600;
}

.status-pill.is-running {
  background: rgba(31, 191, 122, 0.14);
  color: #17845a;
}

/* AstrBot 卡片 */
.admin-state {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 148, 164, 0.16);
  color: var(--text-2);
  font-size: 0.73rem;
  font-weight: 600;
}

.admin-state[data-state="online"] {
  background: rgba(31, 191, 122, 0.14);
  color: #17845a;
}

.admin-state[data-state="offline"] {
  background: rgba(239, 77, 103, 0.12);
  color: var(--danger);
}

.astrbot-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.astrbot-line {
  font-size: 1.02rem;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.astrbot-sub {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-3);
  word-break: break-all;
}

/* AstrBot 状态明细 */
.astrbot-meta {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-top: 1px solid var(--line);
}

.astrbot-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
}

.astrbot-meta-row + .astrbot-meta-row {
  border-top: 1px solid rgba(17, 20, 30, 0.045);
}

.astrbot-meta-row dt {
  flex: none;
  font-size: 0.78rem;
  color: var(--text-3);
}

.astrbot-meta-row dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

@media (prefers-color-scheme: dark) {
  .astrbot-meta-row + .astrbot-meta-row {
    border-top-color: rgba(255, 255, 255, 0.06);
  }
}


/* 页脚里的登录状态 */
.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 240px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.78rem;
  color: var(--text-2);
}

.session-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(31, 191, 122, 0.18);
}

@media (max-width: 980px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .inv-list {
    max-height: 260px;
  }
  .admin-head {
    align-items: flex-start;
  }
}

@media (prefers-color-scheme: dark) {
  .segmented {
    background: rgba(255, 255, 255, 0.08);
  }
  .inv-row + .inv-row {
    border-top-color: rgba(255, 255, 255, 0.06);
  }
  .inv-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
  }
  .status-pill.is-running,
  .admin-state[data-state="online"] {
    color: #63e0a4;
  }
}

/* ----------------------------- 底部 ----------------------------- */
/* 页脚做成一条毛玻璃条：照片最下面往往是暗部，文字直接压上去会看不清 */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(44px, 7vh, 76px);
  padding: 14px 14px 14px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.footer:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ----------------------------- 按钮 ----------------------------- */
.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out),
    background 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

.primary-btn {
  border: 1px solid transparent;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 26px -14px rgba(59, 91, 253, 0.9);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px -14px rgba(59, 91, 253, 0.85);
}

.primary-btn:active {
  transform: translateY(0) scale(0.985);
}

.primary-btn:disabled {
  cursor: progress;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.primary-btn.is-authed {
  background: linear-gradient(140deg, #17b978, #0f9d8a);
  box-shadow: 0 12px 26px -14px rgba(15, 157, 138, 0.9);
}

.btn-arrow {
  width: 14px;
  height: 14px;
  flex: none;
}

.ghost-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
}

.ghost-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface);
}

/* ----------------------------- 弹窗 ----------------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 28, 0.3);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  animation: fade-in 0.28s ease both;
}

@media (prefers-color-scheme: dark) {
  .modal-backdrop {
    background: rgba(0, 0, 0, 0.55);
  }
}

.modal {
  position: relative;
  width: min(430px, 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: var(--surface-strong);
  box-shadow: var(--shadow-modal);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  overflow: hidden;
  animation: pop-in 0.36s var(--ease-spring) both;
}

@media (prefers-color-scheme: dark) {
  .modal {
    border-color: rgba(255, 255, 255, 0.1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* macOS 风格标题栏 */
.modal-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.16));
}

@media (prefers-color-scheme: dark) {
  .modal-bar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  }
}

.traffic {
  display: inline-flex;
  gap: 8px;
}

.traffic i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}

.t-red {
  background: #ff5f57;
}
.t-yellow {
  background: #febc2e;
}
.t-green {
  background: #28c840;
}

.modal-bar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-2);
}

.modal-close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: auto;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.modal-close:hover {
  background: rgba(17, 20, 30, 0.06);
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  .modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 26px 26px;
}

.modal-title {
  font-size: 1.24rem;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.modal-desc {
  margin-top: -8px;
  font-size: 0.83rem;
  line-height: 1.7;
  color: var(--text-2);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-input);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.field-input::placeholder {
  color: var(--text-3);
}

.field-input:focus {
  outline: none;
  border-color: rgba(59, 91, 253, 0.55);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface-strong);
}

.code-row {
  display: flex;
  gap: 10px;
}

.code-input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-align: center;
  text-indent: 0.34em;
}

/* 占位符不要跟着数字间的字距一起拉开，否则中文会被拉得很散 */
.code-input::placeholder {
  letter-spacing: 0.02em;
  font-family: var(--font);
  font-weight: 500;
  text-indent: 0;
}

.send-btn {
  flex: none;
  padding: 0 16px;
  border: 1px solid rgba(59, 91, 253, 0.22);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.send-btn:hover:not(:disabled) {
  background: rgba(59, 91, 253, 0.16);
  border-color: rgba(59, 91, 253, 0.4);
}

.send-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
}

.modal-msg {
  min-height: 1.25em;
  margin-top: -4px;
  font-size: 0.79rem;
  line-height: 1.6;
  color: var(--text-3);
  transition: color 0.25s ease;
}

.modal-msg[data-tone="ok"] {
  color: var(--ok);
}

.modal-msg[data-tone="error"] {
  color: var(--danger);
}

.modal-msg[data-tone="hint"] {
  color: var(--warn);
}

.submit-btn {
  width: 100%;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 14px 30px -16px rgba(59, 91, 253, 0.9);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out),
    opacity 0.25s ease, filter 0.25s ease;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px -16px rgba(59, 91, 253, 0.85);
}

.submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.submit-btn.is-busy {
  cursor: progress;
  opacity: 0.75;
}

.modal-hint {
  font-size: 0.73rem;
  text-align: center;
  color: var(--text-3);
}

/* ----------------------------- 轻提示 ----------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 90;
  max-width: calc(100vw - 48px);
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-lift);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  font-size: 0.84rem;
  color: var(--text);
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: transform 0.4s var(--ease-out), opacity 0.4s var(--ease-out);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ----------------------------- 入场动画 ----------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ----------------------------- 响应式 ----------------------------- */
@media (max-width: 760px) {
  .page {
    width: min(100% - 32px, 620px);
    padding-bottom: 40px;
  }

  .hero {
    padding-block: clamp(40px, 8vh, 72px) 8px;
  }

  .hero-top {
    flex-direction: column;
    gap: 14px;
  }

  .live-pill {
    margin-top: 0;
  }

  .link-grid,
  .status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .link-card {
    padding: 18px;
  }

  .stat-card {
    padding: 20px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-actions {
    width: 100%;
    justify-content: space-between;
  }

  .primary-btn {
    padding: 12px 20px;
  }

  .modal-body {
    padding: 20px 20px 22px;
  }
}

@media (max-width: 400px) {
  .title {
    font-size: 2.45rem;
  }

  .card-sub {
    display: none;
  }

  .net-val {
    font-size: 0.84rem;
  }

  .send-btn {
    padding: 0 12px;
    font-size: 0.76rem;
  }
}

/* ----------------------------- 减弱动效 ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================================
   多页面（分屏）布局：每次只显示一屏，靠顶部标签切换，不用往下滑
   ========================================================================== */

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(1080px, 100% - 48px);
  min-height: 100dvh;
  margin-inline: auto;
  padding-bottom: 26px;
}

/* ----------------------------- 顶栏 ----------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 20px 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 18px -10px rgba(59, 91, 253, 0.9);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-mark rect {
  display: none;
}

.brand-mark path {
  fill: none;
  stroke: #fff;
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-text {
  opacity: 0.9;
}

/* 页面切换标签 */
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

.tab {
  padding: 8px 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(18, 22, 34, 0.1);
}

.topbar-side {
  display: flex;
  align-items: center;
}

/* ----------------------------- 分屏容器 ----------------------------- */
.screens {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: clamp(16px, 4vh, 40px);
}

.screen {
  width: 100%;
}

.screen[hidden] {
  display: none;
}

.screen-in {
  animation: screen-in 0.45s var(--ease-out) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 每个分屏的小标题 */
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-left: 2px;
}

.page-head h2 {
  position: relative;
  padding-left: 14px;
  font-size: 1.12rem;
  font-weight: 680;
  letter-spacing: 0.01em;
}

.page-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform: translateY(-50%);
}

/* ----------------------------- 首页 ----------------------------- */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  gap: clamp(26px, 5vw, 72px);
  align-items: center;
}

.home-intro .title {
  font-size: clamp(3rem, 8vw, 5.1rem);
}

.home-intro .hero-desc {
  margin-top: clamp(16px, 2.6vh, 24px);
}

.home-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.home-links-note {
  align-self: flex-end;
  margin: 0 2px 2px 0;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  font-size: 0.76rem;
  color: #5d6879;
  letter-spacing: 0.02em;
}

@media (prefers-color-scheme: dark) {
  .home-links-note {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-3);
  }
}

/* ----------------------------- 页脚 ----------------------------- */
.footer {
  margin-top: auto;
}

/* 管理员列表在分屏里给固定高度，超出由卡片自己滚动 */
.inv-list {
  max-height: clamp(170px, 44vh, 420px);
}

/* ----------------------------- 分屏响应式 ----------------------------- */
@media (max-width: 860px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .home-links-note {
    text-align: left;
  }

  .screens {
    align-items: flex-start;
    padding-block: 6px 18px;
  }

  .page-head {
    margin-bottom: 14px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 28px, 560px);
  }

  .topbar {
    flex-wrap: wrap;
    row-gap: 10px;
    padding-block: 14px 2px;
  }

  .tabs {
    order: 3;
    width: 100%;
    justify-content: stretch;
  }

  .tab {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .home-intro .title {
    font-size: clamp(2.6rem, 13vw, 3.4rem);
  }

  .inv-list {
    max-height: 30vh;
  }

  .admin-card {
    padding: 14px 15px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }

  .footer-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-color-scheme: dark) {
  .tab.is-active {
    background: rgba(255, 255, 255, 0.12);
  }
}


/* ----------------------------- 手机端：状态卡片压缩成两列 ----------------------------- */
@media (max-width: 640px) {
  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stat-card {
    gap: 8px;
    padding: 14px 15px;
  }

  .stat-label {
    font-size: 0.74rem;
  }

  .stat-extra {
    font-size: 0.66rem;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .stat-text {
    font-size: 1.3rem;
  }

  .stat-value {
    min-height: 34px;
  }

  .stat-foot {
    font-size: 0.66rem;
  }

  .net-rows {
    gap: 3px;
    margin-top: 0;
  }

  .net-row {
    gap: 6px;
  }

  .net-key,
  .net-val {
    font-size: 0.76rem;
  }

  .net-arrow {
    width: 15px;
    height: 15px;
    font-size: 0.64rem;
  }

  .bar {
    height: 6px;
  }

  .admin-grid {
    gap: 12px;
  }

  .astrbot-meta-row {
    padding: 6px 2px;
  }
}


/* ============================================================================
   正在听：音乐卡片
   ========================================================================== */

.music-card {
  width: min(680px, 100%);
  margin-inline: auto;
  padding: clamp(18px, 3.4vh, 26px) clamp(18px, 3vw, 28px) clamp(14px, 2.6vh, 18px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

.music-body {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 26px);
}

/* --- 封面 --- */
.music-cover {
  position: relative;
  flex: none;
  width: clamp(96px, 14vw, 138px);
  height: clamp(96px, 14vw, 138px);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(59, 91, 253, 0.78), rgba(122, 90, 248, 0.88));
  box-shadow: 0 18px 34px -22px rgba(28, 34, 58, 0.75), 0 2px 0 rgba(255, 255, 255, 0.5) inset;
}

.music-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-cover-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
}

.music-cover-ph svg {
  width: 42%;
  height: 42%;
}

/* --- 文字 --- */
.music-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.music-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1.25;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.music-artist {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-3);
  min-height: 18px;
}

.music-status-text {
  letter-spacing: 0.02em;
}

.music-src {
  padding-left: 8px;
  border-left: 1px solid var(--line);
  color: var(--text-3);
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 音波：播放时跳动，暂停时静止 */
.music-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 13px;
}

.music-eq i {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: var(--ok);
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

.music-card[data-state="playing"] .music-eq i {
  opacity: 1;
  animation: music-eq 1.05s ease-in-out infinite;
}

.music-card[data-state="playing"] .music-eq i:nth-child(2) {
  animation-delay: 0.18s;
}

.music-card[data-state="playing"] .music-eq i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes music-eq {
  0%, 100% { height: 4px; }
  35% { height: 12px; }
  65% { height: 7px; }
}

/* --- 进度条 --- */
.music-progress {
  margin-top: clamp(14px, 2.6vh, 20px);
}

.music-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(17, 20, 30, 0.08);
  overflow: hidden;
}

.music-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.45s var(--ease-out);
}

/* 没有真实进度时：跑一段来回的「假装进度」 */
.music-bar.is-fake .music-bar-fill {
  width: 34%;
  transition: none;
  animation: music-bar-fake 2.6s ease-in-out infinite;
}

@keyframes music-bar-fake {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

.music-times {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-3);
}

/* 底部那行来源说明，和进度条拉开一点距离 */
.music-card .stat-foot {
  margin-top: 14px;
  opacity: 0.8;
}

/* --- 切歌淡入淡出 --- */
.music-cover-img,
.music-title,
.music-artist {
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.music-card.is-swapping .music-cover-img,
.music-card.is-swapping .music-title,
.music-card.is-swapping .music-artist {
  opacity: 0;
  transform: translateY(6px);
}

/* 没在播时：进度条和音波都收起来，只留一句「暂时安静」 */
.music-card[data-state="idle"] .music-progress,
.music-card[data-state="idle"] .music-eq {
  display: none;
}

/* 没在播时整体收敛一点 */
.music-card[data-state="idle"] .music-title {
  color: var(--text-2);
  font-weight: 600;
}

.music-card[data-state="idle"] .music-cover {
  box-shadow: 0 12px 26px -22px rgba(28, 34, 58, 0.6);
}

@media (max-width: 640px) {
  .music-card {
    padding: 16px 16px 12px;
  }

  .music-cover {
    width: 88px;
    height: 88px;
    border-radius: 14px;
  }

  .music-title {
    font-size: 1.1rem;
  }

  .music-artist {
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .music-card[data-state="playing"] .music-eq i {
    animation: none;
    height: 9px;
  }

  .music-bar.is-fake .music-bar-fill {
    animation-duration: 4s;
  }
}

@media (prefers-color-scheme: dark) {
  .music-bar {
    background: rgba(255, 255, 255, 0.12);
  }
}


