/* ===== CSS Variables ===== */
:root {
  --primary: #5B7B8A;
  --primary-light: #7BA098;
  --bg: #F5F0EB;
  --bg-secondary: #EDE8E3;
  --text: #2C2C2C;
  --text-secondary: #6B6B6B;
  --accent: #C4A868;
  --wood: #8B7355;
  --white: #FFFFFF;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 24px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
  --font-title: 'Noto Serif SC', 'Songti SC', serif;
  --font-body: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-height: 60px;
  --header-height: 52px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ===== Page Transition ===== */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 20px);
  position: relative;
  animation: pageIn 0.3s ease-out;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  height: var(--header-height);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(91,123,138,0.1);
}
.page-header h1 {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
  margin-left: 8px;
}
.back-btn {
  display: flex;
  align-items: center;
  color: var(--primary);
  width: 32px;
  height: 32px;
  transition: opacity 0.2s;
}
.back-btn:active { opacity: 0.6; }

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid rgba(91,123,138,0.1);
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 8px;
  transition: color 0.2s, transform 0.15s;
}
.bottom-nav .nav-item:active {
  transform: scale(1.15);
}
.bottom-nav .nav-item.active {
  color: var(--primary);
}
.bottom-nav .nav-item svg {
  width: 22px;
  height: 22px;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--white);
  padding: 12px 32px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--primary);
  padding: 12px 32px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  border: 1.5px solid var(--primary);
  transition: background 0.2s, transform 0.1s;
}
.btn-secondary:active { background: rgba(91,123,138,0.05); transform: scale(0.97); }
.btn-large { width: 200px; text-align: center; }

/* ===== Section Title ===== */
.section-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
  padding: 0 20px;
  margin-bottom: 16px;
  color: var(--text);
}

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  font-size: 13px;
  margin-right: 8px;
  margin-bottom: 6px;
}
.aesthetic-tag {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(91,123,138,0.1);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 13px;
  margin-right: 6px;
  margin-bottom: 6px;
}

/* ===== Cards (通用) ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.card:active { transform: scale(0.98); }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}
.empty-state p {
  margin-bottom: 16px;
  font-size: 14px;
}

/* ===== Error Page ===== */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.error-container {
  text-align: center;
}
.error-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--primary);
  font-size: 28px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.error-container h1 {
  font-family: var(--font-title);
  font-size: 20px;
  margin-bottom: 8px;
}
.error-container p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(91,123,138,0.2); border-radius: 2px; }

/* ===== Selection ===== */
::selection {
  background: rgba(91,123,138,0.2);
  color: var(--text);
}
