/* ═══════════ 设计令牌 ═══════════ */
:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --card: #ffffff;
  --text: #1a1a2e;
  --text2: #3d3d56;
  --muted: #8a8fa3;
  --line: #e8eaef;
  --accent: #1f6b4d;
  --accent-light: #e8f5ee;
  --accent2: #2e9a6c;
  --blue: #4a9fe5;
  --yellow: #e5a834;
  --red: #e05252;
  --green: #2e9a6c;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  /* 安全区域 */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --touch-min: 44px;
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav-h) + var(--sab) + 12px);
  padding-left: var(--sal);
  padding-right: var(--sar);
  overflow-x: hidden;
}

/* ═══════════ Tab 页面系统 ═══════════ */
.tab-pages { position: relative; min-height: 100dvh; overflow-x: hidden; width: 100%; }
.tab-page {
  display: block; opacity: 0; visibility: hidden;
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  transition: opacity 240ms ease, visibility 240ms;
  -webkit-overflow-scrolling: touch;
}
.tab-page.active { opacity: 1; visibility: visible; position: relative; }

.page-inner {
  width: min(640px, calc(100% - 24px));
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 12px 12px;
  display: grid;
  gap: 12px;
}

/* ═══════════ 底部 Tab 导航栏 ═══════════ */
.tab-bar {
  position: fixed;
  left: 50%;
  bottom: calc(8px + var(--sab));
  transform: translateX(-50%);
  width: min(420px, calc(100% - 16px - var(--sal) - var(--sar)));
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px;
  border-radius: 20px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  z-index: 100;
}
.tab-btn {
  border: 0; min-height: var(--touch-min);
  border-radius: 16px; background: transparent;
  color: var(--muted); font: inherit; font-weight: 600;
  cursor: pointer; display: inline-flex;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; transition: background 160ms, color 160ms, transform 100ms;
  user-select: none; -webkit-user-select: none;
}
.tab-btn.active { color: var(--accent); background: var(--accent-light); }
.tab-btn:active { transform: scale(0.92); }
.tab-btn span { font-size: 0.68rem; letter-spacing: 0.02em; }
.tab-icon { width: 22px; height: 22px; flex: 0 0 auto; }

/* ═══════════ 首页 Header ═══════════ */
.home-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 4px 0;
}
.home-loc {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.9rem; font-weight: 600; color: var(--text2);
  min-width: 0; flex: 1;
}
.home-loc .icon-pin { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent); }
#locationName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-badge {
  display: inline-flex; align-items: center;
  font-size: 0.76rem; font-weight: 700;
  padding: 5px 14px; border-radius: 999px;
  background: var(--accent-light); color: var(--accent);
  white-space: nowrap; flex-shrink: 0;
  transition: background 200ms, color 200ms;
}
.badge-dry { background: #fde8e8; color: #c53030; }
.badge-watch { background: #fef3cd; color: #b7791f; }
.badge-wet { background: #dbeafe; color: #2563eb; }

/* ═══════════ 仪表盘卡片 ═══════════ */
.dash-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: flex; align-items: center; gap: 28px;
}
.dash-ring {
  width: 140px; height: 140px; border-radius: 50%;
  position: relative; flex-shrink: 0;
  background: conic-gradient(from 210deg, #e8eaef 0deg, #e8eaef 360deg);
  box-shadow: inset 0 0 0 10px rgba(0,0,0,0.02);
}
.dash-ring-fill {
  position: absolute; inset: 0; border-radius: 50%;
  mask: radial-gradient(circle at center, transparent 56%, #000 56.5%);
  -webkit-mask: radial-gradient(circle at center, transparent 56%, #000 56.5%);
  transition: background 500ms ease;
}
.dash-ring-center {
  position: absolute; inset: 14%; border-radius: 50%;
  background: var(--card);
  display: grid; place-items: center; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.dash-pct {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
}
.dash-pct-label { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

.level-danger { color: var(--red); }
.level-warn { color: var(--yellow); }
.level-watch { color: var(--yellow); }
.level-ok { color: var(--green); }

.dash-info { flex: 1; min-width: 0; }
.dash-decision { font-size: 1.2rem; font-weight: 800; line-height: 1.3; margin-bottom: 6px; }
.dash-reason { font-size: 0.84rem; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.dash-meta { display: flex; gap: 16px; }
.dash-meta-item {
  font-size: 0.78rem; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}

/* ═══════════ 通用 Section 卡片 ═══════════ */
.section-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 14px;
}
.section-head h2 { font-size: 0.96rem; font-weight: 700; color: var(--text); }
.meta-text { font-size: 0.74rem; color: var(--muted); }

/* ═══════════ 3 日速览条 ═══════════ */
.day-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.day-strip-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  display: grid; gap: 6px;
  transition: transform 140ms;
}
.day-strip-item:hover { transform: translateY(-1px); }
.day-strip-item.level-danger { border-left: 3px solid var(--red); }
.day-strip-item.level-warn { border-left: 3px solid var(--yellow); }
.day-strip-item.level-watch { border-left: 3px solid var(--yellow); }
.day-strip-item.level-ok { border-left: 3px solid var(--green); }

.ds-head { display: flex; justify-content: space-between; align-items: baseline; }
.ds-day { font-weight: 700; font-size: 0.86rem; }
.ds-emoji { font-size: 1rem; }
.ds-temp { font-size: 0.78rem; color: var(--muted); }
.ds-bottom { display: flex; justify-content: space-between; align-items: center; }
.ds-moisture { font-size: 0.82rem; font-weight: 700; }
.ds-rain { font-size: 0.74rem; color: var(--blue); }
.ds-action {
  font-size: 0.66rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  width: fit-content; white-space: nowrap;
}
.ds-action.badge-danger { background: #fde8e8; color: #c53030; }
.ds-action.badge-warn { background: #fef3cd; color: #b7791f; }
.ds-action.badge-watch { background: #fef3cd; color: #b7791f; }
.ds-action.badge-ok { background: var(--accent-light); color: var(--accent); }

/* ═══════════ 概览行 ═══════════ */
.overview-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.overview-cell {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 14px 12px; text-align: center;
}
.overview-cell span { display: block; font-size: 0.74rem; color: var(--muted); margin-bottom: 4px; }
.overview-cell strong { display: block; font-size: 1.15rem; font-weight: 800; color: var(--text); }

/* ═══════════ 偏差横幅 ═══════════ */
.deviation-banner { display: grid; gap: 8px; }
.deviation-item {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.82rem; line-height: 1.5;
}
.deviation-deficit { background: #fde8e8; color: #8b2e2e; }
.deviation-surplus { background: var(--accent-light); color: #1a6b42; }

/* ═══════════ 土壤仪表 ═══════════ */
.gauge-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 20px; text-align: center;
}
.gauge-wrap { display: grid; place-items: center; padding: 8px 0 16px; }
.gauge {
  width: min(240px, 65vw); aspect-ratio: 1 / 1; border-radius: 50%;
  background: conic-gradient(from 210deg, #e8eaef 0deg, #e8eaef 360deg);
  position: relative;
  box-shadow: inset 0 0 0 12px rgba(0,0,0,0.02);
}
.gauge-fill {
  position: absolute; inset: 0; border-radius: 50%;
  mask: radial-gradient(circle at center, transparent 56%, #000 56.5%);
  -webkit-mask: radial-gradient(circle at center, transparent 56%, #000 56.5%);
  transition: background 500ms ease;
}
.gauge-center {
  position: absolute; inset: 14%; border-radius: 50%;
  background: var(--card);
  display: grid; place-items: center; text-align: center; padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.gauge-number { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -0.04em; }
.gauge-text { margin-top: 4px; font-size: 0.82rem; color: var(--muted); }

/* ═══════════ 操作卡片 ═══════════ */
.action-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px;
}
.action-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.action-note { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }

/* ═══════════ 日志 ═══════════ */
.log-list { display: grid; gap: 6px; }
.log-empty { color: var(--muted); font-size: 0.84rem; text-align: center; padding: 20px; }
.log-item {
  display: flex; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius-xs);
  background: var(--bg); font-size: 0.82rem;
}

/* ═══════════ 7 天计划卡片条 ═══════════ */
.plan-strip {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.strip-day {
  background: var(--card); border-radius: var(--radius-xs);
  padding: 10px 6px; text-align: center;
  display: grid; gap: 4px;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms;
  cursor: default;
}
.strip-day:hover { transform: translateY(-2px); }
.strip-day.level-danger { border-top: 3px solid var(--red); }
.strip-day.level-warn { border-top: 3px solid var(--yellow); }
.strip-day.level-watch { border-top: 3px solid var(--yellow); }
.strip-day.level-ok { border-top: 3px solid var(--green); }
.strip-day-name { font-weight: 700; font-size: 0.78rem; }
.strip-day-date { font-size: 0.66rem; color: var(--muted); }
.strip-day-weather { font-size: 0.88rem; line-height: 1; }
.strip-day-moisture { font-size: 0.84rem; font-weight: 800; }
.strip-day-action {
  font-size: 0.6rem; font-weight: 700;
  padding: 2px 6px; border-radius: 999px;
  width: fit-content; margin: 0 auto; white-space: nowrap;
}
.strip-day-action.badge-danger { background: #fde8e8; color: #c53030; }
.strip-day-action.badge-warn { background: #fef3cd; color: #b7791f; }
.strip-day-action.badge-watch { background: #fef3cd; color: #b7791f; }
.strip-day-action.badge-ok { background: var(--accent-light); color: var(--accent); }
.strip-day-rain { font-size: 0.64rem; color: var(--blue); }
.strip-day-temp { font-size: 0.64rem; color: var(--muted); }

/* ═══════════ 详情块 ═══════════ */
.detail-stack { display: grid; gap: 8px; }
.detail-block {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.detail-summary {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; user-select: none; list-style: none;
}
.detail-summary::-webkit-details-widget-marker { display: none; }
.detail-summary::before {
  content: ""; width: 6px; height: 6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform 200ms;
  flex-shrink: 0;
}
details[open] > .detail-summary::before { transform: rotate(45deg); }
.detail-count { font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.detail-list { padding: 0 14px 14px; display: grid; gap: 6px; }
.detail-item {
  display: grid; gap: 2px; padding: 10px 12px;
  border-radius: var(--radius-xs); background: var(--bg);
}
.detail-item strong { font-size: 0.84rem; }
.detail-item span { color: var(--muted); line-height: 1.5; font-size: 0.78rem; }

/* ═══════════ 图表 ═══════════ */
.chart-wrap { position: relative; overflow: hidden; border-radius: var(--radius-sm); }
.comparison-canvas {
  display: block; width: 100%; height: 200px;
  background: var(--bg); border-radius: var(--radius-sm);
}
.chart-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 0.84rem;
}

/* ═══════════ 按钮 ═══════════ */
.btn {
  appearance: none; border: none; border-radius: 999px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 0 18px; min-height: var(--touch-min);
  font-size: 0.84rem;
  transition: transform 100ms, opacity 100ms, background 100ms, box-shadow 100ms;
  white-space: nowrap; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(31,107,77,0.2);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(31,107,77,0.3); }
.btn-secondary { background: var(--accent-light); color: var(--accent); }
.btn-secondary:hover { background: #d4eddf; }
.btn-ghost { background: var(--bg); color: var(--accent); border: 1px solid var(--line); }
.btn-sm {
  min-height: 34px; padding: 0 12px; font-size: 0.76rem;
  background: var(--accent-light); color: var(--accent); border-radius: 999px;
}
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 0.88rem; }
.btn-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-icon-sm { width: 14px; height: 14px; flex: 0 0 auto; }
.btn-icon-only { padding: 0; width: var(--touch-min); }

/* ═══════════ 表单 ═══════════ */
.form-input, .form-select {
  appearance: none; border: 1px solid var(--line);
  border-radius: var(--radius-xs); background: var(--bg);
  padding: 10px 14px; font: inherit; font-size: 0.86rem;
  color: var(--text); min-height: var(--touch-min);
  transition: border-color 140ms, box-shadow 140ms; width: 100%;
}
.form-input:focus, .form-select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31,107,77,0.1);
}
.form-input-sm { max-width: 80px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .form-select { flex: 1; min-width: 100px; }

/* ═══════════ Toggle 开关 ═══════════ */
.toggle-label {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; cursor: pointer; font-size: 0.86rem; font-weight: 600;
}
.toggle-switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.toggle-input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line); transition: background 200ms; cursor: pointer;
}
.toggle-track::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toggle-input:checked + .toggle-track { background: var(--accent); }
.toggle-input:checked + .toggle-track::after { transform: translateX(20px); }

/* ═══════════ 设置 ═══════════ */
.settings-grid { display: grid; gap: 14px; max-width: 100%; }
.setting-item { display: grid; gap: 6px; position: relative; max-width: 100%; }
.setting-item > label { font-size: 0.82rem; font-weight: 700; color: var(--text2); }
.setting-row { display: flex; gap: 8px; flex-wrap: wrap; max-width: 100%; }
.setting-row .form-input { flex: 1; min-width: 0; }

.about-card {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.about-text { font-size: 0.78rem; color: var(--muted); line-height: 1.7; }

/* ═══════════ 搜索建议下拉框 ═══════════ */
.search-results {
  position: absolute; left: 0; right: 0; top: 100%;
  margin-top: 4px; display: grid; gap: 1px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-lg); z-index: 50;
  max-height: 260px; overflow-y: auto;
  animation: dropIn 160ms ease;
  -webkit-overflow-scrolling: touch;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.search-result-item {
  display: flex; align-items: center;
  padding: 10px 14px; cursor: pointer;
  font-size: 0.82rem; transition: background 80ms;
  border-bottom: 1px solid var(--line);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.highlight { background: var(--accent-light); }
.search-result-item:active { background: #d4eddf; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-name {
  font-weight: 600; color: var(--text); font-size: 0.82rem;
  line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-result-coord { font-size: 0.7rem; color: var(--muted); margin-top: 1px; }

/* ═══════════ 当前位置 ═══════════ */
.location-display {
  margin-top: 4px; font-size: 0.78rem; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.location-display .loc-coord { font-size: 0.7rem; color: var(--muted); opacity: 0.7; }

/* ═══════════ 天气控制 ═══════════ */
.weather-ctrl { display: flex; align-items: center; gap: 8px; }

/* ═══════════ Toast ═══════════ */
.toast-container {
  position: fixed; top: calc(12px + var(--sat));
  left: 50%; transform: translateX(-50%);
  z-index: 9999; display: grid; gap: 8px;
  pointer-events: none; width: min(380px, calc(100% - 24px));
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm);
  background: rgba(26,26,46,0.92); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff; font-size: 0.84rem; font-weight: 500;
  line-height: 1.5; pointer-events: auto;
  animation: toastIn 250ms ease forwards;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.toast.toast-out { animation: toastOut 200ms ease forwards; }
.toast-success { background: rgba(46,154,108,0.94); }
.toast-error { background: rgba(224,82,82,0.94); }
.toast-warn { background: rgba(229,168,52,0.94); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-6px) scale(0.96); }
}

/* ═══════════ 首次设置弹窗 ═══════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fadeIn 200ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 28px 24px;
  width: min(400px, calc(100% - 16px));
  max-width: 100%;
  display: grid; gap: 14px;
  animation: modalIn 280ms ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-title { font-size: 1.15rem; font-weight: 800; }
.modal-desc { font-size: 0.84rem; color: var(--muted); line-height: 1.5; }
.modal-loc-status {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--accent-light); font-size: 0.86rem;
  font-weight: 600; color: var(--accent);
}
.modal-loc-status.loading { background: var(--bg); color: var(--muted); }
.modal-search { position: relative; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }

/* ═══════════ 骨架屏 ═══════════ */
.skeleton-block, .skeleton-card, .skeleton-pill, .skeleton-text {
  position: relative; overflow: hidden;
}
.skeleton-block { background: var(--bg); border-radius: var(--radius-sm); }
.skeleton-card { background: var(--bg); border-radius: var(--radius-sm); min-height: 60px; }
.skeleton-pill { background: var(--line); color: transparent !important; }
.skeleton-text { color: transparent !important; }
.skeleton-line {
  height: 12px; border-radius: 6px; background: var(--line); margin-bottom: 6px;
}
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-block::after, .skeleton-card::after, .skeleton-pill::after, .skeleton-line::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ═══════════ 空状态 ═══════════ */
.empty-hint {
  text-align: center; color: var(--muted);
  font-size: 0.84rem; padding: 20px; grid-column: 1 / -1;
}

/* ═══════════ 响应式 - 平板 ═══════════ */
@media (max-width: 768px) {
  .dash-card { flex-direction: column; text-align: center; padding: 24px 20px; gap: 20px; }
  .dash-meta { justify-content: center; }
  .overview-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* ═══════════ 响应式 - 手机 ═══════════ */
@media (max-width: 480px) {
  :root { --nav-h: 58px; }
  .page-inner { padding: 12px 0 8px; gap: 10px; }
  .dash-card { padding: 20px 16px; gap: 16px; }
  .dash-ring { width: 120px; height: 120px; }
  .dash-pct { font-size: 1.6rem; }
  .dash-decision { font-size: 1.05rem; }
  .dash-reason { font-size: 0.8rem; }

  .day-strip { gap: 6px; }
  .day-strip-item { padding: 10px 8px; gap: 4px; }
  .ds-day { font-size: 0.8rem; }
  .ds-temp { font-size: 0.72rem; }
  .ds-moisture { font-size: 0.78rem; }
  .ds-rain { font-size: 0.7rem; }
  .ds-action { font-size: 0.6rem; padding: 2px 6px; }

  .overview-row { gap: 4px; }
  .overview-cell { padding: 10px 8px; }
  .overview-cell strong { font-size: 1rem; }
  .overview-cell span { font-size: 0.68rem; }

  .gauge { width: min(200px, 60vw); }
  .gauge-number { font-size: 1.6rem; }

  .plan-strip { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .strip-day { padding: 8px 4px; gap: 2px; }
  .strip-day-name { font-size: 0.72rem; }
  .strip-day-date { font-size: 0.6rem; }
  .strip-day-weather { font-size: 0.78rem; }
  .strip-day-moisture { font-size: 0.76rem; }
  .strip-day-action { font-size: 0.56rem; padding: 2px 4px; }
  .strip-day-rain, .strip-day-temp { font-size: 0.58rem; }

  .comparison-canvas { height: 160px; }

  .tab-bar {
    width: calc(100% - 8px - var(--sal) - var(--sar));
    bottom: calc(4px + var(--sab)); border-radius: 16px; padding: 3px;
  }
  .tab-btn { min-height: 46px; }
  .tab-btn span { font-size: 0.64rem; }
  .tab-icon { width: 20px; height: 20px; }

  .inline-form { flex-direction: column; }
  .inline-form .form-input-sm { max-width: none; }
}

/* ═══════════ 响应式 - 小手机 ═══════════ */
@media (max-width: 360px) {
  .dash-ring { width: 100px; height: 100px; }
  .dash-pct { font-size: 1.3rem; }
  .overview-row { grid-template-columns: 1fr; }
  .plan-strip { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════ 横屏 ═══════════ */
@media (max-height: 500px) and (orientation: landscape) {
  .gauge { width: 160px; }
  .dash-card { flex-direction: row; }
  .page-inner { padding: 8px 0; }
}

/* ═══════════ 大屏 ═══════════ */
@media (min-width: 1024px) {
  .page-inner { width: min(720px, 100% - 48px); gap: 14px; }
  .dash-card { padding: 32px; }
}

/* ═══════════ 减少动画 ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════ 打印 ═══════════ */
@media print {
  .tab-bar, .action-card, .toast-container { display: none !important; }
  body { background: #fff; }
}
