/* 听书小屋 · 公共样式（手机优先，支持手动主题与系统跟随） */
:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --bg-deep: #ece3d2;
  --card: #fffdf8;
  --ink: #2e2a24;
  --ink-soft: #7a7064;
  --line: #e4dac8;
  --accent: #c0714f;
  --accent-deep: #a35a3b;
  --accent-soft: #f3dfd3;
  --danger: #c2453d;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(84, 62, 38, .10), 0 2px 6px rgba(84, 62, 38, .06);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
          "Microsoft YaHei", sans-serif;
}

/* 无脚本时仍跟随系统；显式选择浅色时不被系统深色覆盖。 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #1c1915;
    --bg-deep: #14120f;
    --card: #26221c;
    --ink: #ece4d6;
    --ink-soft: #a1968a;
    --line: #3a342b;
    --accent: #e0956f;
    --accent-deep: #f0a986;
    --accent-soft: #3d2c22;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1915;
  --bg-deep: #14120f;
  --card: #26221c;
  --ink: #ece4d6;
  --ink-soft: #a1968a;
  --line: #3a342b;
  --accent: #e0956f;
  --accent-deep: #f0a986;
  --accent-soft: #3d2c22;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, var(--accent-soft) 0, transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px;
  border: none; border-radius: 14px;
  font: 600 16px var(--sans); letter-spacing: .05em;
  color: #fff; background: var(--accent);
  box-shadow: 0 6px 16px rgba(192, 113, 79, .28);
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, opacity .2s ease;
}
.btn:hover { background: var(--accent-deep); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }

.btn-ghost {
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line); box-shadow: none;
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-deep); }

.input {
  width: 100%; height: 50px; padding: 0 16px;
  font: 16px var(--sans); color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

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

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
