:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e3e8f0;
  --text: #1f2733;
  --muted: #6b7686;
  --primary: #2f6df6;
  --primary-d: #2257d6;
  --done: #1fab63;
  --undone: #e0a106;
  --shadow: 0 2px 10px rgba(20,40,80,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 230px; background: #1b2440; color: #cfd8ea; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 18px 12px;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--primary);
  display: grid; place-items: center; font-size: 20px; font-weight: 700; color: #fff;
}
.logo-text { font-weight: 700; color: #fff; line-height: 1.2; font-size: 15px; }
.logo-text small { font-weight: 400; color: #8b98b8; font-size: 11px; }
#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
#nav a {
  color: #b9c3da; text-decoration: none; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; transition: .15s;
}
#nav a:hover { background: #26314f; color: #fff; }
#nav a.active { background: var(--primary); color: #fff; }
#nav a.nav-ext { color: #ffd479; border: 1px solid #4a4326; background: #2a2616; margin-top: 4px; }
#nav a.nav-ext:hover { background: #3a3320; color: #ffe9b0; }
/* 自定义跳转栏目：与上方常规导航一致，图标 + 文字左对齐，外链标记靠右 */
#customNav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }
#nav a.nav-custom { display: flex; align-items: center; gap: 8px; }
#nav a.nav-custom .nav-ico { width: 18px; text-align: center; font-size: 15px; line-height: 1; flex: 0 0 auto; }
#nav a.nav-custom .nav-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav a.nav-custom .nav-ext-mark { margin-left: auto; color: #7e8aa8; font-size: 12px; flex: 0 0 auto; }
.sidebar-foot { font-size: 11px; color: #6f7c9c; padding: 12px 8px 0; border-top: 1px solid #2a3553; }

/* 主区 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
}
.topbar h1 { font-size: 18px; margin: 0; }
.filter-group { display: flex; gap: 6px; }
.fbtn {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; transition: .15s;
}
.fbtn:hover { border-color: var(--primary); color: var(--primary); }
.fbtn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.content { padding: 20px 22px; flex: 1; overflow: auto; }
.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 工具栏 */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.inp {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px;
  outline: none; background: #fff; color: var(--text);
}
.inp:focus { border-color: var(--primary); }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 14px;
  border-radius: 8px; cursor: pointer; font-size: 13px; transition: .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn.danger { color: #d23; border-color: #f3c2c2; }
.btn.danger:hover { background: #d23; color: #fff; border-color: #d23; }
.hint { color: var(--muted); font-size: 12px; }

/* 表格 */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.grid { border-collapse: collapse; width: auto; min-width: 100%; font-size: 13px; }
.grid th, .grid td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid thead th {
  position: sticky; top: 0; background: #f7f9fc; color: var(--muted); font-weight: 600;
  cursor: pointer; user-select: none; z-index: 1;
}
.grid thead th.sortable:hover { color: var(--primary); }
.grid tbody tr:hover { background: #f7faff; }
.grid td.ops { white-space: nowrap; position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 1px 0 0 #eef1f6; }
.grid th:first-child { position: sticky; left: 0; z-index: 3; background: #eef2f8; }
.grid td.cell-wrap { white-space: normal; min-width: 180px; max-width: 260px; word-break: break-word; vertical-align: top; }
.color-preset { height: 28px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: #fff; font-size: 12px; }
.color-preset option[data-c]:before { content: ''; }
.swatch-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 4px; border-radius: 12px; font-size: 12px; }
.swatch-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; }
.badge.done { background: #e3f7ec; color: var(--done); }
.badge.undone { background: #fdf3da; color: var(--undone); }
.badge.na { background: #eef1f6; color: var(--muted); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* 甘特图 */
.gantt-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); max-height: 70vh; }
table.gantt { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.gantt th, table.gantt td { border-right: 1px solid #eef1f6; border-bottom: 1px solid #eef1f6; }
table.gantt thead th {
  position: sticky; top: 0; background: #f7f9fc; z-index: 3; padding: 6px 4px; text-align: center;
  min-width: 110px; max-width: 110px; height: 56px; vertical-align: middle; white-space: nowrap;
}
table.gantt thead th .sch-name { font-size: 11px; line-height: 1.25; word-break: break-all; font-weight: 600; }
table.gantt thead th.corner { left: 0; z-index: 4; min-width: 84px; max-width: 84px; background: #eef2f8; }
table.gantt tbody th.datecell {
  position: sticky; left: 0; background: #f7f9fc; z-index: 2; min-width: 84px; max-width: 84px;
  text-align: center; font-weight: 600; color: #344; white-space: nowrap;
}
table.gantt td.cell { width: 110px; height: 34px; text-align: center; padding: 0; white-space: nowrap; overflow: hidden; }
table.gantt td.cell.active { color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; padding: 6px 12px; letter-spacing: .3px; }
table.gantt td.cell.empty { background: #f4f7fc; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.legend .item { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.legend .dot { width: 14px; height: 14px; border-radius: 3px; }
table.gantt td.cell.active .gname { font-weight: 600; line-height: 1.15; }
table.gantt td.cell.active .grange { font-size: 10px; opacity: .92; margin-top: 2px; }

/* 查看详情网格 */
.view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.view-item { display: flex; flex-direction: column; gap: 3px; border-bottom: 1px dashed #eef1f6; padding-bottom: 8px; }
.view-item.full { grid-column: 1 / -1; }
.view-item .vk { font-size: 12px; color: var(--muted); }

/* 批量导入表格 */
#batchTable { font-size: 12px; }
#batchTable th, #batchTable td { padding: 4px 6px; }
#batchTable th { background: #eef2f8; position: sticky; top: 0; z-index: 1; }
#batchTable td.ops { text-align: center; width: 38px; }
#batchTable input.binp { width: 100%; min-width: 78px; box-sizing: border-box; padding: 4px 6px; border: 1px solid #d8dee9; border-radius: 4px; font-size: 12px; background: #fff; }
#batchTable input.binp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47,109,246,.15); }
.btn.tiny { padding: 2px 8px; font-size: 12px; line-height: 1.5; }

/* 批量导入拖拽区 */
.dropzone { border: 2px dashed #c4cede; border-radius: 10px; background: #f7f9fd; padding: 18px; text-align: center; cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: #eef3fe; }
.dropzone .dz-icon { font-size: 28px; }
.dropzone .dz-text { color: var(--muted); margin: 6px 0 10px; font-size: 13px; }

/* 显示/隐藏列 下拉 */
.col-dropdown { position: relative; display: inline-block; }
.col-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; background: #fff; border: 1px solid #d8dee9; border-radius: 10px; box-shadow: 0 8px 24px rgba(31,45,77,.16); padding: 12px; max-height: 52vh; overflow: auto; min-width: 210px; }
.col-panel .cp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.col-panel .cp-head b { font-size: 13px; color: #2b3654; }
.col-panel .cp-actions button { font-size: 12px; padding: 2px 8px; }
.col-panel label.cp-item { display: flex; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; border-radius: 6px; cursor: pointer; }
.col-panel label.cp-item:hover { background: #f4f7fc; }
.col-panel label.cp-item input { width: 15px; height: 15px; }
.view-item .vv { font-size: 14px; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 860px) { .view-grid { grid-template-columns: 1fr; } }

/* 统计卡片 */
.stat-cards { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 28px; font-weight: 700; }
.stat-card .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat-card.green .num { color: var(--done); }
.stat-card.amber .num { color: var(--undone); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.region-link { color: var(--primary); cursor: pointer; text-decoration: underline; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(20,30,55,.45); display: grid; place-items: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; width: 720px; max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
#schoolForm { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#schoolForm .field { display: flex; flex-direction: column; gap: 5px; }
#schoolForm .field.full { grid-column: 1 / -1; }
#schoolForm label { font-size: 12px; color: var(--muted); }
#schoolForm input, #schoolForm select, #schoolForm textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; outline: none;
}
#schoolForm input:focus, #schoolForm select:focus, #schoolForm textarea:focus { border-color: var(--primary); }
#schoolForm textarea { resize: vertical; min-height: 56px; }

/* 表单 / 设置 */
#pwdForm, #credForm { display: flex; flex-direction: column; gap: 8px; }
#pwdForm label, #credForm label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-msg { font-size: 13px; min-height: 18px; margin: 8px 0; }
.form-msg.ok { color: var(--done); }
.form-msg.err { color: #d23; }
.export-formats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* 自定义跳转栏目 编辑行 */
.links-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.link-row { display: flex; gap: 8px; align-items: center; }
.link-row .link-name { width: 36%; }
.link-row .link-url { flex: 1; }
.link-row .btn.tiny { flex: 0 0 auto; padding: 7px 12px; font-size: 15px; line-height: 1; }

/* Toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1b2440; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .sidebar { width: 64px; padding: 14px 8px; }
  .logo-text, .sidebar-foot, #nav a { font-size: 0; }
  #nav a::first-letter { font-size: 18px; }
  .stat-grid { grid-template-columns: 1fr; }
  #schoolForm { grid-template-columns: 1fr; }
}

/* ===== 登录落地页（未登录时全屏显示，完全遮住应用） ===== */
.landing {
  position: fixed; inset: 0; z-index: 1000; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 46%, #06b6d4 100%);
  font-family: inherit;
}
/* 年轻化发光圆斑 */
.landing::before, .landing::after {
  content: ''; position: absolute; border-radius: 50%;
  filter: blur(50px); z-index: 0;
}
.landing::before { width: 460px; height: 460px; background: #38bdf8; top: -150px; left: -100px; opacity: .55; }
.landing::after  { width: 560px; height: 560px; background: #a855f7; bottom: -200px; right: -140px; opacity: .35; }
/* 细点阵，增加年轻科技感 */
.landing-dots {
  position: absolute; inset: 0; z-index: 0; opacity: .45; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.22) 1.6px, transparent 1.6px);
  background-size: 28px 28px;
}
/* 背景大字水印（带一个文字：河北校翼行学子俱乐部） */
.landing-watermark {
  position: absolute; z-index: 1; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-9deg);
  font-size: clamp(26px, 6vw, 80px); font-weight: 800;
  color: rgba(255,255,255,.12); letter-spacing: 5px; white-space: nowrap;
  user-select: none; pointer-events: none;
}
.landing-card {
  position: relative; z-index: 2;
  background: rgba(255,255,255,.96);
  padding: 42px 38px 34px;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
  width: 90%; max-width: 380px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.landing-logo {
  width: 66px; height: 66px; border-radius: 16px; margin: 0 auto 16px;
  background: linear-gradient(135deg, #2563eb, #16a8c9);
  color: #fff; font-size: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(37,99,235,.4);
}
.landing-title { font-size: 22px; color: #15357a; margin: 0 0 6px; letter-spacing: 1px; font-weight: 700; }
.landing-sub { font-size: 13px; color: #6b7280; margin: 0 0 26px; }
.landing-form { display: flex; flex-direction: column; gap: 12px; }
.landing-form .inp { width: 100%; }
.landing-form .btn.primary { width: 100%; padding: 11px; font-size: 15px; }

/* ===== 对外填报页 intake（仅能新增学校，看不到系统内任何数据） ===== */
.landing.intake { align-items: flex-start; overflow-y: auto; padding: 30px 16px; }
.intake-card { max-width: 720px; }
.intake-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 18px 0 14px; text-align: left; }
.intake-form .field { display: flex; flex-direction: column; gap: 4px; }
.intake-form .field.full { grid-column: 1 / -1; }
.intake-form label { font-size: 12px; color: #6b7280; }
.intake-form input, .intake-form select, .intake-form textarea {
  border: 1px solid #d8dee9; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; outline: none; width: 100%; background: #fff;
}
.intake-form input:focus, .intake-form select:focus, .intake-form textarea:focus { border-color: #2563eb; }
.intake-form textarea { resize: vertical; min-height: 56px; }
.intake-submit { width: 100%; padding: 11px; font-size: 15px; }
@media (max-width: 560px) { .intake-form { grid-template-columns: 1fr; } }
