/* ===================================
   Reset & Base
   =================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #EDEDED;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  color: #1A1A1A;
  -webkit-font-smoothing: antialiased;
}

/* ===================================
   App Container
   =================================== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 540px;
  margin: 0 auto;
  position: relative;
  background: #EDEDED;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ===================================
   Top Navigation Bar
   =================================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 8px 0 4px;
  background: #EDEDED;
  border-bottom: 0.5px solid #D4D4D4;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.top-title {
  font-size: 17px;
  font-weight: 600;
  color: #1A1A1A;
  letter-spacing: 0.2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ===================================
   Icon Buttons (shared)
   =================================== */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  color: #1A1A1A;
  transition: background 0.12s;
  flex-shrink: 0;
}

.icon-btn:active {
  background: rgba(0,0,0,0.06);
}

/* ===================================
   Chat Area
   =================================== */
.chat-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar */
.chat-area::-webkit-scrollbar { width: 0; }

/* ===================================
   Time Divider
   =================================== */
.time-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.time-divider span {
  font-size: 12px;
  color: #999;
  background: rgba(0,0,0,0.06);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* ===================================
   Message Row
   =================================== */
.message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  animation: fadeInUp 0.2s ease;
}

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

/* AI messages: left aligned */
.ai-row {
  flex-direction: row;
  padding-right: 60px;
}

/* User messages: right aligned */
.user-row {
  flex-direction: row-reverse;
  padding-left: 60px;
}

/* ===================================
   Avatar
   =================================== */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar svg,
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.user-avatar {
  background: #5BAF6A;
}

/* ===================================
   Message Content & Bubble
   =================================== */
.message-content {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.sender-name {
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
  padding-left: 2px;
}

.bubble {
  display: inline-block;
  padding: 10px 13px;
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
  position: relative;
  max-width: 100%;
}

/* AI bubble: white with left triangle */
.ai-bubble {
  background: #FFFFFF;
  color: #1A1A1A;
  border-radius: 0 8px 8px 8px;
}

.ai-bubble::before {
  content: '';
  position: absolute;
  top: 12px;
  left: -7px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 8px 5px 0;
  border-color: transparent #FFFFFF transparent transparent;
}

/* User bubble: WeChat green with right triangle */
.user-bubble {
  background: #95EC69;
  color: #1A1A1A;
  border-radius: 8px 0 8px 8px;
}

.user-bubble::after {
  content: '';
  position: absolute;
  top: 12px;
  right: -7px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #95EC69;
}

/* Image bubble */
.image-bubble {
  padding: 3px;
  background: transparent;
  border-radius: 8px;
  max-width: 220px;
}

.image-bubble::before,
.image-bubble::after {
  display: none;
}

.image-bubble img {
  width: 100%;
  max-width: 220px;
  max-height: 280px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  cursor: pointer;
}

/* ===================================
   Voice Message Bubble
   =================================== */
.voice-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 80px;
  padding: 10px 14px;
}

.voice-wave-icon {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 18px;
}

.voice-wave-icon span {
  display: inline-block;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.85;
}

.voice-wave-icon span:nth-child(1) { height: 6px; }
.voice-wave-icon span:nth-child(2) { height: 12px; }
.voice-wave-icon span:nth-child(3) { height: 18px; }
.voice-wave-icon span:nth-child(4) { height: 12px; }
.voice-wave-icon span:nth-child(5) { height: 6px; }

.voice-duration {
  font-size: 14px;
  color: #555;
}

/* 语音播放中的动画效果 */
.voice-bubble.voice-playing {
  background: #07C160;
  transition: background 0.3s;
}

.voice-bubble.voice-playing .voice-wave-icon span {
  animation: voiceWavePlay 0.8s ease-in-out infinite;
}

.voice-bubble.voice-playing .voice-wave-icon span:nth-child(1) { animation-delay: 0s; }
.voice-bubble.voice-playing .voice-wave-icon span:nth-child(2) { animation-delay: 0.1s; }
.voice-bubble.voice-playing .voice-wave-icon span:nth-child(3) { animation-delay: 0.2s; }
.voice-bubble.voice-playing .voice-wave-icon span:nth-child(4) { animation-delay: 0.3s; }
.voice-bubble.voice-playing .voice-wave-icon span:nth-child(5) { animation-delay: 0.4s; }

.voice-bubble.voice-playing .voice-duration {
  color: #fff;
}

@keyframes voiceWavePlay {
  0%, 100% {
    transform: scaleY(0.4);
    opacity: 0.6;
  }
  50% {
    transform: scaleY(1.2);
    opacity: 1;
  }
}

/* ===================================
   Typing Indicator (AI thinking)
   =================================== */
.typing-row .bubble {
  padding: 14px 16px;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 12px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: #AAAAAA;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* ===================================
   Bill Card (AI structured response)
   =================================== */
.bill-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  min-width: 220px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.bill-card-header {
  background: #07C160;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bill-card-header .bill-icon { font-size: 18px; }
.bill-card-header .bill-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.bill-card-body {
  padding: 12px 14px;
}

.bill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
}

.bill-row .label { color: #888; }
.bill-row .value { color: #1A1A1A; font-weight: 500; }
.bill-row .amount { color: #E74C3C; font-size: 18px; font-weight: 700; }
.bill-row .income { color: #07C160; font-size: 18px; font-weight: 700; }

.bill-card-footer {
  padding: 8px 14px 12px;
  border-top: 0.5px solid #F0F0F0;
  font-size: 12px;
  color: #AAA;
  text-align: center;
}

/* ===================================
   Bottom Bar
   =================================== */
.bottom-bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 6px 8px;
  background: #F7F7F7;
  border-top: 0.5px solid #D4D4D4;
  flex-shrink: 0;
  min-height: 56px;
  /* Safe area padding for iOS */
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

/* ===================================
   Text Input Wrapper
   =================================== */
.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 36px;
  max-height: 120px;
}

.text-input {
  width: 100%;
  min-height: 36px;
  max-height: 120px;
  padding: 7px 11px;
  background: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  font-size: 15px;
  color: #1A1A1A;
  resize: none;
  outline: none;
  line-height: 1.4;
  overflow-y: auto;
  transition: border-color 0.15s;
  font-family: inherit;
}

.text-input:focus {
  border-color: #C8C8C8;
}

.text-input::placeholder { color: #BBBBBB; }

/* Hold-to-speak button */
.hold-to-speak {
  width: 100%;
  height: 36px;
  background: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  font-size: 15px;
  color: #1A1A1A;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.1s;
  font-family: inherit;
}

.hold-to-speak:active,
.hold-to-speak.pressing {
  background: #D9D9D9;
}

.hold-to-speak.cancel-mode {
  background: #FF4444;
  color: white;
  border-color: #FF4444;
}

/* ===================================
   Send Button
   =================================== */
.send-btn {
  padding: 0 14px;
  height: 36px;
  background: #07C160;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 0.12s;
}

.send-btn:active { background: #06AD56; }

/* ===================================
   Right Icons (emoji + plus)
   =================================== */
.right-icons {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

/* ===================================
   Plus Panel
   =================================== */
.plus-panel {
  background: #F7F7F7;
  border-top: 0.5px solid #D4D4D4;
  padding: 20px 16px;
  flex-shrink: 0;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.plus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.plus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.plus-item-icon {
  width: 60px;
  height: 60px;
  background: #FFFFFF;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: background 0.12s;
}

.plus-item:active .plus-item-icon {
  background: #E8E8E8;
}

.plus-item span {
  font-size: 12px;
  color: #666;
}

/* ===================================
   Recording Overlay — 微信风格
   =================================== */
.recording-overlay {
  position: fixed;
  inset: 0;
  /* 无全屏遮罩，聊天内容保持可见 */
  background: transparent;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* 触摸穿透，不拦截下方按钮事件 */
  animation: fadeIn 0.12s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.recording-panel {
  background: rgba(28, 28, 28, 0.86);
  border-radius: 20px;
  padding: 26px 36px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 176px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.18s ease;
}

/* 取消区域：面板变红 */
.recording-overlay.cancel-zone .recording-panel {
  background: rgba(180, 38, 38, 0.88);
}

.recording-mic-icon {
  width: 72px;
  height: 72px;
  background: #07C160;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: micPulse 1s infinite ease-in-out;
  transition: background 0.18s ease;
}

.recording-overlay.cancel-zone .recording-mic-icon {
  background: #e03030;
  animation: none;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(7,193,96,0.45); }
  50%       { box-shadow: 0 0 0 14px rgba(7,193,96,0); }
}

.recording-waves {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
}

.recording-waves span {
  display: inline-block;
  width: 4px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  animation: waveBar 0.8s infinite ease-in-out;
}

.recording-waves span:nth-child(1) { animation-delay: 0.0s; }
.recording-waves span:nth-child(2) { animation-delay: 0.1s; }
.recording-waves span:nth-child(3) { animation-delay: 0.2s; }
.recording-waves span:nth-child(4) { animation-delay: 0.3s; }
.recording-waves span:nth-child(5) { animation-delay: 0.4s; }
.recording-waves span:nth-child(6) { animation-delay: 0.3s; }
.recording-waves span:nth-child(7) { animation-delay: 0.2s; }
.recording-waves span:nth-child(8) { animation-delay: 0.1s; }
.recording-waves span:nth-child(9) { animation-delay: 0.0s; }

@keyframes waveBar {
  0%, 100% { height: 6px; }
  50%       { height: 28px; }
}

.recording-hint {
  font-size: 14px;
  color: rgba(255,255,255,0.88);
  text-align: center;
  line-height: 1.4;
}

.recording-hint.cancel { color: #ffaaaa; }

/* ===================================
   Image Preview Overlay
   =================================== */
.image-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.image-preview-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
  max-width: 90vw;
}

.image-preview-content img {
  max-width: 80vw;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 10px;
}

.preview-actions {
  display: flex;
  gap: 20px;
}

.preview-cancel,
.preview-send {
  padding: 10px 32px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.preview-cancel {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.preview-send {
  background: #07C160;
  color: #fff;
}

/* ===================================
   Toast Notification
   =================================== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.72);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  pointer-events: none;
  white-space: nowrap;
  animation: fadeIn 0.15s ease;
}

/* ===================================
   Responsive: slightly wider on tablet
   =================================== */
@media (min-width: 540px) {
  .app-container {
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
  }
}

/* ===================================
   Bill Modal (账单查看页)
   =================================== */
.bill-modal {
  position: absolute;
  inset: 0;
  background: #F2F2F7;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  animation: slideInUp 0.25s ease;
}

@keyframes slideInUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.bill-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 4px 0 8px;
  background: #EDEDED;
  border-bottom: 0.5px solid #D4D4D4;
  flex-shrink: 0;
}

.bill-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #1A1A1A;
  letter-spacing: 0.2px;
}

/* 月度汇总条 */
.bill-modal-summary {
  display: flex;
  justify-content: space-around;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 0.5px solid #E8E8E8;
  flex-shrink: 0;
}

.bill-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bill-summary-label {
  font-size: 12px;
  color: #999;
}

.bill-summary-value {
  font-size: 18px;
  font-weight: 700;
}

.bill-summary-value.expense { color: #E74C3C; }
.bill-summary-value.income  { color: #07C160; }
.bill-summary-value.net     { color: #1A1A1A; }

.bill-summary-divider {
  width: 0.5px;
  background: #E0E0E0;
  margin: 2px 0;
}

/* 账单列表滚动区 */
.bill-modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 20px;
  -webkit-overflow-scrolling: touch;
}

.bill-modal-body::-webkit-scrollbar { width: 0; }

/* 每天一组 */
.bill-date-group {
  margin-bottom: 10px;
}

.bill-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px 6px;
}

.bill-date-label {
  font-size: 13px;
  color: #888;
  font-weight: 500;
}

.bill-date-totals {
  display: flex;
  gap: 10px;
}

.bill-date-expense {
  font-size: 13px;
  color: #E74C3C;
}

.bill-date-income {
  font-size: 13px;
  color: #07C160;
}

/* 每天的账单卡片组 */
.bill-items-group {
  background: #fff;
  border-radius: 12px;
  margin: 0 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 单条账单行 */
.bill-item {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  gap: 12px;
  border-bottom: 0.5px solid #F5F5F5;
  position: relative;
  transition: background 0.12s;
  cursor: pointer;
}

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

.bill-item:active {
  background: #F9F9F9;
}

/* 分类图标圆圈 */
.bill-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* 中间信息区 */
.bill-item-info {
  flex: 1;
  min-width: 0;
}

.bill-item-category {
  font-size: 15px;
  font-weight: 500;
  color: #1A1A1A;
  line-height: 1.3;
}

.bill-item-desc {
  font-size: 12px;
  color: #AAAAAA;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 金额 */
.bill-item-amount {
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.bill-item-amount.expense { color: #E74C3C; }
.bill-item-amount.income  { color: #07C160; }

/* 右侧箭头 > */
.bill-item-edit-btn {
  background: none;
  border: none;
  padding: 0 0 0 8px;
  cursor: pointer;
  color: #C7C7CC;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color 0.12s;
}

.bill-item-edit-btn:active { color: #999; }

/* 空状态 */
.bill-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 14px;
  color: #AAAAAA;
}

.bill-empty .empty-icon { font-size: 48px; }
.bill-empty .empty-text { font-size: 15px; }

/* ===================================
   Edit Bottom Sheet（账单编辑弹窗）
   =================================== */
.edit-sheet {
  position: absolute;
  inset: 0;
  z-index: 1400;
}

.edit-sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  animation: fadeIn 0.2s ease;
}

.edit-sheet-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #F2F2F7;
  border-radius: 16px 16px 0 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  animation: slideInUp 0.25s ease;
}

.edit-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 0.5px solid #E0E0E0;
}

.edit-sheet-title {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
}

.edit-sheet-cancel {
  background: none;
  border: none;
  font-size: 15px;
  color: #888;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.edit-sheet-save {
  background: none;
  border: none;
  font-size: 15px;
  color: #07C160;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.edit-sheet-save:active { opacity: 0.7; }

.edit-delete-wrap {
  padding: 12px 16px 4px;
}

.edit-delete-btn {
  width: 100%;
  padding: 14px;
  background: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  color: #E74C3C;
  cursor: pointer;
  font-family: inherit;
}

.edit-delete-btn:active { opacity: 0.7; }

.edit-sheet-body {
  padding: 8px 0;
}

.edit-field {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  background: #fff;
  border-bottom: 0.5px solid #F5F5F5;
  gap: 16px;
}

.edit-field:last-child { border-bottom: none; }

.edit-field label {
  font-size: 15px;
  color: #666;
  width: 36px;
  flex-shrink: 0;
}

.edit-field input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: #1A1A1A;
  background: transparent;
  text-align: right;
  font-family: inherit;
}

.edit-field input[type="date"] {
  color: #1A1A1A;
}

.edit-field input::placeholder { color: #CCCCCC; }

.edit-type-btns {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.edit-type-btn {
  padding: 5px 18px;
  border-radius: 16px;
  border: 1.5px solid #E0E0E0;
  background: #F7F7F7;
  font-size: 14px;
  cursor: pointer;
  color: #888;
  font-family: inherit;
  transition: all 0.12s;
}

.edit-type-btn.active[data-type="expense"] {
  background: #FFF0F0;
  border-color: #E74C3C;
  color: #E74C3C;
  font-weight: 600;
}

.edit-type-btn.active[data-type="income"] {
  background: #F0FFF4;
  border-color: #07C160;
  color: #07C160;
  font-weight: 600;
}

/* 分类选择行（可点击） */
.edit-field-picker {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.edit-field-picker:active { background: #F9F9F9; }

.edit-picker-value {
  flex: 1;
  text-align: right;
  font-size: 15px;
  color: #1A1A1A;
  margin-right: 4px;
}

.edit-picker-value.placeholder { color: #CCCCCC; }

/* ===================================
   Category Picker（分类选择器）
   =================================== */
.cat-picker {
  position: absolute;
  inset: 0;
  z-index: 1500;
}

.cat-picker-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  animation: fadeIn 0.2s ease;
}

.cat-picker-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #F2F2F7;
  border-radius: 16px 16px 0 0;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  animation: slideInUp 0.25s ease;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.cat-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 8px 12px 16px;
  flex-shrink: 0;
  border-bottom: 0.5px solid #E0E0E0;
}

.cat-picker-title {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
}

.cat-picker-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 8px;
  -webkit-overflow-scrolling: touch;
}

.cat-picker-body::-webkit-scrollbar { width: 0; }

/* 分组 */
.cat-section { margin-bottom: 14px; }

.cat-section-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
  font-weight: 500;
}

/* 分类芯片网格 */
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-chip {
  padding: 7px 16px;
  background: #fff;
  border: 1.5px solid #E8E8E8;
  border-radius: 20px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
  line-height: 1.3;
}

.cat-chip:active { background: #F0F0F0; }

.cat-chip.selected {
  background: #E8F8EE;
  border-color: #07C160;
  color: #07C160;
  font-weight: 600;
}

.cat-chip.custom-chip {
  border-style: dashed;
  border-color: #BBBBBB;
  color: #888;
  background: transparent;
}

/* 自定义分类输入行 */
.cat-custom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 4px;
  border-top: 0.5px solid #E8E8E8;
  flex-shrink: 0;
}

.cat-custom-row input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid #E0E0E0;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  background: #fff;
}

/* ===================================
   Profile Editor
   =================================== */
#topTitle { cursor: pointer; }
#menuBtn  { cursor: pointer; }

.profile-modal {
  position: absolute;
  inset: 0;
  z-index: 1600;
  background: #F2F2F7;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: #F2F2F7;
  border-bottom: 0.5px solid #E0E0E0;
  flex-shrink: 0;
}

.profile-header-title {
  font-size: 17px;
  font-weight: 600;
  color: #1A1A1A;
}

.profile-back-btn { color: #07C160; }

.profile-save-btn {
  background: none;
  border: none;
  font-size: 15px;
  color: #07C160;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.profile-save-btn:active { opacity: 0.7; }

.profile-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 40px;
}

.profile-group-label {
  font-size: 13px;
  color: #888;
  padding: 0 16px 8px;
}

.profile-card {
  background: #fff;
  border-top: 0.5px solid #E0E0E0;
  border-bottom: 0.5px solid #E0E0E0;
  margin-bottom: 24px;
}

.profile-item {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  gap: 12px;
  cursor: pointer;
  min-height: 52px;
}

.profile-item-label {
  font-size: 15px;
  color: #1A1A1A;
  width: 40px;
  flex-shrink: 0;
}

.profile-avatar-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  margin-left: auto;
}

.profile-avatar-thumb img,
.profile-avatar-thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.profile-divider {
  height: 0.5px;
  background: #F0F0F0;
  margin-left: 16px;
}

.profile-name-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: #1A1A1A;
  text-align: right;
  background: transparent;
  font-family: inherit;
  cursor: text;
}
.profile-name-input::placeholder { color: #C7C7CC; }

.cat-custom-row input:focus { border-color: #07C160; }

.cat-custom-row button {
  padding: 0 18px;
  height: 38px;
  background: #07C160;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

/* ===================================
   Month Bill Modal（月账单三层导航）
   =================================== */

.month-modal {
  position: absolute;
  inset: 0;
  background: #F2F2F7;
  z-index: 1200;
  overflow: hidden;
  animation: slideInUp 0.25s ease;
}

/* 每一层视图：全屏覆盖，同一时刻只显示一层 */
.month-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #F2F2F7;
}

/* 向右滑入（深入：列表→月详→日详） */
.month-view.slide-in-right {
  animation: monthSlideInRight 0.22s ease forwards;
}

/* 向左滑入（返回：日详→月详→列表） */
.month-view.slide-in-left {
  animation: monthSlideInLeft 0.22s ease forwards;
}

@keyframes monthSlideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes monthSlideInLeft {
  from { transform: translateX(-28%); opacity: 0.6; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* 内容滚动区 */
.month-modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 20px;
  -webkit-overflow-scrolling: touch;
}

.month-modal-body::-webkit-scrollbar { width: 0; }

/* 通用卡片容器（圆角白底，与日账单列表一致） */
.month-items-card {
  background: #fff;
  border-radius: 12px;
  margin: 0 12px 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ---- 月份列表每行 ---- */
.month-list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 0.5px solid #F5F5F5;
  cursor: pointer;
  transition: background 0.12s;
  gap: 12px;
}

.month-list-item:last-child { border-bottom: none; }
.month-list-item:active     { background: #F9F9F9; }

.month-list-info { flex: 1; }

.month-list-label {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 4px;
}

.month-list-stats {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.month-list-expense { color: #E74C3C; }
.month-list-income  { color: #07C160; }

.month-list-arrow {
  color: #C7C7CC;
  flex-shrink: 0;
}

/* ---- 月详情中每天一行 ---- */
.day-list-item {
  display: flex;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 0.5px solid #F5F5F5;
  cursor: pointer;
  transition: background 0.12s;
  gap: 12px;
}

.day-list-item:last-child { border-bottom: none; }
.day-list-item:active     { background: #F9F9F9; }

.day-list-info  { flex: 1; }

.day-list-label {
  font-size: 15px;
  font-weight: 500;
  color: #1A1A1A;
}

.day-list-count {
  font-size: 12px;
  color: #AAAAAA;
  margin-top: 2px;
}

.day-list-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.day-list-amount-expense {
  font-size: 15px;
  font-weight: 600;
  color: #E74C3C;
}

.day-list-amount-income {
  font-size: 13px;
  font-weight: 500;
  color: #07C160;
}

.day-list-arrow {
  color: #C7C7CC;
  flex-shrink: 0;
  margin-left: 4px;
}

/* ===================================
   Year Bill Modal（年账单，与月账单共用内部 CSS 类）
   =================================== */
.year-modal {
  position: absolute;
  inset: 0;
  background: #F2F2F7;
  z-index: 1200;
  overflow: hidden;
  animation: slideInUp 0.25s ease;
}

/* ===================================
   Bill Calendar Modal（账单日历）
   =================================== */
.cal-modal {
  position: absolute;
  inset: 0;
  background: #F2F2F7;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  animation: slideInUp 0.25s ease;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.cal-month-title {
  font-size: 17px;
  font-weight: 600;
  color: #1A1A1A;
  white-space: nowrap;
}

.cal-week-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fff;
  border-bottom: 0.5px solid #E8E8E8;
  flex-shrink: 0;
}

.cal-week-header span {
  text-align: center;
  padding: 8px 0;
  font-size: 12px;
  color: #888;
  font-weight: 500;
}

.cal-week-header span:first-child { color: #E74C3C; }
.cal-week-header span:last-child  { color: #5B9BD5; }

.cal-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-content: start;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.cal-grid::-webkit-scrollbar { width: 0; }

.cal-cell {
  border-right: 0.5px solid #F0F0F0;
  border-bottom: 0.5px solid #F0F0F0;
  padding: 6px 3px 5px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}

.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:active { background: #F5F5F5; }
.cal-cell.empty  { cursor: default; background: #FAFAFA; }
.cal-cell.today .cal-day-num {
  background: #07C160;
  color: #fff;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}

.cal-day-num {
  font-size: 14px;
  font-weight: 500;
  color: #1A1A1A;
  line-height: 1;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}

.cal-cell:nth-child(7n+1) .cal-day-num { color: #E74C3C; }
.cal-cell:nth-child(7n+1).today .cal-day-num { color: #fff; }
.cal-cell:nth-child(7n)   .cal-day-num { color: #5B9BD5; }
.cal-cell:nth-child(7n).today .cal-day-num   { color: #fff; }

.cal-expense {
  font-size: 10px;
  color: #E74C3C;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-income {
  font-size: 10px;
  color: #07C160;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bill-view-toggle {
  display: flex;
  background: #fff;
  border-bottom: 0.5px solid #E8E8E8;
  flex-shrink: 0;
}

.bill-toggle-btn {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.bill-toggle-btn.active {
  color: #07C160;
  border-bottom-color: #07C160;
  font-weight: 600;
}

/* 类别视图：分类行 */
.cat-stat-item {
  display: flex;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 0.5px solid #F5F5F5;
  gap: 12px;
}

.cat-stat-item:last-child { border-bottom: none; }

.cat-stat-count {
  font-size: 12px;
  color: #AAAAAA;
  margin-top: 2px;
}

/* ===================================
   账单搜索弹窗
   =================================== */

.search-bar-wrap {
  padding: 14px 16px 16px;
  background: #fff;
  border-bottom: 0.5px solid #EBEBEB;
  flex-shrink: 0;
}

/* 外层行：输入框 + 搜索按钮 */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 胶囊形输入行 */
.search-input-row {
  flex: 1;
  display: flex;
  align-items: center;
  background: #F2F2F7;
  border-radius: 26px;
  padding: 0 14px;
  height: 48px;
  gap: 8px;
}

.search-bar-icon { color: #AAAAAA; flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: #1A1A1A;
  background: transparent;
  min-width: 0;
}

.search-input::placeholder { color: #C0C0C0; }

.search-clear {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 右侧圆形绿色搜索按钮 */
.search-submit-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #07C160;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(7,193,96,0.35);
  transition: background 0.15s, transform 0.1s;
}

.search-submit-btn:active {
  background: #06ad56;
  transform: scale(0.94);
}

/* 搜索结果摘要条 */
.search-summary {
  padding: 9px 16px;
  font-size: 13px;
  color: #888;
  background: #FAFAFA;
  border-bottom: 0.5px solid #EBEBEB;
  flex-shrink: 0;
}

.search-summary b { color: #1A1A1A; }

/* 初始占位 */
.search-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 80px 0 40px;
}

.search-placeholder .empty-icon { font-size: 52px; }
.search-placeholder .empty-text { font-size: 15px; color: #AAAAAA; }
.search-placeholder .empty-hint  { font-size: 13px; color: #C8C8C8; }

/* 关键词高亮 */
mark.kw {
  background: #FFF3CD;
  color: #E67E00;
  border-radius: 3px;
  padding: 0 2px;
  font-style: normal;
}

/* 搜索结果日期标签 */
.search-date-label {
  font-size: 12px;
  color: #999;
  padding: 10px 16px 4px;
  font-weight: 500;
}

/* ===================================
   类别视图 — 占比进度条（重构布局）
   =================================== */

.cat-pct-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  gap: 12px;
  border-bottom: 0.5px solid #F5F5F5;
  cursor: pointer;
  transition: background 0.12s;
}
.cat-pct-item:last-child { border-bottom: none; }
.cat-pct-item:active     { background: #F9F9F9; }

/* 图标圆圈 */
.cat-pct-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* 右侧内容区（竖向两行） */
.cat-pct-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* 第一行：名称 + 百分比 + 金额 + 箭头 */
.cat-pct-row1 {
  display: flex;
  align-items: center;
}

.cat-pct-name-pct {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.cat-pct-name {
  font-size: 15px;
  font-weight: 500;
  color: #1A1A1A;
  white-space: nowrap;
}

.cat-pct-pct {
  font-size: 12px;
  font-weight: 500;
}
.cat-pct-pct.expense { color: #E74C3C; }
.cat-pct-pct.income  { color: #07C160; }

.cat-pct-amount-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cat-pct-amount {
  font-size: 15px;
  font-weight: 600;
}
.cat-pct-amount.expense { color: #E74C3C; }
.cat-pct-amount.income  { color: #07C160; }

/* 第二行：进度条 + 笔数 */
.cat-pct-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-pct-bar-bg {
  flex: 1;
  height: 4px;
  background: #EFEFEF;
  border-radius: 2px;
  overflow: hidden;
}

.cat-pct-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.cat-pct-bar-fill.expense { background: #E74C3C; }
.cat-pct-bar-fill.income  { background: #07C160; }

.cat-pct-count {
  font-size: 11px;
  color: #AAAAAA;
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}

/* ===================================
   订阅到期提醒条
   =================================== */
.sub-wall {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFF3CD;
  border-top: 1px solid #FFD960;
  padding: 10px 14px;
  flex-shrink: 0;
}
.sub-wall-icon { font-size: 18px; }
.sub-wall-text {
  flex: 1;
  font-size: 13px;
  color: #7A5F00;
  line-height: 1.4;
}
.sub-wall-btn {
  background: #FF9500;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.sub-wall-btn:active { opacity: 0.85; }

/* ===================================
   订阅支付弹窗
   =================================== */
.sub-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sub-modal.hidden { display: none !important; }

.sub-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.sub-modal-box {
  position: relative;
  width: 100%;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: slideInUp 0.25s ease;
}

.sub-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: #F2F2F7;
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 14px;
  color: #888;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.sub-modal-logo { font-size: 36px; }
.sub-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A1A1A;
}
.sub-modal-price {
  font-size: 28px;
  font-weight: 700;
  color: #FF3B30;
  margin: 2px 0;
}
.sub-modal-price span { font-size: 36px; }
.sub-modal-price em  { font-size: 16px; font-style: normal; color: #888; }

.sub-modal-desc {
  font-size: 13px;
  color: #888;
  text-align: center;
}

.sub-qr-wrap {
  width: 180px; height: 180px;
  border: 1px solid #E5E5E5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 4px 0;
}

.sub-qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #AAAAAA;
  font-size: 13px;
}

.sub-qr-spinner {
  width: 28px; height: 28px;
  border: 3px solid #EEEEEE;
  border-top-color: #07C160;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sub-qr-img {
  width: 180px; height: 180px;
  object-fit: cover;
  border-radius: 12px;
}

.sub-qr-hint {
  font-size: 13px;
  color: #555;
}
.sub-qr-polling {
  font-size: 12px;
  color: #AAAAAA;
}
.sub-qr-polling.paid {
  color: #07C160;
}

/* ===================================
   注册 / 登录蒙层
   =================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #f9a8d4 0%, #c4b5fd 50%, #93c5fd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  /* 默认可见（未登录用户第一帧就看到登录界面，不闪烁）
     已登录时由 <head> 内联脚本添加 html.auth-ok 类，CSS 立即隐藏 */
}
html.auth-ok .auth-overlay {
  display: none;
}
/* 带重置令牌时：强制显示蒙层并直接呈现重置表单，跳过登录表单的闪烁 */
html.auth-reset-mode .auth-overlay   { display: flex !important; }
html.auth-reset-mode #authLoginForm  { display: none !important; }
html.auth-reset-mode #authResetForm  { display: block !important; }

.auth-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 48px 32px 36px;
  width: 340px;
  max-width: calc(100vw - 48px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
}

.auth-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.auth-subtitle {
  text-align: center;
  font-size: 13px;
  color: #aaa;
  margin-bottom: 12px;
}

.auth-value {
  margin: 0 -8px 24px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f0faf4 0%, #e8f5ec 100%);
  border-radius: 12px;
  border: 1px solid #d4edda;
}

.auth-value-head {
  font-size: 13px;
  font-weight: 700;
  color: #07C160;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 0.02em;
}

.auth-value-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-value-list li {
  position: relative;
  font-size: 11.5px;
  color: #555;
  line-height: 1.6;
  padding-left: 16px;
  margin-bottom: 6px;
}

.auth-value-list li:last-child {
  margin-bottom: 0;
}

.auth-value-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #07C160;
  font-weight: 700;
  font-size: 11px;
}

.auth-value-list li b {
  color: #1a1a1a;
}

.auth-tip {
  margin-top: 16px;
  padding: 10px 14px;
  background: #f7f7f7;
  border-radius: 10px;
  font-size: 12px;
  color: #999;
  line-height: 1.6;
  text-align: center;
}

.auth-icp {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: #bbb;
  line-height: 1.6;
}
.auth-icp a {
  color: #bbb;
  text-decoration: none;
}
.auth-icp a:hover {
  color: #07C160;
  text-decoration: underline;
}

.auth-input {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1.5px solid #e0e0e0;
  padding: 14px 2px;
  font-size: 15px;
  color: #1a1a1a;
  outline: none;
  background: transparent;
  margin-bottom: 20px;
  transition: border-color 0.2s;
  font-family: inherit;
}
.auth-input::placeholder { color: #bbb; }
.auth-input:focus { border-bottom-color: #c4b5fd; }

.auth-error {
  font-size: 13px;
  color: #f87171;
  min-height: 20px;
  margin-bottom: 6px;
  text-align: center;
}

.auth-btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #f9a8d4 0%, #93c5fd 100%);
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.2s;
  font-family: inherit;
}
.auth-btn:active { opacity: 0.82; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-switch {
  text-align: center;
  font-size: 14px;
  color: #999;
  margin-top: 18px;
}
.auth-switch a {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
}

.auth-input-wrap {
  position: relative;
  width: 100%;
}
.auth-input-wrap .auth-input {
  padding-right: 40px;
  width: 100%;
  box-sizing: border-box;
}
.auth-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.auth-eye-btn:hover {
  color: #6b7280;
}
.auth-eye-btn .eye-off {
  display: none;
}
.auth-eye-btn.visible .eye-on {
  display: none;
}
.auth-eye-btn.visible .eye-off {
  display: block;
}

.auth-forgot-success {
  margin-top: 4px;
  margin-bottom: 8px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  font-size: 13px;
  color: #166534;
  line-height: 1.6;
  text-align: center;
}

/* ===== 帮助与反馈模态框 ===== */
.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.feedback-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.feedback-modal-panel {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.feedback-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}
.feedback-modal-back {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
}
.feedback-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}
.feedback-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.feedback-intro {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: #0369a1;
  line-height: 1.6;
  margin-bottom: 20px;
}
.feedback-type-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.feedback-type-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  background: #fafafa;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.feedback-type-btn.active {
  border-color: #07C160;
  background: #f0fdf4;
  color: #07C160;
  font-weight: 600;
}
.feedback-textarea {
  width: 100%;
  border: 1.5px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.6;
  resize: none;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.feedback-textarea:focus {
  border-color: #07C160;
}
.feedback-textarea::placeholder {
  color: #bbb;
}
.feedback-counter {
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 6px;
  margin-bottom: 16px;
}
.feedback-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #07C160 0%, #06ae56 100%);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
}
.feedback-submit-btn:hover {
  opacity: 0.9;
}
.feedback-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.feedback-success {
  text-align: center;
  padding: 32px 20px;
}
.feedback-success-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.feedback-success p {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  margin-bottom: 24px;
}
.feedback-close-btn {
  padding: 10px 32px;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: background 0.2s;
}
.feedback-close-btn:hover {
  background: #ebebeb;
}

/* ===== 微信支付引导弹窗 ===== */
#wechatPayGuide {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wechat-pay-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.wechat-pay-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  width: 320px;
  max-width: calc(100vw - 48px);
  text-align: center;
}
.wechat-pay-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.wechat-pay-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}
.wechat-pay-desc {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 16px;
}
.wechat-pay-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.wechat-pay-link {
  flex: 1;
  font-size: 11px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all;
  text-align: left;
}
.wechat-pay-copy-btn {
  flex-shrink: 0;
  background: #07C160;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.wechat-pay-copy-btn:active {
  opacity: 0.8;
}
.wechat-pay-hint {
  font-size: 12px;
  color: #07C160;
  line-height: 1.5;
  margin-bottom: 20px;
}
.wechat-pay-close-btn {
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 10px 40px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
}
.wechat-pay-close-btn:active {
  background: #ebebeb;
}

/* ===================================================================
 *  TaskKeeper-AI 任务管家专属样式（追加在记账版基础样式之后）
 * =================================================================== */

/* —— 任务卡片（聊天内） —— */
.task-card .value.pri-high   { color:#E74C3C; font-weight:600; }
.task-card .value.pri-medium { color:#E69500; font-weight:600; }
.task-card .value.pri-low    { color:#07C160; font-weight:600; }

/* —— 任务列表摘要条 —— */
.task-summary-row {
  display:flex; justify-content:space-around; align-items:center;
  font-size:13px; color:#576B95;
}
.task-summary-row b { color:#1A1A1A; font-size:16px; margin-left:2px; }

/* —— 日期分组标题 —— */
.task-date-group {
  padding:14px 16px 6px; font-size:12px; color:#999; font-weight:600;
}

/* —— 单条任务行 —— */
.task-row {
  display:flex; align-items:flex-start; gap:12px;
  padding:12px 16px; background:#fff; cursor:pointer;
  border-bottom:1px solid #F0F0F0; transition:background .15s;
}
.task-row:active { background:#F7F7F7; }
.task-check {
  flex-shrink:0; width:22px; height:22px; margin-top:1px;
  border:2px solid #C8C8CC; border-radius:50%; background:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:all .15s; padding:0;
}
.task-check.checked { background:#07C160; border-color:#07C160; }
.task-main { flex:1; min-width:0; }
.task-title {
  font-size:15px; color:#1A1A1A; line-height:1.4; word-break:break-word;
}
.task-title.done { color:#B0B0B0; text-decoration:line-through; }
.task-meta {
  display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:6px;
  font-size:12px; color:#999;
}
.task-cat {
  background:#F0F2F5; color:#576B95; padding:2px 8px; border-radius:10px;
}
.task-pri { padding:2px 8px; border-radius:10px; font-weight:600; }
.task-pri.pri-high   { background:#FDECEA; color:#E74C3C; }
.task-pri.pri-medium { background:#FFF3E0; color:#E69500; }
.task-pri.pri-low    { background:#E8F8EF; color:#07C160; }
.task-desc { color:#B0B0B0; }
.task-row.is-done .task-cat { opacity:.6; }

/* —— 统计模态 —— */
.stat-cards {
  display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:16px;
}
.stat-card {
  background:#fff; border-radius:12px; padding:16px 12px; text-align:center;
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
}
.stat-num { font-size:24px; font-weight:700; color:#07C160; }
.stat-label { font-size:12px; color:#999; margin-top:4px; }
.stat-section-title {
  padding:8px 16px; font-size:13px; color:#666; font-weight:600;
}
.stat-bars {
  display:flex; justify-content:space-around; align-items:flex-end;
  height:120px; padding:10px 16px; background:#fff; margin:0 16px;
  border-radius:12px;
}
.stat-bar-col { display:flex; flex-direction:column; align-items:center; gap:4px; }
.stat-bar { width:18px; background:linear-gradient(180deg,#22D37E,#07C160); border-radius:4px 4px 0 0; }
.stat-bar-num { font-size:11px; color:#666; }
.stat-bar-label { font-size:11px; color:#AAA; }
.stat-cats { padding:4px 16px 20px; }
.stat-cat-row {
  display:flex; justify-content:space-between; align-items:center;
  background:#fff; padding:12px 14px; border-radius:10px; margin-bottom:8px;
  font-size:14px; color:#333;
}
.stat-cat-row b { color:#07C160; }
.stat-empty { text-align:center; color:#999; padding:20px; font-size:14px; }

/* —— 分类选择网格 —— */
.cat-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; padding:4px 0 12px; }
.cat-item {
  padding:10px 6px; border:1px solid #E5E5E5; border-radius:10px; background:#fff;
  font-size:13px; color:#333; cursor:pointer; transition:all .15s;
}
.cat-item.selected { border-color:#07C160; color:#07C160; background:#E8F8EF; }
.cat-custom-btn { color:#576B95; border-style:dashed; }

/* —— 优先级编辑按钮选中态（沿用 edit-type-btn，补充三色） —— */
#editPriorityBtns .edit-type-btn.active { background:#07C160; color:#fff; border-color:#07C160; }

/* —— 搜索结果摘要 —— */
.search-summary { padding:10px 16px; font-size:13px; color:#999; }
