/* ============================================
   PageVoice —— 温柔护眼主题
   ============================================ */

:root {
  /* 浅色（默认） */
  --bg: #fbf7f0;
  --bg-elevated: #ffffff;
  --bg-overlay: rgba(255, 255, 255, 0.78);
  --text: #2a2a2a;
  --text-muted: #6b6358;
  --text-subtle: #948b7d;
  --border: #e8e0d0;
  --primary: #7b9e89;
  --primary-hover: #6a8d78;
  --primary-text: #ffffff;
  --accent: #c18c5d;
  --accent-hover: #a87847;
  --highlight: #ffe9b0;
  --highlight-text: #2a2a2a;
  --shadow-sm: 0 1px 2px rgba(60, 50, 30, 0.06);
  --shadow-md: 0 4px 12px rgba(60, 50, 30, 0.10);
  --shadow-lg: 0 12px 32px rgba(60, 50, 30, 0.14);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --font-size-base: 18px;
  --font-size-lg: 20px;
  --font-size-sm: 15px;
  --line-height: 1.8;
  --letter-spacing: 0.02em;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #1f1b16;
  --bg-elevated: #2a251f;
  --bg-overlay: rgba(42, 37, 31, 0.78);
  --text: #e8e0d0;
  --text-muted: #a89e8c;
  --text-subtle: #75695a;
  --border: #3a332a;
  --primary: #a8c4a2;
  --primary-hover: #b8d0b2;
  --primary-text: #1f1b16;
  --accent: #d4a574;
  --accent-hover: #e0b485;
  --highlight: #4a3a20;
  --highlight-text: #ffe9b0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.50);
  color-scheme: dark;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto,
    Arial, sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  letter-spacing: var(--letter-spacing);
}

body {
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== 通用控件 ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.7em 1.4em;
  background: var(--primary);
  color: var(--primary-text);
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.btn-secondary:hover {
  background: var(--bg-elevated);
}

.btn.btn-accent {
  background: var(--accent);
  color: #fff;
}

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

.btn.btn-large {
  font-size: var(--font-size-lg);
  padding: 0.9em 1.8em;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 视图容器 ===== */

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.view-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.view-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ===== 居中卡片（iPad / 桌面） ===== */
@media (min-width: 768px) {
  .view {
    padding: 2.5rem 2rem;
  }
}

/* ===== 工具：屏幕外 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}