/* ===== 悦己 MeTime — 莫兰迪色系设计系统 ===== */

:root {
  /* 莫兰迪色系 */
  --bg: #FAF7F2;
  --bg-card: #FFFFFF;
  --sage: #9CAF88;
  --sage-light: #B8CCAA;
  --sage-soft: #E8F0E2;
  --pink: #D4A5A5;
  --pink-light: #E8C8C8;
  --pink-soft: #F5E6E6;
  --lavender: #B8A9C9;
  --lavender-soft: #E8E0F0;
  --cream: #F5EDE3;
  --warm-gray: #5C5C5C;
  --light-gray: #A8A8A8;
  --border: #EDE8E0;

  /* 字体 */
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;

  /* 圆角 */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 50%;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);

  /* 安全区 */
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 72px;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--warm-gray);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
}

button,
input,
textarea,
select {
  font-family: var(--font);
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

/* ===== Canvas 覆盖层 ===== */
#flower-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* ===== 页面系统 ===== */
.page {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  padding: 0 20px 20px;
  min-height: 100vh;
  min-height: 100dvh;
}

.page.active {
  display: block;
}

.page.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Page Header ===== */
.page-header {
  padding-top: calc(var(--safe-top) + 16px);
  padding-bottom: 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--warm-gray);
  letter-spacing: 0.02em;
}

/* ===== 首页 Greeting ===== */
.greeting {
  margin-bottom: 4px;
}

.greeting-text {
  font-size: 1.6rem;
  font-weight: 500;
  background: linear-gradient(135deg, var(--sage), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.greeting-date {
  font-size: 0.85rem;
  color: var(--light-gray);
  font-weight: 300;
  margin-top: 2px;
}

/* ===== 每日语录 ===== */
.daily-quote {
  background: linear-gradient(135deg, var(--sage-soft), var(--pink-soft));
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.daily-quote::before {
  content: '"';
  position: absolute;
  top: -8px;
  left: 12px;
  font-size: 4rem;
  color: var(--sage);
  opacity: 0.15;
  font-family: Georgia, serif;
}

.quote-text {
  font-size: 0.9rem;
  color: var(--warm-gray);
  font-weight: 300;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}

/* ===== 任务列表 ===== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-section-title {
  font-size: 0.8rem;
  color: var(--light-gray);
  font-weight: 400;
  letter-spacing: 0.08em;
  margin: 8px 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== 任务卡片 ===== */
.task-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
  animation: cardIn 0.4s ease forwards;
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--sage);
  border-radius: 0 4px 4px 0;
  transition: background 0.3s ease;
}

.task-card.completed::before {
  background: var(--pink);
}

.task-card.rested::before {
  background: var(--lavender);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-card .task-emoji {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border-radius: var(--radius-sm);
}

.task-card .task-info {
  flex: 1;
  min-width: 0;
}

.task-card .task-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--warm-gray);
  margin-bottom: 2px;
}

.task-card .task-time {
  font-size: 0.78rem;
  color: var(--light-gray);
  font-weight: 300;
}

.task-card .task-note {
  font-size: 0.78rem;
  color: var(--sage);
  font-weight: 300;
  margin-top: 4px;
  font-style: italic;
}

.task-card .task-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.btn-done {
  padding: 10px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--sage-light), var(--sage));
  color: white;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(156, 175, 136, 0.3);
  white-space: nowrap;
}

.btn-done-icon {
  font-size: 1rem;
}

.btn-done-text {
  font-weight: 500;
}

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

.btn-rest {
  font-size: 0.65rem;
  color: var(--lavender);
  text-align: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-rest:active {
  background: var(--lavender-soft);
}

/* 完成/休息 状态 */
.task-card.completed {
  opacity: 0.7;
}

.task-card.completed .task-name {
  text-decoration: line-through;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
}

.task-card.completed .btn-done {
  background: var(--pink);
  box-shadow: none;
}

.task-card.rested {
  opacity: 0.85;
}

.task-card.rested .task-name {
  color: var(--lavender);
}

/* 当前时间段高亮 */
.task-card.current {
  border: 2px solid var(--sage);
  box-shadow: 0 4px 16px rgba(156, 175, 136, 0.15);
}

.task-card.completed .task-actions {
  pointer-events: auto;
}

.task-status-badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 400;
}

.badge-done {
  background: var(--pink-soft);
  color: var(--pink);
}

.badge-rest {
  background: var(--lavender-soft);
  color: var(--lavender);
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.btn-undo-rest {
  font-size: 0.65rem;
  color: var(--lavender);
  text-align: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-undo-rest:active {
  background: var(--lavender-soft);
}

.btn-undo {
  font-size: 0.65rem;
  color: var(--pink);
  text-align: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  white-space: nowrap;
  margin-top: 4px;
}

.btn-undo:active {
  background: var(--pink-soft);
}

/* ===== 进度条 ===== */
.progress-bar {
  margin-bottom: 16px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--light-gray);
  margin-bottom: 6px;
}

.progress-count {
  color: var(--sage);
  font-weight: 500;
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage-light), var(--sage));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ===== 时间选择器 ===== */
.time-picker-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.anytime-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.anytime-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--sage);
}

.time-input-wrap {
  flex: 1;
}

.time-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--warm-gray);
  transition: border-color 0.3s ease;
}

.time-input:focus {
  border-color: var(--sage);
}

.time-input-wrap.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  animation: fadeIn 0.6s ease;
}

.empty-emoji {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 1rem;
  color: var(--warm-gray);
  font-weight: 400;
}

.empty-sub {
  font-size: 0.85rem !important;
  color: var(--light-gray) !important;
  margin-top: 8px;
}

/* ===== 管理页列表 ===== */
.manage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.manage-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: cardIn 0.4s ease forwards;
}

.manage-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.manage-card .manage-emoji {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.manage-card .manage-info {
  flex: 1;
  min-width: 0;
}

.manage-card .manage-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.manage-card .manage-freq {
  font-size: 0.78rem;
  color: var(--light-gray);
  font-weight: 300;
  margin-top: 2px;
}

.manage-card .manage-arrow {
  color: var(--border);
  font-size: 1.2rem;
}

/* ===== 添加按钮 ===== */
.btn-add {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--light-gray);
  transition: all 0.3s ease;
}

.btn-add:active {
  border-color: var(--sage);
  color: var(--sage);
  background: var(--sage-soft);
}

.btn-add-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--sage-soft);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 300;
}

/* ===== 表单页 ===== */
.btn-back {
  font-size: 0.9rem;
  color: var(--sage);
  margin-bottom: 8px;
  padding: 4px 0;
}

.task-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--warm-gray);
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
  color: var(--warm-gray);
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  border-color: var(--sage);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--light-gray);
  font-weight: 300;
}

.form-group textarea {
  resize: none;
}

/* Emoji Picker */
.emoji-picker,
.emoji-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emoji-free-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emoji-input {
  width: 64px;
  height: 64px;
  font-size: 2.2rem;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: border-color 0.3s ease;
}

.emoji-input:focus {
  border-color: var(--sage);
  outline: none;
}

.emoji-opt {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.emoji-opt:active {
  border-color: var(--sage);
  background: var(--sage-soft);
  transform: scale(1.08);
}

/* 频率选项 */
.freq-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.freq-opt {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.freq-opt input[type="radio"] {
  display: none;
}

.freq-opt.selected {
  border-color: var(--sage);
  background: var(--sage-soft);
}

.freq-label {
  font-size: 0.95rem;
  font-weight: 500;
}

.freq-desc {
  font-size: 0.78rem;
  color: var(--light-gray);
  font-weight: 300;
  margin-top: 2px;
}

/* 间隔设置 */
.interval-input {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.interval-input input[type="number"] {
  width: 64px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  -moz-appearance: textfield;
}

.interval-input input[type="number"]::-webkit-inner-spin-button,
.interval-input input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* 时间段选项 */
.time-options {
  display: flex;
  gap: 8px;
}

.time-opt {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.time-opt input[type="radio"] {
  display: none;
}

.time-opt.selected {
  border-color: var(--sage);
  background: var(--sage-soft);
}

/* 表单按钮 */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 32px;
}

.btn-save {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--sage), var(--sage-light));
  color: white;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(156, 175, 136, 0.3);
  transition: all 0.3s ease;
}

.btn-save:active {
  transform: scale(0.97);
}

.btn-delete {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-lg);
  color: var(--pink);
  font-size: 0.9rem;
  font-weight: 400;
  border: 1.5px solid var(--pink-light);
  transition: all 0.3s ease;
}

.btn-delete:active {
  background: var(--pink-soft);
}

/* ===== 安慰语弹窗 ===== */
.comfort-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(92, 92, 92, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

.comfort-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.comfort-emoji {
  font-size: 3rem;
  margin-bottom: 16px;
}

.comfort-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--warm-gray);
  margin-bottom: 24px;
  font-weight: 300;
}

.comfort-close {
  padding: 12px 32px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--lavender), var(--pink-light));
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(184, 169, 201, 0.3);
  transition: all 0.3s ease;
}

.comfort-close:active {
  transform: scale(0.95);
}

/* ===== 底部导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 24px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.nav-item .nav-icon {
  font-size: 1.4rem;
  transition: transform 0.3s ease;
}

.nav-item .nav-label {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--light-gray);
  transition: color 0.3s ease;
}

.nav-item.active .nav-label {
  color: var(--sage);
  font-weight: 500;
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
}

/* ===== 通用动画 ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== 繁花日历 ===== */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cal-nav-btn:active {
  background: var(--sage-soft);
  border-color: var(--sage);
}

.cal-month-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--warm-gray);
  min-width: 120px;
  text-align: center;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  color: var(--light-gray);
  margin-bottom: 8px;
  font-weight: 400;
}

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

.cal-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: default;
  position: relative;
}

.cal-cell.empty {
  background: transparent;
}

.cal-cell.future {
  opacity: 0.4;
}

.cal-cell.today {
  border: 2px solid var(--sage);
  background: var(--sage-soft);
}

.cal-cell.bloom {
  background: var(--pink-soft);
  cursor: pointer;
}

.cal-cell.sprout {
  background: var(--sage-soft);
  cursor: pointer;
}

.cal-cell.cloud {
  background: var(--lavender-soft);
  cursor: pointer;
}

.cal-cell:not(.empty):not(.future):active {
  transform: scale(0.92);
}

.cal-day {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--warm-gray);
  line-height: 1;
}

.cal-icon {
  font-size: 0.9rem;
  line-height: 1;
  margin-top: 2px;
  min-height: 16px;
}

.cal-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.72rem;
  color: var(--light-gray);
}

/* 日历回顾卡片 */
.day-detail-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.day-detail-date {
  font-size: 0.85rem;
  color: var(--sage);
  font-weight: 500;
  margin-bottom: 16px;
}

.day-detail-intro {
  font-size: 0.9rem;
  color: var(--warm-gray);
  margin-bottom: 12px;
  font-weight: 300;
}

.day-detail-rest-intro {
  font-size: 0.85rem;
  color: var(--lavender);
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 300;
}

.day-detail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.day-detail-item {
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-align: left;
}

.day-detail-item.done {
  background: var(--pink-soft);
  color: var(--warm-gray);
}

.day-detail-item.rest {
  background: var(--lavender-soft);
  color: var(--lavender);
}

.day-detail-encourage {
  font-size: 0.85rem;
  color: var(--sage);
  margin-top: 20px;
  font-weight: 400;
  font-style: italic;
}

/* ===== 温柔提醒 ===== */
.gentle-reminders {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.reminder-card {
  background: linear-gradient(135deg, var(--pink-soft), var(--lavender-soft));
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--warm-gray);
  font-weight: 300;
  line-height: 1.6;
  animation: cardIn 0.4s ease forwards;
}

/* ===== 生活百宝箱 ===== */
.treasure-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.treasure-categories::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 0.82rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cat-tab.active {
  border-color: var(--sage);
  background: var(--sage-soft);
  color: var(--sage);
  font-weight: 500;
}

.cat-tab:active {
  transform: scale(0.95);
}

.treasure-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.item-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: cardIn 0.4s ease forwards;
}

.item-card:active {
  transform: scale(0.98);
}

.item-card.item-low {
  border-left: 3px solid var(--pink-light);
}

.item-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.item-emoji {
  font-size: 1.6rem;
}

.item-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--warm-gray);
}

.item-fav {
  margin-right: 4px;
}

.item-qty {
  font-size: 0.78rem;
  color: var(--sage);
  margin-left: 6px;
  font-weight: 400;
}

.item-meta {
  font-size: 0.75rem;
  color: var(--light-gray);
  margin-top: 2px;
}

.item-note {
  font-size: 0.75rem;
  color: var(--sage);
  font-style: italic;
  margin-top: 3px;
}

.manage-arrow {
  color: var(--border);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* 分区管理列表 */
.manage-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.manage-item .manage-emoji {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.manage-item .manage-info {
  flex: 1;
}

.manage-item .manage-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.manage-item .manage-meta {
  font-size: 0.75rem;
  color: var(--light-gray);
  margin-top: 2px;
}

/* 数量控制 */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  width: fit-content;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--sage);
  font-weight: 500;
}

.qty-btn:active {
  background: var(--sage-soft);
  border-color: var(--sage);
}

.qty-input {
  width: 60px;
  height: 40px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-left: none;
  border-right: none;
  background: var(--bg-card);
  color: var(--warm-gray);
  -moz-appearance: textfield;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* 拍照上传 */
.photo-upload-area {
  margin-top: 10px;
}

.btn-photo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  font-size: 0.85rem;
  color: var(--light-gray);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-photo:active {
  border-color: var(--sage);
  color: var(--sage);
}

.photo-preview {
  position: relative;
  display: inline-block;
  margin-top: 10px;
}

.photo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}

.photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--pink);
  color: white;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Hidden ===== */
.hidden {
  display: none !important;
}

/* ===== 响应式：大屏居中 ===== */
@media (min-width: 480px) {
  body {
    max-width: 428px;
    margin: 0 auto;
    box-shadow: -1px 0 0 var(--border), 1px 0 0 var(--border);
  }

  .bottom-nav {
    max-width: 428px;
    left: 50%;
    transform: translateX(-50%);
  }
}