/* 智慧乘务 - 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a6fe0;
  --primary-dark: #1558b8;
  --primary-light: #e8f1fd;
  --sidebar-bg: #14304f;
  --sidebar-active: #1a6fe0;
  --bg: #f2f5f9;
  --card-bg: #ffffff;
  --text: #24303f;
  --text-light: #6b7a8d;
  --border: #e1e8f0;
  --danger: #e05252;
  --success: #2ea36b;
  --warn: #e69a2e;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ============ 登录/注册页 ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #14304f 0%, #1a6fe0 100%);
  padding: 20px;
}
.auth-card {
  width: 400px;
  max-width: 96vw;
  background: #fff;
  border-radius: 12px;
  padding: 36px 34px 30px;
  box-shadow: 0 12px 40px rgba(10, 30, 60, 0.35);
}
.auth-logo {
  text-align: center;
  margin-bottom: 26px;
}
.auth-logo .icon {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  margin-bottom: 12px;
}
.auth-logo h1 { font-size: 20px; color: var(--text); }
.auth-logo p { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.auth-tabs { display: flex; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.auth-tabs .tab {
  flex: 1; text-align: center; padding: 10px 0; cursor: pointer;
  color: var(--text-light); font-size: 15px; border-bottom: 2px solid transparent;
  user-select: none;
}
.auth-tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: bold; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--text); font-size: 13px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
}
.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background .2s;
  font-family: inherit;
}
.btn:hover { background: var(--primary-dark); }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-outline {
  background: #fff; color: var(--primary); border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #c43f3f; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #24865a; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn:disabled { background: #a8b6c6; cursor: not-allowed; }

.auth-msg { min-height: 20px; font-size: 13px; margin-bottom: 10px; text-align: center; }
.auth-msg.error { color: var(--danger); }
.auth-msg.success { color: var(--success); }
.auth-extra { text-align: center; margin-top: 12px; font-size: 13px; }
.auth-extra a { color: var(--primary); text-decoration: none; cursor: pointer; }
.auth-extra a:hover { text-decoration: underline; }
.pwd-tip { font-size: 12px; color: #888; margin: 2px 0 10px; min-height: 16px; line-height: 1.5; }
.pwd-tip.ok { color: var(--success); }
.pwd-tip.err { color: var(--danger); }

/* ============ 主布局 ============ */
.layout { display: flex; min-height: 100vh; }

/* 左侧导航 */
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: #cfd9e6;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 10;
}
.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-header .icon {
  width: 36px; height: 36px; background: var(--primary);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff; flex-shrink: 0;
}
.sidebar-header .title { font-size: 15px; font-weight: bold; color: #fff; }
.sidebar-header .sub { font-size: 11px; color: #8fa3ba; }

.nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.nav-group { margin-bottom: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  cursor: pointer;
  color: #cfd9e6;
  font-size: 14.5px;
  user-select: none;
  transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item .arrow {
  margin-left: auto; font-size: 11px; transition: transform .2s;
  color: #8fa3ba;
}
.nav-item.open .arrow { transform: rotate(90deg); }

.subnav {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  background: rgba(0,0,0,0.18);
}
.subnav.open { max-height: 400px; }
.subnav-item {
  padding: 10px 18px 10px 48px;
  font-size: 13.5px;
  color: #9fb2c8;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.subnav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.subnav-item.active { color: #fff; background: rgba(26,111,224,0.35); border-left: 3px solid var(--primary); padding-left: 45px; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: #8fa3ba;
}
.sidebar-footer .user-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #dce6f2; }
.sidebar-footer .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}
.sidebar-footer .logout-btn {
  width: 100%; padding: 8px; background: transparent; color: #8fa3ba;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; cursor: pointer; font-size: 12px;
  font-family: inherit;
}
.sidebar-footer .logout-btn:hover { color: #fff; border-color: var(--danger); }

/* 主内容区 */
.main {
  flex: 1;
  margin-left: 220px;
  padding: 24px 28px 60px;
  min-width: 0;
}
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 20px; margin-bottom: 4px; }
.page-header .desc { color: var(--text-light); font-size: 13px; }

.card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(16, 42, 80, 0.06);
  margin-bottom: 20px;
}
.card h3 { font-size: 15px; margin-bottom: 14px; color: var(--text); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f7fafd; color: var(--text); font-weight: bold; white-space: nowrap; }
tr:hover td { background: #f9fbfe; }
.rank-1 { color: #d4a017; font-weight: bold; }
.rank-2 { color: #8c9196; font-weight: bold; }
.rank-3 { color: #b87333; font-weight: bold; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px;
}
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: #e4f5ec; color: var(--success); }
.tag-red { background: #fdeaea; color: var(--danger); }
.tag-gray { background: #eef2f6; color: var(--text-light); }
.tag-orange { background: #fdf3e3; color: var(--warn); }

/* 表单行 */
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.form-row .form-group { flex: 1; min-width: 160px; margin-bottom: 12px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: inherit; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--primary); }

.empty {
  text-align: center; color: var(--text-light); padding: 40px 0; font-size: 13px;
}

/* 首页 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card-bg); border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(16, 42, 80, 0.06);
}
.stat-card .num { font-size: 28px; font-weight: bold; color: var(--primary); }
.stat-card .label { color: var(--text-light); font-size: 13px; margin-top: 4px; }
.stat-card .icon { float: right; font-size: 22px; opacity: .75; }

.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.quick-link {
  background: var(--card-bg); border-radius: 10px; padding: 16px 18px;
  cursor: pointer; box-shadow: 0 1px 4px rgba(16,42,80,0.06);
  transition: all .15s; border: 1px solid transparent;
}
.quick-link:hover { border-color: var(--primary); transform: translateY(-2px); }
.quick-link .t { font-weight: bold; margin-bottom: 4px; }
.quick-link .d { font-size: 12px; color: var(--text-light); }

/* 答题页 */
.quiz-question {
  background: #fbfdff; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 14px;
}
.quiz-question .q-title { font-weight: bold; margin-bottom: 10px; font-size: 14px; }
.quiz-question .q-title .q-no { color: var(--primary); margin-right: 6px; }
.quiz-option {
  display: block; padding: 9px 14px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: all .12s;
  font-size: 13.5px; background: #fff;
}
.quiz-option:hover { border-color: var(--primary); background: var(--primary-light); }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: bold; }
.quiz-progress {
  position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 5;
  display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-light);
}
.quiz-progress .bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.quiz-progress .bar .fill { height: 100%; background: var(--primary); transition: width .2s; }

.quiz-result-score { text-align: center; padding: 20px 0 10px; }
.quiz-result-score .big { font-size: 52px; font-weight: bold; }
.quiz-result-score .pass { color: var(--success); }
.quiz-result-score .fail { color: var(--danger); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10,25,45,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 12px; padding: 24px 26px;
  width: 720px; max-width: 94vw; max-height: 86vh; overflow-y: auto;
  box-shadow: 0 16px 50px rgba(10,30,60,0.3);
}
.modal h3 { margin-bottom: 16px; }
.modal .close-x { float: right; cursor: pointer; color: var(--text-light); font-size: 18px; }
.modal .close-x:hover { color: var(--danger); }

pre.doc-content {
  white-space: pre-wrap; word-break: break-all;
  background: #f7fafd; border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; font-family: inherit; font-size: 13.5px;
  max-height: 60vh; overflow-y: auto;
}

.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: #24303f; color: #fff; padding: 10px 22px; border-radius: 8px;
  font-size: 13.5px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  animation: fadein .2s;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes fadein { from { opacity: 0; transform: translate(-50%,-8px);} to { opacity: 1; transform: translate(-50%,0);} }

.muted { color: var(--text-light); font-size: 12.5px; }
.mt10 { margin-top: 10px; }
.mt16 { margin-top: 16px; }
.mb10 { margin-bottom: 10px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============ 成绩导入：文件选择区与预览 ============ */
.import-drop {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fafcfe;
}
.import-drop:hover { border-color: var(--primary, #2563eb); background: #f2f7ff; }
.import-drop.loading { opacity: .6; pointer-events: none; }
.import-drop-icon { font-size: 34px; margin-bottom: 6px; }
.import-drop-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }

.tag-ok, .tag-warn {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.tag-ok { background: #e8f7ee; color: #1a7f43; }
.tag-warn { background: #fff4e0; color: #b06a00; }

.import-warn {
  background: #fff8e6;
  border: 1px solid #f0d9a0;
  color: #8a5a00;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

.import-ok {
  background: #eef6ff;
  border: 1px solid #c3dcf5;
  color: #1c5fa8;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

.tie-flag {
  cursor: help;
  font-size: 12px;
  opacity: .8;
}

@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar-header .title, .sidebar-header .sub, .sidebar-footer .user-info, .nav-item .txt, .subnav { display: none; }
  .main { margin-left: 64px; }
}

/* ============ 网格小组加分：条款搜索下拉 ============ */
.clause-drop {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(10, 30, 60, 0.15);
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
}
.clause-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.clause-item:last-child { border-bottom: none; }
.clause-item:hover { background: var(--primary-light); }
.clause-item .t { flex: 1; line-height: 1.5; }
.clause-item .p { color: var(--success); font-weight: bold; white-space: nowrap; }
.clause-item .hl { color: var(--primary); }
.clause-empty { padding: 14px 12px; color: var(--text-light); font-size: 13px; text-align: center; }

/* ============ 全格式文件预览 ============ */
.pptx-slide {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.pptx-slide-title {
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 6px;
  font-size: 13px;
}
.docx-view { line-height: 1.8; }

/* ============ 批量选择与修改 ============ */
.row-ck { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.batch-bar {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 10px 30px rgba(20,40,80,.18);
}
.batch-bar .batch-info { font-size: 13px; color: var(--text); }
.batch-bar .batch-count { color: var(--primary); font-size: 16px; font-weight: bold; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { filter: brightness(1.06); }

/* ---- 分/秒/毫秒 三段输入 & 车站双下拉框（v0.0.1） ---- */
.dur-input {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.dur-input input,
.dur-input select {
  width: 90px;
  flex: 0 0 auto;
}
.dur-input span {
  color: #666;
  font-size: 13px;
  white-space: nowrap;
}

/* 用户管理：操作列（编辑 / 重置密码 / 删除）不换行，按钮之间留间距 */
.nowrap {
  white-space: nowrap;
}
.nowrap .btn {
  margin-right: 4px;
}
