/* =====================================================
   Today Page v4.0 - 今日习惯打卡页面
   ===================================================== */

/* ===== 进度摘要卡 ===== */
.today-progress-card {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
}

.today-progress-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.today-progress-card::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.progress-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.progress-stats .stat-item {
  text-align: center;
}

.progress-stats .stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.progress-stats .stat-label {
  font-size: var(--text-xs);
  opacity: 0.75;
  margin-top: var(--space-1);
}

.progress-bar-wrapper {
  margin-top: var(--space-4);
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
}

/* ===== 快捷入口卡片 ===== */
.quick-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: var(--space-3);
}

.quick-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.quick-card:active {
  transform: scale(0.99);
}

.quick-card .quick-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

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

.quick-card .quick-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text);
}

.quick-card .quick-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.quick-card .quick-arrow {
  color: var(--text-tertiary);
  font-size: var(--text-lg);
  flex-shrink: 0;
}

/* ===== 习惯卡片 ===== */
.habit-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: all var(--transition);
}

.habit-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-xs);
}

.habit-card.expanded {
  box-shadow: var(--shadow-sm);
}

.habit-card.done {
  border-left: 3px solid var(--success);
}

.habit-card:not(.done) {
  border-left: 3px solid var(--border);
}

.habit-card.done:hover {
  border-left-color: var(--success);
}

.habit-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.habit-header:active {
  background: var(--bg);
}

.habit-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

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

.habit-name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text);
  line-height: 1.3;
}

.habit-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.habit-status .status-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: var(--font-medium);
}

.habit-status .status-tag.done {
  background: var(--success-bg);
  color: var(--success);
}

.habit-status .status-tag.todo {
  background: var(--bg-secondary);
  color: var(--text-tertiary);
}

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

/* ===== 习惯展开内容 ===== */
.habit-body {
  padding: 0 var(--space-4) var(--space-4);
  animation: fadeIn 0.2s ease;
}

.habit-body .form-group {
  margin-bottom: var(--space-3);
}

.habit-body .form-label {
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
}

.habit-body .form-textarea,
.habit-body .form-input {
  font-size: var(--text-sm);
}

.habit-data-display {
  padding: var(--space-2) 0;
}

.habit-data-item {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-sm);
  line-height: 1.5;
}

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

.habit-data-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.habit-data-value {
  color: var(--text);
}

.habit-data-value.checked {
  color: var(--success);
}

.habit-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* ===== 今日花销摘要 ===== */
.expense-summary-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.expense-total {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--danger);
  line-height: 1.2;
}

.expense-list {
  margin-top: var(--space-3);
}

.expense-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-sm);
}

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

.expense-item .expense-category {
  color: var(--text-secondary);
}

.expense-item .expense-amount {
  font-weight: var(--font-semibold);
  color: var(--text);
}

/* ===== 空状态 ===== */
.today-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-tertiary);
}

.today-empty .empty-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: var(--space-3);
}

.today-empty .empty-text {
  font-size: var(--text-sm);
}
