/* 高考数据分析平台 - 科技蓝浅色主题 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
  background: #f3f6fb; color: #1f2937; min-height: 100vh;
}

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #1e3a8a, #2563eb 60%, #3b82f6);
  color: #fff; padding: 14px 28px; box-shadow: 0 2px 12px rgba(30,58,138,.25);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; border: 1px solid rgba(255,255,255,.35);
}
.brand h1 { font-size: 18px; }
.brand p { font-size: 12px; opacity: .85; }
.tabs { display: flex; gap: 6px; }
.tab {
  padding: 8px 18px; border-radius: 8px; cursor: pointer; font-size: 14px;
  color: rgba(255,255,255,.85); transition: all .2s; text-decoration: none;
}
.tab:hover { background: rgba(255,255,255,.12); }
.tab.active { background: #fff; color: #1e40af; font-weight: 600; }

/* 布局 */
main { max-width: 1320px; margin: 24px auto; padding: 0 20px; }
.panel { display: none; }
.panel.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(15,23,42,.06); border-left: 4px solid #2563eb;
}
.stat-v { font-size: 26px; font-weight: 700; color: #1e40af; }
.stat-t { font-size: 13px; color: #475569; margin-top: 2px; }
.stat-s { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* 卡片 */
.card {
  background: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(15,23,42,.06);
}
.card h3 { font-size: 15px; color: #1e293b; margin-bottom: 12px; display: flex; align-items: baseline; gap: 8px; }
.card h3 .sub { font-size: 12px; color: #94a3b8; font-weight: 400; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart { width: 100%; height: 330px; }
.chart.tall { height: 360px; }

/* 筛选行 */
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; background: #fff; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(15,23,42,.06); }
.filters label, .form-row label { font-size: 13px; color: #475569; display: flex; align-items: center; gap: 6px; }
select, input[type=text], input[type=number] {
  border: 1px solid #dbe3ef; border-radius: 8px; padding: 7px 10px; font-size: 13px;
  background: #f8fafc; color: #1f2937; outline: none; transition: border .2s;
}
select:focus, input:focus { border-color: #2563eb; background: #fff; }
.chk { cursor: pointer; user-select: none; }
.chk input { accent-color: #2563eb; }
.hint { font-size: 12px; color: #64748b; margin-left: auto; }
.btn {
  background: #2563eb; color: #fff; border: none; border-radius: 8px;
  padding: 8px 18px; font-size: 13px; cursor: pointer; transition: background .2s;
}
.btn:hover { background: #1d4ed8; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  background: #f1f5f9; color: #475569; text-align: left; padding: 8px 10px;
  position: sticky; top: 0; font-weight: 600; white-space: nowrap;
}
.tbl td { padding: 7px 10px; border-bottom: 1px solid #eef2f7; color: #334155; white-space: nowrap; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl td b { color: #1e293b; }
.tag {
  display: inline-block; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
  padding: 1px 8px; border-radius: 20px; font-size: 12px;
}

/* 分段明细筛选条 */
.seg-filters { padding: 10px 14px; margin-bottom: 12px; gap: 10px; }
.seg-filters input { padding: 5px 8px; }
.seg-filters .btn { padding: 5px 12px; font-size: 12px; }
.btn-grey { background: #64748b; }
.btn-grey:hover { background: #475569; }

/* 翻页条 */
.pager-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef2f7;
  font-size: 13px; color: #475569;
}
.pager-bar .btn { padding: 5px 12px; font-size: 12px; }
.pager-bar #segPageInfo { padding: 0 8px; font-weight: 500; color: #1e293b; }
.pager-bar .btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ============ 数据管理模块 ============ */
.btn-primary { background: #16a34a; }
.btn-primary:hover { background: #15803d; }
.btn-mini { padding: 3px 10px; font-size: 12px; border-radius: 6px; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.sub-tabs { display: flex; gap: 4px; background: #fff; padding: 6px; border-radius: 12px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(15,23,42,.06); width: fit-content; }
.sub-tab {
  padding: 7px 22px; border-radius: 8px; cursor: pointer; font-size: 14px;
  color: #475569; transition: all .2s;
}
.sub-tab:hover { background: #f1f5f9; }
.sub-tab.active { background: #2563eb; color: #fff; font-weight: 600; }
.sub-panel { display: none; }
.sub-panel.active { display: block; animation: fade .2s ease; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 14px; width: 560px; max-width: 94vw;
  box-shadow: 0 20px 50px rgba(15,23,42,.25); animation: fade .18s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid #eef2f7;
}
.modal-head h3 { font-size: 16px; color: #1e293b; }
.modal-close { background: none; border: none; font-size: 22px; color: #94a3b8; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #dc2626; }
.modal-body { padding: 18px 20px; max-height: 62vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid #eef2f7; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #475569; }
.form-grid input, .form-grid select { width: 100%; }
.form-grid .full { grid-column: 1 / -1; }

/* 提示条 */
#toastBox { position: fixed; top: 70px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px; border-radius: 10px; font-size: 13px; color: #fff;
  box-shadow: 0 6px 20px rgba(15,23,42,.18); animation: slideIn .22s ease;
}
.toast.ok { background: #16a34a; }
.toast.err { background: #dc2626; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; } }

/* 表单与结果 */
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.result {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 14px 16px; font-size: 15px; color: #1e3a8a; min-height: 50px;
}
.result .hl { color: #dc2626; font-size: 20px; }
.err { color: #dc2626; font-size: 13px; }

footer { text-align: center; color: #94a3b8; font-size: 12px; padding: 24px 0 30px; }

/* 学科分档徽标 */
.grade { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.grade-Ap { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.grade-A  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.grade-Am { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.grade-Bp { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.grade-B  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.grade-Bm { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }

/* 页脚数据说明 */
.foot-note { font-size: 12px; color: #94a3b8; margin: 12px 2px 0; line-height: 1.6; }

@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; gap: 10px; }
}
