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

:root {
  --bg: #F7F1E3;
  --bg-card: #FFFFFF;
  --text: #3A3226;
  --text-sub: #8B7D6B;
  --text-light: #B0A495;
  --primary: #B03A2E;
  --primary-light: #F7E3DE;
  --secondary: #D9A441;
  --secondary-light: #F5E9C8;
  --accent: #7A9E8E;
  --border: #E8DDC9;
  --shadow: 0 2px 12px rgba(58, 50, 38, 0.08);
  --shadow-lg: 0 8px 32px rgba(58, 50, 38, 0.12);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

@media (min-width: 431px) {
  body { background: #E8DDC9; }
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

img { display: block; max-width: 100%; }

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

input, textarea {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
}

.page { display: none; flex-direction: column; min-height: 100vh; position: relative; }
.page.active { display: flex; flex: 1; position: relative; overflow-y: auto; }

.title-lg { font-size: 20px; font-weight: 700; color: var(--text); }
.title-md { font-size: 16px; font-weight: 600; color: var(--text); }
.title-sm { font-size: 14px; font-weight: 600; color: var(--text); }
.text { font-size: 13px; color: var(--text); }
.text-sub { font-size: 12px; color: var(--text-sub); }
.text-light { font-size: 11px; color: var(--text-light); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-card);
}
.btn-block { width: 100%; padding: 14px; border-radius: 12px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-secondary { background: var(--secondary-light); color: #8A6B1F; }

.card {
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.img-placeholder-red {
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 12px;
}
.img-placeholder-yellow {
  background: var(--secondary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8A6B1F;
  font-size: 12px;
}

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 calc(env(safe-area-inset-bottom) + 6px);
  z-index: 100;
}
.tab-bar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  font-size: 10px;
  color: var(--text-light);
  transition: color 0.2s;
}
.tab-bar .tab.active { color: var(--primary); }
.tab-bar .tab svg { width: 22px; height: 22px; }

.page-content { flex: 1; padding-bottom: 70px; overflow-y: auto; min-height: 0; }

.fade-in { animation: fadeIn 0.3s ease; }
.slide-up { animation: slideUp 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.icon-fav {
  width: 22px; height: 22px;
  transition: all 0.2s;
}
.icon-fav.active { fill: var(--primary); stroke: var(--primary); transform: scale(1.1); }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-light);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(58, 50, 38, 0.85);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 9999;
  animation: fadeIn 0.2s;
}

.img-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 9999; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.25s; cursor: zoom-out; }
.img-lightbox img { max-width: 96vw; max-height: 88vh; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.img-lightbox-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.15); color: #fff; font-size: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; }

::-webkit-scrollbar { width: 0; height: 0; }
