/* ===== COMMON STYLES - shared across all pages ===== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --bg2: #101018;
  --bg3: #16161f;
  --text: #e8e6e3;
  --dim: #9090a0;
  --accent: #c49a6c;
  --accent2: #e0b87a;
  --glow: rgba(196,154,108,0.2);
  --card-bg: rgba(255,255,255,0.03);
  --card-border: rgba(255,255,255,0.07);
  --nav-bg: rgba(10,10,15,0.92);
}

html.light {
  --bg: #f7f3ed;
  --bg2: #ede8df;
  --bg3: #e3ddd3;
  --text: #111111;
  --dim: #444444;
  --accent: #7a4e1f;
  --accent2: #5c3a15;
  --glow: rgba(122,78,31,0.25);
  --card-bg: rgba(0,0,0,0.05);
  --card-border: rgba(0,0,0,0.2);
  --nav-bg: rgba(247,243,237,0.97);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding-bottom: 4rem;
}

a { text-decoration: none; color: inherit; }

/* ===== BOTTOM TAB BAR ===== */
.bottom-tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  display: flex; justify-content: space-around; align-items: center;
  background: var(--nav-bg); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--card-border);
  padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom));
  font-family: inherit;
}
.bottom-tab-bar a {
  display: flex; flex-direction: column; align-items: center;
  font-size: 0.6rem; color: var(--dim); text-decoration: none; gap: 0.1rem;
  transition: color 0.2s;
}
.bottom-tab-bar a .tab-icon { font-size: 1.2rem; }
.bottom-tab-bar a span { font-weight: 700; }
.bottom-tab-bar a.active { color: var(--accent); }

/* ===== NAV (common base) ===== */
nav {
  position: sticky; top: 0; z-index: 100;
  padding: 0.75rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.nav-back { color: #b0b0bc; font-size: 0.85rem; font-weight: 700; }
.nav-back:hover { color: var(--accent2); }
.nav-title {
  font-family: 'Noto Serif TC', serif;
  font-weight: 900; font-size: 1rem;
  color: var(--accent2);
}

/* ===== FONT CONTROLS ===== */
.font-ctrl { display: flex; gap: 0.2rem; margin-left: 0.3rem; flex-shrink: 0; }
.font-btn {
  background: transparent; border: 1px solid var(--card-border); color: var(--dim);
  width: 28px; height: 28px; border-radius: 4px; cursor: pointer; font-size: 0.75rem;
  font-family: inherit; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.font-btn:hover { border-color: var(--accent); color: var(--accent2); }
