/* ListeningMate · 设计系统
   风格：夜间电台 / 编辑部排版。深墨绿底 + 暖米色文字 + 酸性柠檬高亮。 */

@font-face {
  font-family: 'Fraunces';
  src: url('./fonts/fraunces-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('./fonts/fraunces-latin-wght-italic.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #0a0e0c;
  --bg-2: #0d1310;
  --surface: #121a15;
  --surface-2: #17211b;
  --surface-3: #1d2820;
  --line: rgba(236, 230, 217, 0.09);
  --line-strong: rgba(236, 230, 217, 0.18);
  --ink: #ece6d9;
  --ink-2: #a9b4ab;
  --ink-3: #6f7d73;
  --accent: #d8f75f;
  --accent-ink: #0a0e0c;
  --accent-soft: rgba(216, 247, 95, 0.12);
  --amber: #e8a33d;
  --danger: #ff7062;
  --ok: #71d69a;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-ui: 'Avenir Next', 'Segoe UI Variable Text', 'Segoe UI', system-ui, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Consolas, 'Liberation Mono', monospace;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 18px 50px -24px rgba(0, 0, 0, 0.9);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #f5f1e6;
  --bg-2: #efe9db;
  --surface: #fffdf5;
  --surface-2: #f7f2e5;
  --surface-3: #ece6d6;
  --line: rgba(23, 29, 24, 0.12);
  --line-strong: rgba(23, 29, 24, 0.24);
  --ink: #141a15;
  --ink-2: #556057;
  --ink-3: #8a938a;
  --accent: #4f6d00;
  --accent-ink: #f7fbe8;
  --accent-soft: rgba(133, 173, 20, 0.16);
  --amber: #a8641a;
  --danger: #c0392b;
  --ok: #1f7a4a;
  --shadow-2: 0 20px 45px -30px rgba(20, 26, 21, 0.5);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 作者样式里的 display 会盖掉浏览器默认的 [hidden]，这里强制生效 */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* 氛围：极光 + 纸纹 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 8% -8%, rgba(216, 247, 95, 0.09), transparent 62%),
    radial-gradient(48rem 34rem at 92% 4%, rgba(232, 163, 61, 0.08), transparent 60%),
    radial-gradient(70rem 50rem at 50% 108%, rgba(113, 214, 154, 0.06), transparent 60%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme='light'] body::after {
  opacity: 0.05;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- 通用排版 ---------------- */

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  font-variation-settings: 'SOFT' 30, 'WONK' 1, 'opsz' 40;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.muted {
  color: var(--ink-2);
}

.faint {
  color: var(--ink-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, 44px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  align-self: center;
  animation: pulse 3.6s var(--ease) infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(216, 247, 95, 0.04);
  }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.points-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}

.points-pill b {
  color: var(--accent);
  font-weight: 600;
}

.user-chip {
  font-size: 12.5px;
  color: var(--ink-2);
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px 14px;
  }
  .topbar-right {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .topbar-right .btn {
    padding: 6px 9px;
    font-size: 12px;
  }
  .user-chip {
    display: none;
  }
  .brand-sub {
    display: none;
  }
}

@media (max-width: 520px) {
  .points-pill {
    display: none;
  }
  .brand-name {
    font-size: 17px;
  }
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease),
    color 0.18s var(--ease);
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, white);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-ghost {
  border-color: transparent;
  color: var(--ink-2);
  padding: 7px 12px;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: transparent;
}

.btn-sm {
  padding: 6px 13px;
  font-size: 12.5px;
}

.btn-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  color: var(--ink-2);
}

.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.icon-btn.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* ---------------- 表单 ---------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > label {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-3);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}

.textarea {
  resize: vertical;
  min-height: 78px;
  line-height: 1.6;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a938a' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}

/* ---------------- 徽标 / 标签 ---------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.chip-diff {
  border-color: color-mix(in srgb, var(--amber) 45%, transparent);
  color: var(--amber);
}

.chip-free {
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  color: var(--ok);
}

.chip-paid {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.chip-tag {
  cursor: pointer;
  transition: all 0.16s var(--ease);
}

.chip-tag:hover,
.chip-tag.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------------- 提示 ---------------- */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  font-size: 13px;
  box-shadow: var(--shadow-2);
  animation: toast-in 0.28s var(--ease);
  max-width: min(88vw, 460px);
}

.toast.is-error {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--danger);
}

.toast.is-ok {
  border-color: color-mix(in srgb, var(--ok) 55%, transparent);
  color: var(--ok);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ---------------- 空态 / 载入 ---------------- */

.empty {
  padding: 72px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-3);
}

.empty .display {
  font-size: 24px;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.hidden {
  display: none !important;
}

.fade-up {
  animation: fade-up 0.5s var(--ease) both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 99px;
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------- 通用弹窗（改密等） ---------------- */

.modal {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  width: min(460px, calc(100vw - 32px));
  box-shadow: var(--shadow-2);
}

.modal::backdrop {
  background: rgba(4, 7, 5, 0.68);
  backdrop-filter: blur(3px);
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-height: 86vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 {
  margin: 0;
  font-size: 21px;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.modal-foot .spacer {
  flex: 1;
}

.hint {
  font-size: 11.5px;
  color: var(--ink-3);
}
