/* ============================================
   I can do better - iPhone App Stylesheet
   粉色 Hello Kitty 主题 · 简洁工作台
   ============================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 主色调 - 低饱和粉 */
  --kitty-pink: #ffb6c8;
  --kitty-pink-light: #ffd9e3;
  --kitty-pink-pale: #fff0f4;
  --kitty-pink-deep: #e89bb0;
  --kitty-pink-soft: #f5c5d4;
  
  /* 中性色 */
  --bg-white: #ffffff;
  --bg-cream: #fefafa;
  --bg-gray: #f7f7f9;
  --text-primary: #2c2c2c;
  --text-secondary: #6b6b6b;
  --text-tertiary: #a0a0a0;
  --text-light: #cccccc;
  
  /* 功能色 */
  --priority-high: #e8707e;
  --priority-mid: #f0a868;
  --priority-low: #8ec6a8;
  
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(255, 182, 200, 0.15);
  --shadow-md: 0 4px 12px rgba(255, 182, 200, 0.2);
  --shadow-lg: 0 8px 24px rgba(255, 182, 200, 0.25);
  
  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  /* iPhone 尺寸 */
  --phone-width: 390px;
  --phone-height: 844px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f5e6ea 0%, #e8dff0 50%, #e6f0f5 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text-primary);
}

/* ---------- iPhone 外壳 ---------- */
.phone-frame {
  width: var(--phone-width);
  height: var(--phone-height);
  background: #000;
  border-radius: 55px;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 2px #1a1a1a;
  position: relative;
  flex-shrink: 0;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg-cream);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  background: #000;
  border-radius: 20px;
  z-index: 9999;
}

/* 状态栏 */
.status-bar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.status-bar-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-bar svg {
  width: 17px;
  height: 17px;
}

/* Home Indicator */
.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: var(--text-primary);
  border-radius: 3px;
  z-index: 9999;
  opacity: 0.3;
}

/* ---------- App 容器 ---------- */
.app-container {
  display: flex;
  flex-direction: column;
  height: calc(100% - 54px);
  position: relative;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.app-content::-webkit-scrollbar {
  display: none;
}

/* ---------- 页面通用 ---------- */
.page {
  display: none;
  min-height: 100%;
  padding-bottom: 90px;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 底部 TabBar ---------- */
.tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 83px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 182, 200, 0.2);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 8px;
  z-index: 500;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 12px;
  transition: all 0.2s;
  flex: 1;
}

.tab-item svg {
  width: 26px;
  height: 26px;
  stroke: var(--text-tertiary);
  fill: none;
  stroke-width: 2;
  transition: all 0.2s;
}

.tab-item span {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
  transition: all 0.2s;
}

.tab-item.active svg {
  stroke: var(--kitty-pink-deep);
}

.tab-item.active span {
  color: var(--kitty-pink-deep);
  font-weight: 600;
}

/* ---------- 通用组件 ---------- */

/* 页面标题 */
.page-header {
  padding: 12px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 卡片 */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--kitty-pink);
  color: white;
}

.btn-primary:active {
  background: var(--kitty-pink-deep);
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--kitty-pink-pale);
  color: var(--kitty-pink-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
  gap: 4px;
}

/* FAB 浮动按钮 */
.fab {
  position: absolute;
  bottom: 100px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kitty-pink), var(--kitty-pink-deep));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 400;
  border: none;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
}

.fab:active {
  transform: scale(0.9);
}

/* 标签 chip */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--kitty-pink-pale);
  color: var(--kitty-pink-deep);
}

.chip-gray {
  background: var(--bg-gray);
  color: var(--text-secondary);
}

/* 优先级标记 */
.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.priority-high { background: var(--priority-high); }
.priority-mid { background: var(--priority-mid); }
.priority-low { background: var(--priority-low); }

.priority-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.priority-tag.high { background: rgba(232,112,126,0.12); color: var(--priority-high); }
.priority-tag.mid { background: rgba(240,168,104,0.12); color: var(--priority-mid); }
.priority-tag.low { background: rgba(142,198,168,0.12); color: var(--priority-low); }

/* 复选框 */
.checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--kitty-pink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.checkbox.checked {
  background: var(--kitty-pink);
  border-color: var(--kitty-pink);
}

.checkbox svg {
  width: 14px;
  height: 14px;
  stroke: white;
  stroke-width: 3;
  fill: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.checkbox.checked svg {
  opacity: 1;
}

/* ---------- 弹窗/底部抽屉 ---------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border-radius: 28px 28px 0 0;
  z-index: 900;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 85%;
  overflow-y: auto;
  padding-bottom: 30px;
}

.bottom-sheet.show {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 5px;
  background: var(--text-light);
  border-radius: 3px;
  margin: 10px auto 16px;
}

.sheet-title {
  font-size: 20px;
  font-weight: 700;
  padding: 0 20px 16px;
}

.sheet-body {
  padding: 0 20px;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--kitty-pink-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--bg-cream);
  color: var(--text-primary);
  outline: none;
  transition: border 0.2s;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--kitty-pink);
}

textarea.form-input {
  resize: none;
  min-height: 80px;
}

.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--kitty-pink-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--bg-cream);
  color: var(--text-primary);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23a0a0a0' stroke-width='2' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* 优先级选择器 */
.priority-selector {
  display: flex;
  gap: 8px;
}

.priority-option {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.priority-option.high { background: rgba(232,112,126,0.08); color: var(--priority-high); }
.priority-option.mid { background: rgba(240,168,104,0.08); color: var(--priority-mid); }
.priority-option.low { background: rgba(142,198,168,0.08); color: var(--priority-low); }

.priority-option.selected {
  border-color: currentColor;
}

/* 操作按钮组 */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.action-row .btn {
  flex: 1;
}

/* ---------- Kitty 装饰元素 ---------- */
.kitty-deco {
  position: absolute;
  pointer-events: none;
  opacity: 0.5;
}

.kitty-bow {
  position: absolute;
  width: 20px;
  height: 20px;
}

/* ---------- 空状态 ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ---------- 分段控制 ---------- */
.segment {
  display: flex;
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  padding: 3px;
  margin: 0 20px 12px;
}

.segment-item {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.segment-item.active {
  background: var(--bg-white);
  color: var(--kitty-pink-deep);
  box-shadow: var(--shadow-sm);
}

/* ---------- 任务卡片 ---------- */
.task-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 0 20px 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.2s;
}

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

.task-card.completed {
  opacity: 0.6;
}

.task-card.completed .task-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.task-content-wrap {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.task-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-deadline {
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-deadline.urgent {
  color: var(--priority-high);
  font-weight: 600;
}

.task-deadline svg {
  width: 12px;
  height: 12px;
}

/* 任务关联图片缩略 */
.task-thumbs {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.task-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-gray);
}

/* ---------- 统计看板 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card .stat-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--kitty-pink-deep);
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 迷你图表 */
.mini-chart {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 20px 16px;
  box-shadow: var(--shadow-sm);
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-title span:last-child {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 80px;
  gap: 6px;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 24px;
  background: linear-gradient(180deg, var(--kitty-pink) 0%, var(--kitty-pink-light) 100%);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
}

.bar-label {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ---------- 板块入口卡片 ---------- */
.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 20px;
}

.section-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.section-card:active {
  transform: scale(0.97);
}

.section-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon svg {
  width: 28px;
  height: 28px;
}

.section-info {
  flex: 1;
}

.section-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.section-stats {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  gap: 10px;
}

.section-arrow {
  color: var(--text-light);
  font-size: 20px;
}

/* ---------- 图库 ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 12px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-gray);
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(255,255,255,0.85);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 9px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-item-linked {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--kitty-pink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item-linked svg {
  width: 10px;
  height: 10px;
  stroke: white;
  stroke-width: 3;
  fill: none;
}

/* ---------- 笔记 ---------- */
.note-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 20px 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

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

.note-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.note-preview {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-light);
}

/* ---------- 成果仓库 ---------- */
.achievement-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 20px 12px;
  box-shadow: var(--shadow-sm);
}

.achievement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.achievement-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.achievement-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.achievement-images {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
}

.achievement-images img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ---------- 模板库 ---------- */
.template-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 20px 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
}

.template-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--kitty-pink-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.template-icon svg {
  width: 24px;
  height: 24px;
}

.template-info {
  flex: 1;
}

.template-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.template-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ---------- 复盘日记 ---------- */
.diary-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 20px 12px;
  box-shadow: var(--shadow-sm);
}

.diary-date {
  font-size: 13px;
  color: var(--kitty-pink-deep);
  font-weight: 600;
  margin-bottom: 8px;
}

.diary-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- 小组件预览 ---------- */
.widget-preview-section {
  padding: 0 20px;
}

.widget-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.widget-medium {
  background: linear-gradient(135deg, var(--kitty-pink-pale) 0%, var(--bg-white) 100%);
  border: 1px solid var(--kitty-pink-light);
  box-shadow: var(--shadow-sm);
}

.widget-small {
  background: linear-gradient(135deg, var(--kitty-pink-pale) 0%, var(--bg-white) 100%);
  border: 1px solid var(--kitty-pink-light);
}

.widget-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  font-weight: 600;
}

.widget-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.widget-task-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kitty-pink);
  flex-shrink: 0;
}

.widget-row {
  display: flex;
  gap: 12px;
}

.widget-row .widget-small {
  flex: 1;
}

/* ---------- 每日提醒 ---------- */
.routine-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 0 20px 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.routine-time {
  text-align: center;
  flex-shrink: 0;
  width: 56px;
}

.routine-time .time {
  font-size: 18px;
  font-weight: 700;
  color: var(--kitty-pink-deep);
}

.routine-time .label {
  font-size: 10px;
  color: var(--text-tertiary);
}

.routine-info {
  flex: 1;
}

.routine-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.routine-toggle {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--kitty-pink);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.routine-toggle.off {
  background: var(--text-light);
}

.routine-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.routine-toggle:not(.off)::after {
  transform: translateX(18px);
}

/* ---------- 搜索栏 ---------- */
.search-bar {
  margin: 0 20px 12px;
  position: relative;
}

.search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-tertiary);
  fill: none;
  stroke-width: 2;
}

.search-bar input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-gray);
  font-size: 14px;
  outline: none;
  color: var(--text-primary);
}

/* ---------- 标签筛选 ---------- */
.tag-filter {
  display: flex;
  gap: 8px;
  padding: 0 20px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tag-filter::-webkit-scrollbar { display: none; }

.tag-filter-item {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-gray);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.tag-filter-item.active {
  background: var(--kitty-pink);
  color: white;
}

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 操作菜单 ---------- */
.action-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--bg-gray);
  cursor: pointer;
}

.action-menu-item:last-child {
  border-bottom: none;
}

.action-menu-item svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2;
}

.action-menu-item span {
  font-size: 15px;
  color: var(--text-primary);
}

.action-menu-item.danger span,
.action-menu-item.danger svg {
  color: var(--priority-high);
  stroke: var(--priority-high);
}

/* ---------- 归档标记 ---------- */
.archived-banner {
  background: var(--kitty-pink-pale);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--kitty-pink-deep);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 图片预览弹窗 */
.image-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.image-preview-overlay.show {
  display: flex;
}

.image-preview-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
}

/* 导出文本弹窗 */
.export-textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1.5px solid var(--kitty-pink-light);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--bg-cream);
  color: var(--text-primary);
  outline: none;
  resize: none;
  font-family: 'SF Mono', Monaco, monospace;
  line-height: 1.5;
}

/* ---------- 子页面覆盖 ---------- */
#sub-page {
  display: none;
  background: var(--bg-cream);
  padding-bottom: 90px !important;
}

#sub-page.active {
  display: block;
}

/* 滚动隐藏 */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-x::-webkit-scrollbar { display: none; }

/* 列表过渡 */
.list-item-enter {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 设置页 */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-gray);
  cursor: pointer;
}

.setting-row:last-child { border-bottom: none; }

.setting-row-label {
  font-size: 15px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-row-label svg {
  width: 22px;
  height: 22px;
  stroke: var(--kitty-pink-deep);
  fill: none;
  stroke-width: 2;
}

.setting-row-value {
  font-size: 13px;
  color: var(--text-tertiary);
}
