/* ═══════ HanseBrief 主样式 · Bloomberg 深色终端风 ═══════ */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2330;
  --border: #2a3342;
  --text-primary: #e6edf3;
  --text-secondary: #9aa7b4;
  --text-muted: #6b7684;
  --accent-gold: #c8a45c;
  --accent-gold-hover: #ddb96f;
  --deep-blue: #1a2332;
  --up: #1a7f37;
  --down: #cf222e;
  --link: #58a6ff;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* ═══════ 顶部 Ticker ═══════ */
.ticker-bar {
  background: #000;
  border-bottom: 1px solid var(--border);
  height: 34px;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
}
.ticker-inner {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  padding-left: 100%;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  margin-right: 40px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.ticker-item .sym { color: var(--text-secondary); margin-right: 8px; }
.ticker-item .price { font-weight: 700; margin-right: 6px; }
.ticker-item .chg.up { color: var(--up); }
.ticker-item .chg.down { color: var(--down); }
.ticker-loading { color: var(--text-muted); padding-left: 20px; }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ═══════ 导航栏 ═══════ */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 34px;
  z-index: 99;
}
.nav-left { display: flex; align-items: center; gap: 32px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  background: linear-gradient(135deg, var(--accent-gold), #8a6d3b);
  color: #000;
  font-weight: 700;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 15px;
}
.logo-text { color: var(--text-primary); font-weight: 600; font-size: 17px; letter-spacing: .3px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  transition: all .15s;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-links a.active { color: var(--accent-gold); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

/* ═══════ 按钮 ═══════ */
.btn-primary {
  background: var(--accent-gold);
  color: #000;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: background .15s;
}
.btn-primary:hover { background: var(--accent-gold-hover); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }
.btn-gold {
  display: block;
  background: linear-gradient(135deg, var(--accent-gold), #a5824a);
  color: #000;
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  margin-top: 10px;
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }

/* ═══════ 主体三栏 ═══════ */
.main-grid {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 24px;
  min-height: calc(100vh - 160px);
}
.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: fit-content;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.panel-header h3 { font-size: 15px; font-weight: 600; }
.panel-header.sticky {
  position: sticky;
  top: 94px;
  background: var(--bg-secondary);
  z-index: 10;
  padding-top: 4px;
}
.live-dot {
  width: 8px; height: 8px;
  background: var(--up);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ═══════ 左栏数据看板 ═══════ */
.data-block { margin-bottom: 20px; }
.data-block-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.data-list { display: flex; flex-direction: column; gap: 6px; }
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 13px;
}
.data-row b { font-size: 14px; }
.data-row.skeleton {
  height: 34px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, #222b3a 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.up { color: var(--up); }
.down { color: var(--down); }

.calendar-list { font-size: 13px; }
.cal-item {
  padding: 8px 10px;
  border-left: 3px solid var(--accent-gold);
  background: var(--bg-tertiary);
  border-radius: 0 6px 6px 0;
  margin-bottom: 6px;
}
.cal-date { color: var(--accent-gold); font-size: 11px; font-weight: 600; }
.cal-title { color: var(--text-primary); margin-top: 2px; }
.cal-empty { color: var(--text-muted); font-size: 13px; padding: 8px; }

.upgrade-cta {
  background: linear-gradient(135deg, rgba(200,164,92,.12), rgba(200,164,92,.04));
  border: 1px solid rgba(200,164,92,.3);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.cta-title { font-weight: 700; color: var(--accent-gold); font-size: 15px; }
.cta-desc { color: var(--text-secondary); font-size: 12px; margin-top: 4px; }

/* ═══════ 中栏快讯流 ═══════ */
.newsfeed { min-height: 600px; }
.feed-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.category-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.category-tabs .tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.category-tabs .tab:hover { color: var(--text-primary); border-color: var(--text-muted); }
.category-tabs .tab.active {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
  font-weight: 600;
}
.refresh-hint { font-size: 11px; color: var(--text-muted); }

.news-list { display: flex; flex-direction: column; }
.news-item {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
  border-left: 3px solid transparent;
  position: relative;
}
.news-item:hover {
  background: var(--bg-tertiary);
  border-left-color: var(--accent-gold);
  transform: translateX(2px);
}
.news-item.flash { animation: flash-new 1.2s ease; }
@keyframes flash-new {
  0% { background: rgba(200,164,92,.25); }
  100% { background: transparent; }
}
.news-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 700;
  margin-right: 8px;
}
.news-meta-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.news-cat {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.news-cat.tariff { background: rgba(207,34,46,.15); color: #ff7b72; }
.news-cat.policy { background: rgba(88,166,255,.15); color: #79c0ff; }
.news-cat.market { background: rgba(63,185,80,.15); color: #56d364; }
.news-cat.supply_chain { background: rgba(200,164,92,.15); color: var(--accent-gold); }
.news-cat.fx { background: rgba(188,140,255,.15); color: #d2a8ff; }
.news-cat.china_policy { background: rgba(255,123,114,.15); color: #ffa198; }
.news-source { font-size: 11px; color: var(--text-muted); }
.news-title { font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--text-primary); }
.news-title-zh { font-size: 13px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.news-summary { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; }
.news-premium-badge {
  display: inline-block;
  font-size: 10px;
  background: linear-gradient(135deg, var(--accent-gold), #a5824a);
  color: #000;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 6px;
}
.news-skeleton {
  height: 90px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, #222b3a 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.load-more-wrap { text-align: center; padding: 16px 0 4px; }

/* ═══════ 右栏 ═══════ */
.tracking-box { display: flex; gap: 6px; margin-bottom: 10px; }
.tracking-box input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.tracking-box input:focus { outline: none; border-color: var(--accent-gold); }
.tracking-list { display: flex; flex-direction: column; gap: 6px; }
.tracking-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-tertiary);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.tracking-tag .del { color: var(--text-muted); cursor: pointer; font-size: 16px; }
.tracking-tag .del:hover { color: var(--down); }
.tracking-empty { color: var(--text-muted); font-size: 12px; padding: 8px 0; }

.source-stats { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.source-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border-radius: 6px;
}
.source-row .count { color: var(--accent-gold); font-family: 'JetBrains Mono', monospace; }

/* ═══════ 弹窗 ═══════ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-mask.show { display: flex; }
.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.modal-source { color: var(--accent-gold); font-weight: 600; font-size: 13px; }
.modal-time { color: var(--text-muted); font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.modal-cat { font-size: 11px; background: var(--bg-tertiary); padding: 2px 8px; border-radius: 10px; color: var(--text-secondary); }
.modal-card h2 { font-size: 20px; line-height: 1.4; margin-bottom: 8px; }
.modal-title-zh { font-size: 16px; color: var(--text-secondary); font-weight: 500; margin-bottom: 16px; }
.modal-body { color: var(--text-secondary); line-height: 1.8; font-size: 14px; margin-bottom: 20px; }
.modal-footer { border-top: 1px solid var(--border); padding-top: 16px; }
.modal-lock {
  text-align: center;
  padding: 24px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-top: 12px;
}
.lock-icon { font-size: 32px; margin-bottom: 8px; }

.modal-auth { max-width: 400px; }
.modal-auth h2 { margin-bottom: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
}
.auth-form input:focus { outline: none; border-color: var(--accent-gold); }
.auth-error { color: var(--down); font-size: 13px; min-height: 18px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-muted); }
.auth-switch a { color: var(--accent-gold); text-decoration: none; }

/* ═══════ 页脚 ═══════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  margin-top: 40px;
  background: var(--bg-secondary);
}
.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text-primary); }

/* ═══════ 响应式 ═══════ */
@media (max-width: 1200px) {
  .main-grid { grid-template-columns: 240px 1fr 260px; }
}
@media (max-width: 992px) {
  .main-grid { grid-template-columns: 1fr; }
  .dashboard, .sidebar-right { order: 2; }
  .newsfeed { order: 1; }
  .nav-links { display: none; }
}
