/* Non-blocking branded loading, visible only for slower requests. */
.guanlan-loading{position:fixed;right:24px;bottom:24px;z-index:1200;display:flex;align-items:center;gap:14px;padding:15px 22px;background:var(--card);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 32px #0005;pointer-events:none;color:var(--text);max-width:calc(100vw - 32px)}
.guanlan-loading[hidden]{display:none}.guanlan-loading b{display:block;font-size:13px;font-weight:600}.guanlan-loading span{display:block;font-size:12px;color:var(--muted);margin-top:3px}.loading-mark{position:relative;width:46px;height:46px;flex:0 0 46px;display:grid;place-items:center}.loading-mark img{width:36px;height:36px}.loading-mark i{position:absolute;inset:0;border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:guanlan-spin 1.2s linear infinite}.rise-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:5px;background:rgba(229,69,69,.12);color:var(--up);font-family:Arial,sans-serif;font-size:20px;font-weight:bold}
@keyframes guanlan-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.loading-mark i{animation:none}}@media(max-width:600px){.guanlan-loading{right:16px;bottom:16px;padding:12px 16px}}
/* ============ 主题 ============ */
/* 默认：暗夜黑 */
:root {
  --up: #e54545;
  --down: #1faa59;
  --flat: #888;
  --bg: #090f19;
  --card: #111c2b;
  --card2: #162335;
  --border: #26394e;
  --border2: #1c2c40;
  --hover: #192e43;
  --text: #e0eaf4;
  --muted: #8d9fb5;
  --accent: #42badc;
  --accent-soft: #18394c;
  --warn: #ff9f43;
}

/* 日间白 */
html[data-theme="light"] body {
  --bg: #f4f6fa;
  --card: #ffffff;
  --card2: #eef1f7;
  --border: #d9e0ec;
  --border2: #e9eef6;
  --hover: rgba(47, 124, 246, .08);
  --text: #1c2434;
  --muted: #67718a;
  --accent: #2f7cf6;
  --accent-soft: rgba(47, 124, 246, .12);
  --up: #d63031;
  --down: #00a05a;
  --warn: #e69500;
}

/* 文字选中样式（跟随主题） */
::selection { background: rgba(77, 159, 255, .35); color: inherit; }
html[data-theme="light"] ::selection {
  background: #bcd7fb; color: #1c2434;
}

body { transition: background .25s, color .25s; }
.card, .stat, .leader-card, .tl-item, .flash-item { transition: background .25s, border-color .25s; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.6 "Microsoft YaHei", "PingFang SC", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--flat); }
.muted { color: var(--muted); }
.anom-summary { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin:6px 0 10px; }
.anom-count { padding:2px 8px; border:1px solid var(--border); border-radius:10px; color:var(--muted); font-size:11px; }
.anom-count.high { color:var(--up); border-color:color-mix(in srgb,var(--up) 45%,var(--border)); }
.anom-count.mid { color:var(--warn); border-color:color-mix(in srgb,var(--warn) 45%,var(--border)); }
.anom-refresh { margin-left:auto; color:var(--muted); font-size:11px; }
.tl-item.lv-高 { border-left:3px solid var(--up); background:linear-gradient(90deg,rgba(229,69,69,.08),transparent); }
.tl-item.lv-中 { border-left:3px solid var(--warn); }
.tl-item .detail { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.header {
  display: flex; align-items: center; gap: 12px; padding: 7px 20px;
  background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; flex-wrap: nowrap; min-height: 54px;
}
.header .logo { font-size: 16px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.header nav a { margin-right: 14px; color: var(--muted); }
.header nav a.active, .header nav a:hover { color: var(--text); }
.search-box { position: relative; }
.search-box input {
  background: var(--card2); border: 1px solid var(--border); color: var(--text);
  padding: 5px 10px; border-radius: 4px; width: 220px; outline: none;
}
.search-results {
  position: absolute; top: 32px; left: 0; right: 0; background: var(--card2);
  border: 1px solid var(--border); border-radius: 4px; max-height: 300px; overflow: auto; z-index: 200;
}
.search-results div { padding: 6px 10px; cursor: pointer; }
.search-results div:hover { background: var(--card); }
.container { padding: 16px 20px; max-width: 1600px; margin: 0 auto; }
.grid { display: grid; gap: 14px; align-items: start; }

/* 卡片顶对齐，内容自适应高度，不强制拉到同行最高 */
.card { display: flex; flex-direction: column; }

/* 指定行等高：行高由板块监控决定，警报框跟随对齐，内容框内滚动 */
.grid.equal { align-items: stretch; }
.grid.equal .card { height: 100%; }
.grid.equal #anomalies { flex: 1 1 0; min-height: 0; max-height: none !important; overflow-y: auto; }

/* 第三屏：以连板天梯为主对齐，竞价/自选跟随 */
.grid.equal2 { align-items: stretch; }
.grid.equal2 .card { height: 100%; }
.grid.equal2 #auction { flex: 1 1 0; min-height: 0; max-height: none !important; overflow-y: auto; }

/* 个股页三列：龙虎榜/新闻对齐左侧关联板块格子 */
.grid.equal3 { align-items: stretch; }
.grid.equal3 .card { height: 100%; }
.grid.equal3 #news, .grid.equal3 #lhb { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.grid.equal3 #news { max-height: none !important; }

/* 明日预判页：行内格子等高对齐 + 内容填满 */
.grid.equalT { align-items: stretch; }
.grid.equalT .card { height: 100%; }
.grid.equalT #lhb-list, .grid.equalT #strong-list,
.grid.equalT #evening-news, .grid.equalT #morning-box {
  flex: 1 1 0; min-height: 0; max-height: none !important; overflow-y: auto;
}
/* 期指持仓 / 炸板断板：内容完整展示，不裁剪（行高随之自适应，格子仍等高对齐） */
.grid.equalT #fut-panel, .grid.equalT #zb-list { max-height: none !important; overflow-y: visible !important; }
/* 通用：equalT 行内可滚动填充容器（国际视野等页用） */
.grid.equalT .fillY { flex: 1 1 0; min-height: 0; overflow-y: auto; }

/* 个股页：资金流跟随分时走势高度 */
.grid.equalA { align-items: stretch; }
.grid.equalA .card { height: 100%; }
.grid.equalA #fflow-chart { flex: 1 1 0; min-height: 300px; height: auto !important; }

/* 个股页：行为判断跟随操作决策高度 */
.grid.equalB { align-items: stretch; }
.grid.equalB .card { height: 100%; }
.grid.equalB #behavior-reasons { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
}
.card h3 { font-size: 14px; margin-bottom: 10px; color: var(--text); border-left: 3px solid var(--accent); padding-left: 8px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat {
  background: var(--card2); border-radius: 6px; padding: 10px 12px; text-align: center;
}
.stat .v { font-size: 20px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12px; }
table.tb { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tb th {
  text-align: right; padding: 7px 8px; color: var(--muted); font-weight: 400;
  border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none;
  position: sticky; top: 0; background: var(--card); z-index: 2;
}
.tb-wrap { max-height: 620px; overflow-y: auto; }
table.tb th:first-child, table.tb td:first-child { text-align: left; }
table.tb td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border2); white-space: nowrap; }
table.tb tr:hover td { background: var(--hover); }
.badge {
  display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px;
  background: var(--card2); color: var(--muted); margin-left: 4px;
}
.badge.hot { background: #5a2b2b; color: #ffb3b3; }
html[data-theme="light"] .badge.hot { background: #fde8e8; color: #c0392b; }
.badge.zt { background: var(--up); color: #fff; }
.badge.warn { background: #5a4a22; color: #ffd88a; }
html[data-theme="light"] .badge.warn { background: #fdf3d8; color: #9a7200; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button {
  background: var(--card2); color: var(--muted); border: 1px solid var(--border);
  padding: 5px 14px; border-radius: 4px; cursor: pointer;
}
.tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.timeline { max-height: 420px; overflow-y: auto; }
.tl-item { padding: 8px 10px; border-left: 2px solid var(--border); margin-left: 8px; position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--muted);
}
.tl-item.lv-高::before { background: var(--up); }
.tl-item.lv-中::before { background: var(--warn); }
.tl-item .t { color: var(--muted); font-size: 11px; }
.tl-item .title { font-weight: 600; margin: 2px 0; }
.tl-item .detail { color: var(--muted); font-size: 12px; }
.loading { color: var(--muted); padding: 20px; text-align: center; }
.chart { width: 100%; height: 300px; }
.leader-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.leader-card { background: var(--card2); border-radius: 6px; padding: 10px 12px; }
.leader-card .role { color: var(--muted); font-size: 12px; }
.leader-card .name { font-size: 16px; font-weight: 700; margin: 2px 0; }
.prob-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; font-size: 11px; color: #fff; }
.prob-bar div { display: flex; align-items: center; justify-content: center; min-width: 40px; }
.verdict { font-size: 18px; font-weight: 700; padding: 10px; border-radius: 6px; text-align: center; margin-bottom: 10px; }
.verdict.red { background: #4a2222; color: #ff8a8a; }
.verdict.green { background: #1d3a28; color: #7fe0a8; }
.verdict.orange { background: #4a3a1d; color: #ffd88a; }
ul.reasons { padding-left: 18px; }
ul.reasons li { margin-bottom: 5px; color: var(--text); }
.news-item { padding: 8px 0; border-bottom: 1px solid var(--border2); }
.news-item .t { color: var(--muted); font-size: 11px; }
.flash-item { padding: 6px 0; border-bottom: 1px dashed var(--border2); font-size: 12.5px; }
.flash-item .t { color: var(--warn); font-size: 11px; margin-right: 6px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.draw-btn { background: var(--card2); color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 3px 10px; cursor: pointer; font-size: 12px; margin-right: 6px; }
.draw-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 连板天梯 */
.lad-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.lad-num {
  flex: 0 0 64px; text-align: center; font-weight: 700; font-size: 15px;
  padding: 6px 0; border-radius: 6px; color: #fff;
}
.lad-n5 { background: linear-gradient(135deg, #b30000, #e54545); box-shadow: 0 0 8px #e5454580; }
.lad-n4 { background: linear-gradient(135deg, #c62828, #ef5350); }
.lad-n3 { background: linear-gradient(135deg, #d84315, #ff7043); }
.lad-n2 { background: linear-gradient(135deg, #b26a00, #ffa726); }
.lad-n1 { background: #2c3852; color: var(--muted); }
.lad-stocks { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.lad-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--card2);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; color: var(--text);
  border-left-width: 3px;
}
.lad-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.lad-chip.l1 { border-left-color: #4d5568; }
.lad-chip.l2 { border-left-color: #ffa726; }
.lad-chip.l3 { border-left-color: #ff7043; }
.lad-chip.l4 { border-left-color: #ef5350; }
.lad-chip.l5 { border-left-color: #e54545; box-shadow: 0 0 6px #e5454540; }
.lad-chip .fbt { color: var(--muted); font-size: 11px; }
.lad-chip .zb { color: var(--warn); font-size: 11px; }
.lad-chip .hy { color: var(--accent); font-size: 11px; }
.lad-chip .lb { color: var(--up); font-size: 11px; font-weight: 700; }

/* 快讯展开 */
.flash-item { cursor: pointer; }
.flash-head { display: flex; gap: 8px; align-items: baseline; }
.flash-head .lv { flex: 0 0 auto; }
.flash-detail { display: none; padding: 8px 0 4px 0; }
.flash-item.open .flash-detail { display: block; }
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px;
  background: var(--accent-soft); color: var(--accent); margin: 4px 4px 0 0;
}
.chip.stock { background: #3a2b40; color: #e0aaff; }
html[data-theme="light"] .chip.stock { background: #efe4f7; color: #7b3fb5; }
.lv-高 { color: var(--up); } .lv-中 { color: var(--warn); } .lv-低 { color: var(--muted); }
.ai-read { margin-top: 6px; font-size: 12px; background: var(--card); border-radius: 4px; padding: 6px 8px; }


/* 观澜统一品牌栏：Logo、导航、搜索框分区排列，避免遮挡 */
.header .brand { display:flex; align-items:center; gap:6px; min-width:92px; height:38px; flex-shrink:0; text-decoration:none; }
.brand img { width:36px !important; height:36px !important; flex:0 0 36px; filter:drop-shadow(0 0 4px rgba(55,190,220,.18)); }
.brand span { font-size:17px; letter-spacing:2px; color:var(--text); line-height:1; }
.brand small { display:none; }
.header nav { display:flex; align-items:center; gap:11px; flex:0 1 auto; flex-wrap:nowrap; white-space:nowrap; }
.header nav a { margin-right:0; }
.auth-mask { position:fixed; inset:0; z-index:950; background:rgba(0,0,0,.58); display:flex; align-items:center; justify-content:center; }
.auth-box { width:min(420px,92vw); background:var(--card); border:1px solid var(--border); border-radius:10px; box-shadow:0 16px 50px rgba(0,0,0,.35); }
.auth-body { padding:16px; }
.auth-body input { display:block; width:100%; box-sizing:border-box; margin:8px 0; padding:10px; color:var(--text); background:var(--card2); border:1px solid var(--border); border-radius:5px; }
.auth-body .admin-btn { width:100%; margin-top:8px; }
.chart-placeholder { height:100%; min-height:180px; display:flex; align-items:center; justify-content:center; }
.password-wrap { position:relative; display:flex; align-items:center; margin:5px 0 10px; }
.password-wrap input { flex:1; min-width:0; margin:0 !important; }
.password-toggle { margin-left:6px; padding:8px 10px; border:1px solid var(--border); border-radius:5px; background:var(--card2); color:var(--muted); cursor:pointer; white-space:nowrap; }
.login-gate { position:fixed; inset:0; z-index:940; display:none; align-items:center; justify-content:center; background:radial-gradient(circle at 50% 20%,rgba(42,78,120,.32),transparent 48%),var(--bg); }
.gate-card { width:min(390px,88vw); text-align:center; padding:38px 28px; background:var(--card); border:1px solid var(--border); border-radius:14px; box-shadow:0 18px 60px rgba(0,0,0,.3); }
.gate-card img { width:58px; height:58px; filter:drop-shadow(0 0 12px rgba(75,190,255,.35)); }
.gate-card h1 { margin:14px 0 5px; letter-spacing:5px; }
.gate-card p { color:var(--muted); margin:0 0 24px; }
.gate-btn { width:100%; padding:11px; border:0; border-radius:6px; background:linear-gradient(90deg,#36c9ef,#8171ff); color:#fff; font-weight:700; cursor:pointer; }
.gate-card #gate-msg { color:var(--muted); font-size:11px; margin-top:15px; }
.locked > .header, .locked > .container { visibility:hidden; }
@media (max-width:900px) { .header { gap:9px; padding:7px 12px; overflow-x:auto; } .header .brand { min-width:92px; } .header nav { flex:0 0 auto; overflow:visible; } .search-box { flex:0 0 150px; } .search-box input { width:150px; } }
