.hidden { display: none !important; }

/* ---------------- 登录 ---------------- */
#admin-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(circle at 20% 15%, #e7efff 0, transparent 45%), #f6f8fd;
}
.login-box {
  width: min(100%, 400px); background: #fff; border-radius: 20px; padding: 34px 30px 30px;
  box-shadow: 0 18px 50px rgba(28,48,96,.12); border: 1px solid var(--line);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo { width: 60px; height: 60px; border-radius: 18px; background: var(--brand); margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 28px; box-shadow: 0 10px 24px rgba(47,107,255,.28); }
.login-brand h1 { font-size: 20px; margin: 0 0 7px; }
.login-brand p { font-size: 13px; color: var(--ink-3); margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fbfcff; outline: none; font-size: 14px; color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }
.btn-lg { height: 46px; font-size: 15px; margin-top: 4px; }
.login-tip { font-size: 12px; color: var(--ink-3); text-align: center; margin: 2px 0 0; line-height: 1.6; }
code { background: #f1f4fa; padding: 2px 6px; border-radius: 5px; font-size: 12px; }

/* ---------------- 布局 ---------------- */
#admin-app { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 18px 20px; border-bottom: 1px solid var(--line); }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex: none; }
.brand-name { font-size: 14.5px; font-weight: 700; }
.brand-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.menu { padding: 14px 10px; flex: 1; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none;
  padding: 11px 12px; border-radius: 9px; font-size: 14px; color: var(--ink-2);
  cursor: pointer; margin-bottom: 4px; text-align: left;
}
.menu-item span:first-child { font-size: 16px; width: 20px; }
.menu-item:hover { background: #f5f8ff; }
.menu-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.menu-count { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 11px; padding: 1px 7px; font-weight: 700; }
.menu-count:empty { display: none; }
.sidebar-foot { padding: 16px; border-top: 1px solid var(--line); }
.side-title { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 8px; }
.side-url { font-size: 11px; color: var(--ink-3); word-break: break-all; line-height: 1.5; margin-bottom: 10px; }

.main { flex: 1; min-width: 0; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.env-chip { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-weight: 600; }
.admin-name { font-size: 13px; color: var(--ink-2); }
.content { padding: 22px 24px 40px; }

/* ---------------- 概览 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 12.5px; color: var(--ink-3); }
.stat-value { font-size: 27px; font-weight: 700; margin: 7px 0 4px; line-height: 1.1; }
.stat-sub { font-size: 11.5px; color: var(--ink-3); }
.stat-accent { color: var(--brand); }
.stat-warn { color: var(--warn); }
.stat-good { color: var(--success); }

.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-bottom: 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel.no-pad { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.panel-head h3 { font-size: 15px; margin: 0; }
.panel-sub { font-size: 11.5px; color: var(--ink-3); }
.panel-desc { font-size: 13px; color: var(--ink-2); line-height: 1.75; margin: 0 0 14px; }
.panel-divider { height: 1px; background: var(--line); margin: 18px 0; }

.chart { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding: 8px 0 0; position: relative; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; width: 100%; justify-content: center; }
.chart-bar { width: 16px; border-radius: 5px 5px 0 0; background: var(--brand); min-height: 3px; transition: height .3s; }
.chart-bar.alt { background: #a9c2ff; }
.chart-label { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

.status-dist { display: flex; flex-direction: column; gap: 13px; }
.dist-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dist-name { width: 62px; color: var(--ink-2); }
.dist-track { flex: 1; height: 9px; border-radius: 999px; background: #eef1f7; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 999px; }
.dist-num { width: 42px; text-align: right; font-weight: 700; }
.quick-links { display: flex; flex-direction: column; gap: 9px; }
.quick { border: 1px solid var(--line); background: #fbfcff; border-radius: 9px; padding: 11px 13px;
  text-align: left; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.quick:hover { border-color: #b9cdff; color: var(--brand); background: var(--brand-soft); }

/* ---------------- 表格 ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-item { border: 0; background: none; padding: 7px 14px; border-radius: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.search { flex: 1; min-width: 200px; height: 38px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 9px; outline: none; background: #fff; font-size: 13.5px; }
.search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search.slim { flex: none; width: 240px; height: 34px; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.table th { background: #f8fafd; color: var(--ink-3); font-weight: 600; text-align: left;
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12px; }
.table td { padding: 13px 14px; border-bottom: 1px solid #f0f3f9; vertical-align: middle; }
.table tbody tr:hover { background: #fbfcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.col-check { width: 38px; }
.cell-text { max-width: 320px; line-height: 1.55; font-weight: 500; word-break: break-word; }
.cell-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.cell-audio audio { height: 34px; width: 210px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.pager-btns { display: flex; gap: 6px; }
.bulkbar { display: flex; align-items: center; gap: 10px; background: var(--brand-soft); border: 1px solid #cdddff;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; flex-wrap: wrap; }

/* ---------------- 文本 ---------------- */
.dropzone { border: 1.5px dashed #c9d5ee; background: #fbfcff; border-radius: 12px; padding: 26px 16px;
  text-align: center; cursor: pointer; font-size: 13.5px; color: var(--ink-2); transition: .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.drop-ico { font-size: 30px; margin-bottom: 8px; }
.drop-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.batch-list { max-height: 250px; overflow-y: auto; }
.batch-item { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid #f0f3f9; font-size: 13px; }
.batch-item:last-child { border-bottom: 0; }
.batch-name { font-weight: 600; }
.batch-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.batch-actions { display: flex; gap: 6px; flex: none; }
.text-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.text-cell { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfcff; font-size: 13.5px; line-height: 1.6; }
.text-cell.archived { opacity: .55; }
.text-cell-meta { font-size: 11px; color: var(--ink-3); margin-top: 8px; display: flex; justify-content: space-between; }
/* 文本明细：这条语料最终被哪个账号录了 */
.text-cell-owner { font-size: 11.5px; line-height: 1.65; margin-top: 7px; padding: 7px 9px;
  border-radius: 7px; background: #eef6ff; color: #2455a0; border: 1px solid #d5e6ff; word-break: break-all; }
.text-cell-owner.muted { background: #f6f8fc; color: var(--ink-3); border-color: var(--line); }
.corpus-owner { font-size: 11px; color: #2455a0; margin-top: 5px; line-height: 1.5; }

/* ---------------- 导出 ---------------- */
.export-list { display: flex; flex-direction: column; }
.export-item { display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid #f0f3f9; }
.export-item:last-child { border-bottom: 0; }
.export-item b { font-size: 14px; }
.export-item p { font-size: 12px; color: var(--ink-3); margin: 5px 0 0; line-height: 1.55; }
.url-box { background: #f5f8ff; border: 1px solid #d9e5ff; border-radius: 10px; padding: 13px;
  font-size: 13px; word-break: break-all; color: var(--brand); font-weight: 600; margin-bottom: 12px; }
.safe-list { font-size: 12.5px; color: var(--ink-2); line-height: 1.9; padding-left: 18px; margin: 0; }
.safe-list li { margin-bottom: 6px; }

/* ---------------- 弹层补充 ---------------- */
.sign-preview { background: #fafbfe; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.sign-preview img { max-width: 100%; max-height: 190px; }
.sign-meta { font-size: 12.5px; color: var(--ink-2); line-height: 1.8; margin-top: 12px; }

/* ---------------- 多团队版补充 ---------------- */
.admin-app .modal-card, .modal-card { max-height: 86vh; overflow-y: auto; }
.team-select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px;
  background: #fbfcff; font-size: 12.5px; color: var(--ink-2); outline: none; max-width: 210px; }
.team-select:focus { border-color: var(--brand); }
.team-chip { background: #eef4ff; color: #2456c8; border: 1px solid #d5e3ff; border-radius: 999px;
  padding: 5px 12px; font-size: 12px; font-weight: 600; }
.scope-banner { background: #f3f7ff; border: 1px solid #d9e5ff; color: #35518a; border-radius: 11px;
  padding: 12px 16px; font-size: 12.8px; line-height: 1.8; margin-bottom: 16px; }
.scope-banner b { color: #1b3b7a; }
.side-divider { height: 1px; background: rgba(255,255,255,.13); margin: 14px 0 12px; }
.code-pill { background: #eef4ff; color: #2456c8; border: 1px solid #d5e3ff; border-radius: 7px;
  padding: 4px 9px; font-size: 13px; font-weight: 700; letter-spacing: .4px; word-break: break-all; }
.field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fbfcff; outline: none; font-size: 14px; color: var(--ink); resize: vertical; line-height: 1.6; }
.field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }
.field-hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; margin-top: -2px; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); margin: 10px 0 4px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.static-row { padding: 10px 0; border-bottom: 1px dashed #e6ebf5; }
.static-row:last-child { border-bottom: 0; }
.static-row b { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
.static-value { font-size: 15px; font-weight: 700; color: var(--brand); word-break: break-all;
  background: #f5f8ff; border-radius: 8px; padding: 9px 11px; }
#form-modal-fields { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.corpus-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.corpus-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid #f0f3f9; font-size: 13px; }
.corpus-row:last-child { border-bottom: 0; }
.corpus-no { flex: none; width: 28px; color: var(--ink-3); font-size: 11.5px; padding-top: 2px; }
.corpus-text { flex: 1; line-height: 1.6; word-break: break-all; }
.corpus-meta { flex: none; font-size: 11px; color: var(--ink-3); max-width: 160px; text-align: right; }

/* ---------------- 时长配额 / 协议查看 ---------------- */
.quota-bar { width: 100%; min-width: 110px; height: 7px; border-radius: 999px;
  background: #eaf0fb; overflow: hidden; margin: 5px 0 6px; }
.quota-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2f6bff, #6ea0ff);
  transition: width .3s ease; }
.quota-fill.done { background: linear-gradient(90deg, #16a34a, #4ade80); }
.agreement-view-body { max-height: 46vh; overflow-y: auto; background: #fafbfe;
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  font-size: 13px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap;
  word-break: break-word; font-family: inherit; margin: 0 0 4px; }

/* 账号安全：修改密码表单与只读状态 */
.security-form { max-width: 460px; }
.security-form .field { margin-bottom: 13px; }
.security-form .field input { width: 100%; }
.security-form .field-hint { margin: 2px 0 16px; }
.security-line { display: flex; justify-content: space-between; gap: 18px; padding: 11px 2px;
  border-bottom: 1px solid var(--line); font-size: 13px; }
.security-line:last-child { border-bottom: none; }
.security-line span { color: var(--ink-3); flex: none; }
.security-line b { color: var(--ink, #1b2a4a); font-weight: 600; text-align: right; }

/* 语料上传：Excel 读取高级设置 */
.corpus-advanced { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #f8fafc; }
.corpus-advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.corpus-advanced[open] summary { margin-bottom: 10px; }
.corpus-advanced .field { margin-top: 0; }
.corpus-advanced .field + .field { margin-top: 10px; }

/* 多团队勾选 / 团队标签 / 文本修订标记 */
.multi-select { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px;
  max-height: 210px; overflow-y: auto; padding: 10px; border: 1px solid var(--line, #e2e8f2);
  border-radius: 9px; background: #fbfcff; }
.multi-opt { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2, #334155);
  padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.multi-opt:hover { background: #eef3ff; }
.multi-opt input { width: 15px; height: 15px; accent-color: var(--brand, #2f6bff); flex: none; }
.team-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.team-tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px;
  background: #eaf1ff; color: #2f5fd0; border: 1px solid #d5e3ff; }
.text-edited-mark { margin-top: 5px; font-size: 11.5px; color: #a86400; font-weight: 600; }
.dl-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* 数据导出：条件面板 / 按任务导出 */
.export-filter-panel { margin-bottom: 18px; border-color: #bfe3ff; background: #f7fbff; }
.export-filter-panel .panel-desc { margin-bottom: 14px; }
.filter-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr; gap: 12px; align-items: end; }
.filter-grid .seg { width: 100%; }
.filter-grid .seg-item { flex: 1; padding: 9px 4px; white-space: nowrap; font-size: 12px; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.filter-row .check-row { margin: 0; }
.filter-note { font-size: 12px; color: var(--ink-3, #64748b); flex: 1; min-width: 180px; }
.export-filter-panel .note { margin-top: 12px; }
.task-info { margin: 12px 0 14px; padding: 10px 12px; border-radius: 9px;
  background: #f5f8ff; border: 1px solid #e2eaff; font-size: 12.5px; color: var(--ink-2, #334155); line-height: 1.7; }
#page-export > .grid-2 > div:first-child > .panel + .panel { margin-top: 16px; }
.export-item .tag { margin-left: 4px; }

/* v8：审核工作台 */
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px;
  color: var(--ink-2, #334155); white-space: nowrap; }
.inline-field input { padding: 8px 10px; border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px; font-size: 12.5px; background: #fff; color: inherit; }
.rtask-item { border: 1px solid var(--line, #e2e8f0); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.rtask-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rtask-head b { font-size: 13.5px; }
.rtask-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px;
  font-size: 12px; color: var(--ink-3, #64748b); }
.rtask-meta b { color: var(--brand, #2455a0); }

@media (max-width: 1000px) {
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 68px; }
  .brand > div:last-child, .menu-item span:last-child, .sidebar-foot, .brand { justify-content: center; }
  .menu-item { justify-content: center; font-size: 0; }
  .menu-item span:first-child { font-size: 18px; }
  .menu-count { display: none; }
  .content { padding: 16px; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 14px; }
  .admin-name, .env-chip { display: none; }
}
