/* A-Share Buffett Radar - Slate Theme (石墨板岩灰) */
:root {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-card: #243248;
  --bg-card-hover: #2D3E58;
  --border-color: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(255, 255, 255, 0.25);
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;
  
  --accent-green: #10B981;
  --accent-cyan: #38BDF8;
  --accent-blue: #60A5FA;
  --accent-gold: #F59E0B;
  
  --c-up: #EF4444;    /* A股涨: 红色 */
  --c-down: #10B981;  /* A股跌: 绿色 */
  
  --tier1-bg: rgba(239, 68, 68, 0.15);
  --tier1-text: #FCA5A5;
  --tier1-border: rgba(239, 68, 68, 0.35);

  --tier2-bg: rgba(245, 158, 11, 0.15);
  --tier2-text: #FDE68A;
  --tier2-border: rgba(245, 158, 11, 0.35);

  --tier3-bg: rgba(56, 189, 248, 0.1);
  --tier3-text: #BAE6FD;
  --tier3-border: rgba(56, 189, 248, 0.25);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

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

body {
  background-color: var(--bg-primary) !important;
  color: var(--text-main) !important;
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
}

/* Header */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  font-size: 28px;
  background: var(--bg-card);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-title span {
  color: var(--accent-cyan);
}

.nav-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.etf-header-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
}

.etf-name {
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-sans);
}

.etf-price {
  font-weight: 800;
  color: #fff;
}

.etf-dd {
  color: var(--accent-gold);
  font-size: 11px;
}

.update-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.btn-refresh {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.btn-refresh:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

/* Sections */
.section-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title h2 {
  font-size: 18px;
  font-weight: 700;
}

/* Climate Cards Grid */
.climate-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}

.metric-status {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
  width: fit-content;
}

.status-bullish {
  background: var(--tier1-bg);
  color: var(--tier1-text);
  border: 1px solid var(--tier1-border);
}

.metric-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Summary Badges */
.tier-summary-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.tier1-badge { background: var(--tier1-bg); color: var(--tier1-text); border: 1px solid var(--tier1-border); }
.tier2-badge { background: var(--tier2-bg); color: var(--tier2-text); border: 1px solid var(--tier2-border); }
.tier3-badge { background: var(--tier3-bg); color: var(--tier3-text); border: 1px solid var(--tier3-border); }

/* Table Controls */
.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

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

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.search-box input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-width: 280px;
  outline: none;
  font-family: var(--font-sans);
}

.search-box input:focus {
  border-color: var(--accent-cyan);
}

/* Table Responsive */
.table-responsive {
  overflow-x: auto;
}

.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.stock-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 12px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.stock-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.stock-table tr:hover {
  background: var(--bg-card-hover);
}

.ticker-cell {
  display: flex;
  flex-direction: column;
}

.ticker-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.ticker-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.mono-num {
  font-family: var(--font-mono);
  font-weight: 600;
}

.val-up { color: var(--c-up) !important; font-weight: 700; }
.val-down { color: var(--c-down) !important; font-weight: 700; }

.status-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

.tag-tier1 { background: var(--tier1-bg); color: var(--tier1-text); border: 1px solid var(--tier1-border); }
.tag-tier2 { background: var(--tier2-bg); color: var(--tier2-text); border: 1px solid var(--tier2-border); }
.tag-tier3 { background: var(--tier3-bg); color: var(--tier3-text); border: 1px solid var(--tier3-border); }

/* Quality Row */
.quality-cell {
  display: flex;
  align-items: center;
}

.quality-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  width: fit-content;
}

.rank-s { background: rgba(239, 68, 68, 0.25); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.5); }
.rank-a { background: rgba(245, 158, 11, 0.25); color: #FDE68A; border: 1px solid rgba(245, 158, 11, 0.5); }
.rank-b { background: rgba(56, 189, 248, 0.2); color: #BAE6FD; border: 1px solid rgba(56, 189, 248, 0.4); }

.quality-score-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.quality-details-inline {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Principles Grid */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.principle-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 18px;
  border-radius: var(--radius-md);
}

.p-title {
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  font-size: 14px;
}

.principle-item p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

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