/* ========================================
   国际物流资讯中心 - 样式表
   设计风格：专业商务 / 简洁清晰 / 物流行业
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-bg: #eff6ff;
  --primary-border: #bfdbfe;

  --accent: #0d9488;
  --accent-light: #14b8a6;
  --accent-bg: #f0fdfa;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

  --radius: 8px;
  --radius-lg: 12px;

  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --header-h: 64px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-system);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.logo-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  letter-spacing: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-clock {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Navigation Tabs --- */
.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.nav-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab:hover { background: var(--surface-hover); color: var(--text); }
.nav-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* --- Forex Quick Bar --- */
.forex-quick-bar {
  background: var(--primary-bg);
  border-bottom: 1px solid var(--primary-border);
  padding: 6px 24px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
}

.quick-fx { margin: 0 4px; }
.quick-fx strong { color: var(--primary); }

/* --- Main Content --- */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Buttons --- */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover { background: var(--surface-hover); color: var(--text); }
.btn-icon { padding: 8px; min-width: 36px; justify-content: center; }

/* --- Category Filters --- */
.category-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.category-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.category-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* --- Search --- */
.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* --- News Grid --- */
/* --- 今日国际大事（置顶） --- */
#news-brief {
  margin: 14px 0 18px;
}
.brief-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.brief-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}
.brief-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.brief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.brief-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s, box-shadow 0.15s;
}
.brief-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.brief-card.impact-high { border-left-color: #dc2626; }
.brief-card.impact-medium { border-left-color: #d97706; }
.brief-card.impact-low { border-left-color: #6b7280; }

.brief-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.brief-theme {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}
.brief-impact {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.brief-lead {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.brief-lead:hover { color: var(--primary); }
.brief-summary {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.brief-related-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.brief-related {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.4;
}
.brief-related:hover .brief-related-title { color: var(--primary); text-decoration: underline; }
.brief-dot { color: var(--primary); flex-shrink: 0; }
.brief-related-title { flex: 1; min-width: 0; }
.brief-src {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 置顶卡片可点击 + 查看详情入口 */
.brief-card { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.brief-more {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-align: right;
}
.brief-card:hover .brief-more { text-decoration: underline; }

.brief-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.brief-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.brief-today {
  font-size: 11px;
  font-weight: 700;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 1px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* ===== 置顶大事详情弹窗 ===== */
.evd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 20px;
  animation: evd-fade .15s ease;
}
@keyframes evd-fade { from { opacity: 0; } to { opacity: 1; } }
.evd-box {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 24px 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
  animation: evd-pop .18s ease;
}
@keyframes evd-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.evd-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 30px; height: 30px;
  border: none; border-radius: 8px;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 20px; line-height: 1;
  cursor: pointer;
}
.evd-close:hover { background: #e2e8f0; color: var(--text); }
.evd-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  padding-right: 30px;
}
.evd-icon { font-size: 20px; }
.evd-theme { font-size: 15px; font-weight: 800; color: var(--text-secondary); }
.evd-lead-title {
  font-size: 19px; font-weight: 800; line-height: 1.4;
  color: var(--text); margin-bottom: 6px;
}
.evd-meta { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; }
.evd-summary {
  font-size: 14px; line-height: 1.6; color: var(--text-secondary);
  background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.evd-desc {
  font-size: 13.5px; line-height: 1.7; color: var(--text);
  white-space: pre-wrap; word-break: break-word; margin-bottom: 14px;
}
.evd-desc-empty { color: var(--text-muted); font-style: italic; }
.evd-origin {
  display: inline-block;
  background: var(--primary); color: #fff;
  font-size: 13.5px; font-weight: 700;
  padding: 9px 16px; border-radius: 9px; text-decoration: none;
}
.evd-origin:hover { filter: brightness(1.08); }
.evd-rel-title {
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border);
}
.evd-rel-list { display: flex; flex-direction: column; gap: 8px; }
.evd-rel {
  display: block; text-decoration: none;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 11px;
}
.evd-rel:hover { border-color: var(--primary); }
.evd-rel-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin: 0 0 3px; padding: 0; border: none; }
.evd-rel-meta { font-size: 11.5px; color: var(--text-muted); }

/* ===== 主题历史详情 · 按时间分桶 ===== */
.td-box { max-width: 600px; display: flex; flex-direction: column; }
.td-total {
  margin-left: auto;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.td-intro {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.5;
  background: var(--bg); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px;
}
.td-scroll { max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.td-bucket { margin-bottom: 14px; }
.td-bucket-head {
  display: flex; align-items: center; gap: 8px;
  position: sticky; top: 0;
  background: var(--surface);
  padding: 6px 2px; margin-bottom: 6px;
}
.td-bucket-label {
  font-size: 13px; font-weight: 800; color: var(--text-secondary);
}
.td-bucket-count {
  font-size: 11px; font-weight: 700; color: var(--primary);
  background: var(--primary-light, #e0f2f1);
  border-radius: 10px; padding: 1px 8px;
}
.td-bucket-list { display: flex; flex-direction: column; gap: 6px; }
.td-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 11px; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.td-item:hover { border-color: var(--primary); background: var(--surface); }
.td-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #6b7280;
}
.td-dot.impact-high { background: #dc2626; }
.td-dot.impact-medium { background: #d97706; }
.td-dot.impact-low { background: #6b7280; }
.td-item-main { flex: 1; min-width: 0; }
.td-item-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  line-height: 1.45; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.td-item-meta {
  font-size: 11.5px; color: var(--text-muted); margin-top: 2px;
}
.td-item-go { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.td-item:hover .td-item-go { color: var(--primary); }

.news-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.news-card {
  background: var(--surface);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border-light);
}
.news-card:last-child { border-bottom: none; }

.news-card:hover { background: var(--surface-hover); }

.news-card-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  margin-top: 2px;
}

.news-card-main {
  flex: 1;
  min-width: 0;
}

.news-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 4px;
  color: var(--text);
}
.news-card:hover .news-card-title { color: var(--primary); }

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.news-source { font-weight: 500; color: var(--primary); }
.news-time { white-space: nowrap; }

/* --- Live Pulse Indicator --- */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* --- Holidays Section --- */
.holidays-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

/* Time Range Buttons */
.timerange-buttons {
  display: flex;
  gap: 6px;
}

.timerange-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.timerange-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.timerange-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Progress Bar */
#holidays-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  width: 120px;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Holidays Info Bar */
.holidays-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 10px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}

.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-item.high .legend-dot { background: var(--danger); }
.legend-item.medium .legend-dot { background: var(--warning); }
.legend-item.low .legend-dot { background: var(--text-muted); }

/* Month Group Divider */
.holiday-month-group {
  margin-bottom: 8px;
}

.month-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 8px;
  background: var(--primary-bg);
  border-radius: var(--radius);
  border: 1px solid var(--primary-border);
}

.month-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.month-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* Holiday Cards */
.holidays-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.holiday-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.holiday-card:hover { box-shadow: var(--shadow-md); }

.holiday-card-header {
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}

.holiday-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.impact-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Country Row (new global view) */
.holiday-country-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.holiday-flag {
  font-size: 22px;
  line-height: 1;
}

.holiday-cn-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  margin-left: 2px;
}

.holiday-country-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-today { background: #dcfce7; color: #166534; }
.badge-tomorrow { background: #fef3c7; color: #92400e; }
.badge-urgent { background: #fee2e2; color: #991b1b; }
.badge-upcoming { background: #e0f2fe; color: #075985; }
.badge-later { background: #f3f4f6; color: #6b7280; }
.badge-recent { background: #f3f4f6; color: #6b7280; }

.holiday-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.holiday-eng-name {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  min-height: 0;
}

.holiday-date, .holiday-type {
  font-size: 13px;
  color: var(--text-secondary);
}

.holiday-card-body {
  padding: 12px 16px;
}

.impact-alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.impact-alert strong { color: var(--text); }

.holiday-actions {
  display: flex;
  justify-content: flex-end;
}

.holiday-country-tag {
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
}

/* --- Forex Grid --- */
.forex-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.forex-title { font-size: 18px; font-weight: 700; }
.forex-base-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.forex-base-label { font-weight: 500; }
.forex-base-select {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.forex-base-select:focus { border-color: var(--primary); }
.forex-update { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.forex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.forex-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.forex-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }

.forex-currency {
  display: flex;
  align-items: center;
  gap: 10px;
}

.forex-flag { font-size: 24px; }

.forex-code {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.forex-name {
  font-size: 11px;
  color: var(--text-muted);
}

.forex-rate {
  text-align: right;
}

.forex-value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.forex-up { color: #dc2626; font-size: 12px; font-weight: 600; }
.forex-down { color: #16a34a; font-size: 12px; font-weight: 600; }
.forex-unchanged { color: var(--text-muted); font-size: 12px; }

/* --- 汇率转换器 --- */
.fx-conv {
  background: linear-gradient(135deg, var(--surface), #f8fafc);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.fx-conv-head {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.fx-conv-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.fx-conv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fx-conv-field label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.fx-conv-amount { flex: 0 0 120px; }

.fx-conv-field select,
.fx-conv-field input {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.fx-conv-field select:focus,
.fx-conv-field input:focus { border-color: var(--primary); }

.fx-conv-field select { min-width: 180px; cursor: pointer; }

.fx-swap {
  height: 40px;
  width: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--primary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 0;
}

.fx-swap:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.fx-conv-result {
  margin-top: 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  background: var(--primary);
  border-radius: var(--radius-md);
  color: #fff;
}

.fx-result-val {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.fx-result-unit {
  font-size: 14px;
  opacity: 0.85;
  font-weight: 500;
}

.fx-conv-rate {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 转换器主行：金额 + 基准货币 + 互换 */
.fx-conv-main-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- 可搜索货币下拉框 (combobox) --- */
.fx-combo {
  position: relative;
  min-width: 200px;
}
.fx-combo-input {
  height: 40px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.fx-combo-input:focus { border-color: var(--primary); }

.fx-combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.12));
  display: none;
  padding: 4px;
}
.fx-combo-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
}
.fx-combo-opt:hover,
.fx-combo-opt.hl { background: #eef4ff; }
.fx-combo-opt.active { font-weight: 700; color: var(--primary); }
.fx-combo-flag { font-size: 18px; }
.fx-combo-name { flex: 1; }
.fx-combo-code {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.fx-combo-empty {
  padding: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.fx-combo-group-hdr {
  padding: 8px 10px 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* --- 多目标货币行 --- */
.fx-conv-targets {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fx-conv-target-row, .fx-pair-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.fx-pair-swap {
  height: 40px;
  width: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-end;
  margin-bottom: 2px;
}
.fx-pair-swap:hover { background: var(--primary); color: #fff; }
.fx-conv-t-result {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
  padding: 0 14px;
  min-width: 160px;
  justify-content: flex-end;
}
.fx-eq {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
}
.fx-source-amount-field { flex: 0 0 120px; }
.fx-target-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.fx-target-code {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.fx-target-remove {
  height: 40px;
  width: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: #dc2626;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.fx-target-remove:hover { background: #fee2e2; border-color: #fecaca; }

.fx-add-target {
  margin-top: 14px;
  width: 100%;
  height: 42px;
  border: 1px dashed var(--primary);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.fx-add-target:hover { background: #eef4ff; }

/* --- 转换器模式切换 --- */
.fx-conv-mode {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.fx-mode-btn {
  flex: 1;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.fx-mode-btn:hover { border-color: var(--primary); color: var(--primary); }
.fx-mode-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.fx-hint-inline {
  align-self: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Loading --- */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 10px;
}

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========================================
   Country Selector — 国家选择器
   ======================================== */
.country-selector {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 12px;
}

.country-selector-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.country-selector-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-sm:hover {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary-border);
}

.country-selector-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.country-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  padding: 2px 2px 6px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.country-chips::-webkit-scrollbar { width: 8px; }
.country-chips::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.country-chips::-webkit-scrollbar-track { background: transparent; }

.country-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
  user-select: none;
}
.country-chip:hover {
  border-color: var(--primary-light);
  background: var(--primary-bg);
}
.country-chip.selected {
  background: var(--primary-bg);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
/* 主流贸易国家：默认高亮视觉权重 */
.country-chip.mainstream {
  background: #fff;
}
.country-chip.minor {
  opacity: 0.78;
  font-size: 11px;
  padding: 3px 8px;
}
.country-chip.minor .country-chip-name { font-size: 11px; }

.country-chip-flag {
  width: 20px;
  height: 13px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.country-chip-fallback {
  width: 18px; height: 13px; line-height: 13px;
  text-align: center; font-size: 10px; font-weight: 700;
  background: var(--primary-bg); color: var(--primary);
  border-radius: 2px; flex-shrink: 0;
}

.country-chip-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.country-chip.selected .country-chip-name {
  color: var(--primary);
  font-weight: 600;
}

/* 国家搜索框 */
.country-search-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  flex: 0 1 280px;
}
.country-search-box .search-icon { font-size: 12px; opacity: 0.6; }
.country-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  color: var(--text);
  width: 100%;
  min-width: 120px;
}
.country-search-box input::placeholder { color: var(--text-muted); }

.btn-primary {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}
.btn-primary:hover { background: var(--primary-dark) !important; }

.country-selector-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}
.country-selector-hint strong { color: var(--primary); }

/* ========================================
   Holiday Cards v2 — 全新节日卡片设计
   ======================================== */
.holiday-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

.holiday-card-v2 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.holiday-card-v2:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* 顶部彩色条 */
.holiday-card-bar {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
}

/* 卡片顶部：国旗 + 日期 + 倒计时 */
.holiday-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 0;
}

.holiday-flag-wrap {
  width: 44px;
  height: 30px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
  background: var(--border-light);
}

.holiday-flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.holiday-flag-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.holiday-card-date-block {
  text-align: center;
  flex-shrink: 0;
  min-width: 40px;
}

.holiday-card-monthday {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.holiday-card-weekday {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1;
}

.holiday-countdown {
  margin-left: auto;
}

/* 卡片内容区 */
.holiday-card-body-v2 {
  padding: 10px 16px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.holiday-card-country {
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.holiday-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}

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

.holiday-card-eng {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}

.holiday-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.impact-tag {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.holiday-date-full {
  font-size: 11px;
  color: var(--text-muted);
}

.impact-alert-v2 {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.impact-alert-v2 strong {
  color: var(--text);
}

/* Empty State */
.empty-state {
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state small {
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .logo { font-size: 18px; }
  .logo-icon { width: 30px; height: 30px; font-size: 14px; }
  .nav-tab { padding: 6px 12px; font-size: 13px; }
  .main { padding: 16px; }
  
  .section-title { font-size: 17px; }
  
  .news-grid {
    border-radius: var(--radius);
  }
  .news-card {
    padding: 10px 12px;
    gap: 8px;
  }
  .news-card-title { font-size: 13px; }
  .news-card-tag { font-size: 10px; padding: 1px 6px; }
  
  .forex-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .holidays-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .timerange-buttons {
    flex-wrap: wrap;
  }
  
  .search-box { max-width: none; }
  
  .category-filters { 
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 8px;
  }

  .holiday-cards-row {
    grid-template-columns: 1fr;
  }
  
  .country-chips {
    gap: 4px;
  }
  .country-chip {
    padding: 3px 8px;
  }
  .country-chip-name {
    font-size: 11px;
  }
  
  .holiday-card-v2 {
    border-radius: var(--radius);
  }

  .live-clock { display: none; }
}

@media (max-width: 480px) {
  .forex-grid { grid-template-columns: 1fr; }
  
  .header { flex-direction: column; height: auto; padding: 10px 16px; gap: 10px; }
  
  :root { --header-h: 110px; }
}
