* { box-sizing: border-box; }

:root {
  --bg: #fafaf8;
  --card: #ffffff;
  --line: rgba(0, 0, 0, .10);
  --line-2: rgba(0, 0, 0, .18);
  --t1: #23231f;
  --t2: #6b6a64;
  --t3: #9b9a92;
  --blue: #185fa5;
  --blue-bg: #e6f1fb;
  --red: #a32d2d;
  --green: #0f6e56;
  --amber: #854f0b;
  --amber-bg: #faeeda;
  --radius: 10px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--t1);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
header.top {
  background: var(--card);
  border-bottom: .5px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.top-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  height: 54px; display: flex; align-items: center; gap: 24px;
}
.brand { font-weight: 600; font-size: 15px; letter-spacing: .2px; }
.brand small { color: var(--t3); font-weight: 400; margin-left: 8px; font-size: 12px; }
nav.main { display: flex; gap: 4px; margin-left: auto; }
nav.main a {
  padding: 6px 12px; border-radius: 8px; color: var(--t2);
  font-size: 13px; text-decoration: none;
}
nav.main a:hover { background: #f3f2ee; text-decoration: none; }
nav.main a.on { background: var(--blue-bg); color: #0c447c; font-weight: 500; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.sub { color: var(--t2); font-size: 13px; margin: 0 0 20px; }
h2 { font-size: 15px; font-weight: 600; margin: 28px 0 12px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: .5px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
}
.card.flush { padding: 0; overflow: hidden; }

.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.metric {
  background: #f5f4f0; border-radius: 8px; padding: 14px 16px;
}
.metric .lb { font-size: 12px; color: var(--t2); margin-bottom: 6px; }
.metric .val { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.5px; }
.metric .ft { font-size: 12px; color: var(--t3); margin-top: 4px; }

/* ---------- 表格 ---------- */
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left; font-weight: 500; color: var(--t2); font-size: 12px;
  padding: 10px 12px; border-bottom: .5px solid var(--line-2); white-space: nowrap;
}
table.tb td { padding: 10px 12px; border-bottom: .5px solid var(--line); }
table.tb tr:last-child td { border-bottom: 0; }
table.tb td.r, table.tb th.r { text-align: right; }
table.tb td.c, table.tb th.c { text-align: center; }
table.tb tbody tr:hover { background: #fbfbf9; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
/* 窄屏下日期 / 代码这类短字段不要折成两行 */
.nw { white-space: nowrap; }

.up { color: var(--red); }
.down { color: var(--green); }
.flat { color: var(--t2); }
.muted { color: var(--t3); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 20px; line-height: 1.6;
}
.tag.t1 { background: var(--blue-bg); color: #0c447c; }
.tag.t5 { background: #e1f5ee; color: #085041; }
.tag.ok { background: #e1f5ee; color: #085041; }
.tag.wait { background: var(--amber-bg); color: var(--amber); }
.tag.err { background: #fcebeb; color: #a32d2d; }
.tag.gray { background: #f1efe8; color: #5f5e5a; }
/* 名单方向：看多=红系（涨），看空=绿系（跌） */
.tag.dir-long { background: #fcebeb; color: #a32d2d; }
.tag.dir-short { background: #e1f5ee; color: #0f6e56; }

/* ---------- 表单 ---------- */
label.fl { display: block; font-size: 12px; color: var(--t2); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=date], input[type=file], textarea, select {
  width: 100%; padding: 9px 11px; font-size: 13px; color: var(--t1);
  background: #fff; border: .5px solid var(--line-2); border-radius: 8px;
  font-family: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
textarea { resize: vertical; min-height: 170px; line-height: 1.7; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.field { margin-bottom: 16px; }
.hint { font-size: 12px; color: var(--t3); margin-top: 5px; }

.btn {
  display: inline-block; padding: 9px 18px; font-size: 13px; font-weight: 500;
  border-radius: 8px; border: .5px solid var(--line-2); background: #fff;
  color: var(--t1); cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn:hover { background: #f5f4f0; text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #13528f; }
.btn.danger { color: var(--red); border-color: rgba(163,45,45,.35); }
.btn.sm { padding: 5px 12px; font-size: 12px; }

.row { display: flex; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- 提示条 ---------- */
.flash {
  padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}
.flash.ok { background: #e1f5ee; color: #085041; }
.flash.err { background: #fcebeb; color: #a32d2d; }
.flash.warn { background: var(--amber-bg); color: var(--amber); }

/* ---------- 进度条 ---------- */
.pips { display: flex; gap: 3px; }
.pip { height: 5px; flex: 1; border-radius: 3px; background: #ebe9e3; }
.pip.on { background: var(--blue); }
.pip.on.t5 { background: var(--green); }

/* ---------- 登录 ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-box { width: 100%; max-width: 340px; }
.auth-box h1 { text-align: center; margin-bottom: 22px; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .top-inner { gap: 10px; padding: 0 14px; }
  .brand small { display: none; }
  nav.main a { padding: 6px 9px; font-size: 12px; }
  main { padding: 18px 14px 40px; }
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.tb { min-width: 640px; }
  .metric .val { font-size: 22px; }
}

/* ============================================================
   大盘概览 · 月历
   ============================================================ */
[hidden] { display: none !important; }

.mkt { padding: 18px 20px 16px; }
.mkt-title { font-size: 13px; font-weight: 600; }
.cal-empty-tip {
  font-size: 13px; color: var(--t2); background: #faf9f5;
  border-radius: 8px; padding: 16px; text-align: center;
}

.cal-wrap {
  display: grid; grid-template-columns: 376px minmax(0, 1fr);
  gap: 24px; align-items: start;
}
.cal-side { border-right: .5px solid var(--line); padding-right: 24px; }

.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cal-tt { font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.cal-arr {
  width: 26px; height: 26px; padding: 0; line-height: 1;
  border: .5px solid var(--line-2); border-radius: 7px;
  background: #fff; color: var(--t2); font-size: 16px; cursor: pointer;
  transition: background .12s;
}
.cal-arr:hover:not(:disabled) { background: #f3f2ee; color: var(--t1); }
.cal-arr:disabled { opacity: .3; cursor: default; }

.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin-bottom: 5px;
}
.cal-dow span { text-align: center; font-size: 11px; color: var(--t3); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-blank { height: 50px; }

.cal-day {
  position: relative; height: 50px; width: 100%;
  border: 0; border-radius: 7px; padding: 0 0 9px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  font: inherit; color: var(--t1); background: #f4f3ef;
  cursor: pointer; transition: transform .08s, box-shadow .12s;
  -webkit-appearance: none; appearance: none;
}
.cal-day:hover { transform: translateY(-1px); }
.cal-day.empty { background: transparent; cursor: default; color: #c9c7bf; }
.cal-day.empty:hover { transform: none; }
.cal-day.on { box-shadow: inset 0 0 0 2px var(--t1); }

.cd-n { font-size: 12px; font-weight: 500; line-height: 1; }
.cal-day.today .cd-n { font-weight: 700; text-decoration: underline dotted; text-underline-offset: 2px; }
.cd-p { font-size: 11px; line-height: 1.1; letter-spacing: -.3px; }

/* 底部一条涨跌家数比例条：红＝上涨占比，绿＝下跌占比 */
.cd-b {
  position: absolute; left: 7px; right: 7px; bottom: 4px;
  height: 2.5px; border-radius: 1.5px; overflow: hidden;
  background: rgba(15, 110, 86, .5);
}
.cd-b i { display: block; height: 100%; background: rgba(163, 45, 45, .8); }

.cd-dot {
  position: absolute; top: 5px; right: 5px;
  width: 5px; height: 5px; border-radius: 50%; background: #a9781a;
}

/* 色阶：红涨绿跌 */
.cal-day.fl   { background: #f2f1ec; }
.cal-day.up   { background: #fbe9e9; }
.cal-day.up-1 { background: #f8d3d3; }
.cal-day.up-2 { background: #efa8a8; }
.cal-day.up-3 { background: #df7979; color: #fff; }
.cal-day.up-4 { background: #c74f4f; color: #fff; }
.cal-day.dn   { background: #e9f3ef; }
.cal-day.dn-1 { background: #d1e9e0; }
.cal-day.dn-2 { background: #a8d7c6; }
.cal-day.dn-3 { background: #74bfa6; color: #fff; }
.cal-day.dn-4 { background: #4ba78a; color: #fff; }
.cal-day.up-3 .cd-b, .cal-day.up-4 .cd-b,
.cal-day.dn-3 .cd-b, .cal-day.dn-4 .cd-b { background: rgba(255, 255, 255, .45); }
.cal-day.up-3 .cd-b i, .cal-day.up-4 .cd-b i { background: #fff; }
.cal-day.dn-3 .cd-b i, .cal-day.dn-4 .cd-b i { background: rgba(255, 255, 255, .92); }

.cal-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px;
  border-top: .5px solid var(--line);
}
.cal-sum { font-size: 11.5px; color: var(--t2); }
.cal-sum b { font-weight: 600; }

.cal-legend {
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
  font-size: 11px; color: var(--t3);
}
.cal-legend .cl { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.cal-legend .cl-lb { margin: 0 3px; }
.cal-legend .cl-note { margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; }
.cal-legend .cl-note .cd-dot { position: static; display: inline-block; }
.cl.dn-4 { background: #4ba78a; } .cl.dn-3 { background: #74bfa6; }
.cl.dn-2 { background: #a8d7c6; } .cl.dn-1 { background: #d1e9e0; }
.cl.fl    { background: #f2f1ec; }
.cl.up-1 { background: #f8d3d3; } .cl.up-2 { background: #efa8a8; }
.cl.up-3 { background: #df7979; } .cl.up-4 { background: #c74f4f; }

/* 右侧详情 */
.cal-main { min-height: 300px; display: flex; flex-direction: column; }
.cal-detail { flex: 1; display: flex; flex-direction: column; }
.cd-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 15px;
}
.cd-date { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.cd-wk { font-size: 12px; color: var(--t2); margin-left: 6px; }

/* 左：四指数 2×2，右：涨跌家数 + 关键数字 */
.cd-body {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 20px; align-items: start;
}
.cd-idx { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cd-idx .idx { padding: 11px 13px; }
.cd-idx .idx-v { font-size: 20px; }
.cd-idx .idx-p { font-size: 13px; }

.cd-right {
  border-left: .5px solid var(--line); padding-left: 20px;
  display: flex; flex-direction: column; height: 100%;
}
.cd-cap {
  font-size: 11.5px; color: var(--t3); margin-bottom: 7px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.cd-cap b { color: var(--t1); font-size: 12.5px; font-weight: 600; }

.cd-figs { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.cd-fig {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12.5px; color: var(--t2);
}
.cd-fig b { font-size: 15px; font-weight: 600; color: var(--t1); letter-spacing: -.2px; }
.cd-fig b.up { color: var(--red); }
.cd-fig b.down { color: var(--green); }

.cd-nodata {
  font-size: 12px; color: var(--t3); background: #faf9f5;
  border-radius: 8px; padding: 10px 12px; line-height: 1.6;
}
.cd-batches {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 16px; padding-top: 13px; border-top: .5px solid var(--line);
}
.cd-lb { font-size: 11.5px; color: var(--t3); }
.cd-batch {
  font-size: 12px; padding: 4px 9px; border-radius: 6px;
  background: var(--blue-bg); color: #0c447c;
}
.cd-batch:hover { text-decoration: none; background: #d8e8f8; }

.mood {
  display: inline-block; font-size: 12px; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap;
}
.mood.hot  { background: #fbeaea; color: #a32d2d; }
.mood.warm { background: #fdf1ec; color: #9c5227; }
.mood.mid  { background: #f2f1ec; color: #5f5e5a; }
.mood.cool { background: #eaf2ef; color: #0f6e56; }
.mood.cold { background: #e4f0ec; color: #0b5a46; }

.idx-row {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px; margin-bottom: 14px;
}
.idx { background: #f7f6f2; border-radius: 8px; padding: 10px 12px; }
.idx-n { font-size: 11.5px; color: var(--t2); margin-bottom: 2px; }
.idx-v { font-size: 19px; font-weight: 600; letter-spacing: -.4px; line-height: 1.25; }
.idx-p { font-size: 12.5px; font-weight: 500; }

.breadth { display: flex; flex-direction: column; gap: 7px; }
.b-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #eeece6; }
.b-bar span { display: block; height: 100%; }
.b-up   { background: var(--red); }
.b-flat { background: #d5d3cb; }
.b-down { background: var(--green); }
.b-legend { display: flex; gap: 16px; font-size: 12px; flex-wrap: wrap; }
.b-legend b { font-weight: 600; }

.mkt-foot {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 14px; font-size: 12.5px; color: var(--t2);
}
.mkt-foot b { color: var(--t1); font-weight: 600; }

/* ============================================================
   标注
   ============================================================ */
.metric.focus { background: #fdf7ea; box-shadow: inset 3px 0 0 #e3b45c; }
.metric.short { background: #f1f7f4; box-shadow: inset 3px 0 0 #7fb6a4; }
.metric.plain { background: #f6f6f3; }
.metric .val.sm { font-size: 20px; }

.mini { font-size: 11px; line-height: 1.45; color: var(--t2); }
.star { color: #a9781a; }

.tag.star { background: #fdf3d8; color: #8a6116; }

.focus-strip {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline;
  margin-top: 9px; padding: 6px 9px; border-radius: 6px;
  background: #fdf7ea; font-size: 12px; color: var(--t1);
}
.focus-summary { background: #fffdf7; }

tr.focus-row td { background: #fffdf5; }
tr.focus-row:hover td { background: #fdf8ea; }

/* 表格里的「重点」勾选框 */
.row-check {
  width: 15px; height: 15px; margin: 0; cursor: pointer;
  accent-color: #c99500; vertical-align: middle;
}

.mini-sel, .mini-inp {
  padding: 4px 6px !important; font-size: 12px !important;
  border-radius: 6px !important; height: 28px;
}
.mini-sel { min-width: 70px; }

table.tb.compact th, table.tb.compact td { padding: 8px 10px; }
table.tb tfoot td {
  background: #faf9f5; border-top: .5px solid var(--line-2);
  color: var(--t2); font-size: 12.5px;
}

@media (max-width: 960px) {
  .cal-wrap { grid-template-columns: 330px minmax(0, 1fr); gap: 18px; }
  .cal-side { padding-right: 18px; }
  .cal-day, .cal-blank { height: 52px; }
  .cd-body { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .cd-right {
    border-left: 0; padding-left: 0;
    border-top: .5px solid var(--line); padding-top: 14px;
  }
}

@media (max-width: 760px) {
  .idx-row { grid-template-columns: 1fr 1fr; }
  .mkt { padding: 14px 14px 14px; }
  .idx-v { font-size: 17px; }
  .b-legend { gap: 10px; }
  .mkt-foot { gap: 12px; font-size: 12px; }

  .cal-wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cal-side {
    border-right: 0; padding-right: 0;
    border-bottom: .5px solid var(--line); padding-bottom: 14px;
  }
  .cal-grid { gap: 3px; }
  .cal-day, .cal-blank { height: 48px; }
  .cd-p { font-size: 10px; }
  .cd-n { font-size: 10.5px; }
  .cal-main { min-height: 0; }
  .cd-idx .idx-v { font-size: 18px; }

  /* 窄屏省掉重复的 ISO 日期，避免「2026-10-28」折成两行 */
  .cd-head .mono { display: none; }
  .cd-date, .cd-wk { white-space: nowrap; }
  .cd-head { gap: 8px; }
  .cd-b { left: 4px; right: 4px; bottom: 2px; }
  .cd-dot { top: 3px; right: 3px; width: 4px; height: 4px; }

  .top-inner { gap: 8px; }
  nav.main { gap: 2px; }
  nav.main a { padding: 6px 7px; font-size: 12px; white-space: nowrap; }
}

/* ============================================================
   批次详情：轮次卡里的大盘对照
   ============================================================ */
.mkt-line {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-top: 9px; padding: 7px 10px; border-radius: 7px;
  background: #faf9f5; font-size: 12px; color: var(--t2);
}
.mkt-lb { font-size: 11px; color: var(--t3); }
.mkt-v  { font-size: 14px; font-weight: 600; letter-spacing: -.2px; }
.mkt-win { font-size: 11px; color: var(--t3); }
.mkt-alpha { margin-left: auto; white-space: nowrap; }
.mkt-alpha b { font-weight: 600; }

/* ============================================================
   批次表：名称不换行 + 交易日折叠
   ============================================================ */
table.tb.batch-px th, table.tb.batch-px td { padding: 9px 8px; }
table.tb.batch-px td.cd { white-space: nowrap; }
table.tb.batch-px td.nm, table.tb.batch-px th.nm { white-space: nowrap; }
table.tb.batch-px.min-days .mid-day { display: none; }

.mkt-mini { margin-top: 3px; white-space: nowrap; }

.mkt-mini { font-size: 11.5px; }
.mkt-mini .up, .mkt-mini .down { font-weight: 600; }

/* 批次页底部操作条：窄屏换行显示，别把按钮挤成竖排 */
.batch-actions .btn { white-space: nowrap; }
.batch-actions label { white-space: nowrap; }
@media (max-width: 760px) {
  .batch-actions { flex-direction: column; align-items: flex-start; gap: 10px; }
  .batch-actions .row { flex-wrap: wrap; gap: 10px 14px; }
}

/* ============================================================
   批次表：盘中快照条 + 单元格里的【盘中】标记
   ============================================================ */
.snap-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 14px; flex-wrap: wrap;
  padding: 9px 12px; margin-bottom: 12px;
  border-radius: 8px; background: #fdf7ea;
  border: .5px solid rgba(169, 120, 26, .22);
  font-size: 12.5px;
}
.snap-bar form { margin: 0; flex: 0 0 auto; }
.snap-info { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.snap-t { font-weight: 600; }
.snap-k { color: var(--t2); white-space: nowrap; }
.snap-k .up, .snap-k .down { font-weight: 600; }
.snap-note { color: var(--t3); font-size: 11.5px; }

.tag.snap { background: var(--amber-bg); color: var(--amber); }
.snap-lb { color: var(--amber); font-size: 10.5px; line-height: 1.2; letter-spacing: -.2px; }

@media (max-width: 760px) {
  .snap-bar { align-items: flex-start; }
  .snap-info { gap: 4px 10px; }
  .snap-note { flex-basis: 100%; }
}
