/* ============================================================
 * 2026 年度日历 · 样式（参考设计还原）
 * 深紫黑背景 #1a1a2e · 粉色强调 #e94560 · 卡片式布局
 * ============================================================ */

:root {
  --bg: #1a1a2e;
  --bg-card: #1e1e36;
  --bg-cell: #1e1e36;
  --bg-cell-hover: #2a2a4a;
  --bg-summary: #1e1e36;
  --border: #2e2e4e;
  --border-light: #3a3a5a;
  --text-primary: #ffffff;
  --text-secondary: #9ea6c2;
  --text-muted: #6b7492;
  --text-weekend: #b095b8;
  --accent-pink: #e94560;
  --accent-pink-glow: rgba(233, 69, 96, 0.35);
  --accent-orange: #ff9f43;
  --accent-teal: #26debd;
  --accent-purple: #a78bfa;
  --accent-gray: #8892a4;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

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

html, body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 5px 48px 5px;
  width: 100%;
  box-sizing: border-box;
}

/* ===== 头部 ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 4px 28px;
}

.header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.month-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.month-year {
  font-size: 22px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.month-cn {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
  line-height: 1;
}

.month-en {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
}

.week-badge {
  font-size: 13px;
  color: var(--accent-pink);
  background: rgba(233, 69, 96, 0.12);
  border: 1px solid rgba(233, 69, 96, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* ===== 星期表头 ===== */
.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.weekday {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 0;
  letter-spacing: 2px;
}

/* ===== 日历网格 ===== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.calendar-cell {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-cell);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background 0.15s ease;
  user-select: none;
  padding: 6px 2px 4px;
  min-height: 64px;
  min-width: 0;
  overflow: hidden;
}

.calendar-cell:nth-child(7n) {
  border-right: none;
}

.calendar-cell:nth-last-child(-n+7) {
  border-bottom: none;
}

.calendar-cell:hover {
  background: var(--bg-cell-hover);
}

.calendar-cell:active {
  background: rgba(233, 69, 96, 0.08);
}

.calendar-cell.other-month {
  background: #16162a;
  opacity: 0.3;
  pointer-events: none;
}

.calendar-cell.today .day-number {
  background: var(--accent-pink);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px var(--accent-pink-glow);
  font-weight: 700;
}

/* 粉色小圆点 */
.pink-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-pink);
  box-shadow: 0 0 5px var(--accent-pink-glow);
}

.day-number {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.calendar-cell.weekend .day-number {
  color: var(--text-weekend);
}

.calendar-cell.today .day-number {
  color: #fff;
}

.day-lunar {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-cell.solar-term .day-lunar,
.calendar-cell.holiday .day-lunar {
  color: var(--accent-pink);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* 状态徽章 */
.status-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 12px;
  line-height: 1.5;
  letter-spacing: 0.3px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill.used {
  background: rgba(136, 146, 164, 0.2);
  color: var(--accent-gray);
  border: 1px solid rgba(136, 146, 164, 0.3);
}

.status-pill.ot {
  background: rgba(255, 159, 67, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 159, 67, 0.3);
}

.status-pill.rest {
  background: rgba(38, 222, 189, 0.15);
  color: var(--accent-teal);
  border: 1px solid rgba(38, 222, 189, 0.3);
}

.status-pill.outing {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

/* ===== 图例 ===== */
.legend {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 18px 16px 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.used { background: var(--accent-gray); }
.legend-dot.ot { background: var(--accent-orange); }
.legend-dot.rest { background: var(--accent-teal); }
.legend-dot.outing {
  background: transparent;
  width: auto;
  height: auto;
}

.legend-icon-outing {
  width: 14px;
  height: 14px;
  color: var(--accent-purple);
}

.legend-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== 汇总卡片 ===== */
.summary-card {
  background: var(--bg-summary);
  border-radius: 16px;
  padding: 24px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.summary-icon {
  width: 22px;
  height: 22px;
  color: var(--accent-pink);
}

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

.summary-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.total-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent-pink);
  line-height: 1;
}

.total-unit {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-secondary);
}

.total-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: auto;
}

.summary-section {
  margin-bottom: 18px;
}

.summary-section:last-of-type {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.section-dot.ot { background: var(--accent-orange); }
.section-dot.rest { background: var(--accent-teal); }

.section-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-purple);
}

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

.section-content {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 18px;
  line-height: 1.9;
}

.section-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.section-empty {
  color: var(--text-muted);
  font-style: italic;
  padding-left: 18px;
  font-size: 13px;
}

/* ===== 底部按钮 ===== */
.footer {
  margin-top: 20px;
  text-align: center;
}

.reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.reset-btn:hover {
  border-color: var(--accent-pink);
  color: var(--accent-pink);
  background: rgba(233, 69, 96, 0.08);
}

/* ===== 月份切换按钮（移动端隐藏，桌面端显示） ===== */
@media (min-width: 600px) {
  .header {
    flex-direction: row;
    align-items: center;
  }

  .nav-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    color: var(--text-primary);
  }

  .nav-btn:hover {
    background: var(--bg-cell-hover);
    border-color: var(--accent-pink);
    color: var(--accent-pink);
  }

  .nav-btn:active {
    transform: scale(0.92);
  }

  .header-left {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .month-row {
    gap: 14px;
  }

  .month-cn {
    font-size: 48px;
  }

  .month-year {
    font-size: 26px;
  }

  .app {
    max-width: 600px;
    padding: 32px 24px 48px;
  }

  .calendar-cell {
    min-height: 84px;
  }

  .day-number {
    font-size: 22px;
  }

  .day-lunar {
    font-size: 11px;
  }

  .status-pill {
    font-size: 11px;
    padding: 3px 10px;
  }

  .pink-dot {
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 380px) {
  .app {
    padding: 16px 10px 36px;
  }

  .month-cn {
    font-size: 36px;
  }

  .month-year {
    font-size: 18px;
  }

  .calendar-cell {
    min-height: 58px;
    padding: 4px 1px;
    gap: 2px;
  }

  .day-number {
    font-size: 17px;
  }

  .day-lunar {
    font-size: 9px;
  }

  .status-pill {
    font-size: 9px;
    padding: 1px 6px;
  }

  .pink-dot {
    top: 5px;
    right: 5px;
    width: 5px;
    height: 5px;
  }

  .calendar-cell.today .day-number {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  .total-number {
    font-size: 40px;
  }

  .legend {
    gap: 14px;
  }
}
