/* 基金投研报告系统 —— 深色科技感主题 */
:root {
  --bg: #0a0e1a;
  --bg-card: rgba(20, 28, 50, 0.72);
  --bg-card-hover: rgba(28, 40, 70, 0.85);
  --border: rgba(90, 140, 255, 0.18);
  --text: #e8eeff;
  --text-dim: #8fa3c8;
  --accent: #4d9fff;
  --accent2: #7c5cff;
  --red: #ff4d5e;      /* 加仓/入场 */
  --green: #00d68f;    /* 减仓 */
  --gray: #6b7894;     /* 保持当前 */
  --gold: #ffd166;     /* 重点标记 */
  --glow-red: 0 0 18px rgba(255, 77, 94, 0.35);
  --glow-green: 0 0 18px rgba(0, 214, 143, 0.3);
  --glow-gold: 0 0 22px rgba(255, 209, 102, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #16224a 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #1a1440 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  min-height: 100vh;
  padding-bottom: 60px;
}
a { color: var(--accent); text-decoration: none; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 26, 0.8); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 100;
}
.brand { font-size: 20px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand small { font-size: 11px; opacity: 0.6; margin-left: 10px; letter-spacing: 2px; }
.nav a { margin-left: 22px; font-size: 14px; color: var(--text-dim); padding: 6px 4px; }
.nav a:hover, .nav a.active { color: var(--text); border-bottom: 2px solid var(--accent); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 28px; }
.page-title { font-size: 24px; font-weight: 700; margin: 8px 0 4px; }
.page-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 22px; }

/* 仪表盘 */
.dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; }
.dash-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 22px; position: relative; overflow: hidden;
}
.dash-card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.dash-card .label { font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }
.dash-card .value { font-size: 30px; font-weight: 800; margin-top: 8px;
  font-variant-numeric: tabular-nums; }
.dash-card .unit { font-size: 13px; color: var(--text-dim); margin-left: 4px; font-weight: 400; }
.dash-card .hint { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.value.red { color: var(--red); text-shadow: var(--glow-red); }
.value.blue { color: var(--accent); text-shadow: 0 0 18px rgba(77,159,255,.4); }
.value.green { color: var(--green); text-shadow: var(--glow-green); }

/* 卡片 */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; margin-bottom: 24px; backdrop-filter: blur(6px);
}
.card h2 { font-size: 17px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.card h2 .tag { font-size: 11px; color: var(--text-dim); background: rgba(255,255,255,.06);
  padding: 2px 10px; border-radius: 20px; font-weight: 400; }
.card .sub { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--text-dim); font-weight: 500; font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid rgba(90,140,255,0.08); vertical-align: middle; }
tr:hover td { background: rgba(77, 159, 255, 0.05); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.pos { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--red); } .down { color: var(--green); }

/* 操作徽标 */
.badge { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 12.5px;
  font-weight: 600; white-space: nowrap; }
.badge.buy    { background: rgba(255,77,94,.12);  color: var(--red);   border: 1px solid rgba(255,77,94,.4);  box-shadow: var(--glow-red); }
.badge.sell   { background: rgba(0,214,143,.1);   color: var(--green); border: 1px solid rgba(0,214,143,.35); box-shadow: var(--glow-green); }
.badge.hold   { background: rgba(107,120,148,.12); color: var(--gray); border: 1px solid rgba(107,120,148,.3); }
.badge.enter  { background: rgba(255,77,94,.18);  color: var(--red);   border: 1px solid rgba(255,77,94,.55);  box-shadow: var(--glow-red); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 8px rgba(255,77,94,.3);} 50% { box-shadow: 0 0 22px rgba(255,77,94,.7);} }

/* 重点基金徽标 */
.hot-mark { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 20px;
  font-size: 11px; color: #1a1400; background: linear-gradient(90deg, #ffd166, #ffb347);
  font-weight: 700; box-shadow: var(--glow-gold); animation: hotpulse 1.6s infinite; }
@keyframes hotpulse { 0%,100% { box-shadow: 0 0 10px rgba(255,209,102,.5);} 50% { box-shadow: 0 0 26px rgba(255,209,102,.95);} }

/* 迷你趋势图 */
svg.spark { display: block; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.spark path.area { fill: rgba(77,159,255,0.12); stroke: none; }

/* 日期选择器 */
.datebar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.datebar .ctrl { display: flex; gap: 10px; align-items: center; }
.datebar input[type="date"] {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 9px 14px; font-size: 14px; outline: none;
}
.datebar input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }
.btn {
  background: linear-gradient(90deg, rgba(77,159,255,.18), rgba(124,92,255,.18));
  border: 1px solid rgba(77,159,255,.4); color: var(--text); border-radius: 10px;
  padding: 9px 18px; cursor: pointer; font-size: 13.5px; transition: all .2s;
}
.btn:hover { box-shadow: 0 0 16px rgba(77,159,255,.35); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* 时间轴 (历史页) */
.timeline { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 14px; }
.tl-node {
  min-width: 92px; text-align: center; padding: 10px 8px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border); cursor: pointer;
  font-size: 12px; color: var(--text-dim); transition: all .2s; flex-shrink: 0;
}
.tl-node:hover { border-color: var(--accent); color: var(--text); }
.tl-node.active { border-color: var(--accent); color: var(--text); background: rgba(77,159,255,.12);
  box-shadow: 0 0 14px rgba(77,159,255,.3); }
.tl-node .d { font-size: 13px; font-weight: 600; color: var(--text); }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty .big { font-size: 40px; margin-bottom: 12px; opacity: .5; }

/* 页脚合规声明 */
.footer { text-align: center; color: var(--text-dim); font-size: 11.5px;
  padding: 18px; border-top: 1px solid var(--border); margin-top: 30px; line-height: 1.8; }

/* 重点基金页卡片 */
.fund-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fund-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; cursor: pointer; transition: all .2s; position: relative; }
.fund-card:hover { transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(77,159,255,.15); }
.fund-card .fname { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.fund-card .fcode { color: var(--text-dim); font-size: 12px; }
.fund-card .sector { display: inline-block; margin-top: 10px; font-size: 11.5px;
  color: var(--accent); background: rgba(77,159,255,.1); padding: 3px 12px; border-radius: 20px; }
.fund-card.hot { border-color: rgba(255,209,102,.5); }
.fund-card.hot::before { content: "★"; position: absolute; top: 12px; right: 16px;
  color: var(--gold); font-size: 20px; text-shadow: var(--glow-gold); }

/* 基金专页 */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.profile-item { background: rgba(255,255,255,.03); border-radius: 10px; padding: 14px 16px; }
.profile-item .k { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.profile-item .v { font-size: 14px; font-weight: 600; }
.chart-box { margin-top: 14px; }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-dim); margin: 10px 2px; }
.legend i { display: inline-block; width: 22px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* 新闻时间线 */
.news-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(90,140,255,.08); }
.news-item:last-child { border-bottom: none; }
.news-item .ndate { color: var(--text-dim); font-size: 12px; min-width: 76px; padding-top: 2px; }
.news-item .ntext { font-size: 13.5px; line-height: 1.6; }

.back-link { display: inline-block; margin-bottom: 14px; font-size: 13px; color: var(--text-dim); }
.back-link:hover { color: var(--text); }
