:root {
  --primary: #1e5eff;
  --primary-dark: #0f46d6;
  --primary-light: #eaf1ff;
  --success: #12a150;
  --warning: #e8890c;
  --danger: #dc2626;
  --text: #1f2937;
  --text-2: #5b6472;
  --text-3: #8b95a5;
  --border: #e3e8f0;
  --bg: #f4f6fa;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 20px rgba(16, 24, 40, .05);
}

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

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

/* ---------------- 登录页 ---------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e5eff 0%, #2f7cf6 40%, #4b9bff 100%);
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(13, 40, 100, .25);
  padding: 40px 36px 32px;
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .mark {
  width: 52px; height: 52px; border-radius: 12px; margin: 0 auto 12px;
  background: var(--primary); color: #fff; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-logo h1 { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.login-logo p { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.login-tip {
  background: #fff8e6; border: 1px solid #ffe3a3; color: #8a5a00;
  border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-top: 18px;
}

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; flex-shrink: 0; background: #10233f; color: #c8d4e8;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
}
.sidebar .brand {
  padding: 20px 18px; font-size: 16px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08); line-height: 1.4;
}
.sidebar .brand small { display: block; font-size: 11px; color: #7b8ca8; font-weight: 400; margin-top: 3px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 20px;
  color: #c8d4e8; font-size: 14px; cursor: pointer; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.sidebar nav a.active { background: rgba(30,94,255,.18); color: #fff; border-left-color: var(--primary); }
.sidebar nav a .ico { width: 18px; text-align: center; opacity: .85; }
.sidebar .side-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #7b8ca8; }
.sidebar .side-foot .uname { color: #fff; font-weight: 600; }

.main { flex: 1; margin-left: 210px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 17px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-2); }
.content { padding: 22px 24px 60px; flex: 1; }

/* ---------------- 卡片 / 网格 ---------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { color: var(--text-3); font-size: 12.5px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.stat .value small { font-size: 13px; font-weight: 400; color: var(--text-3); }
.stat .foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.stat.blue .value { color: var(--primary); }
.stat.green .value { color: var(--success); }
.stat.orange .value { color: var(--warning); }

/* ---------------- 表单 ---------------- */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field label .req { color: var(--danger); }
input[type=text], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d5dce8; border-radius: 7px;
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff; outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,94,255,.12); }
textarea { resize: vertical; min-height: 70px; }
input[type=file] { padding: 7px; }
.field .hint { font-size: 12px; color: var(--text-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 7px; border: 1px solid transparent;
  font-size: 13.5px; font-family: inherit; cursor: pointer; transition: .15s; background: #fff; color: var(--text);
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { border-color: #d5dce8; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-warn { background: var(--warning); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { padding: 12px 20px; font-size: 15px; width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- 表格 ---------------- */
.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); vertical-align: middle; }
th { background: #f7f9fc; font-weight: 600; color: var(--text-2); white-space: nowrap; }
tbody tr:hover { background: #fafbfe; }
td.num, th.num { text-align: right; }
td.c, th.c { text-align: center; }
.table-empty { padding: 40px; text-align: center; color: var(--text-3); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; line-height: 1.7; }
.tag-green { background: #e6f7ee; color: #0e8a4a; }
.tag-orange { background: #fff3e2; color: #b96a00; }
.tag-gray { background: #f0f2f6; color: #6b7280; }
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-red { background: #fdecec; color: #c02626; }

.bar { height: 7px; background: #eceff5; border-radius: 6px; overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }

/* ---------------- 评分卡 ---------------- */
.score-group { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; overflow: hidden; background: #fff; }
.score-group .sg-head {
  background: var(--primary-light); padding: 10px 16px; display: flex; justify-content: space-between;
  align-items: center; gap: 10px; border-bottom: 1px solid var(--border);
}
.score-group .sg-title { font-weight: 600; font-size: 14.5px; color: var(--primary-dark); }
.score-group .sg-sum { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.score-group .sg-sum b { color: var(--primary); font-size: 15px; }
.score-group .score-item { border: 0; border-bottom: 1px dashed var(--border); border-radius: 0; margin: 0; }
.score-group .score-item:last-child { border-bottom: 0; }
.score-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.score-item .si-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.score-item .si-name { font-weight: 600; font-size: 14.5px; }
.score-item .si-meta { font-size: 12.5px; color: var(--text-3); }
.score-item .si-desc { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.score-input { display: flex; align-items: center; gap: 10px; }
.score-input input[type=number] { width: 110px; text-align: center; font-size: 16px; font-weight: 600; }
.score-input input[type=range] { flex: 1; accent-color: var(--primary); }
.score-input .max { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* ---------------- 任务列表 ---------------- */
.task-list { display: flex; flex-direction: column; gap: 10px; }

/* ---------------- 专家端：课题信息条 ---------------- */
.info-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 8px 10px;
  background: #f7f9fc;
  border-radius: 8px;
  font-size: 13px;
}
@media (max-width: 1200px) {
  .info-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- 专家端：预览 + 紧凑打分 双栏 ---------------- */
.info-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 8px 10px;
  background: #f7f9fc;
  border-radius: 8px;
  font-size: 13px;
}
@media (max-width: 1200px) {
  .info-strip { grid-template-columns: repeat(2, 1fr); }
}
.work-split { display: flex; gap: 10px; align-items: stretch; margin-top: 10px; }
.preview-pane {
  flex: 0 0 58%; min-width: 420px; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  position: sticky; top: 10px; max-height: calc(100vh - 130px);
}
.preview-head {
  padding: 6px 10px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #f7f9fc;
  border-radius: 10px 10px 0 0; flex-shrink: 0;
}
.preview-head .muted { font-size: 11.5px; }
.preview-body { flex: 1; overflow: auto; padding: 8px 10px; font-size: 13px; line-height: 1.7; color: var(--text); }
.preview-body iframe { width: 100%; height: 100%; min-height: 540px; border: 0; display: block; }
.doc-preview h1, .doc-preview h2, .doc-preview h3 { font-size: 14.5px; margin: 8px 0 4px; }
.doc-preview p { margin: 0 0 6px; }
.doc-preview table { border-collapse: collapse; width: 100%; font-size: 12.5px; margin: 4px 0; }
.doc-preview td, .doc-preview th { border: 1px solid var(--border); padding: 4px 6px; }
.doc-preview img { max-width: 100%; }
.legacy-tip {
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 6px; padding: 6px 10px; font-size: 12.5px; margin-bottom: 10px;
}
/* docx-preview 渲染容器：保证内容完整，不被压缩或截断 */
.docx-render { padding: 0; background: #525659; overflow: auto; min-width: 100%; }
.docx-render .docx-wrapper { background: #fff; min-width: max-content; }
.docx-render .docx-wrapper > section.docx { margin: 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.score-pane { flex: 1; min-width: 0; }
@media (max-width: 1200px) { .work-split { flex-direction: column; } .preview-pane { position: static; max-height: 58vh; flex-basis: auto; width: 100%; min-width: 0; } }

.score-topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.score-table { width: 100%; border-collapse: collapse; font-size: 12.5px; border: 1px solid var(--border); border-radius: 8px; }
.score-table thead th {
  background: #f2f5fa; font-size: 11.5px; color: var(--text-3); font-weight: 600;
  padding: 4px 6px; text-align: left; border-bottom: 1px solid var(--border);
}
.score-table thead th.c { text-align: center; }
.score-table td { padding: 3px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.score-table tbody tr:last-child td { border-bottom: 0; }
.score-table tr.group-row td {
  background: var(--primary-light); font-weight: 600; font-size: 12.5px;
  color: var(--primary-dark); padding: 5px 8px; display: flex; justify-content: space-between; gap: 10px;
}
.score-table tr.group-row .g-sum { font-weight: 400; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.score-table tr.group-row .g-sum b { color: var(--primary); }
.score-table .ct-name { font-size: 12.5px; line-height: 1.35; }
.score-table .ct-desc { font-size: 11.5px; color: var(--text-3); line-height: 1.4; margin-top: 1px; }
.score-table .ct-err { font-size: 11.5px; color: var(--danger); min-height: 0; line-height: 1.4; }
.score-table .ct-err:empty { display: none; }
.score-val {
  width: 64px; text-align: center; font-weight: 600; font-size: 13px;
  padding: 3px 3px; border: 1px solid var(--border); border-radius: 5px;
}
.score-val:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,100,220,.12); }
.score-val.invalid { border-color: var(--danger); background: #fff5f4; }
.score-table tr.has-error td { background: #fffafa; }
#totalScoreErr { font-size: 11.5px; color: var(--danger); line-height: 1.4; min-height: 0; margin-top: 3px; }
#totalScoreErr:empty { display: none; }
.score-footer {
  margin-top: 8px; padding: 8px 10px; background: #f7f9fc; border-radius: 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px;
}
.score-footer #totalPreview { color: var(--primary); font-size: 18px; }
.task-item {
  border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; cursor: pointer; background: #fff; transition: .15s;
}
.task-item:hover { border-color: #b9cffa; box-shadow: 0 2px 10px rgba(30,94,255,.08); }
.task-item.active { border-color: var(--primary); background: var(--primary-light); }
.task-item .t-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.task-item .t-meta { font-size: 12.5px; color: var(--text-3); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

.panel-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.file-view { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #f7f9fc; }
.file-view iframe { width: 100%; height: 70vh; border: 0; display: block; }
.file-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 620px; max-height: 88vh; display: flex; flex-direction: column; }
.modal-lg { max-width: 900px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.close-x { cursor: pointer; font-size: 20px; color: var(--text-3); background: none; border: none; line-height: 1; }
.close-x:hover { color: var(--text); }

/* ---------------- 提示 ---------------- */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 18px; border-radius: 8px; color: #fff; font-size: 13.5px; box-shadow: 0 6px 20px rgba(0,0,0,.15); animation: fade .25s; }
.toast.ok { background: #12a150; }
.toast.err { background: #dc2626; }
.toast.info { background: #1e5eff; }
@keyframes fade { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

.notice-bar { background: var(--primary-light); border: 1px solid #c7d9ff; color: #1746b0; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.muted { color: var(--text-3); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.check-cell { display: flex; flex-wrap: wrap; gap: 8px; }
.chk { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d5dce8; border-radius: 20px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chk.on { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.chk input { display: none; }
.footer-note { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 16px 0 4px; }

/* ===== 评分体系（方案）选择器 ===== */
.scheme-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px; padding: 6px 8px;
  background: #f7f9fc; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12.5px; line-height: 1.4;
}
.scheme-bar select { min-width: 220px; }
.scheme-bar .sb-desc { font-size: 12px; flex: 1 1 auto; min-width: 0; }
#criteriaSchemeInfo { font-size: 12.5px; }
#schemeTable button[disabled] { opacity: .45; cursor: not-allowed; }

/* ===== 校徽横幅（登录页） ===== */
.login-logo { margin-bottom: 20px; }
.login-logo img { display: block; margin: 0 auto 16px; max-width: 320px; width: 100%; height: auto; }
