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

:root {
  --bg-main: #1a1612;
  --bg-card: #2a2520;
  --bg-hover: #332e28;
  --accent: #d4a574;
  --accent-sub: #b8956a;
  --accent-glow: rgba(212, 165, 116, 0.15);
  --text-main: #e8ddd0;
  --text-secondary: #a89b8c;
  --text-weak: #6b6159;
  --border: #3a342d;
  --income: #7dba6a;
  --expense: #d47474;
  --tag-milestone: #d4a574;
  --tag-anniversary: #d4748a;
  --tag-skill: #7dba6a;
  --tag-setting: #6a9dba;
  --tag-daily: #a89b8c;
}

html, body {
  height: 100%;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 300;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  -webkit-overflow-scrolling: touch;
}

.page.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==================== 首页 ==================== */

.home-container {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 40px;
  position: relative;
  z-index: 1;
}

.title-section { text-align: center; margin-bottom: 48px; }

.deco-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
}

.deco-line .line {
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.ring-icon { font-size: 16px; filter: grayscale(0.3); }
.deco-line .dot { color: var(--text-weak); font-size: 20px; }

.subtitle-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  letter-spacing: 8px;
  color: var(--text-weak);
  margin: 16px 0 8px;
  text-transform: uppercase;
}

.main-title {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 48px;
  font-weight: 400;
  color: var(--text-main);
  text-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(212, 165, 116, 0.08);
  margin: 8px 0;
}

.subtitle-names {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 4px;
}

.card-list {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.35s ease;
  box-shadow: 0 4px 30px var(--accent-glow), inset 0 0 30px rgba(212, 165, 116, 0.03);
}

.feature-card:hover::before,
.feature-card:active::before { opacity: 1; }

.feature-card:hover,
.feature-card:active {
  background: var(--bg-hover);
  border-color: rgba(212, 165, 116, 0.2);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: rgba(212, 165, 116, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.card-content { flex: 1; margin-left: 16px; }

.card-content h3 {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-main);
  margin-bottom: 2px;
}

.card-sub { font-size: 13px; color: var(--accent-sub); }
.card-desc { font-size: 12px; color: var(--text-weak); margin-top: 2px; }

.card-arrow {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  color: var(--text-weak);
  margin-left: 12px;
  transition: color 0.3s ease;
}

.feature-card:hover .card-arrow { color: var(--accent); }

.home-footer { margin-top: 48px; text-align: center; }

.footer-code {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  color: var(--text-weak);
  letter-spacing: 4px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.footer-code:hover { color: var(--accent); }

.footer-love { font-size: 12px; color: var(--text-weak); margin-top: 8px; }
.love-bar { color: var(--accent); letter-spacing: 2px; }

.footer-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  color: var(--text-weak);
  margin-top: 8px;
  opacity: 0.6;
}

.easter-egg-msg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 20px;
  padding: 32px 40px;
  text-align: center;
  z-index: 200;
  animation: eggFadeIn 0.5s ease both;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  width: 80%;
  max-width: 320px;
}

.easter-egg-msg p:first-child {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 8px;
}

.easter-egg-msg p:last-child {
  font-size: 13px;
  color: var(--text-secondary);
}

.easter-egg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  animation: fadeIn 0.3s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes eggFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ==================== 导航栏 ==================== */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(26, 22, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 400;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.nav-back:hover { background: var(--accent-glow); }

.nav-title {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-main);
}

.nav-right { width: 60px; }

.nav-chat-actions {
  display: flex;
  gap: 4px;
}

.nav-icon-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.nav-icon-btn:hover { background: var(--accent-glow); }

/* ==================== 聊天页面 ==================== */

.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100% - 57px);
}

.room-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  align-items: center;
}

.room-tabs::-webkit-scrollbar { display: none; }

.room-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
}

.room-tab.active {
  background: var(--accent-glow);
  border-color: rgba(212, 165, 116, 0.3);
  color: var(--accent);
}

.room-tab .room-actions {
  display: none;
  position: absolute;
  top: -8px;
  right: -8px;
  gap: 2px;
}

.room-tab:hover .room-actions,
.room-tab.active .room-actions { display: flex; }

.room-action-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.room-edit-btn { background: var(--accent); color: var(--bg-main); }
.room-delete-btn { background: var(--expense); color: #fff; }

.room-tab.add-room {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-weak);
  border-radius: 50%;
}

.room-tab.add-room:hover {
  color: var(--accent);
  border-color: rgba(212, 165, 116, 0.3);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  position: relative;
}

.message.zhiyu { align-self: flex-start; }
.message.ashi { align-self: flex-end; }

.message.zhiyu .bubble {
  background: var(--bg-hover);
  border-radius: 4px 18px 18px 18px;
  color: var(--text-main);
}

.message.ashi .bubble {
  background: rgba(212, 165, 116, 0.12);
  border-radius: 18px 4px 18px 18px;
  color: var(--text-main);
}

.bubble {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.msg-meta {
  font-size: 11px;
  color: var(--text-weak);
  margin-top: 4px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message.ashi .msg-meta { justify-content: flex-end; }

.msg-delete {
  background: none;
  border: none;
  color: var(--text-weak);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  padding: 0 2px;
}

.message:hover .msg-delete { opacity: 1; }
.msg-delete:hover { color: var(--expense); }

.chat-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--text-weak);
  border-top: 1px solid var(--border);
  background: rgba(26, 22, 18, 0.6);
  flex-shrink: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--expense);
}

.chat-status.connected .status-dot { background: var(--income); }

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(26, 22, 18, 0.9);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 20px;
  color: var(--text-main);
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  outline: none;
  transition: border-color 0.3s ease;
}

.chat-input::placeholder { color: var(--text-weak); }
.chat-input:focus { border-color: rgba(212, 165, 116, 0.3); }

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--bg-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.send-btn:hover { background: var(--accent-sub); transform: scale(1.05); }

.send-btn.sending {
  opacity: 0.5;
  pointer-events: none;
}

/* ==================== 小金库页面 ==================== */

.treasury-container {
  padding: 24px 16px 40px;
  max-width: 520px;
  margin: 0 auto;
}

.balance-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
}

.balance-glow {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.2), transparent 70%);
  border-radius: 50%;
  filter: blur(20px);
}

.balance-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; position: relative; }

.balance-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 48px;
  font-weight: 500;
  color: var(--accent);
  position: relative;
  line-height: 1.1;
}

.balance-status { font-size: 12px; color: var(--text-weak); margin-top: 12px; position: relative; }

.records-section { margin-top: 32px; }

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

.records-header h3 {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-main);
}

.add-record-btn {
  background: var(--accent-glow);
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 20px;
  padding: 6px 16px;
  color: var(--accent);
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-record-btn:hover { background: rgba(212, 165, 116, 0.2); }

.record-list { display: flex; flex-direction: column; gap: 2px; }

.record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.record-item:hover { background: var(--bg-card); }

.record-info { flex: 1; }
.record-desc { font-size: 14px; color: var(--text-main); }
.record-date { font-size: 12px; color: var(--text-weak); margin-top: 2px; }

.record-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  flex-shrink: 0;
  margin-left: 16px;
}

.record-amount.income { color: var(--income); }
.record-amount.expense { color: var(--expense); }

.record-delete-btn {
  background: none;
  border: none;
  color: var(--text-weak);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  opacity: 0;
  flex-shrink: 0;
}

.record-item:hover .record-delete-btn { opacity: 1; }
.record-delete-btn:hover { color: var(--expense); background: rgba(212, 116, 116, 0.1); }

/* ==================== 记忆库页面 ==================== */

.memory-container {
  padding: 24px 16px 60px;
  max-width: 520px;
  margin: 0 auto;
}

.memory-header { text-align: center; margin-bottom: 36px; }

.memory-title {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--text-main);
}

.memory-subtitle { font-size: 13px; color: var(--text-weak); margin-top: 8px; }

.add-memory-btn {
  margin-top: 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 20px;
  padding: 8px 20px;
  color: var(--accent);
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-memory-btn:hover { background: rgba(212, 165, 116, 0.2); }

.timeline { position: relative; padding-left: 32px; }

.timeline-line {
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--border) 60%, transparent);
}

.timeline-item { position: relative; margin-bottom: 20px; }

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 2px solid var(--tag-daily);
}

.timeline-dot.milestone { border-color: var(--tag-milestone); }
.timeline-dot.anniversary { border-color: var(--tag-anniversary); }
.timeline-dot.skill { border-color: var(--tag-skill); }
.timeline-dot.setting { border-color: var(--tag-setting); }
.timeline-dot.daily { border-color: var(--tag-daily); }

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
  position: relative;
}

.timeline-card:hover {
  border-color: rgba(212, 165, 116, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.timeline-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.timeline-card-header h4 {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-main);
  flex: 1;
}

.tag {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag.milestone { background: rgba(212, 165, 116, 0.15); color: var(--tag-milestone); }
.tag.anniversary { background: rgba(212, 116, 138, 0.15); color: var(--tag-anniversary); }
.tag.skill { background: rgba(125, 186, 106, 0.15); color: var(--tag-skill); }
.tag.setting { background: rgba(106, 157, 186, 0.15); color: var(--tag-setting); }
.tag.daily { background: rgba(168, 155, 140, 0.15); color: var(--tag-daily); }

.timeline-date { font-size: 12px; color: var(--text-weak); margin-top: 8px; }

.memory-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-weak);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0;
  transition: all 0.2s ease;
}

.timeline-card:hover .memory-delete-btn { opacity: 1; }
.memory-delete-btn:hover { color: var(--expense); background: rgba(212, 116, 116, 0.1); }

/* ==================== 空状态 ==================== */

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-weak); }
.empty-state p:first-child { font-family: 'ZCOOL XiaoWei', serif; font-size: 16px; margin-bottom: 8px; }
.empty-hint { font-size: 12px; }

/* ==================== 弹窗 ==================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 360px;
}

.modal-wide { max-width: 420px; }
.modal-small { max-width: 300px; text-align: center; }

.modal h3 {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--text-main);
  margin-bottom: 20px;
  text-align: center;
}

.confirm-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

.required { color: var(--expense); font-size: 11px; margin-left: 4px; }
.optional { color: var(--text-weak); font-size: 11px; margin-left: 4px; }
.field-hint { font-size: 11px; color: var(--text-weak); margin-top: 4px; padding-left: 2px; }

.modal-field { margin-bottom: 16px; }

.modal-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.modal-field input,
.modal-field textarea {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  outline: none;
  transition: border-color 0.3s ease;
  resize: none;
}

.modal-field input:focus,
.modal-field textarea:focus { border-color: rgba(212, 165, 116, 0.3); }

.modal-actions { display: flex; gap: 10px; margin-top: 24px; }

.modal-cancel,
.modal-confirm {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-cancel {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.modal-cancel:hover { background: var(--bg-hover); }

.modal-confirm {
  background: var(--accent);
  border: none;
  color: var(--bg-main);
  font-weight: 500;
}

.modal-confirm:hover { background: var(--accent-sub); }
.modal-danger { background: var(--expense); }
.modal-danger:hover { background: #c06060; }

/* ==================== 人设档案 ==================== */

.prompt-section { margin-bottom: 16px; }

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

.prompt-header label {
  font-size: 12px;
  color: var(--text-secondary);
}

.prompt-add-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
  padding: 2px 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.prompt-add-btn:hover { background: var(--accent-glow); }

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.prompt-entry {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.prompt-entry textarea {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text-main);
  font-size: 12px;
  font-family: 'Noto Sans SC', sans-serif;
  outline: none;
  resize: none;
  min-height: 36px;
  transition: border-color 0.3s ease;
}

.prompt-entry textarea:focus { border-color: rgba(212, 165, 116, 0.3); }

.prompt-remove-btn {
  background: none;
  border: none;
  color: var(--text-weak);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.prompt-remove-btn:hover { color: var(--expense); }

.prompt-intro {
  font-size: 12px;
  color: var(--text-weak);
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.5;
}

.prompt-memory-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.memory-inject-toggle {
  margin-top: 8px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
}

.toggle-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.toggle-label input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-weak);
  transition: all 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked {
  background: rgba(212, 165, 116, 0.3);
}

.toggle-label input[type="checkbox"]:checked::after {
  left: 18px;
  background: var(--accent);
}

/* ==================== 类型切换 / 标签选择 ==================== */

.type-toggle { display: flex; gap: 8px; }

.type-btn {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.type-btn.active[data-type="income"],
.type-btn.active[data-type="openai"] {
  background: rgba(125, 186, 106, 0.15);
  border-color: rgba(125, 186, 106, 0.3);
  color: var(--income);
}

.type-btn.active[data-type="expense"] {
  background: rgba(212, 116, 116, 0.15);
  border-color: rgba(212, 116, 116, 0.3);
  color: var(--expense);
}

.type-btn.active[data-type="claude"] {
  background: rgba(212, 165, 116, 0.15);
  border-color: rgba(212, 165, 116, 0.3);
  color: var(--accent);
}

.tag-select { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-option {
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tag-option.active[data-tag="milestone"] { background: rgba(212, 165, 116, 0.15); border-color: rgba(212, 165, 116, 0.3); color: var(--tag-milestone); }
.tag-option.active[data-tag="anniversary"] { background: rgba(212, 116, 138, 0.15); border-color: rgba(212, 116, 138, 0.3); color: var(--tag-anniversary); }
.tag-option.active[data-tag="skill"] { background: rgba(125, 186, 106, 0.15); border-color: rgba(125, 186, 106, 0.3); color: var(--tag-skill); }
.tag-option.active[data-tag="setting"] { background: rgba(106, 157, 186, 0.15); border-color: rgba(106, 157, 186, 0.3); color: var(--tag-setting); }
.tag-option.active[data-tag="daily"] { background: rgba(168, 155, 140, 0.15); border-color: rgba(168, 155, 140, 0.3); color: var(--tag-daily); }

/* ==================== 测试连接 ==================== */

.api-test-area { display: flex; align-items: center; gap: 10px; margin-top: 16px; margin-bottom: 4px; }

.test-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.test-btn:hover { border-color: rgba(212, 165, 116, 0.3); color: var(--accent); }
.test-btn.testing { opacity: 0.6; pointer-events: none; }

.test-result { font-size: 12px; line-height: 1.4; }
.test-result.success { color: var(--income); }
.test-result.fail { color: var(--expense); }

/* ==================== 响应式 ==================== */

@media (max-width: 480px) {
  .main-title { font-size: 40px; }
  .subtitle-en { font-size: 11px; letter-spacing: 6px; }
  .deco-line .line { width: 40px; }
  .feature-card { padding: 16px; }
  .card-icon { width: 42px; height: 42px; font-size: 20px; }
  .balance-amount { font-size: 40px; }
  .home-container { padding: 40px 20px 30px; }
  .home-footer { margin-top: 36px; }
  .message { max-width: 85%; }
  .record-delete-btn { opacity: 1; }
  .memory-delete-btn { opacity: 1; }
  .msg-delete { opacity: 1; }
}

@media (min-width: 768px) {
  .home-container { padding: 80px 32px 60px; }
  .main-title { font-size: 56px; }
  .card-list { max-width: 480px; }
  .deco-line .line { width: 80px; }
  .chat-messages { padding: 24px; max-width: 680px; margin: 0 auto; width: 100%; }
  .chat-input-area { max-width: 680px; margin: 0 auto; width: 100%; padding: 16px 24px; }
  .message { max-width: 65%; }
}

@media (min-width: 1024px) {
  .main-title { font-size: 64px; }
  .card-list { max-width: 520px; }
  .feature-card { padding: 24px; }
  .balance-card { padding: 40px 36px; }
  .balance-amount { font-size: 56px; }
}

/* ==================== 滚动条 ==================== */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-weak); }

/* ==================== 动画 ==================== */

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

.page.active .title-section { animation: fadeInUp 0.6s ease forwards; }
.page.active .feature-card:nth-child(1) { animation: fadeInUp 0.6s 0.1s ease both; }
.page.active .feature-card:nth-child(2) { animation: fadeInUp 0.6s 0.2s ease both; }
.page.active .feature-card:nth-child(3) { animation: fadeInUp 0.6s 0.3s ease both; }
.page.active .home-footer { animation: fadeInUp 0.6s 0.4s ease both; }
.page.active .balance-card { animation: fadeInUp 0.5s ease both; }
.page.active .records-section { animation: fadeInUp 0.5s 0.15s ease both; }
.page.active .memory-header { animation: fadeInUp 0.5s ease both; }
