/* ============================================================
   地震日报 · archive 页面专属样式（v2 主题化 + 视图切换 2026-09-21）
   - 包含视图切换、分页、日历
   ============================================================ */

body { padding: 70px 16px 40px; }

@media (max-width: 600px) { body { padding: 62px 10px 32px; } }

/* ========== Archive Header（与 daily .header 高度对齐） ========== */
.archive-header {
  text-align: center;
  padding: 24px 0 20px;
}

h1 {
  font-size: 30px;
  font-weight: 800;
  background: var(--gradient-text);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

/* ========== View Switch (Segmented Control) ========== */
.view-switch {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  max-width: 280px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}
.view-switch-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.view-switch-btn:hover:not(.active) {
  background: var(--surface-hover);
  color: var(--text-secondary);
}
.view-switch-btn.active {
  background: var(--gradient-cta);
  color: var(--text-on-accent);
  box-shadow: 0 2px 8px rgba(74, 144, 217, 0.25);
}
.view-switch-btn .view-icon { font-size: 14px; line-height: 1; }
@media (max-width: 480px) {
  .view-switch { max-width: 100%; }
  .view-switch-btn { padding: 8px 12px; font-size: 12.5px; }
}

/* ========== Stats Mini ========== */
.stats-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-mini {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.stat-mini .val {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-mini .lbl {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
  font-weight: 500;
}

/* ========== Trend Section ========== */
.trend-section {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.trend-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#trendChart { width: 100%; height: 200px; }

/* ========== View Container ========== */
.archive-view { margin-bottom: 24px; }
.archive-view[hidden] { display: none !important; }

/* ========== List View ========== */
ul.archive-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.archive-page { margin: 0; padding: 0; }
.archive-page[hidden] { display: none; }

.archive-item {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  margin-bottom: 10px;
  padding: 0;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.archive-item:hover {
  background: var(--surface-hover);
  transform: translateX(2px);
  border-color: rgba(74, 144, 217, 0.3);
}
.archive-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  color: inherit;
  text-decoration: none;
}
.archive-item .archive-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-1);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  flex-shrink: 0;
  min-width: 95px;
}
.archive-item .archive-count {
  background: rgba(74, 144, 217, 0.14);
  color: var(--accent-1);
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: auto;
}
.archive-item .archive-loc {
  color: var(--text-muted);
  font-size: 13px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-item .archive-mag {
  background: rgba(231, 76, 60, 0.14);
  color: var(--accent-danger);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.archive-item .archive-arrow {
  margin-left: 4px;
  color: var(--text-faint);
  font-size: 18px;
  font-weight: 300;
  flex-shrink: 0;
  transition: transform 0.2s, color 0.2s;
}
.archive-item:hover .archive-arrow {
  color: var(--accent-1);
  transform: translateX(3px);
}

/* 0 地震日的归档列表项：弱化 + 不可点（无 <a>，hover 不响应） */
.archive-item-empty { cursor: default; opacity: 0.6; }
.archive-item-empty:hover {
  background: var(--surface);
  transform: none;
  border-color: var(--surface-border);
}
.archive-item-empty .archive-none {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
  letter-spacing: 0.5px;
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.page-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: rgba(74, 144, 217, 0.3);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-numbers {
  display: flex;
  gap: 4px;
}
.page-num {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.page-num:hover:not(.active) {
  background: var(--surface);
  color: var(--text-primary);
}
.page-num.active {
  background: var(--gradient-cta);
  color: var(--text-on-accent);
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(74, 144, 217, 0.25);
}
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 36px;
  color: var(--text-faint);
  font-size: 13px;
  cursor: default;
}

/* ========== Calendar View ========== */
.archive-view-calendar { padding-top: 4px; }

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
}
.cal-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}
.cal-nav-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.cal-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.cal-nav-range {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  flex: 1;
  text-align: center;
}

.cal-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cal-month {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 14px 12px 12px;
}
.cal-month-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.cal-month-count {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 10.5px;
  color: var(--text-faint);
  font-weight: 500;
  padding: 4px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 11.5px;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.cal-day-other-month { color: var(--text-faint); opacity: 0.4; }
.cal-day-empty { color: var(--text-faint); }
/* 0 地震日：显示明确「无地震」，灰化且不可点 */
.cal-day-noquake { color: var(--text-faint); cursor: default; }
.cal-day-noquake .cal-day-none {
  display: block;
  font-size: 9px;
  line-height: 1.2;
  margin-top: 2px;
  opacity: 0.85;
  letter-spacing: 0.3px;
}
.cal-day-future { color: var(--text-faint); opacity: 0.5; }

.cal-day-has-report {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.16), rgba(6, 182, 212, 0.16));
  color: var(--accent-1);
  font-weight: 600;
}
.cal-day-has-report:hover {
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.32), rgba(6, 182, 212, 0.32));
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
  z-index: 2;
}
.cal-day-has-report .cal-day-count {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: -1px;
  font-weight: 500;
}

.cal-day-today {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 1px rgba(74, 144, 217, 0.3);
}

/* ========== Footer ========== */
.footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-faint);
  font-size: 12px;
}

/* ========== View Transition ========== */
.archive-view {
  animation: viewFadeIn 0.3s ease;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Mobile ========== */
@media (max-width: 900px) {
  .cal-months { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stats-mini { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-mini .val { font-size: 18px; }
  h1 { font-size: 26px; }

  .archive-item a {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }
  .archive-item .archive-date { min-width: 0; font-size: 13px; }
  .archive-item .archive-mag { font-size: 12px; }
  .archive-item .archive-count { font-size: 11px; }
  .archive-item .archive-arrow { display: none; }

  .page-btn { padding: 6px 10px; font-size: 12px; }
  .page-num { min-width: 32px; height: 32px; font-size: 12px; }

  .cal-months { grid-template-columns: 1fr; }
  .cal-day { font-size: 12px; }
  .cal-day-num { font-size: 12px; }
  .cal-day-has-report .cal-day-count { font-size: 8.5px; }
}