/* 起源望远镜 · 本地复刻版 — 活动日程 */

/* 主题变量由 styles/app.css 提供；这里只做别名与兜底，不重复定义整套主题色。 */
:root {
  --sc-surface: var(--surface, #ffffff);
  --sc-surface-2: var(--surface-2, #f5f8f9);
  --sc-text: var(--text, #12303a);
  --sc-muted: var(--muted, #5f7885);
  --sc-border: var(--border, #d7e2e7);
  --sc-accent: var(--accent, #14424e);
  --sc-accent-soft: var(--accent-soft, #e2eff1);
  --sc-radius: var(--radius, 10px);
  --sc-radius-sm: var(--radius-sm, 6px);
  --sc-warn: #9a5b12;
  --sc-warn-soft: #fdf1df;
  --sc-done: var(--sc-muted);
  --sc-done-soft: var(--sc-surface-2);
}

/* ---------- 标题 ---------- */

.schedule-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.schedule-heading h1 { font-size: 18px; }

.schedule-subtitle {
  margin: 4px 0 0;
  color: var(--sc-muted);
  font-size: 12px;
  line-height: 1.5;
}

.schedule-heading button {
  margin-left: auto;
  padding: 6px 14px;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius-sm);
  background: var(--sc-surface);
  color: var(--sc-text);
  font-size: 13px;
  white-space: nowrap;
}

.schedule-heading button:hover {
  border-color: var(--sc-accent);
  color: var(--sc-accent);
}

/* ---------- 范围与筛选 ---------- */

.schedule-controls {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  background: var(--sc-surface);
}

.schedule-window {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-live {
  padding: 2px 9px;
  border: 1px solid var(--sc-border);
  border-radius: 999px;
  background: var(--sc-surface-2);
  color: var(--sc-muted);
  font-size: 12px;
  white-space: nowrap;
}

.schedule-live.is-live {
  border-color: transparent;
  background: var(--sc-accent-soft);
  color: var(--sc-accent);
}

.schedule-range {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.schedule-timezone {
  margin-left: auto;
  color: var(--sc-muted);
  font-size: 11px;
  white-space: nowrap;
}

.schedule-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.schedule-time-actions { display: flex; gap: 8px; }

.schedule-time-actions button {
  padding: 5px 12px;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius-sm);
  background: var(--sc-surface-2);
  color: var(--sc-text);
  font-size: 12px;
  white-space: nowrap;
}

.schedule-time-actions button:hover:not(:disabled) {
  border-color: var(--sc-accent);
  color: var(--sc-accent);
}

.schedule-time-actions button:disabled {
  opacity: 0.55;
  cursor: default;
}

.schedule-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sc-muted);
  font-size: 12px;
  white-space: nowrap;
}

.schedule-toolbar input[type="date"],
.schedule-toolbar select,
.schedule-toolbar input[type="search"] {
  padding: 4px 8px;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius-sm);
  background: var(--sc-surface);
  color: var(--sc-text);
  font: inherit;
  font-size: 12px;
}

.schedule-toolbar input[type="search"] { width: 180px; }

.schedule-watch-only input { margin: 0; }

.schedule-hint {
  margin: 8px 0 0;
  color: var(--sc-muted);
  font-size: 12px;
  line-height: 1.5;
}

.schedule-watchlist {
  margin: 8px 0 0;
  color: var(--sc-muted);
  font-size: 12px;
}

.schedule-watchlist a {
  color: var(--sc-accent);
  text-decoration: underline;
}

#schedule-status {
  margin: 8px 0 0;
  color: var(--sc-muted);
  font-size: 12px;
}

/* ---------- 日程表 ---------- */

.schedule-days {
  margin-top: 8px;
  max-height: 70vh;
  overflow: auto;
}

.schedule-day {
  margin-bottom: 12px;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  background: var(--sc-surface);
}

.schedule-day > h2 {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 10px;
  border-bottom: 1px solid var(--sc-border);
  border-radius: var(--sc-radius) var(--sc-radius) 0 0;
  background: var(--sc-surface-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.schedule-day-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sc-accent);
  color: #eaf5f6;
  font-size: 10px;
  font-weight: 600;
}

.schedule-day-count {
  margin-left: auto;
  color: var(--sc-muted);
  font-size: 11px;
  font-weight: 400;
}

.schedule-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
}

.schedule-table th,
.schedule-table td {
  border-bottom: 1px solid var(--sc-border);
  vertical-align: top;
}

.schedule-table tbody tr:last-child th,
.schedule-table tbody tr:last-child td { border-bottom: 0; }

.schedule-table thead th {
  position: sticky;
  top: 34px;
  z-index: 2;
  padding: 5px 8px;
  border-right: 1px solid var(--sc-border);
  background: var(--sc-surface-2);
  color: var(--sc-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.schedule-table thead th:first-child { width: 74px; }
.schedule-table thead th:nth-child(2) { width: 26%; }
.schedule-table thead th:nth-child(3) { width: 22%; }
.schedule-table thead th:last-child { border-right: 0; }

.schedule-table tbody th,
.schedule-table tbody td {
  padding: 6px 8px;
  border-right: 1px solid var(--sc-border);
}

.schedule-table tbody tr:last-child td:last-child { border-right: 0; }

.schedule-time {
  color: var(--sc-text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.schedule-time small {
  display: block;
  margin-top: 1px;
  color: var(--sc-muted);
  font-size: 10px;
  font-weight: 400;
}

.schedule-time.is-current-hour {
  background: var(--sc-accent-soft);
  color: var(--sc-accent);
}

.schedule-time.is-current-hour small { color: var(--sc-accent); }

.schedule-table tbody td:last-child { border-right: 0; }

.schedule-cell-empty {
  color: var(--sc-border);
  font-size: 12px;
}

/* 活动条目 */

.schedule-event {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  padding: 2px 0;
  line-height: 1.35;
}

.schedule-event + .schedule-event {
  border-top: 1px dashed var(--sc-border);
  margin-top: 2px;
  padding-top: 3px;
}

.schedule-event strong {
  font-size: 12px;
  font-weight: 600;
}

.schedule-event-detail {
  color: var(--sc-muted);
  font-size: 11px;
}

.schedule-badge {
  flex: 0 0 auto;
  padding: 0 6px;
  border: 1px solid var(--sc-border);
  border-radius: 999px;
  font-size: 10px;
  line-height: 16px;
  white-space: nowrap;
}

.schedule-badge.is-forecast {
  border-color: transparent;
  background: var(--sc-accent-soft);
  color: var(--sc-accent);
}

.schedule-badge.is-live {
  border-color: transparent;
  background: var(--sc-accent);
  color: #eaf5f6;
}

.schedule-badge.is-pending {
  background: var(--sc-surface-2);
  color: var(--sc-muted);
}

.schedule-badge.is-done {
  border-color: transparent;
  background: var(--sc-done-soft);
  color: var(--sc-done);
}

.schedule-carry {
  color: var(--sc-warn);
  font-size: 10px;
  font-style: normal;
}

/* 推荐商品 */

.schedule-goods .schedule-good + .schedule-good { margin-top: 3px; }

.schedule-good {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid var(--sc-border);
  border-left: 3px solid var(--sc-accent);
  border-radius: var(--sc-radius-sm);
  background: var(--sc-surface-2);
}

.schedule-good.is-mayor {
  border-left-color: var(--sc-warn);
}

.schedule-good strong {
  font-size: 12px;
  font-weight: 600;
}

.schedule-good em {
  color: var(--sc-muted);
  font-size: 11px;
  font-style: normal;
}

.schedule-good-more {
  color: var(--sc-muted);
  font-size: 11px;
}

.schedule-empty {
  margin: 0;
  padding: 22px;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  background: var(--sc-surface);
  color: var(--sc-muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 900px) {
  .schedule-toolbar { gap: 8px; }
  .schedule-table { table-layout: auto; }
  .schedule-table thead th:first-child { width: auto; }
}