/* 马娃出行清单 · 静态示意图样式（Flat 2.0 / Semi-flat） */

:root {
  --primary: #3f6df0;
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-strong: #f4f6fa;
  --border: #dbe1ea;
  --text: #1c2430;
  --text-muted: #5a6472;
  --accent: #ff7a45;
  --on-primary: #000000;
  --on-accent: #000000;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --shadow-1: 0 1px 2px rgba(28, 36, 48, 0.06);
  --shadow-2: 0 4px 8px rgba(28, 36, 48, 0.06);
  --shadow-3: 0 10px 24px rgba(28, 36, 48, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Roboto', 'Google Sans', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ---------- 头部 ---------- */

.app-header { padding: var(--space-md) 0 var(--space-sm); }

.app-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-sub {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 2px;
}

.mock-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  align-self: flex-start;
}

/* ---------- 按钮 ---------- */

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(63, 109, 240, 0.4); outline-offset: 2px; }

.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-2); }
.btn-primary:hover { filter: brightness(1.08); }

.btn-accent { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-2); }
.btn-accent:hover { filter: brightness(1.05); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}
.btn-ghost:hover { background: var(--surface-strong); }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 4px;
}

/* ---------- 分区标签 ---------- */

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--space-sm) 4px 4px;
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-2);
}

.task-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease;
}
.task-card:hover { box-shadow: var(--shadow-3); }
.task-card:focus-visible { outline: 3px solid rgba(63, 109, 240, 0.4); outline-offset: 2px; }

.task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.task-name { font-size: 1.125rem; font-weight: 700; }

.chip {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(63, 109, 240, 0.10);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.chip-done { color: #2e7d4f; background: rgba(46, 125, 79, 0.10); }

.task-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 2px 0 12px;
}

.progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.progress-row strong { color: var(--text); font-size: 1rem; }

.progress-track {
  height: 8px;
  background: var(--surface-strong);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.members {
  display: flex;
  gap: var(--space-sm);
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.member-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}
.member-dot.mom { background: #e0528a; }
.member-dot.dad { background: #3f6df0; }

/* ---------- 历史列表 ---------- */

.history-list {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 14px 20px;
  text-decoration: none;
  color: inherit;
}
.history-item + .history-item { border-top: 1px solid var(--border); }
.history-item:hover { background: var(--surface-strong); }

.history-name { font-weight: 600; font-size: 0.9375rem; }
.history-meta { font-size: 0.8125rem; color: var(--text-muted); }

.history-check {
  color: #2e7d4f;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- 加入任务码 ---------- */

.join-row {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
}

.join-row input {
  flex: 1;
  min-width: 0;
}

.text-input {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  width: 100%;
  box-shadow: var(--shadow-1);
}
.text-input::placeholder { color: #9aa3b0; }
.text-input:focus-visible { outline: 3px solid rgba(63, 109, 240, 0.4); outline-offset: 1px; }

.join-row .btn { width: auto; padding: 12px 20px; }

/* ---------- 表单页 ---------- */

.page-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0 var(--space-sm);
}

.back-link {
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  padding: 4px 8px 4px 0;
  border-radius: var(--radius-sm);
}
.back-link:focus-visible { outline: 3px solid rgba(63, 109, 240, 0.4); }

.page-title { font-size: 1.375rem; font-weight: 700; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 4px 6px;
}

.field { display: flex; flex-direction: column; }

.field + .field { margin-top: var(--space-md); }

/* 场景选择 */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.scene-option {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-1);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.scene-option .scene-icon { font-size: 1.5rem; display: block; line-height: 1.4; }
.scene-option .scene-name { font-size: 0.875rem; font-weight: 600; }

.scene-option:hover { background: var(--surface-strong); }
.scene-option.selected { border-color: var(--primary); background: rgba(63, 109, 240, 0.08); }
.scene-option:focus-visible { outline: 3px solid rgba(63, 109, 240, 0.4); outline-offset: 2px; }

.scene-option.wide { grid-column: span 1; }

/* 时长输入 + 单位切换 */
.duration-row {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
}

.duration-row .text-input { flex: 1; min-width: 0; }

.segmented {
  display: inline-flex;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.segmented button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
}

.segmented button.selected {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

/* 估算提示 */
.estimate {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.8;
}
.estimate strong { color: var(--text); }

.form-footnote {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0 4px;
}

/* ---------- 任务页 ---------- */

.trip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-md);
}

.trip-head .left { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.trip-name { font-size: 1.25rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-share {
  width: auto;
  padding: 8px 18px;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.trip-meta { color: var(--text-muted); font-size: 0.9375rem; padding: 0 2px; }

.trip-actions {
  display: flex;
  gap: var(--space-md);
  padding: 0 2px;
}

/* 清单分组 */
.group-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.group-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px 20px 8px;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--border);
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
}
.item + .item { border-top: 1px solid var(--border); }

.checkbox {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.item.checked .checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.item-main { flex: 1; min-width: 0; }

.item-name { font-weight: 600; font-size: 0.9375rem; }
.item.checked .item-name { color: var(--text-muted); }

.item-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.item-by { font-size: 0.75rem; color: #e0528a; font-weight: 600; }
.item-by.dad { color: var(--primary); }

/* 数量步进器 */
.stepper {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}

.stepper button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}

.stepper button:hover { background: var(--surface); }
.stepper .qty {
  min-width: 56px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 备注 */
.note-btn {
  flex: none;
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  opacity: 0.55;
}
.note-btn.has-note { opacity: 1; }
.note-btn:hover { background: var(--surface-strong); }

.note-box {
  border-top: 1px dashed var(--border);
  background: rgba(255, 122, 69, 0.06);
  padding: 10px 16px 12px 50px;
}

.note-box .text-input {
  box-shadow: none;
  padding: 8px 12px;
  font-size: 0.875rem;
}

/* 大件行（不带步进器） */
.item .gear-tag {
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255, 122, 69, 0.12);
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 页脚操作 */
.trip-footer {
  display: flex;
  gap: var(--space-sm);
  padding-bottom: var(--space-lg);
}
.trip-footer .btn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
