/* 管理后台专用样式（叠加在 styles.css 令牌之上） */
.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 10px 24px 60px; }
.admin-hint {
  background: var(--brand-tint); border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 10px 14px; font-size: 13px; color: var(--ink); margin-bottom: 16px; line-height: 1.7;
}
.admin-hint b { color: var(--brand-deep); }

.profile-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.profile-table th, .profile-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.profile-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.profile-table .p-name { font-weight: 700; }
.profile-table .p-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; word-break: break-all; }
.badge { display: inline-block; font-size: 11.5px; border-radius: 99px; padding: 2px 9px; margin-right: 4px; }
.badge.active { background: var(--brand-tint); color: var(--brand-deep); font-weight: 700; }
.badge.vision { background: #f3edfd; color: #6d4bc4; }
.badge.off { background: var(--paper-soft); color: var(--muted); }
.badge.ok { background: #e9f6ee; color: var(--ok); }
.badge.bad { background: var(--vermilion-tint); color: var(--vermilion-deep); }
.p-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input[type="text"], .form-grid input[type="password"], .form-grid select {
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 9px 12px; width: 100%; outline: none; background: #fff;
}
.form-grid input:focus, .form-grid select:focus { border-color: var(--brand); }

.test-result { font-size: 12.5px; padding: 8px 12px; border-radius: 9px; margin-top: 10px; display: none; }
.test-result.ok { display: block; background: #e9f6ee; color: var(--ok); }
.test-result.bad { display: block; background: var(--vermilion-tint); color: var(--vermilion-deep); }

/* 登录卡 */
.login-wrap { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(360px, 100%); padding: 30px 28px; text-align: center; }
.login-card img { width: 64px; height: 64px; }
.login-card h1 { font-family: var(--serif); font-size: 20px; margin: 10px 0 2px; }
.login-card .d { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.login-card .field { text-align: left; margin-bottom: 12px; }
.login-card .btn.primary { width: 100%; letter-spacing: 4px; margin-top: 6px; }

@media (max-width: 720px) {
  .admin-wrap { padding: 6px 12px 40px; }
  .profile-table thead { display: none; }
  .profile-table tr { display: block; border-bottom: 1px solid var(--line-soft); padding: 10px 2px; }
  .profile-table td { display: block; border: 0; padding: 3px 2px; }
  .profile-table td.p-actions { justify-content: flex-start; margin-top: 8px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* 标签页 */
.admin-tabs {
  display: flex; gap: 4px; background: var(--paper-soft); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 4px; margin-bottom: 18px; width: fit-content;
}
.admin-tab {
  border: 0; background: none; padding: 8px 18px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); border-radius: 9px; cursor: pointer;
}
.admin-tab:hover { color: var(--brand); }
.admin-tab.on { background: #fff; color: var(--brand-deep); box-shadow: 0 1px 3px rgba(38,48,62,.12); }

/* 阅卷标准编辑 */
.rubric-card { padding: 16px 18px; margin-bottom: 14px; }
.rb-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.rb-title .rb-sub { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; }
/* 后台提示词编辑框：加高（约 20 行），可纵向拖拽调整 */
.prompt-editor {
  width: 100%; min-height: 340px; resize: vertical; outline: none;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff;
  padding: 12px 14px; font-family: var(--sans); font-size: 13px; line-height: 1.8; color: var(--ink);
}
.prompt-editor:focus { border-color: var(--brand); }

/* 注册码 */
.invite-code { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 14px; font-weight: 700; letter-spacing: 1px; }

/* 表单输入统一：数字输入框此前未套样式导致与文本框宽度不一 */
.form-grid input[type="number"], .form-grid textarea,
.admin-wrap .field input[type="number"], .admin-wrap .field textarea {
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 9px 12px; width: 100%;
  outline: none; background: #fff; font-size: 14px; font-family: var(--sans);
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus,
.admin-wrap .field input:focus, .admin-wrap .field textarea:focus { border-color: var(--brand); }

/* 分值输入：数字框 + 「分」后缀 */
.score-input { position: relative; display: flex; align-items: center; }
.score-input input { padding-right: 34px !important; }
.score-suffix {
  position: absolute; right: 12px; color: var(--muted); font-size: 13px; pointer-events: none;
}

/* 当前批阅模板卡片 */
.tpl-card {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; margin-bottom: 16px;
}
.tpl-icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--brand-tint); color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.tpl-info { flex: 1; min-width: 0; }
.tpl-title { font-family: var(--serif); font-weight: 700; font-size: 16.5px; }
.tpl-excerpt {
  font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tpl-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tpl-meta b { color: var(--brand-deep); }
.tpl-sep { margin: 0 8px; opacity: .5; }
.tpl-actions { display: flex; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }

/* 评分标准工具栏与列表 */
.rubric-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.rubric-title { font-family: var(--serif); font-weight: 700; font-size: 15.5px; }
.rubric-hint { font-size: 12px; color: var(--muted); }
.rubric-toolbar .spacer { flex: 1; }
.rubric-search {
  width: min(300px, 100%); border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px;
  outline: none; font-size: 13px; background: #fff; font-family: var(--sans);
}
.rubric-search:focus { border-color: var(--brand); }
.score-badge { background: #f3edfd; color: #6d4bc4; font-weight: 700; }
.danger-link { color: var(--vermilion-deep); }
.danger-link:hover:not(:disabled) { border-color: var(--vermilion); color: var(--vermilion-deep); background: var(--vermilion-tint); }
.rubric-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 12.5px; color: var(--muted); }
.rubric-foot .spacer { flex: 1; }
.rubric-page { font-variant-numeric: tabular-nums; }

/* 模板预览 */
.tpl-preview {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font-size: 13.5px; line-height: 1.9; font-family: var(--sans);
  background: var(--paper-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px 16px;
}

@media (max-width: 720px) {
  .tpl-card { flex-direction: column; align-items: flex-start; }
  .tpl-actions { width: 100%; }
}

/* 管理页顶栏（主界面已改为侧栏布局，顶栏样式归入管理页） */
.topbar {
  max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 16px 24px 10px;
}
.topbar .brand { display: flex; align-items: center; gap: 11px; }
.topbar .brand img { width: 42px; height: 42px; border-radius: 12px; }
.topbar .brand .name { font-family: var(--serif); font-weight: 700; font-size: 18px; line-height: 1.2; }
.topbar .brand .sub { font-size: 11.5px; color: var(--muted); }
.topbar .spacer { flex: 1; }

/* 操作按钮：单行排列，不竖排堆叠 */
.p-actions { flex-wrap: nowrap; white-space: nowrap; justify-content: flex-end; }

/* 行内连通性测试结果：限制宽度换行，不撑爆表格 */
.profile-table [data-test] {
  display: block; max-width: 200px; word-break: break-all; line-height: 1.5;
}

/* 分数档徽章 */
.badge.mid { background: #fdf4e7; color: #b26a12; }

/* 批阅记录详情 */
.log-dialog { width: min(760px, 100%); height: min(80vh, 720px); }
.log-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.log-report { font-size: 14px; }
.log-report-md { font-family: var(--serif); line-height: 1.9; }
.log-report-md h1, .log-report-md h2, .log-report-md h3 {
  font-family: var(--serif); border-bottom: 1px solid var(--line-soft);
  padding-bottom: 5px; margin: 1.4em 0 .5em;
}
.log-report-md table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12.5px; }
.log-report-md th, .log-report-md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.log-report-md th { background: var(--paper-soft); }
.log-chat { display: flex; flex-direction: column; gap: 12px; }
.log-msg { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 14px; }
.log-msg-user { background: var(--brand-tint); }
.log-msg-who { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.log-msg-body { font-size: 13.5px; line-height: 1.8; font-family: var(--serif); white-space: pre-wrap; word-break: break-word; }
.log-msg-ai .log-msg-body { white-space: normal; }

/* 编辑评分标准弹窗：固定高度，仅文本框内部滚动，不出整体滚动条 */
.dialog-tall { height: min(86vh, 780px); }
.dialog-tall .dlg-body { display: flex; flex-direction: column; overflow: hidden; }
.dialog-tall .form-grid { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dialog-tall .form-grid .field.full:last-child { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.prompt-grow { flex: 1; min-height: 100px; height: auto; resize: none; overflow-y: auto; }

/* 批阅记录 log 流 */
.log-hint {
  font-size: 12px; color: var(--muted); background: var(--paper-soft);
  border: 1px solid var(--line-soft); border-radius: 9px; padding: 8px 12px; margin-bottom: 12px; line-height: 1.7;
}
.log-hint b { color: var(--brand-deep); }
.log-flow { display: flex; flex-direction: column; gap: 12px; }
.log-entry { border: 1px solid var(--line-soft); border-radius: 11px; overflow: hidden; }
.le-up { border-left: 3px solid var(--brand); }
.le-down { border-left: 3px solid var(--ok); }
.log-entry-head {
  display: flex; align-items: center; gap: 7px; padding: 7px 12px;
  background: var(--paper-soft); font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12px; font-weight: 700;
}
.le-up .le-tag { color: var(--brand-deep); }
.le-down .le-tag { color: var(--ok); }
.le-role { color: var(--muted); }
.log-entry-body { padding: 10px 13px; font-size: 13px; }
.log-entry-body details summary {
  cursor: pointer; color: var(--muted); font-size: 12.5px; user-select: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.log-entry-body details[open] summary { color: var(--brand); margin-bottom: 6px; }
.log-pre {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12.5px; line-height: 1.8; color: var(--ink);
  background: var(--paper-soft); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px;
  max-height: 340px; overflow-y: auto;
}
.log-img { display: block; max-width: 320px; max-height: 240px; border: 1px solid var(--line); border-radius: 9px; margin-top: 7px; }
.log-img-link { color: var(--brand); font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
