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

body {
  background: #0d1117;
  color: #e6edf3;
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.6;
}

.container { max-width: 1400px; margin: 0 auto; padding: 20px 16px 40px; }

.header {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 8px 4px 16px; border-bottom: 1px solid #30363d; margin-bottom: 16px;
}
.header h1 { font-size: 24px; letter-spacing: 1px; }
.sub { color: #8b949e; font-size: 12px; margin-top: 4px; }
.actions { display: flex; align-items: center; gap: 12px; }

button {
  background: #21262d; color: #e6edf3; border: 1px solid #30363d;
  padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
button:hover { background: #30363d; }
button:active { transform: scale(.98); }

input[type="date"] {
  background: #161b22; color: #e6edf3; border: 1px solid #30363d;
  padding: 6px 10px; border-radius: 6px; font-size: 13px;
  color-scheme: dark;
}
input[type="date"]:focus { outline: none; border-color: #58a6ff; }

#btn-prev, #btn-next, #btn-today { padding: 8px 12px; }

.badge { font-size: 12px; color: #8b949e; }

.banner {
  display: flex; align-items: center; gap: 12px; background: #1c2333;
  border: 1px solid #2f4b6e; border-radius: 8px; padding: 10px 14px;
  margin-bottom: 16px; font-size: 13px; color: #9ecbff;
}
.banner.hidden { display: none; }
.progress { flex: 1; height: 6px; background: #21262d; border-radius: 3px; overflow: hidden; }
.bar { height: 100%; width: 0%; background: #58a6ff; transition: width .3s; }

section { margin-bottom: 28px; }
.sec-title {
  font-size: 16px; font-weight: 600; margin-bottom: 12px; padding-left: 10px;
  border-left: 4px solid #f0883e; color: #f0f6fc;
}
.sec-title small { font-size: 12px; color: #8b949e; font-weight: 400; margin-left: 8px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.card {
  background: #161b22; border: 1px solid #30363d; border-radius: 8px;
  padding: 14px; text-align: center;
}
.card .label { color: #8b949e; font-size: 12px; }
.card .big { font-size: 22px; font-weight: 700; margin: 6px 0; font-variant-numeric: tabular-nums; }
.card .small { font-size: 12px; }
.card.mini { display: flex; flex-direction: column; justify-content: center; }
.sub-label { margin-top: 2px; }

.up { color: #f85149; }
.down { color: #2ea043; }
.flat { color: #8b949e; }

.panel {
  background: #161b22; border: 1px solid #30363d; border-radius: 10px;
  padding: 14px; margin-bottom: 12px; min-height: 120px;
}
.panel-title { font-weight: 600; margin-bottom: 10px; color: #c9d1d9; }
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.chart { width: 100%; height: 300px; }

.scroll-panel { max-height: 380px; overflow: auto; }
.scroll-panel::-webkit-scrollbar { width: 8px; }
.scroll-panel::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid #21262d; white-space: nowrap; }
th { background: #1c2128; color: #8b949e; font-weight: 600; position: sticky; top: 0; }
tr:hover { background: #1c2128; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.tier-block { margin-bottom: 14px; }
.tier-title { font-weight: 600; color: #f0883e; margin: 8px 0 6px; font-size: 14px; }

.status { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11.5px; }
.st-连板 { background: #f8514933; color: #f85149; border: 1px solid #f85149; }
.st-涨停 { background: #f8514933; color: #f85149; }
.st-上涨 { background: #f8514918; color: #f85149; }
.st-平盘 { background: #30363d; color: #c9d1d9; }
.st-下跌 { background: #2ea04318; color: #2ea043; }
.st-跌停 { background: #2ea04333; color: #2ea043; border: 1px solid #2ea043; }
.st-停牌 { background: #30363d; color: #c9d1d9; }

footer { text-align: center; color: #484f58; font-size: 12px; margin-top: 30px; }

/* 个股K线弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-mask.hidden { display: none; }
.modal {
  position: relative; width: min(960px, 94vw); height: min(640px, 88vh);
  background: #0d1117; border: 1px solid #30363d; border-radius: 10px;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid #30363d;
}
.modal-title { font-size: 15px; font-weight: 600; color: #f0f6fc; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-count { font-size: 12px; color: #8b949e; padding: 0 8px; min-width: 40px; text-align: center; }
.nav-btn {
  background: #21262d; color: #e6edf3; border: 1px solid #30363d;
  border-radius: 6px; font-size: 13px; line-height: 1; padding: 6px 10px; cursor: pointer;
}
.nav-btn:hover:not(:disabled) { background: #30363d; }
.nav-btn:disabled { opacity: 0.35; cursor: default; }
.modal-close { font-size: 24px; color: #8b949e; cursor: pointer; line-height: 1; padding: 0 6px; }
.modal-close:hover { color: #e6edf3; }
.modal-tabs { display: flex; gap: 6px; padding: 10px 16px 0; }
.modal-tabs .tab {
  padding: 6px 20px; border-radius: 6px 6px 0 0; border: 1px solid #30363d;
  background: #161b22; color: #8b949e; cursor: pointer; font-size: 13px;
}
.modal-tabs .tab:hover { background: #21262d; }
.modal-tabs .tab.active { background: #21262d; color: #f0f6fc; border-bottom-color: #21262d; }
.modal-chart { flex: 1; min-height: 0; }
.modal-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #0d1117; color: #8b949e; font-size: 14px; z-index: 2;
}
.modal-overlay.hidden { display: none; }
.modal-error { color: #f85149; }

.stock { color: #58a6ff; cursor: pointer; text-decoration: none; }
.stock:hover { text-decoration: underline; }
