* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 默认紫色主题 */
  --primary: #7C3AED;
  --secondary: #A78BFA;
  --accent: #F43F5E;
  --text-light: #FFFFFF;
  --text-dark: #1F2937;

  /* 玻璃效果 - 提高不透明度 */
  --glass-bg: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-blur: 15px;
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-light);
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 背景容器 */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url(default-bg.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  transition: opacity 0.5s ease;
}

/* 主容器 */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 100px;
  min-height: 100vh;
}

/* 玻璃卡片基础样式 */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ========== 日历卡片 ========== */
.calendar-card {
  padding: 16px;
}

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

.calendar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
}

.nav-btn {
  min-width: 44px;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

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

.weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  /* 去掉 min-height 避免窄屏溢出，aspect-ratio 已保证正方形 */
}

.calendar-day:not(.other-month):not(.disabled):active {
  transform: scale(0.9);
}

.calendar-day.other-month {
  color: rgba(255, 255, 255, 0.3);
  cursor: default;
}

.calendar-day.today {
  background: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.calendar-day.selected {
  background: var(--accent);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
}

.calendar-day.has-tasks::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* ========== 计划列表卡片 ========== */
.tasks-card {
  min-height: 300px;
}

.tasks-header {
  margin-bottom: 16px;
}

.tasks-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tasks-count {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
}

.tasks-list {
  margin-bottom: 16px;
  min-height: 200px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.empty-state svg {
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.task-item:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.15);
}

.task-checkbox {
  min-width: 24px;
  min-height: 24px;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.task-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.task-checkbox svg {
  width: 16px;
  height: 16px;
  color: white;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.task-checkbox.checked svg {
  opacity: 1;
}

.task-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-text {
  font-size: 15px;
  color: var(--text-light);
  word-break: break-word;
  transition: all 0.2s ease;
}

.task-reminder {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.task-reminder svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.task-item.completed .task-text {
  text-decoration: line-through;
  opacity: 0.5;
}

.task-item.completed .task-reminder {
  opacity: 0.5;
}

.task-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.task-action-btn {
  min-width: 36px;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.task-action-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2);
}

.task-action-btn.delete {
  color: #EF4444;
}

/* 添加计划输入框 */
.add-task-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.add-task-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: var(--text-light);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.add-task-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.add-task-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.add-task-btn {
  min-width: 44px;
  min-height: 44px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.add-task-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

/* ========== 底部操作栏 ========== */
.bottom-actions {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 0 16px;
  max-width: 480px;
  width: 100%;
}

.action-btn {
  flex: 1;
  min-height: 52px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  box-shadow: var(--glass-shadow);
  padding: 8px 4px;
}

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

.action-btn span {
  font-size: 11px;
  white-space: nowrap;
}

.action-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.3);
}

/* ========== 编辑弹窗 ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 16px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: var(--text-light);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  margin-bottom: 16px;
}

.modal-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.reminder-section {
  margin-bottom: 20px;
}

.reminder-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
}

.reminder-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.reminder-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: var(--text-light);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  color-scheme: dark;
}

.reminder-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.cancel-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.15);
}

.confirm-btn {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.confirm-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

/* ========== 响应式 ========== */
@media (max-width: 375px) {
  .container {
    padding: 16px 12px 100px;
  }

  .glass-card {
    padding: 16px;
  }

  .calendar-day {
    font-size: 13px;
  }

  .action-btn span {
    font-size: 13px;
  }
}

/* ========== 减少动画（无障碍） ========== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
