/* AiToEarn 样式 */
:root { --ink:#172033; --muted:#667085; --navy:#101828; --blue:#2563eb; --line:#e4e7ec; --surface:#fff; }
body { background: #f2f4f7; color:var(--ink); font-size: 14px; }
.container-fluid.mt-3 { max-width: 1520px; display:flex; flex-direction:column; }
.strategy-hero { order:1; } #action-panel { order:2; } .equity-card { order:3; }
#overview-cards { order:4; } .ranking-card { order:5; } .container-fluid.mt-3 > .row.mb-3 { order:6; }
.method-note { order:7; }
.longterm-card { order:8; }

.navbar { padding: 0.55rem 1rem; background:var(--navy); box-shadow:0 3px 16px rgba(16,24,40,.18); }
.navbar-brand { font-size: 1.1rem; letter-spacing: 0.5px; }
.navbar-brand small { color:#98a2b3; font-size:.68rem; font-weight:500; margin-left:.35rem; }
.brand-mark { display:inline-grid; place-items:center; width:27px; height:27px; border-radius:8px; background:#2e63e9; margin-right:4px; }
.navbar .container-fluid { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:20px; }
.nav-center { justify-self:center; }
.nav-tools { justify-self:end; display:flex; align-items:center; gap:12px; }
.data-freshness { display:flex; align-items:center; gap:8px; padding-right:12px; border-right:1px solid rgba(255,255,255,.13); color:#fff; }
.data-freshness > span:last-child { display:flex; flex-direction:column; line-height:1.15; }
.data-freshness small { color:#98a2b3; font-size:.62rem; }
.data-freshness strong { font-size:.78rem; font-weight:600; font-variant-numeric:tabular-nums; }
.status-dot { width:7px; height:7px; border-radius:50%; background:#32d583; box-shadow:0 0 0 4px rgba(50,213,131,.12); }
.btn-refresh { color:white; border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.08); padding:.36rem .7rem; }
.btn-refresh:hover { color:white; background:rgba(255,255,255,.15); }
.btn-refresh span { display:inline-block; font-size:1rem; margin-right:3px; }
.spin { animation:spin .8s linear infinite; } @keyframes spin { to { transform:rotate(360deg); } }
.strategy-hero { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:24px 28px; color:white; border-radius:16px; background:linear-gradient(125deg,#101828 0%,#183b76 70%,#2563eb 130%); box-shadow:0 8px 28px rgba(16,24,40,.16); }
.strategy-hero .eyebrow { color:#93c5fd; font-size:.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.strategy-hero h1 { font-size:1.55rem; margin:.2rem 0 .35rem; }
.strategy-hero p { color:#d0d5dd; margin:0; max-width:620px; }
.strategy-facts { display:grid; grid-template-columns:repeat(4,minmax(90px,1fr)); gap:10px; min-width:480px; }
.strategy-facts div { padding:10px 12px; border:1px solid rgba(255,255,255,.14); border-radius:10px; background:rgba(255,255,255,.07); }
.strategy-facts span,.strategy-facts strong { display:block; }
.strategy-facts span { color:#aebbd0; font-size:.68rem; margin-bottom:3px; }
.strategy-facts strong { font-size:.88rem; }

/* 区域2：账户总览卡片 */
.overview-card {
  height:100%; background: white; border:1px solid var(--line); border-radius: 12px; padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(16,24,40,.05); text-align: left;
}
.overview-card .label { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.overview-card .value { font-size: 1.6rem; font-weight: 700; margin-top: 2px; }
.overview-card .sub { font-size: 0.8rem; margin-top: 2px; }
.overview-card.risk-card { border-left:3px solid #e74c3c; }
.overview-card .positive { color: #e74c3c; }
.overview-card .negative { color: #27ae60; }

/* 区域3：操作指令卡片 */
.action-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e8f5e9 100%);
  border: 2px solid #b3d9ff; border-radius: 14px;
  padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.action-section {
  background: rgba(255,255,255,0.5); border-radius: 10px; padding: 12px 16px;
}
.action-card .section-title {
  font-size: 0.9rem; font-weight: 700; color: #1565c0;
  margin-bottom: 4px; padding-bottom: 6px; border-bottom: 2px solid #90caf9;
}
.action-card .section-subtitle {
  font-size: 0.75rem; color: #888; margin-bottom: 10px;
}
.holding-item {
  background: white; border-radius: 8px; padding: 10px 14px;
  margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex; justify-content: space-between; align-items: center;
}
.holding-item .name { font-weight: 600; font-size: 0.9rem; }
.holding-item .detail { font-size: 0.78rem; color: #666; }
.holding-item .pnl-positive { color: #e74c3c; font-weight: 600; }
.holding-item .pnl-negative { color: #27ae60; font-weight: 600; }

.status-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 0.7rem; font-weight: 600;
}
.status-hold { background: #e8f5e9; color: #2e7d32; }
.status-sell { background: #ffebee; color: #c62828; }
.status-new { background: #fff8e1; color: #f57f17; }

.rebalance-info { font-size: 0.85rem; }
.rebalance-info dt { font-weight: 600; color: #333; width: 90px; }
.rebalance-info dd { margin-bottom: 6px; color: #555; }

/* 区域4：收益曲线 */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-radius: 10px; }
.card-header { background: white; border-bottom: 1px solid #eee; font-weight: 600; font-size: 0.9rem; }
.header-note { margin-left:10px; font-weight:400; color:#98a2b3; }
.method-note { padding:13px 16px; border:1px solid #dbe5f5; border-radius:10px; background:#f7faff; color:#475467; font-size:.8rem; }
.method-note strong { color:#244a82; margin-right:8px; }
.longterm-header { display:flex; justify-content:space-between; align-items:center; }
.longterm-header small { display:block; color:#98a2b3; font-weight:400; margin-top:3px; }
.data-source-badge { padding:4px 9px; border-radius:999px; background:#ecfdf3; color:#027a48; font-size:.68rem; }
.longterm-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:8px; }
.longterm-kpis div { padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:#fcfcfd; }
.longterm-kpis span,.longterm-kpis strong { display:block; }
.longterm-kpis span { color:var(--muted); font-size:.72rem; }
.longterm-kpis strong { font-size:1.15rem; margin-top:3px; }
.subsection-title { font-size:.82rem; font-weight:700; margin-bottom:8px; }
.annual-table th,.annual-table td { font-size:.78rem; padding:.42rem; }
.longterm-positions { display:grid; gap:7px; font-size:.78rem; }
.longterm-position { display:flex; justify-content:space-between; padding:8px 10px; background:#f8fafc; border-radius:8px; }
.longterm-footnote { margin:12px 0 0; color:#98a2b3; font-size:.72rem; }

/* 区域5：排行榜 */
#ranking-table th, #ranking-table td { font-size: 0.8rem; padding: 0.35rem 0.5rem; vertical-align: middle; }
#ranking-table .rank-1 { border-left: 3px solid #ffd700; }
#ranking-table .rank-2 { border-left: 3px solid #c0c0c0; }
#ranking-table .rank-3 { border-left: 3px solid #cd7f32; }
#ranking-table .rank-1 .rank-num { color: #ffd700; font-weight: 700; }
#ranking-table .rank-2 .rank-num { color: #c0c0c0; font-weight: 700; }
#ranking-table .rank-3 .rank-num { color: #cd7f32; font-weight: 700; }
.above-ma { color: #27ae60; }
.below-ma { color: #e74c3c; }

.badge-status-ok { background: #27ae60; }
.badge-status-warn { background: #f39c12; }
.badge-status-err { background: #e74c3c; }

.btn:focus { box-shadow: none; }
.sticky-top { top: 0; z-index: 1; }

/* 区域6：换仓历史时间轴 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: #ddd;
}
.timeline-item {
  position: relative; margin-bottom: 16px; padding-left: 16px;
}
.timeline-item::before {
  content: ''; position: absolute; left: -16px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #3498db; border: 2px solid white;
  box-shadow: 0 0 0 2px #3498db;
}
.timeline-item .date { font-weight: 600; color: #333; font-size: 0.85rem; }
.timeline-item .detail { font-size: 0.78rem; color: #666; margin-top: 2px; }
.timeline-item .asset { font-size: 0.78rem; color: #888; margin-top: 2px; }

/* 统计指标 */
.stat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.stat-row:last-child { border-bottom: none; }
.stat-row .label { color: #888; font-size: 0.82rem; }
.stat-row .value { font-weight: 600; font-size: 0.85rem; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* 响应式 */
@media (max-width: 768px) {
  .navbar .container-fluid { grid-template-columns:1fr auto; gap:10px; }
  .nav-center { grid-row:2; grid-column:1 / -1; width:100%; }
  .nav-center .btn-group { display:flex; width:100%; }
  .nav-center .btn { flex:1; }
  .data-freshness { border:0; padding:0; }
  .btn-refresh { font-size:0; padding:.34rem .55rem; }
  .btn-refresh span { font-size:1.15rem; margin:0; }
  .strategy-hero { align-items:flex-start; flex-direction:column; padding:20px; }
  .strategy-facts { min-width:0; width:100%; grid-template-columns:repeat(2,1fr); }
  .longterm-kpis { grid-template-columns:repeat(2,1fr); }
  .header-note { display:block; margin:3px 0 0; }
  .action-card .row { flex-direction: column; }
  .overview-card .value { font-size: 1.3rem; }
}
