/* 基础样式 — 清新家庭主题 */
:root {
  --color-breakfast: #E67E22;
  --color-lunch: #27AE60;
  --color-dinner: #8E44AD;
  --color-bg: #f0f4f8;
  --color-surface: #ffffff;
  --color-text: #2d3748;
  --color-text-secondary: #718096;
  --color-border: #e2e8f0;
  --color-accent: #e8734a;
  --color-today-bg: #e8734a;
  --color-selected-ring: #e8734a;
  --color-selected-bg: #fff5f0;
  --color-card-shadow: rgba(0, 0, 0, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #171923;
    --color-surface: #2d3748;
    --color-text: #e2e8f0;
    --color-text-secondary: #a0aec0;
    --color-border: #4a5568;
    --color-selected-bg: #3a2a22;
    --color-card-shadow: rgba(0, 0, 0, 0.25);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── 顶部 ─── */
.header {
  text-align: center;
  padding: 28px 20px 8px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.header-emoji { font-size: 28px; }

.header-title {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #e8734a, #d4543a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-sub {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* ─── 月份导航 ─── */
.month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
}

.month-label {
  font-size: 17px;
  font-weight: 700;
}

.btn-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px var(--color-card-shadow);
  transition: transform 0.15s;
}

.btn-nav:active { transform: scale(0.9); }

/* ─── 日历卡片 ─── */
.calendar-card {
  background: var(--color-surface);
  margin: 0 12px 16px;
  border-radius: var(--radius);
  padding: 12px 10px 14px;
  box-shadow: 0 2px 10px var(--color-card-shadow);
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 6px;
}

.weekday-row span {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.day-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  gap: 2px;
}

.day-cell:active { transform: scale(0.9); }

.day-cell.empty { cursor: default; }
.day-cell.empty:active { transform: none; }

.day-cell.today {
  background: var(--color-today-bg);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(232, 115, 74, 0.4);
}

.day-cell.selected:not(.today) {
  background: var(--color-selected-bg);
  outline: 2px solid var(--color-selected-ring);
}

.day-cell.today.selected {
  outline: 2px solid rgba(255,255,255,0.7);
  outline-offset: 1px;
}

.day-cell.past .day-number {
  color: var(--color-text-secondary);
  opacity: 0.5;
}

.day-number {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

/* ─── 天气卡片 ─── */
.weather-card {
  margin: 12px 12px 0;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 2px 10px var(--color-card-shadow);
}

@media (prefers-color-scheme: dark) {
  .weather-card {
    background: linear-gradient(135deg, #1e3a5f, #172554);
  }
}

.weather-loading {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 8px 0;
}

.weather-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 10px;
}

@media (prefers-color-scheme: dark) {
  .weather-title { color: #93c5fd; }
}

.weather-days {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.weather-day {
  flex: 1;
  background: rgba(255,255,255,0.6);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .weather-day { background: rgba(255,255,255,0.08); }
}

.weather-day-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.weather-day-icon {
  font-size: 24px;
  line-height: 1.2;
}

.weather-day-temp {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin: 2px 0;
}

.weather-day-desc {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.weather-tips {
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  padding: 10px 12px;
}

@media (prefers-color-scheme: dark) {
  .weather-tips { background: rgba(255,255,255,0.06); }
}

.weather-tips-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 6px;
}

@media (prefers-color-scheme: dark) {
  .weather-tips-title { color: #93c5fd; }
}

.weather-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.weather-tips li {
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text);
  padding-left: 18px;
  position: relative;
}

.weather-tips li::before {
  content: attr(data-icon);
  position: absolute;
  left: 0;
  font-size: 12px;
}

/* ─── 三餐方格 ─── */
.meal-date {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 8px 0 6px;
}

.meal-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px 14px;
}

.meal-box {
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  box-shadow: 0 2px 8px var(--color-card-shadow);
  transition: transform 0.12s;
}

.meal-box:active { transform: scale(0.96); }

.meal-box-breakfast {
  background: linear-gradient(160deg, #fff7ed, #fed7aa);
  border-top: 3px solid var(--color-breakfast);
}
.meal-box-lunch {
  background: linear-gradient(160deg, #f0fff4, #c6f6d5);
  border-top: 3px solid var(--color-lunch);
}
.meal-box-dinner {
  background: linear-gradient(160deg, #faf5ff, #e9d5ff);
  border-top: 3px solid var(--color-dinner);
}

@media (prefers-color-scheme: dark) {
  .meal-box-breakfast { background: linear-gradient(160deg, #3a2a1a, #2a2018); }
  .meal-box-lunch { background: linear-gradient(160deg, #1a2a1a, #182018); }
  .meal-box-dinner { background: linear-gradient(160deg, #2a1a3a, #201828); }
}

.meal-box-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text-secondary);
}

.meal-box-select-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.meal-box-select {
  font-size: 16px;
  font-weight: 800;
  background: none;
  border: none;
  color: var(--color-text);
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  padding: 4px 16px 4px 4px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23a0aec0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}

.meal-box-select:focus {
  outline: none;
}

/* ─── 提醒事项 ─── */
.reminders {
  margin: 8px 12px 12px;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px var(--color-card-shadow);
  overflow: hidden;
}

.reminders-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--color-border);
}

.reminders-body {
  padding: 12px 16px 16px;
}

.reminder-priority {
  font-size: 14px;
  font-weight: 700;
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .reminder-priority {
    color: #fdba74;
    background: #3a2a1a;
    border-color: #5a3a1a;
  }
}

.reminder-section {
  margin-bottom: 14px;
}

.reminder-section:last-child {
  margin-bottom: 0;
}

.reminder-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.reminder-section ul {
  list-style: none;
  padding: 0;
}

.reminder-section li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  padding-left: 16px;
  position: relative;
}

.reminder-section li::before {
  content: '•';
  position: absolute;
  left: 2px;
  color: var(--color-accent);
  font-weight: 700;
}

/* ─── 底部 ─── */
.footer {
  text-align: center;
  padding: 8px 20px 32px;
  font-size: 12px;
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  background: var(--color-surface);
  padding: 10px 20px;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px var(--color-card-shadow);
  transition: transform 0.12s;
}

.footer-link:active {
  transform: scale(0.96);
}
