/* ========== 全局样式 ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ========== 头部样式 ========== */
/* .header layout is defined in dark-theme.css (.page-bar) */

/* Flat page header — shared by timeline.html / trump.html / gold.html
   (economic_calendar). No card fill/shadow: the title sits directly on the
   page background, anchored by a colored bottom rule instead of a box. */
.pg-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 22px 0 16px;
    border-bottom: 2px solid var(--blue);
    margin: 0 0 20px;
}

.pg-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pg-header-icon {
    width: 20px;
    height: 20px;
    color: var(--blue);
    flex-shrink: 0;
}

.pg-header-left h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--tx-0);
    margin: 0;
}

@media (max-width: 640px) {
    .pg-header { flex-direction: column; align-items: flex-start; padding: 16px 0 14px; }
}

.date-range .separator {
    margin: 0 6px;
    opacity: 0.5;
}

/* 时区标签 - header 日期范围旁 */
.tz-label {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
}

/* 时区标签 - 事件时间旁 */
.tz-tag {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--blue);
    background-color: var(--blue-light);
    padding: 1px 5px;
    border-radius: 6px;
    vertical-align: middle;
}

.event-date {
    font-size: 12px;
    font-weight: 500;
    color: var(--tx-2);
    letter-spacing: 0.3px;
}

/* 时区标签 - 经济日历时间下方 */
.tz-micro {
    font-size: 10px;
    font-weight: 600;
    color: var(--blue);
    margin-top: 2px;
}

/* ========== 经济日历区块样式 ========== */

.upcoming-header {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    gap: 12px;
}

.upcoming-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.upcoming-count {
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.upcoming-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.upcoming-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    padding: 0 20px;
}

.upcoming-content.show {
    max-height: 10000px;
    padding: 0 20px 20px;
}

.upcoming-events-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upcoming-event-card {
    display: flex;
    border-bottom: 1px solid var(--bd-0);
    padding: 16px;
    border-left: 4px solid var(--blue);
    transition: all 0.2s ease;
    gap: 16px;
}

.upcoming-event-card:hover {
    transform: translateX(3px);
}

/* Severity border — same reduced palette as the main timeline cards */
.upcoming-event-card.severity-border-critical {
    border-left-color: var(--dn);
}

.upcoming-event-card.severity-border-high {
    border-left-color: var(--warn);
}

.upcoming-event-card.severity-border-medium {
    border-left-color: var(--info);
}

.upcoming-event-card.severity-border-low {
    border-left-color: var(--tx-3);
}

.upcoming-event-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 4px 0;
}

.upcoming-date {
    font-size: 15px;
    font-weight: 700;
}

.upcoming-clock {
    font-size: 13px;
    font-weight: 500;
}

.upcoming-event-body {
    flex: 1;
    min-width: 0;
}

.upcoming-event-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.upcoming-event-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.upcoming-event-title-zh {
    font-size: 12px;
    color: var(--tx-2);
    margin: 2px 0 0 0;
    line-height: 1.4;
    flex-basis: 100%;
}

.upcoming-event-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.badge-fomc {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-hover) 100%);
    color: white;
    font-weight: 700;
}

.badge-gold-impact {
    background: linear-gradient(135deg, var(--warn) 0%, var(--warn-bright) 100%);
    color: var(--warn-dark);
    font-weight: 700;
}

.upcoming-event-data {
    display: flex;
    gap: 16px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.data-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.data-label {
    color: var(--tx-2);
    font-weight: 500;
}

.data-value {
    color: var(--tx-0);
    font-weight: 600;
}

.upcoming-event-desc {
    font-size: 13px;
    color: var(--tx-2);
    line-height: 1.5;
    margin: 0;
}

/* ========== 筛选面板样式 ========== */
.filter-panel {
    border-bottom: 2px solid var(--bd-0);
}

.filter-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
}

.filter-toggle-button {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-icon {
    font-size: 16px;
}

.filter-text {
    font-size: 14px;
}

.filter-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-toggle-button.rotated .filter-arrow {
    transform: rotate(180deg);
}

.filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    padding: 0 20px;
}

.filter-content.show {
    max-height: 800px;
    padding: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-group-title {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--tx-2);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 10px 14px;
    min-height: 44px;
    font-family: var(--font-sans);
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    border: 1px solid var(--bd-0);
    background-color: var(--bg-2);
    color: var(--tx-1);
}

.filter-btn:hover {
    background-color: var(--bg-1);
    color: var(--tx-0);
}

.filter-btn.active,
.filter-btn.selected {
    background-color: var(--blue-light);
    color: var(--blue);
    border-color: var(--blue-ring);
}

/* PRESERVE: severity filter button colors */
.filter-btn.severity-critical,
.filter-btn.severity-high,
.filter-btn.severity-medium,
.filter-btn.severity-low {
    font-family: var(--font-mono);
}

.filter-btn.severity-critical {
    background-color: var(--dn-light);
    border-color: var(--dn-bd, var(--dn-light));
    color: var(--dn);
}

.filter-btn.severity-critical.active {
    background-color: var(--dn);
    border-color: var(--dn);
    color: white;
}

.filter-btn.severity-high {
    background-color: var(--warn-light);
    border-color: var(--warn-light);
    color: var(--warn);
}

.filter-btn.severity-high.active {
    background-color: var(--warn);
    border-color: var(--warn);
    color: white;
}

.filter-btn.severity-medium {
    background-color: var(--info-light);
    border-color: var(--info-light);
    color: var(--info);
}

.filter-btn.severity-medium.active {
    background-color: var(--info);
    border-color: var(--info);
    color: white;
}

.filter-btn.severity-low {
    background-color: var(--bg-3);
    border-color: var(--bd-0);
    color: var(--tx-3);
}

.filter-btn.severity-low.active {
    background-color: var(--tx-3);
    border-color: var(--tx-3);
    color: white;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--tx-1);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--tx-1);
    padding: 8px 12px;
    background-color: var(--bg-1);
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.filter-checkbox:hover {
    background-color: var(--bg-3);
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--blue);
}

/* ========== 统计摘要样式 ========== */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px 20px;
    background-color: var(--bg-1);
    border-bottom: 1px solid var(--bd-0);
}

.stat-box {
    text-align: center;
    padding: 20px;
    background-color: var(--bg-2);
    border-radius: 12px;
    box-shadow: var(--sh-sm);
    transition: transform 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-md);
}

.stat-box .number {
    font-size: 36px;
    font-weight: bold;
    color: var(--blue);
    margin-bottom: 8px;
}

.stat-box .label {
    font-size: 14px;
    color: var(--tx-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.critical-text {
    color: var(--dn) !important;
}

.high-text {
    color: var(--warn) !important;
}

.gold-text {
    color: var(--warn) !important;
}

/* ========== 时间轴样式 ========== */
.timeline-container {
    padding: 40px 20px;
    min-height: 400px;
}

.timeline {
    position: relative;
    /* wider gutter so the timestamp can live on the axis itself, to the
       left of the rail, instead of inside the card header (desktop only —
       @media 768px below reverts to the narrower mobile gutter and puts
       the time back inside the card). */
    padding-left: 100px;
}

/* 时间轴主线 */
.timeline::before {
    content: '';
    position: absolute;
    left: 70px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--blue) 0%, var(--blue-light) 100%);
    border-radius: 2px;
}

/* 时间轴项目 */
.timeline-item {
    position: relative;
    margin-bottom: 18px;
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

/* 逐个延迟动画 */
.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-item:nth-child(4) { animation-delay: 0.2s; }
.timeline-item:nth-child(5) { animation-delay: 0.25s; }

/* 时间轴标记点 — 核心圆点 + 描边光环，critical 级别附加雷达脉冲动画。
   尺寸/光环比之前略微加大，和左侧时间标签拉开更明显的间距，两者不再贴在一起。 */
.timeline-marker {
    position: absolute;
    left: -35px;
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: var(--blue);
    border: 3px solid var(--bg-2);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--blue-ring, var(--blue));
    z-index: 2;
}

/* Severity marker colors — reduced to the site's existing semantic tokens
   (red/amber/neutral/neutral) instead of a bespoke four-hue rainbow, so the
   signal reads as "the same data-color system as the rest of the site" not
   a separate decorative palette. */
.timeline-item.critical .timeline-marker {
    background-color: var(--dn);
    box-shadow: 0 0 0 2px var(--dn);
}

.timeline-item.high .timeline-marker {
    background-color: var(--warn);
    box-shadow: 0 0 0 2px var(--warn);
}

.timeline-item.medium .timeline-marker {
    background-color: var(--info);
    box-shadow: 0 0 0 2px var(--info);
}

.timeline-item.low .timeline-marker {
    background-color: var(--tx-3);
    box-shadow: 0 0 0 2px var(--tx-3);
}

/* Critical only: a radar-ping ring draws the eye to the most urgent signal;
   high/medium/low stay static so motion isn't spent everywhere at once. */
.timeline-item.critical .timeline-marker::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid var(--dn);
    opacity: 0.5;
    animation: marker-pulse-ring 1.8s ease-out infinite;
}

@keyframes marker-pulse-ring {
    0% { transform: scale(0.6); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* 时间轴内容卡片 */
.timeline-content {
    border-bottom: 1px solid var(--bd-0);
    border-left: 4px solid var(--blue);
    padding: 14px 16px;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    /* lift only — don't touch border-color, it would clobber the
       severity-specific left-stripe color set below */
    transform: translateY(-1px);
}

/* Severity signal — left-border stripe only, using the reduced semantic
   palette above. No full-card background wash: a tinted card per category
   is the single most common "AI dashboard" tell, and it fights the site's
   one-accent-plus-neutrals color discipline. The severity chip badge in the
   header (badge.severity-*) is the primary way severity reads; this stripe
   is a quiet secondary cue. */
.timeline-item.critical .timeline-content {
    border-left-color: var(--dn);
}

.timeline-item.high .timeline-content {
    border-left-color: var(--warn);
}

.timeline-item.medium .timeline-content {
    border-left-color: var(--info);
}

.timeline-item.low .timeline-content {
    border-left-color: var(--tx-3);
}

/* 事件头部 — 时间已移到时间轴主线上（见下方 .event-time），
   这里只剩 badges，靠右对齐延续原本的视觉位置 */
.event-header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

/* 时间标签移出卡片，绝对定位在时间轴主线左侧，与标记点水平对齐；
   .timeline-item 是最近的 position:relative 祖先，定位以它为基准。 */
.event-time {
    position: absolute;
    left: -112px;
    top: -1px;
    width: 70px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
    line-height: 1.3;
}

/* Force the clock+tz-tag row onto one line — at this width, a wrapped
   tz-tag chip would sit flush under the digits and read as overlapping
   text rather than a stacked label. */
.event-time > span:last-child {
    white-space: nowrap;
}

.event-time .tz-tag {
    margin-left: 3px;
    padding: 0 3px;
}

.event-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Display badges — non-filterable corner labels */
.display-badges {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.display-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.4;
}

.badge-breaking {
    background-color: var(--dn-light);
    color: var(--dn);
    border: 1px solid var(--dn-bd, var(--dn-light));
}

.badge-scheduled {
    background-color: var(--bg-3);
    color: var(--tx-2);
    border: 1px solid var(--bd-0);
}

.badge-confirmed {
    background-color: var(--up-light);
    color: var(--up);
    border: 1px solid var(--up-light);
}

.badge-developing {
    background-color: var(--warn-light);
    color: var(--warn);
    border: 1px solid var(--warn-light);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* Severity badge — same reduced palette as the marker/stripe above */
.badge.severity-critical {
    background-color: var(--dn-light);
    color: var(--dn);
    border: 1px solid var(--dn-bd, var(--dn-light));
}

.badge.severity-high {
    background-color: var(--warn-light);
    color: var(--warn);
    border: 1px solid var(--warn-light);
}

.badge.severity-medium {
    background-color: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info-light);
}

.badge.severity-low {
    background-color: var(--bg-3);
    color: var(--tx-3);
    border: 1px solid var(--bd-0);
}

/* Functional impact flag — not a topic label, reuses the warn token */
.badge.gold-impact {
    background-color: var(--warn-light);
    color: var(--warn);
    border: 1px solid var(--warn-light);
}

.badge[class*="type-"] {
    background-color: var(--bg-3);
    color: var(--tx-1);
    border: 1px solid var(--bd-0);
}

/* Topic/tag badges — one accent for all of them (the site's blue), varied
   only by label text. A distinct hue per topic (fed/trump/china/trade/bond/
   gold/stock/dollar/oil/war/inflation/employment — twelve-plus colors) was
   the biggest source of "every category gets its own color" AI-dashboard
   feel; collapsing to one accent is the actual fix, not a re-hued rainbow. */
.badge[class*="tag-"] {
    background-color: var(--blue-light);
    color: var(--blue);
    border: 1px solid var(--blue-ring);
}

/* Two tags stay functional exceptions, not topic labels: breaking news and
   high-impact-economic-release both reuse the severity red instead of their
   own bespoke hue. */
.badge.tag-breaking {
    background-color: var(--dn-light);
    color: var(--dn);
    border: 1px solid var(--dn-bd, var(--dn-light));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.badge.tag-scheduled {
    background-color: var(--bg-3);
    color: var(--tx-2);
    border: 1px solid var(--bd-0);
}

.badge.tag-high-impact {
    background-color: var(--dn-light);
    color: var(--dn);
    border: 1px solid var(--dn-bd, var(--dn-light));
}

.badge-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.badge-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-sm);
    opacity: 0.9;
}

.badge-clickable:active {
    transform: translateY(0);
}

/* 事件标题和描述 */
/* Per-item card title in a dense repeated list — stays sans, overriding the
   global h3 serif rule (design.md: dense repeated content is an explicit
   exception). */
.event-title {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    color: var(--tx-0);
    margin-bottom: 3px;
    line-height: 1.35;
}

/* 英文副标题（中文为主时显示的次级标题） */
.event-title-en {
    font-size: 13px;
    color: var(--tx-2);
    margin: 0 0 6px 0;
    line-height: 1.4;
    font-weight: 400;
}

/* 旧版兼容（已弃用，保留防止外部引用报错） */
.event-title-zh {
    font-size: 14px;
    font-style: italic;
    color: var(--tx-1);
    background-color: var(--bg-1);
    border-radius: 6px;
    padding: 6px 10px;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.event-description {
    color: var(--tx-1);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* 市场快照 */
.market-snapshot {
    margin-bottom: 15px;
    padding: 10px 12px;
    background-color: var(--bg-1);
    border-radius: 8px;
    border: 1px solid var(--bd-0);
}

.snapshot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.snapshot-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    white-space: nowrap;
}

.snapshot-item.gold-highlight {
    font-weight: 700;
}

.snapshot-item.gold-highlight .snapshot-label {
    color: var(--warn);
}

.snapshot-item.gold-highlight .snapshot-price {
    color: var(--warn);
}

.snapshot-label {
    color: var(--tx-2);
    font-weight: 500;
}

.snapshot-price {
    color: var(--tx-0);
    font-weight: 600;
}

.snapshot-change {
    font-size: 12px;
    font-weight: 600;
}

.snapshot-change.positive {
    color: var(--up);
}

.snapshot-change.negative {
    color: var(--dn);
}

/* Legacy event metadata (kept for backwards-compat) */
.event-metadata {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.metadata-item .label {
    color: var(--tx-2);
    font-weight: 500;
}

.metadata-item .value {
    font-weight: 600;
    color: var(--tx-0);
}

.metadata-item .value.positive {
    color: var(--up);
}

.metadata-item .value.negative {
    color: var(--dn);
}

/* 事件底部 */
.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--bd-0);
    font-size: 13px;
    flex-wrap: wrap;
    gap: 10px;
}

.event-source {
    color: var(--tx-2);
    font-style: italic;
}

.event-link {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.event-link:hover {
    color: var(--blue-hover);
    text-decoration: underline;
}

/* ========== 空状态样式 ========== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--tx-0);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--tx-2);
    font-size: 16px;
}

/* ========== 加载更多按钮 ========== */
.load-more-container {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--bd-0);
}

.load-more-btn {
    background: var(--blue);
    color: white;
    border: none;
    padding: 12px 32px;
    font-family: var(--font-sans);
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-md);
}

/* ========== 页脚样式 ========== */
.footer {
    background-color: var(--bg-1);
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid var(--bd-0);
    color: var(--tx-2);
    font-size: 14px;
}

.footer p {
    margin: 8px 0;
}

.footer a {
    color: var(--blue);
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    text-decoration: underline;
}

/* 刷新倒计时 */
#nextRefreshCountdown {
    font-size: 13px;
    color: var(--tx-2);
    font-style: italic;
}

#lastRefreshTime {
    font-weight: 500;
}

/* ========== 加载指示器 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Bottom Loading Indicator */
.bottom-loading {
    padding: 40px 20px;
    text-align: center;
    background-color: var(--bg-1);
    border-top: 1px solid var(--bd-0);
}

.bottom-loading p {
    margin-top: 15px;
    color: var(--tx-2);
    font-size: 14px;
}

.loading-spinner-bottom {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bd-0);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* ========== 动画 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== 响应式设计 ========== */

/* 平板设备 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 26px;
    }

    /* .container has no horizontal padding — without this the flat header's
       title/update-time touch the screen edges on phones. */
    .pg-header {
        padding: 18px 16px 14px;
    }

    .date-range {
        font-size: 14px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filter-header {
        padding: 12px 15px;
    }

    .filter-toggle-button {
        font-size: 13px;
        padding: 8px 16px;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px 15px;
    }

    .stat-box .number {
        font-size: 28px;
    }

    .timeline {
        padding-left: 40px;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-marker {
        left: -33px;
    }

    .timeline-item.critical .timeline-marker {
        left: -35px;
    }

    .timeline-content {
        padding: 15px;
    }

    .event-title {
        font-size: 18px;
    }

    .event-description {
        font-size: 14px;
    }

    .event-header {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
    }

    /* Mobile gutter is too narrow for an on-rail time label — put the
       time back inside the card header, same as before this feature. */
    .event-time {
        position: static;
        left: auto;
        top: auto;
        width: auto;
        align-items: flex-start;
        text-align: left;
    }

    .filter-options {
        gap: 8px;
    }

    .filter-btn {
        font-size: 13px;
        padding: 6px 12px;
    }

    .upcoming-title {
        font-size: 16px;
    }

    .upcoming-event-card {
        padding: 12px;
        gap: 12px;
    }

    .upcoming-event-time {
        min-width: 48px;
    }

    .upcoming-event-title {
        font-size: 14px;
    }

    .upcoming-event-top {
        flex-direction: column;
        align-items: flex-start;
    }

}

/* 手机设备 */
@media (max-width: 480px) {
    .container {
        box-shadow: none;
    }

    .container .header {
        padding: 14px 15px;
        height: auto;
        flex-wrap: wrap;
        gap: 6px 12px;
    }

    .header h1 {
        font-size: 20px;
        white-space: nowrap;
    }

    .date-range {
        font-size: 12px;
    }

    .filter-header {
        padding: 10px 12px;
    }

    .filter-toggle-button {
        font-size: 12px;
        padding: 10px 18px;
        min-height: 44px;
    }

    .filter-icon {
        font-size: 14px;
    }

    .filter-text {
        font-size: 12px;
    }

    .filter-btn {
        font-size: 13px;
        padding: 10px 14px;
        min-height: 44px;
        line-height: 1.2;
    }

    .filter-group-title {
        font-size: 12px;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px 12px;
    }

    .stat-box {
        padding: 14px 10px;
    }

    .stat-box .number {
        font-size: 26px;
    }

    .stat-box .label {
        font-size: 12px;
    }

    .timeline-container {
        /* 16px sides to match .pg-header — 10px left the event cards
           crowding the screen edges on phones. */
        padding: 20px 16px;
    }

    .timeline {
        padding-left: 35px;
    }

    .timeline::before {
        left: 12px;
        width: 2px;
    }

    .timeline-marker {
        width: 12px;
        height: 12px;
        left: -28px;
        top: 10px;
    }

    .timeline-item.critical .timeline-marker {
        width: 16px;
        height: 16px;
        left: -30px;
        top: 8px;
    }

    .timeline-content {
        padding: 12px;
        overflow: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .event-title {
        font-size: 16px;
        word-break: break-word;
    }

    .event-description {
        font-size: 13px;
        word-break: break-word;
    }

    .event-time {
        font-size: 16px;
    }

    .badge {
        font-size: 11px;
        padding: 3px 10px;
        min-height: 28px;
    }

    .badge-clickable {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }

    .display-badge {
        min-height: 28px;
        display: inline-flex;
        align-items: center;
    }

    .snapshot-grid {
        gap: 8px 12px;
    }

    .snapshot-item {
        font-size: 12px;
    }

    .event-metadata {
        flex-direction: column;
        gap: 8px;
    }

    .event-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .event-link {
        display: inline-block;
        min-height: 44px;
        line-height: 44px;
    }

    .filter-content.show {
        padding: 15px 12px;
    }

    .filter-options {
        gap: 6px;
    }

    .upcoming-header {
        padding: 14px 12px;
    }

    .upcoming-title {
        font-size: 14px;
    }

    .upcoming-count {
        font-size: 11px;
    }

    .upcoming-content.show {
        padding: 0 12px 12px;
    }

    .upcoming-event-card {
        padding: 10px;
        gap: 10px;
    }

    .upcoming-event-time {
        min-width: 44px;
    }

    .upcoming-date {
        font-size: 13px;
    }

    .upcoming-clock {
        font-size: 11px;
    }

    .upcoming-event-title {
        font-size: 13px;
    }

    .upcoming-event-desc {
        font-size: 12px;
    }

    .data-item {
        font-size: 12px;
    }

}

/* ========== 微信小程序 webview 适配 ========== */

/* 下拉刷新指示器 */
.pull-refresh-indicator {
    text-align: center;
    padding: 0;
    overflow: hidden;
    height: 0;
    transition: height 0.3s ease;
    background-color: var(--bg-1);
    color: var(--tx-2);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pull-refresh-indicator.pulling {
    height: 50px;
}

.pull-refresh-indicator.refreshing {
    height: 50px;
}

.pull-refresh-indicator .refresh-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--bd-0);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.pull-refresh-indicator.refreshing .refresh-spinner {
    display: block;
}

.pull-refresh-indicator .refresh-arrow {
    transition: transform 0.3s ease;
    font-size: 16px;
}

.pull-refresh-indicator.ready .refresh-arrow {
    transform: rotate(180deg);
}

.pull-refresh-indicator.refreshing .refresh-arrow {
    display: none;
}

/* 超窄屏幕（如 320px 宽度的小程序 webview） */
@media (max-width: 360px) {
    .header h1 {
        font-size: 18px;
    }

    .date-range {
        font-size: 12px;
    }

    .stat-box .number {
        font-size: 22px;
    }

    .timeline {
        padding-left: 30px;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-marker {
        width: 10px;
        height: 10px;
        left: -24px;
        top: 12px;
    }

    .timeline-item.critical .timeline-marker {
        width: 14px;
        height: 14px;
        left: -26px;
        top: 10px;
    }

    .timeline-content {
        padding: 10px;
    }

    .event-title {
        font-size: 15px;
    }

    .event-description {
        font-size: 12px;
    }

    .badge {
        font-size: 10px;
        padding: 3px 8px;
    }

}

/* 打印样式 */
@media print {
    .filter-toggle,
    .filter-bar,
    .load-more-container {
        display: none;
    }

    .timeline-content {
        page-break-inside: avoid;
    }

    .container {
        box-shadow: none;
    }
}

/* ========== Agent Comments ========== */

.agent-comments {
    margin-top: 10px;
    border-top: 1px solid var(--bd-0);
    padding-top: 8px;
}

/* Toggle button */
.agent-comments-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--blue);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: color 0.2s ease, opacity 0.2s ease;
    line-height: 1.5;
    user-select: none;
}

.agent-comments-toggle:hover { color: var(--blue-hover); }

/* Inert state — no comments */
.agent-comments-toggle.no-comments {
    color: var(--tx-3);
    cursor: default;
    font-weight: 500;
}
.agent-comments-toggle.no-comments:hover { color: var(--tx-3); }

/* Loading state — subtle pulse */
.agent-comments-toggle.loading {
    color: var(--tx-3);
    cursor: default;
    animation: ac-label-pulse 1.4s ease-in-out infinite;
}
.agent-comments-toggle.loading:hover { color: var(--tx-3); }

@keyframes ac-label-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.agent-comments-toggle .toggle-icon {
    font-size: 10px;
    transition: transform 0.22s ease;
    display: inline-block;
    color: var(--tx-3);
}

.agent-comments-toggle.expanded .toggle-icon { transform: rotate(90deg); }

/* Comment list container */
.agent-comments-list {
    display: none;
    margin-top: 12px;
    flex-direction: column;
    gap: 10px;
    animation: ac-slide-in 0.18s ease;
}

@keyframes ac-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.agent-comments-list.visible { display: flex; }

/* Individual comment card — mirrors .timeline-content style */
.agent-comment-item {
    background: var(--bg-2);
    border: 1px solid var(--bd-0);
    border-left: 3px solid var(--bd-1);
    border-radius: 6px;
    padding: 12px 14px;
    box-shadow: var(--sh-sm);
    transition: box-shadow 0.2s ease, border-left-color 0.2s ease;
}

.agent-comment-item:hover {
    box-shadow: var(--sh-md);
    border-left-color: var(--blue);
}

/* Top comment (most-liked) — use brand indigo tint */
.agent-comment-item.top-comment {
    border-left-color: var(--blue);
    background: var(--blue-light);
}

/* Header row */
.agent-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

/* Agent identity badge — matches existing .badge pattern */
.agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    background: var(--blue-light);
    color: var(--blue);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.agent-model {
    font-size: 11px;
    color: var(--tx-3);
    font-style: italic;
}

.agent-space-tag {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    color: var(--tx-2);
    background: var(--bg-1);
    border: 1px solid var(--bd-0);
    padding: 1px 6px;
    border-radius: 8px;
}

/* Comment body */
.agent-comment-content {
    font-size: 13px;
    color: var(--tx-0);
    line-height: 1.55;
    margin-bottom: 8px;
}

/* Footer: likes + time */
.agent-comment-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--tx-3);
}

.agent-comment-likes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--blue);
    font-weight: 600;
}

.agent-comment-likes .like-icon { font-size: 11px; }

/* Replies — indented sub-section */
.agent-replies {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--bd-0);
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agent-reply-item {
    background: var(--bg-1);
    border-left: 2px solid var(--bd-0);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--tx-1);
    transition: border-left-color 0.2s ease;
}

.agent-reply-item:hover { border-left-color: var(--blue); }

.agent-reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.agent-reply-content {
    line-height: 1.45;
    color: var(--tx-1);
}

.agent-reply-footer {
    margin-top: 4px;
    font-size: 10px;
    color: var(--tx-3);
    display: flex;
    gap: 10px;
    align-items: center;
}

.agent-reply-likes {
    color: var(--blue);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Loading / empty state */
.comments-loading {
    font-size: 12px;
    color: var(--tx-3);
    padding: 4px 0;
    font-style: italic;
}

/* "N more replies" hint inside a replies block */
.replies-more-link {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--blue);
    font-weight: 600;
}

/* "Show N more / show less" collapsible extra comments */
.comments-extra-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comments-extra-list {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 6px;
    animation: ac-slide-in 0.18s ease;
}

.comments-extra-wrap.expanded .comments-extra-list { display: flex; }

.comments-extra-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--blue);
    transition: color 0.15s ease;
}
.comments-extra-toggle:hover { color: var(--blue-hover); }

/* Toggle label visibility */
.comments-extra-toggle .extra-hide { display: none; }
.comments-extra-wrap.expanded .comments-extra-toggle .extra-show { display: none; }
.comments-extra-wrap.expanded .comments-extra-toggle .extra-hide  { display: inline; }
