﻿@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+SC:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');
:root {
  /* Fresh & Clean Light Glassmorphism（对齐 AlibabaRobotWeb 设计系统）：青绿/青蓝渐变主色 + 浅石板背景 + 玻璃面板 */
  --bg: #f8fafc;
  --bg-accent: #f1f5f9;
  --sidebar: rgba(241, 245, 249, 0.78);
  --sidebar-border: rgba(226, 232, 240, 0.8);
  --paper: #ffffff;
  --paper-soft: #f1f5f9;
  --ink: #0f172a;
  --muted: #475569;
  --line: rgba(226, 232, 240, 0.9);
  --line-strong: #cbd5e1;
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-soft: rgba(13, 148, 136, 0.10);
  /* 主操作渐变（青绿→青蓝），与参考站 --primary-gradient 一致 */
  --primary-gradient: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  --primary-glow: 0 4px 15px rgba(13, 148, 136, 0.25);
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-dark: #b45309;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --accent-cyan: #0284c7;
  --accent-purple: #7c3aed;
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.10);
  --shadow-sm: 0 1px 2px rgba(148, 163, 184, 0.10);
  --shadow-md: 0 8px 32px 0 rgba(148, 163, 184, 0.12);
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prototype-upload-form .upload-dropzone {
  width: min(590px, 100%);
  min-height: 220px;
  margin: 0 auto;
}

.prototype-upload-form .upload-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.prototype-upload-form .upload-dropzone .form-card-head strong {
  font-size: 16px;
  font-weight: 500;
}

.prototype-upload-form .upload-dropzone .form-card-head p::after {
  content: ".dwg   .dxf   .zip";
}

.prototype-upload-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border-radius: 12px;
  background: #f5f5f4;
  color: #57534e;
  font-size: 26px;
  line-height: 1;
}

.upload-file-summary {
  margin-top: 14px;
  color: var(--primary-dark);
  font-size: 12px;
}

.upload-file-summary:empty {
  display: none;
}

.upload-file-picker {
  cursor: pointer;
}

.prototype-language-row {
  width: min(430px, 100%);
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
  margin: 0 auto;
}

.prototype-language-row::before {
  content: ">";
  grid-column: 2;
  grid-row: 1;
  /* 行内两个语言框（select 高 36px）底对齐，箭头改为对齐到下沿再上移半个框高，
     使其落在下拉框的垂直中线，而非整列（含标题文字）的中点。 */
  align-self: end;
  margin-bottom: 8px;
  color: #a8a29e;
}

.prototype-language-row label {
  text-align: left;
}

.prototype-language-row label:nth-child(1) {
  grid-column: 1;
}

.prototype-language-row label:nth-child(2) {
  grid-column: 3;
}

.prototype-group-title {
  margin-bottom: 10px;
  color: #57534e;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.prototype-write-modes {
  width: min(640px, 100%);
  margin: 0 auto;
}

.prototype-write-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.prototype-write-card {
  min-height: 74px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #1c1917;
  box-shadow: none;
  text-align: left;
}

.prototype-write-card strong {
  font-size: 13px;
}

.prototype-write-card span {
  color: #78716c;
  font-size: 11px;
  line-height: 1.3;
}

.prototype-write-card:hover,
.prototype-write-card.is-active {
  border-color: #67e8f9;
  background: #ecfeff;
  color: #155e75;
}

.prototype-upload-form .toolbar {
  width: min(640px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto;
  margin-top: 0;
}

.prototype-upload-form .toolbar button[type="submit"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

.prototype-upload-form .toolbar button[type="submit"]:hover {
  background: var(--accent-hover);
  color: #fff;
  opacity: 1;
}

.prototype-upload-form .toolbar button[type="submit"]:disabled {
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

.prototype-secondary-actions {
  display: contents;
  min-width: 0;
  margin: 0;
}

.prototype-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 2px 0 12px;
  color: #a8a29e;
  font-size: 12px;
}

.prototype-divider::before,
.prototype-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.prototype-secondary-grid {
  display: contents;
}

.prototype-secondary-card {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.prototype-secondary-card:hover {
  background: var(--accent-hover);
  color: #fff;
}

.prototype-secondary-card.is-highlight {
  background: var(--accent);
  color: #fff;
}

.prototype-secondary-card strong {
  font-size: 14px;
}

.prototype-secondary-card span {
  display: none;
}

#historyFilterForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 10px 12px;
  padding: 12px 18px;
  align-items: end;
}

#historyFilterForm .form-card-head {
  grid-column: 1 / -1;
  margin: 0;
}

#historyFilterForm .form-card-head p {
  margin: 2px 0 0;
  font-size: 12px;
}

#historyFilterForm .grid-3 {
  grid-column: 1;
  grid-template-columns: minmax(160px, 1.1fr) minmax(130px, 1fr) minmax(120px, 1fr) minmax(190px, 1.1fr);
  gap: 10px;
}

.history-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-date-range input[type="date"] {
  flex: 1 1 0;
  min-width: 0;
}
.history-date-range span {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 13px;
}

#historyFilterForm label {
  gap: 4px;
}

#historyFilterForm input,
#historyFilterForm select {
  min-height: 36px;
}

#historyFilterForm .toolbar {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  align-self: end;
}

#historyFilterForm .toolbar button {
  min-height: 38px;
}

.prototype-advanced-settings {
  width: min(640px, 100%);
  margin: 0 auto;
  text-align: left;
}

.prototype-advanced-settings summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.prototype-advanced-body {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans SC", "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 26px 26px,
    var(--bg);
  background-blend-mode: soft-light, soft-light, normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body:not(.is-authenticated) .workspace-shell {
  display: none;
}

body.is-authenticated .login-shell {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1320px);
  align-items: center;
  justify-content: center;
  padding: 48px 64px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(250, 250, 249, 0.92)),
    repeating-linear-gradient(0deg, rgba(28, 25, 23, 0.035) 0 1px, transparent 1px 32px),
    linear-gradient(135deg, #ecfeff 0%, #fafaf9 48%, #f0fdf4 100%);
}

.login-document {
  min-height: min(780px, calc(100vh - 96px));
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(420px, 500px);
  gap: 0;
  border: 1px solid #d8e2f1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(55, 72, 104, 0.14);
  overflow: hidden;
}

.login-feature-panel {
  display: grid;
  align-content: center;
  gap: 34px;
  padding: 64px;
  background:
    linear-gradient(90deg, rgba(216, 226, 241, 0.45) 1px, transparent 1px) 0 0 / 54px 54px,
    linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
  border-right: 1px solid #d8e2f1;
}

.login-feature-copy {
  max-width: 680px;
}

.login-feature-copy h1 {
  margin: 10px 0 16px;
  color: #182436;
  font-size: clamp(42px, 4.8vw, 68px);
  line-height: 1.08;
  letter-spacing: 0;
}

.login-feature-copy p:last-child {
  margin: 0;
  color: #526176;
  font-size: 17px;
  line-height: 1.75;
}

.login-cad-preview {
  overflow: hidden;
  border: 1px solid #c7d2e4;
  border-radius: 8px;
  background: #182232;
  box-shadow: 0 18px 42px rgba(24, 34, 50, 0.18);
}

.cad-preview-toolbar {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.24);
  background: #223048;
}

.cad-preview-toolbar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
}

.cad-preview-canvas {
  position: relative;
  min-height: 330px;
  background:
    linear-gradient(rgba(148, 163, 184, 0.14) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(148, 163, 184, 0.14) 1px, transparent 1px) 0 0 / 28px 28px,
    #182232;
}

.cad-line,
.cad-table,
.cad-highlight,
.cad-label {
  position: absolute;
  display: block;
}

.cad-line {
  background: #e2e8f0;
}

.cad-line-a {
  left: 56px;
  right: 56px;
  top: 70px;
  height: 2px;
}

.cad-line-b {
  left: 56px;
  right: 56px;
  bottom: 70px;
  height: 2px;
}

.cad-line-c {
  left: 56px;
  top: 70px;
  bottom: 70px;
  width: 2px;
}

.cad-line-d {
  right: 56px;
  top: 70px;
  bottom: 70px;
  width: 2px;
}

.cad-table {
  border: 1px solid #dbeafe;
  background:
    linear-gradient(#dbeafe 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, #dbeafe 1px, transparent 1px) 0 0 / 72px 100%;
}

.cad-table-a {
  left: 96px;
  top: 108px;
  width: 250px;
  height: 132px;
}

.cad-table-b {
  right: 96px;
  top: 108px;
  width: 190px;
  height: 132px;
}

.cad-highlight {
  left: 140px;
  right: 140px;
  bottom: 104px;
  height: 44px;
  border: 1px solid #facc15;
  background: rgba(250, 204, 21, 0.08);
}

.cad-label {
  left: 160px;
  bottom: 116px;
  color: #facc15;
  font-size: 15px;
  font-weight: 800;
}

.login-feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.login-feature-list div {
  min-height: 112px;
  padding: 20px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.login-feature-list strong {
  display: block;
  margin-bottom: 10px;
  color: #1f2a3d;
  font-size: 17px;
}

.login-feature-list span {
  color: #627187;
  font-size: 14px;
  line-height: 1.6;
}

.document-spine {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #24324d;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.document-sheet {
  display: grid;
  align-content: start;
  gap: 30px;
  padding: 46px;
  background:
    linear-gradient(90deg, rgba(216, 226, 241, 0.55) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(#fff, #fbfdff);
}

.document-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 24px;
  border-bottom: 2px solid #24324d;
}

.document-head h1 {
  margin: 8px 0 0;
  color: #1e293b;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.06;
  letter-spacing: 0;
}

.document-status {
  min-width: 92px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c9d6e8;
  border-radius: 999px;
  color: #475569;
  background: #fafaf9;
  font-size: 12px;
  font-weight: 800;
}

.document-lines {
  display: grid;
  gap: 14px;
  width: min(620px, 100%);
}

.document-lines span {
  height: 10px;
  border-radius: 999px;
  background: #e8eef7;
}

.document-lines span:nth-child(1) {
  width: 86%;
}

.document-lines span:nth-child(2) {
  width: 68%;
}

.document-lines span:nth-child(3) {
  width: 78%;
}

.document-lines span:nth-child(4) {
  width: 52%;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.document-grid article {
  min-height: 150px;
  padding: 18px;
  border: 1px solid #dfe7f3;
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.82);
}

.document-grid strong {
  display: block;
  margin-bottom: 10px;
  color: #26354f;
  font-size: 16px;
}

.document-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.login-card {
  align-self: center;
  margin: 0 46px;
  display: grid;
  gap: 22px;
  padding: 38px;
  border: 1px solid #d8e2f1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 56px rgba(51, 65, 102, 0.16);
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 6px;
}

.login-card-head h2 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

/* 登录/注册输入框统一样式见 .login-card .input-field（与参考项目一致：单一完整样式，不依赖图标容器） */

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.login-options .checkbox-line {
  margin: 0;
}

.login-hint {
  margin: 0;
  padding-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.workspace-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px 18px;
  background: var(--sidebar);
  box-shadow: inset -1px 0 0 var(--sidebar-border);
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1597b8, #0e7490);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 14px 26px rgba(21, 151, 184, 0.35);
}

.brand-card strong,
.brand-card p,
.sidebar-note strong,
.sidebar-note p,
.sidebar-link {
  color: #fff;
}

.brand-card p,
.sidebar-note p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.5;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  justify-content: flex-start;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(21, 151, 184, 0.94), rgba(14, 116, 144, 0.84));
  box-shadow: 0 14px 26px rgba(14, 116, 144, 0.22);
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.05);
}

.nav-item.is-active .nav-dot {
  background: #ffffff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.sidebar-note {
  padding: 16px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.main-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.topbar-breadcrumb strong {
  color: var(--ink);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.search-shell {
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-shell input {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
}

.search-pill,
.topbar-meta,
.user-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.topbar-meta {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #cfd5ff;
}

.user-pill {
  color: #41506d;
  background: #fff;
}

.content-shell {
  padding: 26px;
  display: grid;
  gap: 20px;
}

.panel,
.status-card,
.metric-card,
.subpanel,
.result-card,
.preview-block,
.history-item,
.help-panel,
.detail-history-item,
.batch-item-row {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.panel,
.help-panel {
  border-radius: 16px;
  padding: 20px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 420px);
  gap: 20px;
  background:
    linear-gradient(180deg, rgba(242, 246, 255, 0.88), rgba(255, 255, 255, 0.96)),
    radial-gradient(circle at top left, rgba(14, 116, 144, 0.12), transparent 32%);
}

.hero-copy {
  display: grid;
  gap: 14px;
  align-content: start;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.overview-actions {
  display: grid;
  gap: 18px;
}

.overview-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.overview-action-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fafaf9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.overview-action-card strong {
  font-size: 18px;
}

.overview-action-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-side {
  display: grid;
  gap: 16px;
}

.status-card {
  border-radius: 20px;
  padding: 18px 18px 16px;
}

.status-card.prominent {
  background: linear-gradient(180deg, #fff, #f7f9ff);
}

.status-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.status-card p,
.hint,
.section-subtitle,
.meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.section-subtitle {
  margin-top: 8px;
  font-size: 14px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.metric-card {
  border-radius: 16px;
  padding: 20px;
}

.metric-label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.module-rail {
  padding: 14px 18px;
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.module-tab {
  width: auto;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #f3f6fb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.module-tab:hover {
  background: #eaf0ff;
  color: var(--primary);
}

.module-tab.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 24px rgba(14, 116, 144, 0.2);
}

.subsection-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.subsection-tab {
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #dbe3f4;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}

.subsection-tab:hover {
  color: var(--primary);
  border-color: #cfd9ff;
  background: #f7f9ff;
}

.subsection-tab.is-active {
  color: var(--primary);
  border-color: #cfd9ff;
  background: var(--primary-soft);
}

.subsection-panel {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.subsection-panel.is-hidden {
  display: none;
}

/* 分组模块顶部 tab 栏（账户中心 / 管理后台）：注入在面板第一个子元素，置于 panel-header 之上。 */
.module-group-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

/* 与「任务详情」的 .detail-tab 保持一致：透明底、下划线高亮的 tab 样式。 */
.module-group-tab {
  width: auto;
  appearance: none;
  min-height: 38px;
  padding: 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft, #64748b);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.module-group-tab:hover {
  color: var(--ink, #0f172a);
  background: transparent;
}

.module-group-tab.is-active {
  color: var(--accent, #2563eb);
  border-bottom-color: var(--accent, #2563eb);
  background: transparent;
}

.dataset-detail-panel.is-hidden {
  display: none;
}

.workflow-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.workflow-mode-tab {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #dbe3f4;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.workflow-mode-tab:hover {
  color: var(--primary);
  border-color: #cfd9ff;
  background: #f7f9ff;
}

.workflow-mode-tab.is-active {
  color: var(--primary);
  border-color: #cfd9ff;
  background: var(--primary-soft);
}

[data-workflow-mode-section].is-hidden {
  display: none;
}

.module-panel.is-hidden,
[data-module].is-hidden {
  display: none;
}

h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

form {
  display: grid;
  gap: 16px;
}

.form-card,
.subpanel,
.tip-banner {
  border-radius: 20px;
  padding: 18px;
}

.subpanel {
  background: var(--paper-soft);
}

.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
}

.cad-export-settings {
  display: grid;
  gap: 16px;
  background: #fff;
}

.cad-export-settings .form-card-head {
  margin-bottom: 0;
}

.cad-export-settings input[type="color"] {
  min-height: 36px;
  padding: 4px 6px;
}

.setting-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
}

.setting-check-grid .checkbox-line {
  margin: 0;
}

.setting-group {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
}

.setting-label {
  font-size: 13px;
  font-weight: 800;
  color: #4b5874;
}

.setting-group .checkbox-line {
  margin: 0;
}

.dataset-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.dataset-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.dataset-detail-tabs {
  margin-bottom: 12px;
}

.dataset-result-list {
  display: grid;
  gap: 12px;
}

.dataset-result-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dataset-result-item,
.dataset-result-empty {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.dataset-result-item p,
.dataset-result-empty p {
  grid-column: 1 / -1;
  margin: 0;
}

.dataset-issue-preview {
  margin-top: 2px;
}

.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

/* 参考术语工具条：检索框/计数靠左，"新增参考术语"和"保存术语复核"两个按钮成组靠右、
   彼此挨近（不再被 space-between 撑到两端）。 */
.reference-term-toolbar {
  justify-content: flex-start;
}
.reference-term-toolbar [data-action="open-reference-glossary-add"] {
  margin-left: auto;
}

.form-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.form-card-head strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.form-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 2px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.checkbox-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

input[type="file"],
input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="date"],
select,
textarea,
button {
  width: 100%;
  border-radius: 8px;
}

input[type="file"],
input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="date"],
select,
textarea {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  min-height: 38px;
  padding: 0 18px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.15s ease;
  box-shadow: var(--shadow-sm);
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.ghost-button,
.floating-help-trigger,
.help-close,
.action-button.action-link,
.hint-reset {
  width: auto;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  box-shadow: none;
  font-weight: 500;
}

.ghost-button:hover,
.floating-help-trigger:hover,
.help-close:hover,
.action-button.action-link:hover,
.hint-reset:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--bg-accent);
}

/* 转 PDF 成功后“下载 PDF”按钮点亮，提示新结果已就绪 */
.action-button.action-link.pdf-ready {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary-dark);
  font-weight: 600;
}

.action-button.action-link.pdf-ready:hover {
  color: #fff;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar button {
  flex: 1 1 220px;
}

.toolbar button.is-busy {
  position: relative;
  box-shadow: 0 6px 16px rgba(14, 116, 144, 0.2);
}

.tip-banner {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.tip-banner.info {
  background: var(--primary-soft);
  border: 1px solid var(--line-strong);
}

.tip-banner strong {
  color: var(--primary-dark);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.stack {
  display: grid;
  gap: 14px;
}

.actions a {
  text-decoration: none;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  text-decoration: none;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  border: 1px solid #d7dcff;
}

.action-link:hover {
  background: #e6ebff;
}

/* Tooltip 统一使用浏览器原生 title 提示，避免和自定义气泡同时出现。 */
.hinted-action,
[data-help-text] {
  position: static;
}

.hinted-action::after,
.hinted-action::before,
[data-help-text]::after,
[data-help-text]::before {
  display: none;
  content: none;
}

.result-card,
.preview-block,
.history-item,
.detail-history-item,
.batch-item-row {
  border-radius: 18px;
  padding: 16px;
}

.result-card strong,
.history-item strong {
  display: block;
}

.preview-table {
  width: 100%;
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.preview-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.preview-table thead th {
  background: #f5f5f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preview-table th,
.preview-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.preview-table tbody tr:hover {
  background: #fafcff;
}

.history-table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.history-table {
  width: 100%;
  min-width: 1360px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.history-table th {
  background: #f5f5f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-table tbody tr:hover {
  background: #fafcff;
}

.history-table tbody tr:last-child td {
  border-bottom: 0;
}

.history-task-cell,
.history-file-cell,
.history-status-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.history-task-cell strong,
.history-file-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-task-cell strong {
  max-width: 240px;
}

.history-message-pill {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}

.history-file-cell span {
  max-width: 260px;
}

.history-status-cell {
  align-items: start;
}

.history-status-cell > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 180px;
}

.history-table .action-link {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.history-file-menu {
  width: max-content;
}

.history-file-menu summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.history-file-menu summary::-webkit-details-marker {
  display: none;
}

.history-file-menu[open] summary {
  background: #e6ebff;
}

.history-file-actions {
  width: 260px;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.history-file-actions .action-link {
  justify-content: flex-start;
  width: 100%;
}

.review-input {
  width: 100%;
  min-width: 180px;
}

textarea.review-input {
  min-height: 70px;
  resize: vertical;
}

.reference-data-panel {
  margin-top: 18px;
}

.reference-review-toolbar {
  align-items: end;
  justify-content: space-between;
}

.reference-review-toolbar label {
  flex: 1;
  min-width: 260px;
}

.reference-data-view.is-hidden {
  display: none;
}

.risk-chip,
.summary-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.risk-high,
.risk-critical,
.status-failed,
.summary-pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.risk-medium,
.status-running {
  background: var(--warning-soft);
  color: var(--warning);
}

.risk-low,
.status-completed,
.summary-pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.status-pending,
.summary-pill {
  background: #f3f6fb;
  color: var(--muted);
}

.system-check-head,
.status-row,
.history-links,
.batch-summary-grid,
.batch-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.system-check-list {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.system-check-item.ok {
  color: var(--success);
}

.system-check-item.warn {
  color: var(--danger);
}

.stage-text,
.history-time {
  color: var(--muted);
  font-size: 13px;
}

.stage-progress {
  width: 100%;
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: #edf2f9;
  overflow: hidden;
}

.stage-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c6bff, var(--primary));
}

.stage-progress-bar.processing {
  position: relative;
  background: linear-gradient(90deg, #7c6bff, #5a54f9, #8f8aff);
  background-size: 200% 100%;
  animation: progressFlow 1.6s linear infinite;
}

.processing-card {
  border: 1px solid rgba(94, 82, 255, 0.16);
  box-shadow: 0 18px 36px rgba(68, 82, 255, 0.08);
}

.progress-hint {
  margin-top: 10px;
}

@keyframes progressFlow {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.history-card.is-active {
  border-color: #cfd9ff;
  background: linear-gradient(180deg, #fff, #f7f9ff);
  box-shadow: 0 16px 34px rgba(14, 116, 144, 0.12);
}

.history-card-head,
.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.history-card-head {
  align-items: flex-start;
  justify-content: space-between;
}

.history-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.error-list {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--danger-soft);
  border: 1px solid #ffd9df;
}

.error-list ul,
.help-list {
  margin: 0;
  padding-left: 20px;
}

.error-list ul {
  display: grid;
  gap: 6px;
}

.batch-item-list,
.detail-history {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.help-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
}

.help-fab-button {
  min-width: 118px;
  border-radius: 999px;
}

.help-modal.hidden {
  display: none;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(4px);
}

.help-panel {
  position: relative;
  width: min(600px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.detail-panel,
.profile-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: min(980px, calc(100vw - 320px));
  height: calc(100vh - 32px);
  margin: 0;
  border-radius: 16px;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.24);
  animation: slideInRight 0.22s ease;
}

#detailModal .detail-panel {
  font-size: 14px;
}

.help-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 2;
}

#detailModal .help-panel-head {
  padding-bottom: 12px;
}

#detailModal .help-panel-head strong {
  font-size: 15px;
  font-weight: 650;
}

.help-panel-body {
  margin-top: 16px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

#detailModal .help-panel-body {
  margin-top: 14px;
}

.help-panel-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.help-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.help-nav {
  display: grid;
  gap: 8px;
  padding-right: 8px;
  border-right: 1px solid var(--line);
}

.help-nav button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  padding: 0 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid transparent;
  box-shadow: none;
  color: var(--muted);
}

.help-nav button.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--line-strong);
}

.help-content {
  min-height: 0;
}

/* 任务详情：左侧信息 + 右侧导出配置，两栏并排尽量一屏显示 */
.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.detail-col {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.detail-col .detail-grid,
.detail-col .preview-block {
  margin-top: 0;
}

#detailReferenceList {
  max-height: 108px;
  overflow-y: auto;
}

.running-tasks {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.running-tasks-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.running-tasks-head strong {
  font-size: 14px;
  font-weight: 700;
}
.running-tasks-list {
  display: grid;
  gap: 12px;
}

.detail-stage-block {
  max-height: 240px;
  overflow: auto;
}

@media (max-width: 960px) {
  .detail-columns {
    grid-template-columns: 1fr;
  }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.detail-grid > div {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  font-size: 12px;
}

.detail-grid > div strong {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* 任务详情里的备注编辑框 */
.detail-notes-edit {
  margin-top: 14px;
}
.detail-notes-edit > strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.detail-notes-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
}
.detail-notes-input::placeholder { color: #cbd5e1; }
.detail-notes-input:focus { outline: none; border-color: #93c5fd; }
.detail-notes-input.is-saving { opacity: 0.6; }
.detail-notes-input.is-saved { border-color: #86efac; background: #f0fdf4; }

#detailModal .preview-block {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 13px;
}

#detailModal .preview-block > strong {
  font-size: 15px;
  font-weight: 650;
}

/* 任务详情 · CAD 导出配置（分区重排） */
.detail-export-editor {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}
.detail-export-editor .export-section {
  display: grid;
  gap: 8px;
}
.detail-export-editor .export-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--line);
}
.detail-export-editor .export-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 540px) {
  .detail-export-editor .export-fields {
    grid-template-columns: 1fr 1fr;
  }
}
.detail-export-editor .export-fields.cols3 {
  grid-template-columns: 1fr 1fr 1fr;
}
/* 译文 PDF 排版里「对照 / 译文颜色 / 指定颜色」三项同一行；指定颜色只占色块宽度。 */
.detail-export-editor .pdf-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr max-content;
  gap: 14px;
  align-items: end;
  min-width: 0;
}
@media (max-width: 540px) {
  .detail-export-editor .pdf-color-row { grid-template-columns: 1fr; }
}
/* [hidden] 的 display:none 会被上面 .detail-export-editor label{display:grid} 盖掉，
   导致「指定颜色」在「保持原颜色」时仍然显示；这里强制隐藏，让 JS 的 .hidden 真正生效。 */
.detail-export-editor [hidden] { display: none !important; }

.detail-export-editor label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}
.detail-export-editor select,
.detail-export-editor input[type="number"],
.detail-export-editor input[type="text"],
.detail-reference-select {
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
}
.detail-export-editor .inline-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.detail-export-editor .inline-controls > select {
  flex: 1 1 0;
  min-width: 0;
}
.detail-export-editor .inline-controls > input[type="text"] {
  flex: 1 1 0;
  min-width: 0;
}
.detail-export-editor .inline-controls > input[type="color"] {
  flex: 0 0 42px;
  width: 42px;
  height: 32px;
  padding: 2px;
  border-radius: 6px;
}
.detail-export-editor .inline-controls :disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.detail-export-editor .setting-check-grid {
  margin-top: 2px;
}
.export-reference {
  margin-top: 12px;
}
.detail-reference-select {
  margin-top: 4px;
}
.detail-downloads .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.detail-export-editor .export-section-title .sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--faint, #9a9c95);
  letter-spacing: 0;
}

/* 勾选胶囊：一行平铺，绝不换行 */
.detail-export-editor .check-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.detail-export-editor .chk {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2, #fafaf8);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 8px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: 0.15s;
}
.detail-export-editor .chk input { position: absolute; opacity: 0; pointer-events: none; }
.detail-export-editor .chk .box {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--line-strong, #d8d8d2);
  background: #fff;
  display: grid;
  place-items: center;
  transition: 0.15s;
}
.detail-export-editor .chk .box svg { width: 10px; height: 10px; opacity: 0; transform: scale(0.6); transition: 0.15s; }
.detail-export-editor .chk.on { color: var(--ink); background: var(--accent-soft, #fbe9e0); border-color: #f0c3ad; }
.detail-export-editor .chk.on .box { background: var(--accent, #e2561d); border-color: var(--accent, #e2561d); }
.detail-export-editor .chk.on .box svg { opacity: 1; transform: scale(1); }

/* 多选参考包（下拉 + 标签） */
.multi { position: relative; }
.multi-control {
  display: flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 5px 8px; margin-top: 4px;
  border: 1px solid var(--line-strong, #d8d8d2); border-radius: 7px; background: #fff; cursor: pointer;
}
.multi.open .multi-control { border-color: var(--focus, #2b6cb0); box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.12); }
.multi-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 0; min-width: 0; }
.multi-chips:empty::before { content: "（不使用参考包）"; color: var(--faint, #9a9c95); font-size: 12.5px; }
.multi .chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  background: var(--accent-soft, #fbe9e0); color: var(--accent, #e2561d);
  border: 1px solid #f0c3ad; border-radius: 6px; padding: 3px 4px 3px 8px;
}
.multi .chip-x { border: none; background: none; color: var(--accent, #e2561d); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 1px; }
.multi-caret { color: var(--muted); flex: 0 0 auto; transition: 0.15s; font-size: 11px; }
.multi.open .multi-caret { transform: rotate(180deg); }
.multi-panel {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5;
  background: #fff; border: 1px solid var(--line-strong, #d8d8d2); border-radius: 9px;
  box-shadow: 0 14px 32px -16px rgba(28, 30, 26, 0.4); padding: 6px; max-height: 190px; overflow: auto;
}
.multi.open .multi-panel { display: block; }
.multi-opt { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink); padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.multi-opt:hover { background: var(--surface-2, #fafaf8); }
.multi-opt input { position: absolute; opacity: 0; pointer-events: none; }
.multi-opt .box { flex: 0 0 16px; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-strong, #d8d8d2); background: #fff; display: grid; place-items: center; }
.multi-opt .box svg { width: 10px; height: 10px; opacity: 0; transition: 0.15s; }
.multi-opt input:checked + .box { background: var(--accent, #e2561d); border-color: var(--accent, #e2561d); }
.multi-opt input:checked + .box svg { opacity: 1; }

/* 重译/出图按钮：并成一行，等宽不换行 */
.detail-rerun-actions { display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 10px; }
.detail-rerun-actions > button { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 9px 10px; }

/* 任务详情整体更紧凑 */
#detailModal .preview-block { padding: 12px 14px; margin-top: 10px; }
.detail-export-editor { gap: 10px; }
.detail-export-editor .export-section { gap: 7px; }
.detail-export-editor .section,
.detail-export-editor .export-fields { gap: 8px 12px; }
.detail-columns { gap: 14px; margin-top: 12px; }
#detailModal .detail-grid { gap: 7px; margin-top: 12px; }
#detailModal .detail-grid > div { padding: 7px 9px; }
.export-reference { margin-top: 10px; }
#detailModal .detail-stage-block { max-height: 460px; }

/* 两栏首个卡片顶部对齐：去掉首元素的上边距，统一从行顶开始 */
#detailModal .detail-columns { align-items: start; }
#detailModal .detail-col > *:first-child { margin-top: 0; }

/* 顶部导航标签不显示 hover 帮助气泡（标签本身已清楚），避免移上去冒出色块 */
.module-tabs .module-tab::after,
.module-tabs .module-tab::before {
  content: none !important;
  display: none !important;
}
/* 顶部主导航 .nav-item 的 hover 帮助气泡也关掉（保留选中项的下划线 .is-active::after） */
.nav-item:not(.is-active)::after,
.nav-item::before {
  content: none !important;
  display: none !important;
}

/* 翻译配置弹窗：顶部已有“写入方式/颜色/指定颜色/未翻译也用色”的快捷控件，
   隐藏“更多排版设置”里重复的同名控件，避免出现两遍（控件仍在 DOM 内，双向同步不受影响）。 */
#translateConfigAdvancedSlot label:has(#cadTextWriteMode),
#translateConfigAdvancedSlot label:has(#cadTranslationColorMode),
#translateConfigAdvancedSlot label:has(#cadTranslationColor),
#translateConfigAdvancedSlot label:has(#cadColorUntranslatedText),
#translateConfigAdvancedSlot .checkbox-line:has(#cadColorUntranslatedText) {
  display: none !important;
}

#detailModal .detail-history {
  gap: 0;
  margin-top: 10px;
  position: relative;
}

/* 阶段历史改为竖向时间轴：圆点 + 连线 */
#detailModal .detail-history-item {
  position: relative;
  padding: 0 0 14px 22px;
  border: none;
  background: none;
  border-radius: 0;
  font-size: 12.5px;
}
#detailModal .detail-history-item::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent, #e2561d);
}
#detailModal .detail-history-item::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 15px;
  bottom: -1px;
  width: 2px;
  background: var(--line);
}
#detailModal .detail-history-item:last-child::after { display: none; }
#detailModal .detail-history-item strong {
  display: block;
  margin-bottom: 1px;
  font-size: 13px;
  font-weight: 650;
}
/* 隐藏每条里冗余的“已完成”状态行（首个 div） */
#detailModal .detail-history-item > div:nth-of-type(1) { display: none; }
#detailModal .detail-history-item .hint { font-size: 12px; color: var(--muted); }
#detailModal .detail-history-item .meta { font-size: 11px; color: var(--faint, #9a9c95); margin-top: 1px; }

#detailModal .hint,
#detailModal .meta {
  font-size: 13px;
}

#detailModal .summary-pill {
  min-height: 28px;
  font-size: 12px;
  font-weight: 650;
}

.floating-help-trigger {
  font-size: 12px;
}

.profile-table-wrap input,
.profile-table-wrap select {
  min-width: 120px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
}

.profile-table th,
.profile-table td {
  min-width: 140px;
}

.wide {
  grid-column: 1 / -1;
}

@media (max-width: 1260px) {
  .workspace-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .metrics-strip,
  .overview-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel,
  .profile-panel {
    width: min(920px, calc(100vw - 240px));
  }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .login-document {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-card {
    margin: 0;
  }

  .login-feature-panel {
    border-right: 0;
    border-bottom: 1px solid #d8e2f1;
    padding: 34px;
  }

  .login-feature-copy h1 {
    font-size: 30px;
  }

  .login-feature-list {
    grid-template-columns: 1fr;
  }

  .document-sheet {
    padding: 30px;
  }

  .document-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .split-layout,
  .workflow-mode-tabs,
  .grid-2,
  .grid-3,
  .setting-check-grid,
  .dataset-workspace,
  .dataset-result-item,
  .dataset-result-empty,
  .detail-grid,
  .metrics-strip,
  .overview-action-grid,
  .help-shell {
    grid-template-columns: 1fr;
  }

  .topbar,
  .content-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .detail-panel,
  .profile-panel {
    width: calc(100vw - 24px);
    right: 12px;
    top: 12px;
    height: calc(100vh - 24px);
  }

  .help-nav {
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .login-shell {
    padding: 14px;
  }

  .login-document {
    grid-template-columns: 1fr;
  }

  .document-spine {
    min-height: 40px;
    writing-mode: horizontal-tb;
  }

  .document-sheet,
  .login-card,
  .login-feature-panel {
    padding: 22px;
  }

  .login-feature-copy h1 {
    font-size: 26px;
  }

  .login-cad-preview {
    display: none;
  }

  .document-head,
  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .topbar-actions,
  .module-tabs,
  .subsection-tabs,
  .workflow-mode-tabs,
  .toolbar,
  .hero-actions {
    width: 100%;
  }

  .topbar-actions,
  .toolbar {
    flex-direction: column;
  }

  .settings-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-panel,
  .profile-panel,
  .help-panel {
    width: calc(100vw - 16px);
    right: 8px;
    top: 8px;
    height: calc(100vh - 16px);
    margin: 0;
  }

  .search-pill,
  .topbar-meta,
  .user-pill,
  .module-tab,
  .subsection-tab,
  .ghost-button,
  .action-link,
  .help-close,
  .floating-help-trigger {
    width: 100%;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(32px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Prototype visual baseline
   This app shell must track prototype/index.html: light industrial workspace,
   top horizontal navigation, restrained cards, teal primary actions, brick CTA.
   Do not fall back to the older purple/sidebar dashboard style. */
:root {
  --bg: #fafaf9;
  --bg-accent: #f5f5f4;
  --paper: #ffffff;
  --paper-soft: #f5f5f4;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --primary: #0e7490;
  --primary-dark: #155e75;
  --primary-soft: #ecfeff;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --shadow-sm: 0 2px 6px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 8px 24px rgba(28, 25, 23, 0.08);
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
}

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg);
}

.workspace-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.brand-card {
  gap: 8px;
  min-width: 190px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  box-shadow: none;
  font-size: 13px;
}

.brand-card strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.brand-card p,
.sidebar-footer,
.nav-dot {
  display: none;
}

.sidebar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.nav-item {
  position: relative;
  width: auto;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.nav-item:hover {
  color: var(--ink);
  background: transparent;
  transform: none;
}

.nav-item.is-active {
  color: var(--primary);
  background: transparent;
  box-shadow: none;
}

.nav-item.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
}

.main-shell {
  display: block;
}

.topbar {
  position: static;
  min-height: 44px;
  padding: 8px 24px;
  background: #292524;
  color: #d6d3d1;
  border-bottom: 1px solid #1c1917;
  backdrop-filter: none;
}

.topbar-breadcrumb,
.topbar-breadcrumb strong,
.search-shell,
.user-pill {
  color: inherit;
}

.search-shell {
  display: none;
}

.topbar-meta,
.user-pill,
.ghost-button.floating-help-trigger {
  min-height: 28px;
  border-radius: 4px;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #d6d3d1;
  box-shadow: none;
  font-size: 12px;
}

.content-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px;
}

body[data-active-module="historyModule"] .content-shell,
body[data-active-module="referenceModule"] .content-shell,
body[data-active-module="datasetModule"] .content-shell,
body[data-active-module="profileModule"] .content-shell {
  width: 100%;
  max-width: none;
  margin: 0;
}

body[data-active-module="historyModule"] .module-panel,
body[data-active-module="referenceModule"] .module-panel,
body[data-active-module="datasetModule"] .module-panel,
body[data-active-module="profileModule"] .module-panel {
  width: 100%;
}

[data-module-nav].is-hidden,
[data-target-module].is-hidden {
  display: none !important;
}

.panel,
.subpanel,
.form-card,
.result-card,
.preview-block,
.history-card,
.history-table-shell,
.status-card,
.metric-card {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: none;
}

.panel {
  padding: 20px;
}

.hero-card {
  display: block;
  text-align: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-top: 32px;
}

.hero-copy {
  max-width: 640px;
  margin: 0 auto;
}

.hero-copy h1 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: 0;
}

.eyebrow {
  color: #a8a29e;
  letter-spacing: 2px;
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-weight: 600;
}

.lead {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
}

.hero-side,
.overview-actions,
.metrics-strip,
.module-rail {
  display: none;
}

.module-panel {
  margin-top: 0;
}

.prototype-workflow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.prototype-workflow-eyebrow {
  margin: 18px 0;
  font-size: 12px;
}

.prototype-workflow > h2 {
  margin: 0;
  color: #0c0a09;
  font-size: 30px;
  font-weight: 750;
  line-height: 1.2;
}

.prototype-workflow > .section-subtitle {
  margin: 16px auto 26px;
  max-width: 560px;
  color: #292524;
  font-size: 14px;
}

.prototype-workflow .subsection-tabs,
.prototype-workflow .tip-banner {
  display: none;
}

.prototype-capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(440px, 100%);
  margin: 0 auto 24px;
}

.prototype-capability-card {
  min-height: 124px;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #0c0a09;
  box-shadow: none;
}

.prototype-capability-card:hover,
.prototype-capability-card.is-active {
  border-color: var(--line-strong);
  background: #fff;
  color: #0c0a09;
}

.prototype-capability-card strong {
  font-size: 13px;
  font-weight: 750;
}

.prototype-capability-card small {
  color: #44403c;
  font-size: 12px;
  line-height: 1.35;
}

.prototype-capability-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}

.prototype-capability-icon.cad {
  background: #ecfeff;
  color: #155e75;
}

.prototype-capability-icon.pdf {
  background: #fef2f2;
  color: #b91c1c;
}

.prototype-upload-form {
  display: grid;
  gap: 20px;
}

h2 {
  font-size: 22px;
  letter-spacing: 0;
}

.module-tabs,
.subsection-tabs {
  gap: 8px;
}

.module-tab,
.subsection-tab,
.ghost-button,
.action-link,
.action-button.action-link,
.help-close,
.floating-help-trigger {
  border-radius: var(--radius-md);
  border-color: var(--line);
  background: var(--paper-soft);
  color: var(--muted);
  box-shadow: none;
}

.module-tab.is-active,
.subsection-tab.is-active {
  border-color: #a5f3fc;
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: none;
}

button,
.toolbar button,
.login-card button[type="submit"] {
  min-height: 44px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 800;
  border-radius: var(--radius-md);
  background: var(--accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, var(--shadow-sm);
  color: #fff;
}

button:hover,
.toolbar button:hover,
.login-card button[type="submit"]:hover {
  background: var(--accent-dark);
  transform: none;
  filter: none;
}

.ghost-button:hover,
.action-link:hover,
.action-button.action-link:hover,
.module-tab:hover,
.subsection-tab:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

input[type="file"],
input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="date"],
select,
textarea {
  border-radius: var(--radius-md);
  border-color: var(--line);
  background: #fff;
}

.upload-dropzone {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 32px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-xl);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.upload-dropzone input[type="file"] {
  max-width: 360px;
  margin: 12px auto 0;
}

.upload-dropzone .form-card-head {
  display: block;
  margin: 0;
}

.upload-dropzone .form-card-head strong {
  font-size: 16px;
}

.upload-dropzone .form-card-head p::after {
  content: "  鏀寔 .dwg / .dxf / .zip";
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 11px;
}

.status-badge,
.summary-pill,
.risk-chip {
  border-radius: 999px;
}

.history-table th,
.preview-table thead th {
  background: var(--paper-soft);
  color: var(--muted);
}

.history-table tbody tr,
.history-card,
.dataset-result-item {
  cursor: default;
}

.history-table tbody tr.history-row-clickable {
  cursor: pointer;
}

.history-table tbody tr:hover,
.preview-table tbody tr:hover {
  background: #fafaf9;
}

.detail-panel,
.profile-panel {
  border-radius: var(--radius-xl);
}

.login-shell {
  background: var(--bg);
}

.login-document {
  display: block;
  min-height: auto;
  max-width: 430px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

@media (max-width: 980px) {
  .sidebar {
    height: auto;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 12px 16px;
  }

  .sidebar-nav {
    width: 100%;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .content-shell {
    padding: 24px 16px;
  }

  .prototype-write-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prototype-upload-form .toolbar,
  .prototype-capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #historyFilterForm {
    grid-template-columns: 1fr;
  }

  #historyFilterForm .grid-3,
  #historyFilterForm .toolbar {
    grid-column: 1;
  }
}

/* 质量徽章行（命中参考/术语/风险） */
.quality-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.quality-badge strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.quality-badge.ref { background: #ecfeff; color: #0e7490; border-color: #cffafe; }
.quality-badge.term { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.quality-badge.risk { background: #fffbeb; color: #b45309; border-color: #fde68a; }

/* 文件选择即时反馈 */
.file-select-feedback {
  margin-top: 10px;
}
.file-select-summary {
  font-size: 13px;
  color: #0e7490;
  margin-bottom: 6px;
}
.file-select-summary strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.file-format-detected {
  font-size: 13px;
  color: #334155;
  margin-bottom: 6px;
}
.file-format-detected strong {
  font-weight: 700;
}
.file-format-detected .hint {
  font-size: 12px;
}
.file-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #334155;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-chip.more { color: #64748b; background: transparent; }

/* 进度卡底部（转后台） */
.processing-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
}
.processing-foot .hint {
  font-size: 12px;
  color: #94a3b8;
}

/* 首页“几个在跑”汇总卡：只显示在跑数量，不显示阶段/百分比/进度条 */
.running-summary-card .status-row {
  align-items: center;
  gap: 10px;
}
.running-summary-card .stage-text {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
}

/* CAD 导出设置可折叠 */
.cad-export-toggle {
  cursor: pointer;
  user-select: none;
}
.cad-export-toggle:hover strong {
  color: #0e7490;
}
.cad-export-chevron {
  display: inline-block;
  transition: transform 0.18s ease;
  color: #94a3b8;
  font-size: 0.85em;
}
.cad-export-settings:not(.is-collapsed) .cad-export-chevron {
  transform: rotate(180deg);
}
.cad-export-settings.is-collapsed > :not(.form-card-head) {
  display: none !important;
}
.cad-export-settings.is-collapsed {
  cursor: pointer;
}

/* 设置抽屉 */
.settings-gear {
  white-space: nowrap;
}
.settings-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.settings-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}
.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 92vw;
  background: #ffffff;
  box-shadow: -20px 0 48px rgba(15, 23, 42, 0.16);
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.26s ease;
  display: flex;
  flex-direction: column;
}
.settings-drawer.is-open {
  transform: translateX(0);
}
.settings-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #eef2f7;
}
.settings-drawer-head strong {
  font-size: 16px;
}
.settings-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}
.settings-drawer-group {
  margin-bottom: 24px;
}
.settings-drawer-group h4 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f7;
}
.settings-drawer-group > label {
  display: block;
  margin-bottom: 14px;
}
.settings-id-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.translation-prompt-setting textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  line-height: 1.5;
}
.settings-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid #eef2f7;
  background: #f8fafc;
}
.settings-drawer-foot .hint {
  font-size: 12px;
  color: #94a3b8;
}

/* 素材库（referenceModule）向原型靠拢的视觉重组 */
#referenceModule .reference-data-panel {
  background: #ffffff;
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  padding: 20px 22px;
  margin-top: 18px;
}
#referenceModule .reference-review-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #eef2f7;
}
#referenceModule .reference-review-toolbar label {
  flex: 1;
  min-width: 240px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
#referenceModule #referenceJobSelect {
  margin-top: 6px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 14px;
  color: #1e293b;
}
#referenceModule #referenceJobSelect:focus {
  border-color: #0e7490;
  background: #ffffff;
}
/* 子 Tab pill 化 */
#referenceModule [data-reference-data-tabs] {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #f1f5f9;
  border: 1px solid #e6eaf0;
  border-radius: 10px;
  margin-bottom: 16px;
}
#referenceModule [data-reference-data-tabs] .subsection-tab {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}
#referenceModule [data-reference-data-tabs] .subsection-tab:hover {
  color: #1e293b;
}
#referenceModule [data-reference-data-tabs] .subsection-tab.is-active {
  background: #0e7490;
  color: #ffffff;
}
/* 表格更干净 */
#referenceModule .preview-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#referenceModule .preview-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid #e6eaf0;
  white-space: nowrap;
}
#referenceModule .preview-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
#referenceModule .preview-table tbody tr:hover td {
  background: #f8fafc;
}
#referenceModule .preview-table .review-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  resize: vertical;
}
#referenceModule .preview-table .review-input:focus {
  border-color: #0e7490;
  outline: none;
}

/* 素材库头部：标题左 + 子 Tab 右 */
#referenceModule .material-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
#referenceModule .material-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}
/* 素材库子 Tab（参考译文 / 术语表） */
.material-subtabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border: 1px solid #e6eaf0;
  border-radius: 12px;
  margin: 0;
}
.material-head .material-subtabs {
  margin: 0;
  /* Tab 组作为整体不被压缩，避免内部按钮文字被挤换行 */
  flex-shrink: 0;
}
.material-head .material-subtab {
  padding: 7px 16px;
  font-size: 13px;
  white-space: nowrap;
}

/* 参考译文面板：扁平化（去掉复核卡片边框） */
#referenceModule .material-subpanel[data-material-sub="reference"] .reference-data-panel {
  border: 0;
  padding: 0;
  margin-top: 0;
  background: transparent;
}
#referenceModule [data-reference-data-tabs] {
  display: inline-flex;
  margin: 0 0 14px;
}
#referenceModule .reference-data-view.is-hidden {
  display: none;
}
.material-subtab {
  border: 0;
  background: transparent;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.material-subtab:hover {
  color: #1e293b;
}
.material-subtab.is-active {
  background: #0e7490;
  color: #ffffff;
}
.material-subpanel.is-hidden {
  display: none;
}

.term-workbench {
  display: grid;
  gap: 18px;
}
.term-toolbar,
.term-filter-row,
.term-table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.term-actions-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.term-upload-wrap {
  position: relative;
  display: inline-flex;
}
.term-format-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 10;
  display: none;
  width: 340px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
  font-size: 12px;
  line-height: 1.7;
}
.term-format-popover strong,
.term-format-popover span {
  display: block;
}
.term-format-popover strong {
  margin-bottom: 4px;
  color: #0f172a;
  font-size: 13px;
}
.term-upload-wrap:hover .term-format-popover,
.term-upload-wrap:focus-within .term-format-popover {
  display: block;
}
.term-actions-left .ghost-button {
  width: auto;
  min-height: 36px;
}
.term-strict-toggle {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #0e7490;
  border-radius: 8px;
  color: #0e7490;
  font-size: 13px;
  font-weight: 700;
  background: #ecfeff;
}
.term-filter-row .material-search {
  flex: 1 1 auto;
  min-width: 0;
}
.term-filter-row select {
  width: 160px;
  flex: 0 0 auto;
}
.term-table-wrap {
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.term-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.term-table-wrap th {
  padding: 12px 16px;
  text-align: left;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}
.term-table-wrap td {
  padding: 20px 16px;
  border-top: 1px solid #edf2f7;
}
.term-source-chip {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 5px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
}
.term-source-chip.manual {
  background: #cffafe;
  color: #0e7490;
}
.term-source-chip.task {
  background: #ffedd5;
  color: #c2410c;
}
.term-source-chip.upload {
  background: #dbeafe;
  color: #1d4ed8;
}
.term-source-chip.reference {
  background: #dcfce7;
  color: #15803d;
}
.term-row-actions {
  display: inline-flex;
  gap: 8px;
}
.term-row-actions .action-button,
.term-row-actions .row-icon-btn {
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  box-shadow: none;
}
.term-table-foot {
  color: #475569;
  font-size: 12px;
}
.term-table-foot .ghost-button {
  width: auto;
}
.term-empty {
  padding: 16px 0;
}

/* 来源批次列表 */
.reference-batch-list {
  margin-bottom: 18px;
  border: 1px solid #e6eaf0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}
.reference-batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.material-upload-btn {
  flex: 0 0 auto;
  width: auto;
  align-self: center;
  border: 0;
  background: #0e7490;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.material-upload-btn:hover {
  background: #0c647d;
}
.material-upload-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* 上传参考稿弹窗 */
.material-modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.material-modal-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}
.material-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%);
  width: 520px;
  max-width: 92vw;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  z-index: 130;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.material-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}
.translate-config-modal {
  width: 680px;
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  border-radius: 10px;
  font-size: 13px;
}
.translate-config-modal .material-modal-body {
  overflow-y: auto;
  display: grid;
  gap: 12px;
}
.translate-config-modal #translateConfigReferenceList {
  max-height: 210px;
  overflow-y: auto;
}
.translate-config-modal #translateConfigAdvancedSlot .cad-export-settings {
  margin: 0;
  padding: 14px;
  gap: 12px;
  border-radius: 10px;
}
.translate-config-modal #translateConfigAdvancedSlot .cad-export-settings .form-card-head {
  display: none;
}
.translate-config-modal #translateConfigAdvancedSlot .cad-export-settings .grid {
  gap: 10px;
}
.translate-config-modal #translateConfigAdvancedSlot .cad-export-settings label,
.translate-config-modal label,
.translate-config-modal .checkbox-line {
  font-size: 12px;
}
.translate-config-modal input[type="text"],
.translate-config-modal input[type="number"],
.translate-config-modal select {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}
.translate-config-modal input[type="color"] {
  min-height: 34px;
}
.translate-config-modal .setting-group {
  gap: 7px;
  padding: 10px 12px;
  border-radius: 10px;
}
/* [hidden] 的 display:none 会被 .setting-group/.grid 等类的 display 盖掉，这里强制隐藏，
   确保 CAD 模式隐藏「译文输出格式」、PDF 模式隐藏 CAD 专属设置。 */
.translate-config-modal [hidden] { display: none !important; }
.translate-config-modal .hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}
.translate-config-modal .setting-check-grid {
  gap: 6px 14px;
  padding: 8px 10px;
}
.material-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #eef2f7;
}
.material-modal-head strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
}
.material-modal-close {
  flex: 0 0 auto;
  width: 30px;
  min-height: 30px;
  min-width: 30px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  box-shadow: none;
}
.material-modal-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.material-modal-body {
  padding: 16px 18px;
}
.material-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid #eef2f7;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}
/* 新增参考术语/译文弹窗的底部：取消/保存两按钮等宽、不换行（默认 button{width:100%}
   会让"保存"撑满、"取消"被挤成最小宽度而把"取消"竖排断行）。 */
.reference-manual-modal .material-modal-foot button {
  flex: 1 1 0;
  width: auto;
  white-space: nowrap;
}
.reference-dropdown {
  position: relative;
}
.reference-dropdown-button {
  width: 100%;
  min-height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.reference-dropdown-button::after {
  content: "▾";
  position: absolute;
  right: 13px;
  top: 9px;
  color: #64748b;
  pointer-events: none;
}
.reference-dropdown-button:hover {
  background: #fff;
  color: var(--ink);
}
.reference-dropdown-menu {
  display: none;
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}
.reference-dropdown.is-open .reference-dropdown-menu {
  display: grid;
  gap: 4px;
}
.reference-dropdown-menu .checkbox-line {
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 6px;
}
.reference-dropdown-menu .checkbox-line:hover {
  background: #f8fafc;
}
.reference-dropdown-empty {
  padding: 8px 6px;
}
.material-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.15s ease;
}
.material-dropzone:hover,
.material-dropzone.is-dragover {
  border-color: #0e7490;
  background: #ecfeff;
}
.material-dropzone-icon {
  font-size: 30px;
  margin-bottom: 8px;
}
.material-dropzone-title {
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 4px;
}
.material-file-picked {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  background: #ecfeff;
  border: 1px solid #cffafe;
  border-radius: 10px;
  font-size: 13px;
}
.material-file-picked.is-hidden {
  display: none;
}
.material-file-name {
  flex: 1;
  font-weight: 500;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-file-size {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

/* 批次列表：上传进度行 */
.reference-batch-row.is-uploading {
  background: #f8fafc;
}
.rb-progress {
  display: inline-block;
  width: 80px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.rb-progress > span {
  display: block;
  width: 40%;
  height: 100%;
  background: #0e7490;
  border-radius: 2px;
  animation: rbIndeterminate 1.1s ease-in-out infinite;
}
@keyframes rbIndeterminate {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}
.rb-failed {
  color: #b91c1c;
}

/* 批次行字体/颜色对齐原型（提升优先级盖过全局 button 样式） */
#referenceModule .reference-batch-row {
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  color: #1e293b;
  letter-spacing: normal;
  text-transform: none;
}
#referenceModule .reference-batch-row .rb-date {
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
#referenceModule .reference-batch-row .rb-name {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  text-align: left;
}
#referenceModule .reference-batch-row .rb-name-meta {
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
}
#referenceModule .reference-batch-row .rb-count {
  font-size: 13px;
  font-weight: 600;
  color: #0e7490;
}
#referenceModule .reference-batch-row .rb-arrow {
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
}
#referenceModule .reference-batch-head {
  font-family: inherit;
}
.reference-batch-row {
  display: grid;
  grid-template-columns: 130px 1fr auto auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease;
}
.reference-batch-row:last-child {
  border-bottom: 0;
}
.reference-batch-row:hover {
  background: #ecfeff;
}
.reference-batch-row.is-active {
  background: #ecfeff;
  box-shadow: inset 3px 0 0 #0e7490;
}
.reference-batch-row .rb-date {
  font-size: 12px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.reference-batch-row .rb-name {
  font-weight: 500;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reference-batch-row .rb-count {
  font-size: 12px;
  color: #0e7490;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.reference-batch-row .rb-arrow {
  font-size: 12px;
  color: #94a3b8;
}
.rb-delete {
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  color: var(--danger);
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.rb-delete:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.tiny-danger-button {
  width: auto !important;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid rgba(185, 28, 28, 0.22);
  border-radius: 6px;
  background: rgba(254, 242, 242, 0.75);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}
.tiny-danger-button:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.reference-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reference-row-actions .tiny-danger-button {
  flex: 0 0 auto;
  margin-left: 0;
}
.reference-sample-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}
.reference-support-tip {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.reference-support-trigger {
  padding: 6px 10px;
  font-size: 12px;
}
.reference-support-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 48px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.reference-support-tip:hover .reference-support-popover,
.reference-support-tip:focus-within .reference-support-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.reference-support-popover strong {
  display: block;
  margin-bottom: 6px;
}
.reference-support-popover p {
  margin: 0 0 6px;
  color: var(--muted);
}
.reference-support-popover ul {
  margin: 0;
  padding-left: 18px;
}
.reference-batch-row.is-active .rb-arrow,
.reference-batch-row:hover .rb-arrow {
  color: #0e7490;
}

/* 录入类控件折叠块 */
.reference-manage {
  margin-bottom: 18px;
}
.reference-manage-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0e7490;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.reference-manage-toggle:hover {
  border-color: #0e7490;
  background: #ecfeff;
}
.reference-manage-chevron {
  color: #94a3b8;
  font-size: 0.85em;
  transition: transform 0.18s ease;
}
.reference-manage.is-open .reference-manage-chevron {
  transform: rotate(180deg);
}
.reference-manage-body {
  margin-top: 14px;
}
.reference-manage-body.is-hidden {
  display: none;
}
/* 上传入口已挪到来源批次标题行，隐藏独立折叠按钮（仍可被批次行按钮触发） */
.reference-manage > .reference-manage-toggle {
  display: none;
}
.reference-manage.is-open > .reference-manage-toggle {
  display: inline-flex;
}

/* 参考译文表格工具行（搜索/筛选/保存） */
.td-summary-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.td-summary-card {
  width: auto;
  min-height: 0;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  cursor: pointer;
}
.td-summary-card strong {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.td-summary-card:hover {
  border-color: var(--primary);
  background: var(--bg-accent);
}
.td-summary-card.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.td-summary-card.is-active strong {
  color: var(--primary-dark);
}
.td-summary-card.td-summary-warn {
  border-color: var(--danger);
  color: var(--danger);
}
.td-summary-card.td-summary-warn strong {
  color: var(--danger);
}
.td-summary-card.td-summary-warn.is-active {
  background: var(--danger-soft);
}

.material-table-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.material-search {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 14px;
}
.material-search:focus {
  outline: none;
  border-color: #0e7490;
  background: #ffffff;
}
.material-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
}

/* 参考译文表格（向原型对齐） */
.material-table {
  border: 1px solid #e6eaf0;
  border-radius: 12px;
  overflow: hidden;
}
.material-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.material-table th {
  text-align: left;
  padding: 12px 16px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid #e6eaf0;
  white-space: nowrap;
}
.material-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.material-table tbody tr:last-child td {
  border-bottom: 0;
}
.material-table tbody tr:hover td {
  background: #f8fafc;
}
.material-table .col-sel {
  width: 34px;
  text-align: center;
}
.material-table .col-idx {
  width: 44px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.material-table .col-src {
  width: 130px;
}
.material-table .col-op {
  width: 70px;
  text-align: right;
}
.material-table .cell-source-text {
  color: #1e293b;
}
/* 句对手动合并（断句）的即时反馈：被并入的行置灰删除线，首行挂"已合并"小标。 */
.material-table tr.td-merged-hidden td {
  color: #94a3b8;
  text-decoration: line-through;
  background: #f8fafc;
}
.material-table tr.td-merged-primary {
  background: #eef6ff;
}
.td-merged-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #1d4ed8;
  background: #dbeafe;
  white-space: nowrap;
}
/* 译文弹窗内联提示（合并/校验反馈，避免被弹窗挡住的状态栏吞掉） */
.td-foot-msg { margin-left: 10px; font-size: 13px; align-self: center; }
.td-foot-msg.is-ok { color: #15803d; }
.td-foot-msg.is-warn { color: #b91c1c; font-weight: 600; }
/* 译文弹窗合并模式 */
.td-head-actions { display: inline-flex; align-items: center; gap: 8px; }
.td-merge-tip { margin: 0 0 10px; }
.td-merge-group { margin-bottom: 16px; }
.td-merge-group-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 8px;
  margin-bottom: 4px;
  font-weight: 650;
  font-size: 13px;
  color: #0f172a;
  background: #eef2f7;
  border-radius: 8px;
}
.td-merge-group-head .review-count { margin-left: 6px; }
.material-table .review-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  resize: vertical;
  background: transparent;
}
.material-table .review-input:hover {
  border-color: #e2e8f0;
  background: #ffffff;
}
.material-table .review-input:focus {
  border-color: #0e7490;
  background: #ffffff;
  outline: none;
}
/* 参考译文表格：来源/删除已拆为左右两列，译文框压到单行高、行内边距收紧，整行更矮 */
.material-table.reference-memory-table td {
  padding: 8px 14px;
  vertical-align: top;
}
.material-table.reference-memory-table .review-input {
  min-height: 30px;
}
.source-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: #ecfeff;
  color: #0e7490;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-icon-btn {
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 6px;
}
.row-icon-btn:hover {
  color: #0e7490;
  background: #ecfeff;
}

/* 历史任务清单（向原型对齐） */
.material-history-list {
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  /* 屏幕变窄、列放不下时改为横向滚动（而非裁切/挤压重叠）；圆角仍保留。
     手机端（≤600px）会改成竖排字段卡片，下方媒体查询里把 min-width 复位。 */
  overflow-x: auto;
  background: #ffffff;
}
/* 列表表头与每一行共用同一套固定列宽（仅"任务"列弹性），保证表头与各行对齐。 */
.mh-head,
.mh-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 150px 80px 100px 92px 92px minmax(168px, max-content);
  align-items: center;
  gap: 16px;
  width: 100%;
  /* 各列有最小宽度，整体放不下时容器横向滚动，列不会被压到重叠。 */
  min-width: 920px;
  text-align: left;
}
.mh-head {
  padding: 10px 18px;
  border-bottom: 1px solid #e6eaf0;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}
.mh-row {
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease;
}
.mh-row:last-child {
  border-bottom: 0;
}
.mh-row:hover {
  background: #f8fafc;
}
.mh-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.mh-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mh-icon.extract { background: #ecfeff; color: #0e7490; }
.mh-icon.translate { background: #ecfeff; color: #0e7490; }
.mh-icon.check { background: #f5f3ff; color: #6d28d9; }
.mh-icon.ref { background: #e0f2fe; color: #0369a1; }
.mh-icon.batch { background: #f3e8ff; color: #7e22ce; }
.mh-icon.doc { background: #f1f5f9; color: #475569; }
.mh-main {
  min-width: 0;
}
.mh-name {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  /* 长文件名自动换行（含连续无空格的长串也能断行），不再省略号截断 */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.mh-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
.mh-notes {
  font-size: 12.5px;
  color: #475569;
  margin-top: 4px;
  padding: 3px 8px;
  background: #fef9c3;
  border-left: 3px solid #facc15;
  border-radius: 0 4px 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* 任务备注：列表内只读展示（编辑改到任务详情里进行） */
.mh-notes-cell { min-width: 0; }
.mh-notes-text {
  display: block;
  font-size: 12.5px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mh-notes-text.mh-notes-empty { color: #cbd5e1; }
.workflow-notes-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 38px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
}
.mh-count {
  font-size: 13px;
  font-weight: 600;
  color: #0e7490;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mh-count-button {
  border: 1px solid #cffafe;
  border-radius: 6px;
  padding: 3px 8px;
  background: #ecfeff;
  cursor: pointer;
}
.mh-count-button:hover {
  background: #0e7490;
  color: #ffffff;
  border-color: #0e7490;
}
.mh-annotation {
  display: grid;
  gap: 1px;
  min-width: 82px;
  color: #475569;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mh-annotation span {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.1;
}
.mh-annotation small {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.1;
}
.mh-status {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.mh-status.ok { background: #f0fdf4; color: #15803d; }
.mh-status.doing { background: #ecfeff; color: #0e7490; }
.mh-status.warn { background: #fffbeb; color: #b45309; }
.mh-status.fail { background: #fef2f2; color: #b91c1c; }
.mh-progress {
  width: min(360px, 100%);
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.mh-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0e7490;
}
.mh-progress-bar.ok { background: #16a34a; }
.mh-progress-bar.doing { background: #0891b2; }
.mh-progress-bar.warn { background: #d97706; }
.mh-progress-bar.fail { background: #dc2626; }
.detail-progress {
  width: 100%;
  height: 8px;
  margin: 10px 0 4px;
}
.mh-downloads {
  display: inline-flex;
  gap: 8px;
  white-space: nowrap;
}
.mh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}
.mh-empty {
  color: #cbd5e1;
  font-size: 12px;
}
/* 「操作」列：下载与动作统一为方形图标按钮（含义靠悬浮 tooltip 提示） */
.mh-actions .mh-icon-btn {
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.mh-actions .mh-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}
.mh-actions .mh-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
  filter: none;
  transform: translateY(-1px);
}
.mh-actions .mh-icon-btn[data-action="delete-job"] {
  border-color: #fecaca;
  color: #b91c1c;
}
.mh-actions .mh-icon-btn[data-action="delete-job"]:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}
.mh-icon-btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-soft);
}
.mh-icon-btn.is-loading .loading-spinner-icon {
  animation: history-refresh-spin 0.75s linear infinite;
}
.history-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 0;
  color: #64748b;
  font-size: 12px;
}
.history-pager > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.history-pager .pager-btn {
  width: auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  box-shadow: none;
  font-size: 12px;
}
.history-pager .pager-btn:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
  opacity: 1;
}
.mh-dl {
  font-size: 12px;
  color: #0e7490;
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid #cffafe;
  border-radius: 6px;
  background: #ecfeff;
}
.mh-dl:hover {
  background: #0e7490;
  color: #ffffff;
  border-color: #0e7490;
}
.mh-amount {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #334155;
  white-space: nowrap;
}
.mh-amount-value {
  font-weight: 600;
  color: #0f766e;
}
.mh-amount-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-variant-numeric: tabular-nums;
}
.mh-amount-button:hover,
.mh-amount-button:focus-visible {
  color: #0b5f59;
}
.mh-amount-button:disabled {
  cursor: wait;
  opacity: 0.7;
}
.mh-arrow {
  color: #cbd5e1;
  text-align: right;
}
.mh-row:hover .mh-arrow {
  color: #0e7490;
}

/* 译文句子质量卡模态 */
.translation-detail-modal {
  width: 980px;
  max-width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.translation-detail-modal .material-modal-head {
  align-items: flex-start;
}
.translation-detail-modal .td-stats {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}
.translation-detail-modal .material-modal-body {
  flex: 1;
  overflow-y: auto;
}
.translation-detail-modal .material-modal-foot {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.translation-detail-modal .td-foot-left {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.translation-detail-modal .td-foot-right {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.translation-detail-modal .material-table .col-idx {
  width: 44px;
}
.translation-detail-modal .material-table .col-src {
  width: 96px;
}
.translation-detail-modal .material-table .col-risk {
  width: 150px;
}
.translation-detail-modal .risk-reason {
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}
.translation-detail-modal .risk-none {
  font-size: 12px;
  color: #cbd5e1;
}

/* 参考句子分页 */
.material-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.material-pager .pager-info {
  font-size: 13px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.material-pager .pager-btns {
  display: inline-flex;
  gap: 8px;
}
.material-pager .pager-btn {
  padding: 7px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.material-pager .pager-btn:hover:not(:disabled) {
  border-color: #0e7490;
  color: #0e7490;
}
.material-pager .pager-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 翻译对话记录弹框 */
.tdlg-modal {
  max-width: 1100px;
  width: 92vw;
}
.tdlg-hint {
  margin: 0 20px 8px;
}
.tdlg-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  max-height: 70vh;
}
.tdlg-list {
  overflow-y: auto;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}
.tdlg-item {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border, #d0d5dd);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.tdlg-item.on {
  border-color: #2563eb;
  background: #eff4ff;
  font-weight: 600;
}
.tdlg-view {
  overflow-y: auto;
  max-height: 70vh;
}
.tdlg-section {
  margin-bottom: 14px;
}
.tdlg-section strong {
  display: block;
  margin-bottom: 4px;
}
.tdlg-section pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  max-height: 320px;
  overflow: auto;
}

/* ===== 任务详情 Tab + 图纸校对 ===== */
.detail-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.detail-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft, #64748b);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.detail-tab:hover { color: var(--ink, #0f172a); }
.detail-tab.is-active {
  color: var(--accent, #2563eb);
  border-bottom-color: var(--accent, #2563eb);
}
.detail-tabpane.hidden { display: none; }

/* 校对 Tab 打开时把抽屉拓宽 */
#detailModal .detail-panel--wide {
  width: min(1320px, calc(100vw - 48px));
}

.review-root {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* 留出弹窗标题栏 + 详情标签页 + 内边距的高度，保证"三栏 + 底部句对面板"整体落在弹窗一屏内，
     不让详情弹窗出现滚动条把句对推到屏外。 */
  height: calc(100vh - 200px);
  min-height: 360px;
}
.review-main {
  display: grid;
  /* 左栏窄到约 4 个汉字宽（文件名换行显示） */
  grid-template-columns: 88px minmax(0, 1fr) 320px;
  /* 行高被父容器约束，不让任一栏内容（如长批注列表）把整行撑高、把滚动条挤没 */
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}
.review-pane {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper, #fff);
  overflow: auto;
  min-width: 0;
}
.review-files { padding: 6px; }
.review-files-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 6px;
}
.review-files-title { font-size: 12px; font-weight: 650; color: var(--ink, #0f172a); }
.review-prerender-btn { font-size: 11px; padding: 3px 8px; white-space: nowrap; }
.review-prerender-btn:disabled { opacity: 0.6; cursor: default; }
.review-prerender {
  font-size: 11px;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 8px;
}
.review-files-list { display: grid; gap: 10px; }
/* 文件名做成一行的可点击折叠头：超出省略 + hover title 看全名；点击折叠/展开该文件的页 */
.review-file-name {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  color: var(--ink, #0f172a);
  padding: 4px 4px;
  border-radius: 4px;
}
.review-file-name:hover { background: var(--surface-soft, #f1f5f9); }
.review-file-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.review-file-caret {
  flex: 0 0 auto;
  color: var(--muted, #94a3b8);
  font-size: 9px;
  transition: transform 0.15s ease;
}
.review-file.is-collapsed .review-file-caret { transform: rotate(-90deg); }
.review-file.is-collapsed .review-pages { display: none; }
/* 文件名旁的批注标识：橙色=有待处理(显示条数)，绿色✓=有批注且已全部处理 */
.review-file-anno {
  flex: 0 0 auto;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.review-file-anno.is-open { background: var(--warn, #f59e0b); }
.review-file-anno.is-done { background: var(--ok, #22c55e); }
.review-pages { display: grid; gap: 4px; }
.review-page {
  appearance: none;
  text-align: left;
  border: 1px solid transparent;
  background: var(--surface-soft, #f1f5f9);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  color: var(--ink, #0f172a);
  cursor: pointer;
  word-break: break-all;
  line-height: 1.3;
}
.review-files-title { font-size: 11px; }
.review-prerender-btn { font-size: 10px; padding: 2px 6px; }
.review-page:hover { border-color: var(--accent, #2563eb); }
.review-page.is-active {
  background: var(--accent, #2563eb);
  color: #fff;
}
/* 左侧文件树:本页通过/不通过 状态背景色 + 左边线;is-active 时颜色更深 */
.review-page.review-page--pass {
  background: #dcfce7;
  border-left: 3px solid #16a34a;
  color: #14532d;
}
.review-page.review-page--fail {
  background: #fee2e2;
  border-left: 3px solid #dc2626;
  color: #7f1d1d;
}
.review-page.review-page--pass.is-active { background: #16a34a; color: #fff; }
.review-page.review-page--fail.is-active { background: #dc2626; color: #fff; }
.review-page-empty { font-size: 11px; color: var(--ink-soft, #94a3b8); padding: 4px; }
/* 单页文件：文件名即预览入口，选中/通过/不通过沿用页按钮一致的高亮 */
.review-file-name--single.is-active { background: var(--accent, #2563eb); color: #fff; }
.review-file-name--single.review-page--pass { background: #dcfce7; color: #14532d; }
.review-file-name--single.review-page--fail { background: #fee2e2; color: #7f1d1d; }
.review-file-name--single.review-page--pass.is-active { background: #16a34a; color: #fff; }
.review-file-name--single.review-page--fail.is-active { background: #dc2626; color: #fff; }
/* 画布栏的通过/不通过按钮组 */
.review-state-group { display: inline-flex; gap: 4px; }
.review-state-btn.is-active[data-state-target="pass"] {
  background: #16a34a; color: #fff; border-color: #15803d;
}
.review-state-btn.is-active[data-state-target="fail"] {
  background: #dc2626; color: #fff; border-color: #b91c1c;
}
.review-state-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.review-canvas { display: flex; flex-direction: column; }
.review-canvas-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper, #fff);
  z-index: 2;
}
.review-canvas-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-pin-btn { white-space: nowrap; }
.review-pin-btn.is-active {
  background: var(--accent, #2563eb);
  color: #fff;
}
.review-zoom { display: inline-flex; align-items: center; gap: 2px; }
.review-zoom-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-soft, #f1f5f9);
  color: var(--ink, #0f172a);
  font-size: 12px;
  line-height: 1;
  padding: 4px 7px;
  cursor: pointer;
  border-radius: 6px;
}
.review-zoom-btn:hover:not(:disabled) { border-color: var(--accent, #2563eb); }
.review-zoom-btn:disabled { opacity: 0.45; cursor: default; }
.review-zoom-label { min-width: 46px; font-variant-numeric: tabular-nums; }
.review-stage {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: repeating-conic-gradient(#f8fafc 0% 25%, #eef2f7 0% 50%) 50% / 22px 22px;
}
.review-stage.is-placing .review-img-wrap { cursor: crosshair; }
.review-stage.is-panning { cursor: grabbing; }
.review-img-wrap {
  position: relative;
  display: block;
  flex: 0 0 auto; /* 关键：作为 stage 的 flex 子项不被压缩，放大后才能溢出+滚动 */
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.18);
}
.review-img { display: block; width: 100%; height: auto; background: #fff; }
.review-pin-layer { position: absolute; inset: 0; pointer-events: none; }
.review-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.review-pin.sev-high { background: #dc2626; }
.review-pin.sev-medium { background: #f59e0b; }
.review-pin.sev-low { background: #2563eb; }
.review-pin.is-resolved { opacity: 0.45; }
.review-pin.is-active { outline: 3px solid rgba(37, 99, 235, 0.45); }
.review-pin-draft, .review-pin.review-pin-draft {
  background: #0ea5e9;
  animation: reviewPinPulse 1s ease-in-out infinite;
}
@keyframes reviewPinPulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.2); } }

.review-side { padding: 10px; display: flex; flex-direction: column; min-height: 0; }
.review-side-head {
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.review-count {
  background: var(--surface-soft, #e2e8f0);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
}
/* flex:1 + min-height:0 让批注列表占满 .review-side 剩余空间并自己滚（不再把整列撑高） */
.review-anno-list { display: grid; gap: 10px; align-content: start; overflow-y: auto; flex: 1; min-height: 0; padding-right: 2px; }
/* 批注列表按文件分组、可折叠 */
.review-anno-group { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper, #fff); }
.review-anno-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  background: var(--surface-soft, #f8fafc);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink, #0f172a);
}
.review-anno-group-head:hover { background: #f1f5f9; }
.review-anno-caret { transition: transform 0.15s ease; color: var(--muted, #94a3b8); font-size: 10px; }
.review-anno-group.is-collapsed .review-anno-caret { transform: rotate(-90deg); }
.review-anno-group.is-collapsed .review-anno-group-body { display: none; }
.review-anno-group-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-anno-group-stat { font-size: 11px; color: var(--muted, #94a3b8); }
.review-anno-group-body { display: grid; gap: 8px; padding: 8px; }
/* 批注三态徽章：待修正(open) / 已修正(done) / 未修正(notfixed) */
/* nowrap：避免在窄列里被挤成 "已/修/正" 竖排一柱，"已修正" 始终一行 */
.review-status-badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.review-status-badge.st-open { background: #fef3c7; color: #92400e; }
.review-status-badge.st-done { background: #d1fae5; color: #047857; }
.review-status-badge.st-notfixed { background: #fee2e2; color: #b91c1c; }
.review-page-tag { font-size: 11px; color: var(--muted, #94a3b8); margin-left: auto; }
.review-card-actions .ghost-button.is-on { background: #dbeafe; color: #2563eb; border-color: #93c5fd; }
.review-edit-input {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  resize: vertical;
}
.review-version-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;          /* 强制单行横排，原图/重跑N 并列显示，不再换到下一行 */
  gap: 4px;
  padding: 4px 8px 0;
  align-items: flex-end;
  overflow-x: auto;           /* 版本太多放不下时容器内横向滚动 */
}
.review-version-tabs:empty { display: none; }
.review-version-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;     /* label + 计数徽章统一居中 */
  gap: 4px;
  font-size: 11px;
  line-height: 1.4;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: var(--surface-soft, #f1f5f9);
  color: var(--ink-soft, #475569);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  width: auto;                 /* 覆盖全局 button { width:100% }，否则单 tab 撑满全行、多 tab 互相挤出屏外 */
  min-width: 5em;              /* 每个 tab 约 5 字宽，统一外观，避免“原图/重跑1”一长一短 */
}
.review-version-tab.is-active {
  background: var(--paper, #fff);
  font-weight: 700;
  color: var(--accent, #2563eb);
  border-color: var(--accent, #2563eb);
  /* 顶部一道粗蓝条 + 底部白色与下方面板"接平"，明确标识"被选中" */
  box-shadow: inset 0 3px 0 var(--accent, #2563eb), 0 1px 0 var(--paper, #fff);
}
.review-version-tab-count {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  text-align: center;
  font-size: 10px;
  line-height: 13px;
  border-radius: 999px;
  background: var(--accent, #2563eb);
  color: #fff;
}
.review-version-tab:not(.is-active) .review-version-tab-count {
  background: var(--muted, #94a3b8);
}
/* 本页句对：校对页最下方的全宽可折叠表格区（表格样式复用 .material-table） */
.review-pairs-panel { display: flex; flex-direction: column; flex: 0 0 auto; padding: 0; overflow: hidden; }
.review-pairs-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: var(--surface-soft, #f8fafc);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  font-size: 13px;
  color: var(--ink, #0f172a);
  border-radius: 12px 12px 0 0;
}
/* 标题栏一行：标题(撑开) + 搜索框 + 匹配数 + 合并模式按钮 + 折叠箭头 */
.review-pairs-toggle { gap: 10px; }
.review-pairs-title { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.review-pairs-caret { flex: 0 0 auto; transition: transform 0.15s ease; color: var(--muted, #94a3b8); }
.review-merge-mode-btn { flex: 0 0 auto; padding: 3px 10px; font-size: 12px; font-weight: 600; border-radius: 6px; line-height: 1.5; white-space: nowrap; }
/* 本页句对搜索框：常驻标题栏，纯前端过滤当前页句对 */
.review-pairs-search-input {
  flex: 0 0 auto;
  width: min(220px, 32vw);
  font: inherit;
  font-weight: 400;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
}
.review-pairs-search-input:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.1); }
.review-pairs-search-count { flex: 0 0 auto; font-size: 12px; font-weight: 400; color: var(--muted, #94a3b8); font-variant-numeric: tabular-nums; }
.review-pairs-panel.is-collapsed .review-pairs-caret { transform: rotate(-90deg); }
.review-pairs-panel.is-collapsed .review-pairs-toggle { border-radius: 12px; }
.review-pairs-body { padding: 0 12px 12px; overflow: auto; max-height: 220px; }
.review-pairs-panel.is-collapsed .review-pairs-body { display: none; }
.review-pairs-body .material-table { border-radius: 8px; }
/* 合并模式工具条：紧凑按钮，横向排列不撑满 */
.review-pairs-tools { display: flex; align-items: center; gap: 8px; padding: 8px 0; flex-wrap: wrap; }
.review-pairs-tools .ghost-button-sm { flex: 0 0 auto; width: auto; }
.review-merge-hint { font-size: 12px; color: var(--muted, #94a3b8); }
/* 合并/拆分反馈：浮动 toast，固定屏幕中下方，滚动也不被遮住，几秒自动消失 */
.merge-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(12px);
  max-width: 560px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  color: #fff;
  background: #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100000;
}
.merge-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.merge-toast.is-ok { background: #15803d; }
.merge-toast.is-warn { background: #b91c1c; }
.ghost-button-sm {
  /* 覆盖全局 button{width:100%;min-height:38px}，否则在 flex 里会被撑成全宽/过高 */
  width: auto;
  min-height: 0;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: var(--ink, #0f172a);
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ghost-button-sm:hover { background: var(--surface-soft, #f8fafc); }
.ghost-button-sm.is-active { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.review-pairs-body .cell-source-text { white-space: pre-wrap; word-break: break-word; }
.review-pair-untranslated { color: var(--muted, #94a3b8); font-style: italic; }
.review-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: var(--paper, #fff);
  min-width: 0;
  overflow: visible;
}
.review-card.is-active { border-color: var(--accent, #2563eb); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18); }
.review-card.is-resolved { opacity: 0.7; }
.review-card-draft { border-color: #0ea5e9; background: #f0f9ff; }
.review-card-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.review-pin-tag {
  width: 20px; height: 20px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.review-pin-tag.sev-high { background: #dc2626; }
.review-pin-tag.sev-medium { background: #f59e0b; }
.review-pin-tag.sev-low { background: #2563eb; }
.review-sev-badge { font-size: 11px; font-weight: 600; }
.review-sev-badge.sev-high { color: #dc2626; }
.review-sev-badge.sev-medium { color: #d97706; }
.review-sev-badge.sev-low { color: #2563eb; }
.review-status-done { font-size: 11px; color: #16a34a; font-weight: 600; }
.review-card-del {
  margin-left: auto;
  appearance: none; border: none; background: transparent;
  color: var(--ink-soft, #94a3b8); cursor: pointer; font-size: 13px;
  /* 覆盖全局 button { min-height:38px; padding:0 18px }，否则被撑成宽矩形 */
  width: auto; min-height: 0; padding: 0; box-shadow: none;
}
.review-card-del:hover { color: #dc2626; }
.review-card-comment { display: block; min-width: 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.review-card-meta { font-size: 11px; color: var(--ink-soft, #94a3b8); }
.review-card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* 窄侧栏内允许动作按钮换行，避免挤压或盖住批注正文 */
.review-card-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.review-card-actions > .ghost-button,
.review-card-actions > .review-upload-btn,
/* 「保存批注」无 class，会吃全局 button{width:100%;min-height:38px}被撑成整行，导致和「取消」上下堆成两排；
   纳入同一缩小规则，让它与「取消」一样小、并排成一行（仍保留全局的主色底色）。 */
.review-card-actions > [data-review-draft-save] {
  padding: 4px 6px;
  font-size: 11px;
  min-height: 26px;
  white-space: nowrap;
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  text-align: center;
  justify-content: center;
}
.review-draft-comment {
  width: 100%; resize: vertical; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; font-size: 13px; font-family: inherit;
}
.review-shots { display: flex; flex-wrap: wrap; gap: 6px; }
.review-shot { position: relative; }
.review-shot img {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in;
}
.review-shot-del {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  border: none; background: #dc2626; color: #fff;
  font-size: 10px; cursor: pointer; line-height: 1;
  /* 覆盖全局 button { min-height:38px; padding:0 18px } —— 否则会被撑成 54×38px 的大红块，把整张截图盖住 */
  min-height: 0; padding: 0; box-sizing: border-box; box-shadow: none;
  display: flex; align-items: center; justify-content: center;
}
.review-upload-btn {
  display: inline-flex; align-items: center;
  font-size: 12px; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--line); cursor: pointer; background: var(--surface-soft, #f1f5f9);
}
.review-upload-btn:hover { border-color: var(--accent, #2563eb); }
.review-loading { color: var(--ink-soft, #94a3b8); }
.review-card { cursor: default; }
.review-card[data-card] { cursor: pointer; }
.review-paste-hint { font-size: 11px; color: #0369a1; }
.review-card-draft .review-paste-hint { color: var(--ink-soft, #94a3b8); }

@media (max-width: 1100px) {
  .review-root {
    height: auto;
  }
  .review-main {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(180px, auto);
  }
}

/* CAD / PDF 两层入口标签（用独立类名，避免被 .prototype-workflow .subsection-tabs 的隐藏规则影响） */
.prototype-kind-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px auto 18px;
}

.prototype-kind-tab {
  padding: 8px 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--muted);
  box-shadow: none;
  font-size: 14px;
  cursor: pointer;
}

.prototype-kind-tab:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.prototype-kind-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* 「转 Word」按钮仅在 PDF 模式显示（非 PDF 时隐藏） */
.prototype-secondary-card.is-hidden {
  display: none;
}

/* PDF 专用选项（如"文字页按图纸渲染"）仅 PDF 模式显示 */
.pdf-only-option {
  justify-content: center;
  margin: 4px auto 10px;
}

.pdf-only-option.is-hidden {
  display: none;
}

/* PDF 页面类型明细 */
.pdf-method-detail {
  margin-top: 8px;
  line-height: 1.6;
}

/* PDF 直接翻译弹框里的译文输出格式选择（PDF / Word） */
.pdf-output-format-options {
  display: inline-flex;
  gap: 16px;
}

.pdf-output-format-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* 任务详情：用译好的 Excel 出图 */
.detail-import-excel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.detail-import-excel .actions {
  align-items: center;
  gap: 10px;
}

.detail-file-pick {
  cursor: pointer;
}

/* PDF 模式下上传区的支持格式提示（覆盖 CAD 的 .dwg/.dxf/.zip 文案） */
#workflowModule.is-pdf-source .prototype-upload-form .upload-dropzone .form-card-head p::after {
  content: ".pdf   .zip";
}

/* =========================================================
   手机适配（≤600px）
   覆盖范围：提交新任务、查进度/任务列表、任务详情、下载产物、参考稿上传、
   句对查看、修改重跑等。「图纸校对预览」不做手机化（小屏看 A3/A0 图意义不大）。
   ========================================================= */
@media (max-width: 600px) {
  /* 主体边距收紧、字号略小 */
  body { font-size: 14px; }
  .topbar, .module-tabs, .subsection-tabs { padding-left: 10px; padding-right: 10px; }
  main, .module-section { padding: 10px !important; }

  /* 弹窗：抽屉式右侧侧滑改为全屏（手机屏窄，侧滑显示不下） */
  .detail-panel, .profile-panel {
    position: fixed;
    top: 8px; right: 8px; bottom: 8px; left: 8px;
    width: auto; height: auto;
    border-radius: 12px;
    animation: none;
  }
  #detailModal .detail-panel--wide { width: auto; }
  .help-panel-body { padding-right: 0; }

  /* 详情页双栏 → 单列 */
  .detail-columns { grid-template-columns: 1fr !important; gap: 12px; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .detail-grid > div { padding: 6px 8px; font-size: 12px; }

  /* 历史任务列表：手机上转为字段卡片，避免整页横向拖动 */
  .material-history-list {
    display: grid;
    gap: 10px;
    border: 0;
    background: transparent;
  }
  .mh-head { display: none; }
  .mh-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid #e6eaf0;
    border-radius: 12px;
    background: #fff;
    /* 手机端竖排卡片，复位桌面端的最小宽度，避免出现横向滚动条 */
    min-width: 0;
  }
  /* 手机端整个列表也不需要横向滚动 */
  .material-history-list { overflow-x: visible; }
  .mh-main { min-width: 0; }
  .mh-name { font-size: 13.5px; line-height: 1.4; }
  .mh-arrow { display: none; }
  .mh-row > [data-label] {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-width: 0;
  }
  .mh-row > [data-label]::before {
    content: attr(data-label);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 650;
  }
  .mh-notes-text {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .mh-downloads,
  .mh-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    white-space: normal;
  }
  .mh-downloads .action-link,
  .mh-actions .action-button {
    min-height: 32px;
  }
  .history-pager {
    display: grid;
    justify-items: stretch;
  }
  .history-pager > div {
    justify-content: space-between;
  }

  /* 任务中心筛选表单：手机上单列堆叠，筛选项两列 */
  #historyFilterForm { grid-template-columns: 1fr; }
  #historyFilterForm .grid-3 { grid-template-columns: 1fr 1fr; }
  #historyFilterForm .toolbar { grid-column: 1; }

  /* 通用：两列网格在手机上拍成单列；按钮/操作排堆叠 */
  .grid.grid-2 { grid-template-columns: 1fr !important; }
  .actions { flex-wrap: wrap; gap: 8px; }
  .actions .action-link, .actions .action-button, .actions button { width: 100%; justify-content: center; }
  .detail-rerun-actions button { width: 100%; }

  /* 翻译/PDF 排版配置弹框：全屏式，内部表单单列 */
  .material-modal {
    width: calc(100vw - 16px) !important;
    max-width: none !important;
    max-height: calc(100vh - 16px) !important;
    border-radius: 12px;
    inset: auto !important;
  }
  .material-modal-body { padding: 14px; }
  .material-modal .grid.grid-2,
  .material-modal .detail-export-editor { grid-template-columns: 1fr !important; }
  .pdf-output-format-options { flex-wrap: wrap; }

  /* 句对详情弹窗里的表格：横向滚动，行内 padding 收紧 */
  .translation-detail-modal .material-table { overflow-x: auto; }
  .translation-detail-modal .material-table table { min-width: 560px; }
  .translation-detail-modal .material-table th,
  .translation-detail-modal .material-table td { padding: 8px 10px; font-size: 12px; }
  .translation-detail-modal .col-sel,
  .translation-detail-modal .col-idx,
  .translation-detail-modal .col-src,
  .translation-detail-modal .col-risk { display: none; }   /* 手机隐藏次要列 */

  /* 任务列表卡片：紧凑 */
  .mh-item { padding: 10px; }
  .mh-meta { flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }

  /* 触摸目标：按钮最小高度 36 */
  button, .action-link, .action-button, .ghost-button {
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  /* 文本输入/下拉防 iOS 自动缩放：字号 ≥16px */
  input[type="text"], input[type="search"], input[type="password"],
  input[type="email"], input[type="number"], select, textarea {
    font-size: 16px;
  }

  /* 表单：单列 */
  form .form-row, form .form-grid { grid-template-columns: 1fr !important; }

  /* 任务详情 PDF 排版编辑器：单列 */
  .detail-export-editor { grid-template-columns: 1fr !important; }

  /* 顶部状态条：换行不挤 */
  .status-row { flex-wrap: wrap; gap: 6px; }

  /* 隐藏图纸校对入口（手机看图体验差，避免误用） */
  .detail-tab[data-detail-tab="review"] { display: none; }
}

/* ===== 余额与充值（walletModule） ===== */
.wallet-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.wallet-card { background: #fff; border: 1px solid #e6e1d5; border-radius: 14px; padding: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.wallet-card-label { display: block; font-size: 13px; color: #7a847f; }
.wallet-card-value { display: block; margin-top: 8px; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-card-value.amber { color: #a8631a; }
.wallet-admin { margin: 8px 0 24px; border: 1px solid #e6e1d5; border-radius: 12px; padding: 8px 16px; background: #fbfaf6; }
.wallet-admin > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.wallet-admin-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding: 8px 0; }
.wallet-admin-form label { display: flex; flex-direction: column; font-size: 13px; color: #46514d; gap: 5px; }
.wallet-admin-form input, .wallet-admin-form select { padding: 8px 10px; border: 1px solid #c2bba9; border-radius: 8px; font-size: 14px; min-width: 150px; }
.wallet-admin-hint { font-size: 12px; color: #7a847f; margin: 4px 0 8px; }
#billingAdminModule.is-readonly input:disabled,
#billingAdminModule.is-readonly select:disabled {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
  cursor: not-allowed;
}
.wallet-ledger h3 { margin: 0 0 12px; font-size: 16px; }
.wallet-ledger-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wallet-ledger-table th { text-align: left; color: #7a847f; font-weight: 500; padding: 9px 12px; border-bottom: 1px solid #e6e1d5; background: #f3f0e8; }
.wallet-ledger-table td { padding: 10px 12px; border-bottom: 1px solid #eee7d8; }
.wallet-ledger-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.wallet-ledger-table .wallet-in { color: #2f7d44; }
.wallet-ledger-table .wallet-out { color: #a32f2a; }
.wallet-empty { text-align: center; color: #9aa29d; padding: 22px 0; }

/* ===== 计费配置（billingAdminModule） ===== */
.billing-admin-version { font-size: 13px; color: #7a847f; }
.billing-admin-version strong { color: #0c6b62; font-variant-numeric: tabular-nums; }
.billing-admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 16px; }
.billing-admin-grid h3 { font-size: 15px; margin: 18px 0 10px; }
.billing-config-col h3:first-child, .billing-side-col h3:first-child { margin-top: 0; }
/* 与「任务清单」的 .history-table 同款：外层 .history-table-shell 提供圆角描边+阴影，
   表头灰底、行 hover、末行无分隔线。 */
.billing-config-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.billing-config-table th,
.billing-config-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.billing-config-table th { background: #f5f5f4; color: var(--muted); font-size: 12px; font-weight: 800; }
.billing-config-table tbody tr:hover { background: #fafcff; }
.billing-config-table tbody tr:last-child td { border-bottom: 0; }
.billing-config-table .num { text-align: right; }
.billing-config-table input[type="text"] { padding: 5px 8px; border: 1px solid #c2bba9; border-radius: 7px; font-size: 13px; }
.billing-fields { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.billing-fields label { display: flex; flex-direction: column; font-size: 13px; color: #46514d; gap: 5px; }
/* 一列内纵向堆叠：让「OCR 启用」勾选落在「OCR 每页」正下方，不再被 flex 挤到旁边换行。 */
.billing-field-col { display: flex; flex-direction: column; gap: 8px; }
.billing-fields input, .billing-fields select { padding: 7px 9px; border: 1px solid #c2bba9; border-radius: 8px; font-size: 14px; min-width: 120px; }
.billing-fields input[type="checkbox"] { min-width: 0; align-self: flex-start; }
.billing-publish { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.billing-publish input { flex: 1; min-width: 220px; padding: 9px 11px; border: 1px solid #c2bba9; border-radius: 8px; }
.billing-admin-hint { font-size: 12px; color: #7a847f; }
.billing-sim-result { margin: 12px 0 8px; padding: 12px; border: 1px solid #e6e1d5; border-radius: 10px; background: #fbfaf6; min-height: 20px; font-size: 13px; }
.billing-sim-total { font-size: 18px; font-weight: 600; color: #a8631a; margin-bottom: 8px; }
.billing-sim-total span { font-size: 12px; color: #7a847f; font-weight: 400; }
.billing-sim-row { display: flex; justify-content: space-between; padding: 3px 0; color: #46514d; }
.billing-audit { max-height: 320px; overflow: auto; }

.low-balance-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
  border: 1px solid #e7b957;
  background: #fff8e5;
  color: #5d4211;
  border-radius: 8px;
  font-size: 13px;
}
.low-balance-notice span { flex: 1; }

.role-panel-head,
.role-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.role-panel-head { justify-content: space-between; margin-bottom: 10px; }
.role-actions { margin-top: 10px; }
.role-matrix-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 8px; }
.role-matrix th,
.role-matrix td { min-width: 92px; text-align: center; }
.role-matrix th:first-child,
.role-matrix td:first-child { min-width: 190px; text-align: left; }
.role-matrix input[type="checkbox"] { width: 16px; height: 16px; }
.detail-billing-block { margin-top: 12px; }
.detail-billing-block h3 { margin: 0 0 10px; font-size: 14px; }
.detail-billing-table { margin-top: 10px; font-size: 12px; }
.detail-billing-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.detail-billing-actions .hint { margin: 0; }
.register-form.hidden,
.notify-panel.hidden {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 120;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(380px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head strong {
  font-size: 15px;
}

.modal-card form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 10px;
}

.modal-card form input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.login-register-switch {
  min-height: 42px;
  margin-top: 12px;
  width: 100%;
  font-size: 14px;
}
.login-actions .login-register-switch {
  margin-top: 0;
  width: auto;
}

/* 登录态标题（欢迎回来 / 登录控制台 / 版本号） */
.login-title {
  text-align: center;
  margin-top: 12px;
}
.login-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}
.login-title p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
}
.login-version {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
}

/* 登录卡片底部：免费注册 / 返回首页 + 条款 */
.login-foot {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin-top: 14px;
}
.login-foot a {
  color: var(--accent-purple);
  text-decoration: none;
}
.login-foot a[data-auth-view] {
  color: #94a3b8;
}
.login-foot a:hover {
  text-decoration: underline;
}
.login-legal {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
.login-legal a {
  color: inherit;
  text-decoration: none;
}
.login-legal a:hover {
  color: #64748b;
  text-decoration: underline;
}
.register-agree a {
  color: var(--accent-purple);
  text-decoration: none;
}
.register-agree a:hover {
  text-decoration: underline;
}

/* 合规条款弹窗正文 */
.legal-card {
  width: min(720px, calc(100vw - 32px));
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.legal-body {
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 13px;
  color: #475569;
  padding-right: 4px;
}

/* 注册态标题（图2：创建您的账号 / 注册即开通免费试用版） */
.login-header-extra {
  text-align: center;
  margin-top: 12px;
}
.login-header-extra.hidden {
  display: none;
}
.login-header-extra h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}
.login-header-extra p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
}

/* 注册表单：同意条款 + 底部去登录 */
.register-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #64748b;
  cursor: pointer;
}
.register-agree input {
  margin-top: 3px;
  flex: none;
}
/* 空的提示行（无报错时）不占位，避免按钮和下方文字之间多出一截空白 */
.login-card .login-hint:empty {
  display: none;
}
.register-foot {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}
.register-foot a {
  color: var(--accent-purple);
  text-decoration: none;
}
.register-foot a:hover {
  text-decoration: underline;
}

.sms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.notify-panel {
  position: fixed;
  top: 70px;
  right: 24px;
  width: min(360px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  z-index: 80;
}

.notify-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.notify-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
}

.notify-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 68px;
  padding: 10px;
  text-align: left;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.notify-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.notify-item.warn {
  border-color: #d89c1d;
  background: #fff8e5;
}

.notify-item.error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.notify-item.ok {
  border-color: var(--success);
  background: var(--success-soft);
}

.notify-item.is-read {
  opacity: 0.62;
}
.billing-audit-row { padding: 9px 0; border-bottom: 1px dashed #e6e1d5; font-size: 12.5px; }
.billing-audit-field { font-weight: 600; color: #1b2422; }
.billing-audit-change { font-family: ui-monospace, Menlo, monospace; color: #46514d; }
.billing-audit-meta { color: #9aa29d; font-size: 11.5px; }
.billing-config-table .billing-audit-time { color: #9aa29d; white-space: nowrap; }
.billing-config-table .billing-audit-summary { min-width: 360px; white-space: normal; line-height: 1.55; }
@media (max-width: 1080px) { .billing-admin-grid { grid-template-columns: 1fr; } }

/* ===== 在线充值（walletModule） ===== */
.wallet-recharge { margin: 8px 0 18px; padding: 16px; border: 1px solid #e6e1d5; border-radius: 12px; background: #fbfaf6; }
.wallet-recharge h3 { margin: 0 0 12px; font-size: 15px; }
.recharge-tiers { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.recharge-tiers button { padding: 10px 18px; border: 1.5px solid #c2bba9; border-radius: 10px; background: #fff; cursor: pointer; font-size: 15px; font-variant-numeric: tabular-nums; }
.recharge-tiers button.on { border-color: #0c6b62; background: #dceae7; color: #08534c; font-weight: 600; }
.recharge-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.recharge-row input, .recharge-row select { padding: 9px 11px; border: 1px solid #c2bba9; border-radius: 8px; font-size: 14px; }
.recharge-row input { width: 160px; }
.recharge-panel { margin-top: 14px; }
.recharge-order { display: flex; gap: 18px; align-items: center; padding: 14px; border: 1px solid #e6e1d5; border-radius: 10px; background: #fff; }
.recharge-qr { width: 120px; height: 120px; flex: none; border-radius: 8px; background: repeating-conic-gradient(#1b2422 0% 25%, #fff 0% 50%) 0 0 / 12px 12px; }
.recharge-info { font-size: 13px; line-height: 1.9; }
.recharge-info code { background: #f3f0e8; padding: 1px 6px; border-radius: 5px; }
.recharge-status { color: #7a847f; margin: 6px 0; }

/* 左侧导航：桌面端始终左右结构，仅在小屏(≤700px)才把侧栏收到顶部并横向滚动 */
@media (max-width: 980px) {
  .workspace-shell { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .workspace-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
}

/* ============================================================
   覆盖"顶部导航改版块"(≈2571 行)：恢复左侧竖向导航 + 青墨主题。
   放在文件末尾，靠源码顺序覆盖前面的同名选择器。
   ============================================================ */
:root {
  --bg: #f4f1ea; --bg-accent: #ece8df; --paper: #fbfaf6; --paper-soft: #f1ede4;
  --ink: #1b2422; --muted: #5c655f; --line: #ddd7c9; --line-strong: #c2bba9;
  --primary: #0c6b62; --primary-dark: #08534c; --primary-soft: #dceae7;
  --accent: #a8631a; --accent-dark: #8f5113; --accent-hover: #8f5113; --accent-soft: #f3e6d2;
  --success: #2f7d44; --success-soft: #dcebe0; --warning: #a8631a; --warning-soft: #f3e6d2;
  --danger: #a32f2a; --danger-soft: #f0dcd8;
  --sidebar: linear-gradient(180deg, #222b29 0%, #141b19 100%);
  --sidebar-border: rgba(255, 255, 255, 0.08);
}
body {
  font-family: "IBM Plex Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 26px 26px,
    var(--bg);
  background-blend-mode: soft-light, soft-light, normal;
}
.workspace-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 30;
  display: flex; flex-direction: column; align-items: stretch; gap: 18px;
  padding: 20px 14px 16px; background: var(--sidebar);
  border-bottom: 0; box-shadow: inset -1px 0 0 var(--sidebar-border);
}
.brand-card {
  flex-direction: row; align-items: center; gap: 12px; min-width: 0;
  padding: 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-badge { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #0e7a70, #08534c); color: #eafffb; font-size: 14px; box-shadow: none; }
.brand-card strong { color: #f3f1ea; font-size: 15px; }
.brand-card p { display: block; color: rgba(255, 255, 255, 0.6); margin: 3px 0 0; }
.sidebar-footer { display: grid; margin-top: auto; }
.nav-dot { display: block; }
.sidebar-nav { display: grid; grid-auto-flow: row; gap: 6px; flex: none; align-items: stretch; }
.nav-item {
  width: 100%; height: auto; min-height: 0; padding: 10px 14px; border-radius: 10px;
  border: 1px solid transparent; color: rgba(255, 255, 255, 0.8);
  font-weight: 500; justify-content: flex-start;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.08); transform: none; }
.nav-item.is-active { color: #eafffb; background: linear-gradient(100deg, #123d39, #0e302c); box-shadow: none; }
.nav-item.is-active::after { display: none; }
@media (max-width: 700px) {
  .workspace-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar-nav { grid-auto-flow: column; grid-auto-columns: max-content; }
}

/* ===== 在线客服 / 帮助（supportModule） ===== */
.support-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; margin-top: 16px; }
.support-faq h3, .support-contact h3 { font-size: 15px; margin: 0 0 12px; }
.support-faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.support-faq summary { cursor: pointer; font-weight: 500; color: var(--ink); }
.support-faq details p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.support-contact { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-soft); }
.support-qr { width: 150px; height: 150px; border-radius: 10px; margin: 0 auto 12px;
  background: repeating-conic-gradient(#1b2422 0% 25%, #fff 0% 50%) 0 0 / 14px 14px; border: 1px solid var(--line); }
@media (max-width: 980px) { .support-grid { grid-template-columns: 1fr; } }

/* ===== 总览首页（billingHomeModule） ===== */
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; }
.home-stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); }
.home-stat-k { font-size: 13px; color: var(--muted); }
.home-stat-v { display: block; margin: 8px 0 4px; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--primary-dark); }
.home-stat-v.amber { color: var(--accent); }
.home-stat-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.home-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; }
.home-recent { padding: 4px 0 0; }
.home-recent .panel-header { padding: 14px 16px 6px; }
.home-tag { display: inline-block; margin-top: 3px; font-size: 11px; color: var(--muted); background: var(--bg-accent); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; }
@media (max-width: 980px) { .home-stats { grid-template-columns: 1fr; } .home-grid { grid-template-columns: 1fr; } }

/* 状态徽章（总览 / 流水共用，青墨配色） */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.b-ok { color: var(--success); background: var(--success-soft); }
.badge.b-run { color: var(--primary-dark); background: var(--primary-soft); }
.badge.b-wait { color: var(--accent); background: var(--accent-soft); }
.badge.b-err { color: var(--danger); background: var(--danger-soft); }
.badge.b-mute { color: var(--muted); background: var(--bg-accent); }
.badge.b-info { color: #2f5d8c; background: #dde6f0; }

/* ===== 充值中心两栏 + 档位/渠道（rechargeModule） ===== */
.recharge-2col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: 16px; align-items: start; }
.recharge-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.recharge-tiers button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 10px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--paper); cursor: pointer; }
.recharge-tiers button.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.recharge-tiers .tier-pay { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.recharge-tiers .tier-bonus { font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; }
.recharge-tiers .tier-ribbon { position: absolute; top: -1px; right: -1px; background: var(--accent); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 0 12px 0 9px; }
.recharge-custom { display: block; margin-top: 14px; font-size: 13px; color: var(--muted); }
.recharge-custom input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; font-size: 14px; font-variant-numeric: tabular-nums; }
.recharge-channels { display: inline-flex; gap: 4px; background: var(--bg-accent); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.recharge-channels button { border: 0; background: transparent; padding: 8px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); }
.recharge-channels button.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }
.recharge-pay { text-align: center; }
.recharge-status { color: var(--accent); margin: 12px 0; font-size: 13px; }

.users-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px !important;
}
.users-list-head > div { min-width: 0; }
.user-add-btn {
  width: auto !important;
  flex: none;
  padding: 8px 16px !important;
  min-height: 34px;
  box-shadow: var(--shadow-sm) !important;
}
.users-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
}
.users-filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.users-filter-bar input,
.users-filter-bar select {
  height: 32px;
  min-width: 132px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 9px;
  font-size: 13px;
}
.users-filter-bar input[type="search"] { min-width: 220px; }
.users-filter-bar .ghost-button { padding: 7px 12px; }
.user-role-text { color: var(--ink); font-weight: 400; }
.user-remark-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
/* ===== 流水分类 Tab（walletModule） ===== */
.wallet-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.wallet-module-head > div { min-width: 0; }
.wallet-module-head h2 { margin-bottom: 8px; }
.wallet-module-head p { margin: 0; }
.wallet-refresh-btn { flex: none; align-self: flex-start; margin-top: 0; }
.ledger-tabs { display: inline-flex; gap: 4px; background: var(--bg-accent); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.ledger-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); }
.ledger-tabs button.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }
.wallet-ledger > .panel-header {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}
.wallet-ledger > .panel-header > div { flex: none; }
.wallet-ledger > .panel-header .ledger-tabs {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
}
.wallet-ledger > .panel-header .ledger-tabs button {
  position: relative;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0 0 9px;
  min-height: 32px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.wallet-ledger > .panel-header .ledger-tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
}
.wallet-ledger > .panel-header .ledger-tabs button.on { color: var(--primary-dark); }
.wallet-ledger > .panel-header .ledger-tabs button.on::after { background: var(--primary); }
.wallet-ledger-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
}
.wallet-charge-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
}
.wallet-charge-filter select {
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 9px;
  font-size: 13px;
}
.wallet-filter-clear { padding: 7px 12px; }
@media (max-width: 980px) { .recharge-2col { grid-template-columns: 1fr; } }

/* ===== 主流程三栏（workflowModule · 上传/配置/费用） ===== */
.wf-3col { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 16px; align-items: start; margin-top: 12px; }
.wf-col { min-width: 0; }
.wf-step { font-family: var(--mono); font-size: 12px; color: var(--primary-dark); margin: 0 0 10px; }
.wf-col .form-card { margin: 0 0 12px; }
/* 窄列里把内嵌的 grid-3/grid-2 压成单列，避免拥挤 */
.wf-col-cfg .grid-3, .wf-col-cfg .grid-2 { grid-template-columns: 1fr; }
.wf-col-cfg .cad-export-settings .grid-3 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .wf-3col { grid-template-columns: 1fr; } .wf-col-cfg .cad-export-settings .grid-3 { grid-template-columns: 1fr; } }

/* ===== 主流程功能分段 + 三栏内项（workflowModule JS 生成） ===== */
.wf-fnlabel { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.wf-fnbar { display: flex; flex-wrap: wrap; gap: 4px; background: var(--bg-accent); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.wf-fnbar button { border: 0; background: transparent; padding: 8px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); }
.wf-fnbar button.is-active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.wf-fnbar button.is-hidden { display: none; }
.wf-fn-hint { margin: 8px 0 14px; }
.wf-col-cfg .prototype-language-row { grid-template-columns: 1fr 1fr; display: grid; gap: 0 12px; }
.wf-morecfg { width: 100%; margin-top: 6px; }
.wf-fee { margin-bottom: 12px; }
.prototype-workflow .wf-3col { margin-top: 4px; }

.wf-model-select-field {
  display: block;
}
.wf-model-select-field select {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 6px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}
/* 功能分段强制横排（覆盖表单里 button{width:100%}），+ 翻译模型分段 / 图纸范围 */
.wf-fnbar { flex-wrap: wrap; }
.wf-fnbar button { width: auto; flex: 0 0 auto; }
.wf-subfield { margin-bottom: 14px; }
.wf-seg { display: flex; gap: 4px; background: var(--bg-accent); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.wf-seg button { width: auto; flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.wf-seg button.is-active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.wf-rangefield { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.wf-rangefield input { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; font-size: 14px; }

/* 三栏：三列都做成等高白色卡片、左对齐（覆盖 prototype-workflow 的居中/无框） */
.prototype-workflow .wf-3col { align-items: stretch; }
.prototype-workflow .wf-col {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; text-align: left; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.prototype-workflow .wf-col > * { text-align: left; }
.prototype-workflow .wf-col .form-card { border: 0; background: transparent; box-shadow: none; padding: 0; margin: 0 0 10px; }
.prototype-workflow .wf-col .wf-step { text-align: left; margin-top: 0; }
.prototype-workflow .wf-col .toolbar { display: block; margin-top: auto; padding-top: 14px; }
.prototype-workflow .wf-col .toolbar button { width: 100%; }
.prototype-workflow .wf-fnbar, .prototype-workflow .wf-fn-hint, .prototype-workflow .wf-seg,
.prototype-workflow .prototype-language-row, .prototype-workflow .wf-rangefield, .prototype-workflow .wf-fnlabel { text-align: left; }

/* 主流程整体靠左、不居中、不限宽（覆盖旧"居中漏斗"样式） */
.prototype-workflow { max-width: none !important; margin: 0 !important; text-align: left !important; }
.prototype-workflow-eyebrow,
.prototype-workflow > h2,
.prototype-workflow > .section-subtitle {
  text-align: left !important; margin-left: 0 !important; margin-right: 0 !important; max-width: none !important;
}
.prototype-workflow .prototype-kind-tabs { justify-content: flex-start; margin: 0 0 16px !important; max-width: 520px; }
.prototype-workflow .prototype-language-row { margin: 0 !important; max-width: none !important; }
.prototype-workflow .wf-col .upload-dropzone { margin: 0 !important; width: 100%; }
.prototype-workflow .workflow-notes-field { margin-top: 8px; }
.prototype-workflow .workflow-notes-field textarea {
  min-height: 96px;
  line-height: 1.45;
}
.prototype-workflow .wf-col .toolbar { margin: auto 0 0 !important; max-width: none !important; width: 100%; }
.prototype-workflow .wf-col .toolbar button[type="submit"] { width: 100% !important; }

/* 计费配置：头部动作条 + 配置铺满 + 计费试算弹窗 */
.billing-admin-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.billing-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.billing-section-head h3 { margin: 0 0 10px !important; }
.pricing-model-add {
  width: auto !important;
  flex: none;
  padding: 7px 12px !important;
  margin-bottom: 8px;
}
.pricing-model-table input[type="text"] {
  width: 100%;
  min-width: 90px;
  box-sizing: border-box;
}
.pricing-model-table td:nth-child(2) input[type="text"] {
  max-width: 90px;
  text-align: right;
}
.pricing-row-btn {
  width: auto !important;
  padding: 6px 10px !important;
  white-space: nowrap;
}
/* 发布条：改价原因（多行）占满左侧，发布按钮收成普通尺寸贴右下。 */
.billing-publish-bar { display: flex; align-items: flex-end; gap: 12px; margin: 4px 0 10px; }
.billing-publish-bar .billing-reason {
  flex: 1; min-width: 0; min-height: 52px; resize: vertical;
  padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px;
}
.billing-publish-bar .primary-button { width: auto; flex: none; align-self: stretch; padding: 0 22px; }
.billing-config-full { margin-top: 8px; }
.billing-config-full h3 { font-size: 15px; margin: 0 0 10px; }
.sim-scrim { position: fixed; inset: 0; background: rgba(27,36,34,.42); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: .18s; z-index: 70; }
.sim-scrim.open { opacity: 1; pointer-events: auto; }
.sim-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.97); opacity: 0; pointer-events: none; transition: .18s; z-index: 71;
  width: 460px; max-width: 92vw; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.sim-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%) scale(1); }
.sim-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sim-modal-head strong { font-size: 16px; }
.sim-modal-body { padding: 18px 20px; }

/* 经营控制台风险告警行 */
.note-line { margin: 0 0 8px; font-size: 13px; padding: 8px 11px; border-radius: 8px; }
.note-line.ok { color: var(--success); background: var(--success-soft); }
.note-line.warn { color: var(--accent); background: var(--accent-soft); }
.note-line.err { color: var(--danger); background: var(--danger-soft); }

/* 充值中心不铺满：限制两栏最大宽度，左对齐 */
#rechargeModule .recharge-2col { max-width: 960px; }

/* 主流程不铺满：三栏限制最大宽度、左对齐（与充值中心一致） */
.prototype-workflow .wf-3col { max-width: 1080px; margin-left: 0; margin-right: 0; }

/* 计费配置不铺满 + 功能处理费/OCR 两卡 */
#billingAdminModule .billing-config-full { max-width: 1180px; }
.billing-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.billing-subcard { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; background: var(--paper); }
.billing-subcard h4 { margin: 0 0 12px; font-size: 14px; }
.billing-subcard .billing-fields { gap: 12px 18px; }
.billing-subcard .billing-fields label { min-width: 130px; }
.billing-check { flex-direction: row !important; align-items: center; gap: 8px !important; }
@media (max-width: 980px) { .billing-two { grid-template-columns: 1fr; } }

/* 提交任务后弹出的醒目提示（顶部居中，几秒后自动消失），避免客户以为没反应 */
.app-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -16px);
  z-index: 9999;
  max-width: min(92vw, 520px);
  padding: 13px 22px;
  border-radius: var(--radius-md, 9px);
  background: var(--primary, #0c6b62);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 12px 30px -10px rgba(12, 107, 98, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   AlibabaRobotWeb 设计系统对齐（登录界面 / 界面色彩 / 表格样式）
   置于文件末尾以确保层叠覆盖旧主题。参考：frontend/src/index.css
   ============================================================ */

/* ---------- 全局背景：清新柔和径向渐变 ---------- */
body {
  background:
    radial-gradient(circle at top right, #e2f1fc, #f0fdf4 35%, #f8fafc 75%) fixed;
}

/* ---------- 玻璃面板 ---------- */
.glass-panel {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.08);
}

@keyframes ar-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.fade-in { animation: ar-slide-up 0.4s ease; }

/* ---------- 未登录视图：默认落地大页面，点登录切到登录卡片 ---------- */
.login-shell {
  display: block;
  min-height: 100vh;
  background: radial-gradient(circle at top right, #e2f1fc, #f0fdf4 35%, #f8fafc 75%);
}
/* 默认：展示落地页、隐藏登录卡片 */
.login-shell .login-view { display: none; }
.login-shell.show-login #authLanding { display: none; }
.login-shell.show-login .login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

/* ---------- 落地大页面（对齐参考站 landing） ---------- */
.landing-page {
  min-height: 100vh;
  width: 100%;
  padding: 0 clamp(20px, 6vw, 90px) 3rem;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(13, 148, 136, 0.10), transparent),
    radial-gradient(900px 400px at 0% 10%, rgba(2, 132, 199, 0.08), transparent);
}
.landing-nav,
.landing-hero,
.landing-features,
.landing-steps,
.landing-footer {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(248, 250, 252, 0));
  backdrop-filter: blur(6px);
}
.landing-nav-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  box-shadow: var(--primary-glow);
  flex: none;
}
.logo-text {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.3px;
  color: var(--ink);
}
.landing-ver-pill {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid rgba(13, 148, 136, 0.28);
}

/* 通用按钮（参考站 .btn / .btn-primary / .btn-secondary） */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 0;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn svg { flex: none; }
.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
  filter: none;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  box-shadow: none;
}
.btn-secondary:hover {
  background: #ffffff;
  border-color: #94a3b8;
  transform: none;
  filter: none;
}

/* Hero */
.landing-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0 3.5rem;
}
.landing-hero-text h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.18;
  letter-spacing: 0;
  margin: 0 0 1rem;
  color: var(--ink);
}
.landing-hero-text p {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.7;
  margin: 0;
}
.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.6rem;
}
.landing-hero-actions .btn { padding: 0.8rem 1.6rem; }
.landing-hero-img {
  display: flex;
  justify-content: center;
}
.landing-hero-img .login-cad-preview {
  width: 100%;
  max-width: 460px;
}

/* 功能卡片 */
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-bottom: 3.5rem;
}
.landing-feature-card { padding: 1.7rem; }
.landing-feature-card h3 { margin: 1rem 0 0.5rem; color: var(--ink); font-size: 1.1rem; }
.landing-feature-card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.65; }
.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* 使用流程 */
.landing-steps { margin-bottom: 3rem; }
.landing-steps h2 { text-align: center; color: var(--ink); font-size: 1.5rem; margin: 0 0 0.4rem; }
.landing-steps-sub { text-align: center; color: var(--muted); margin: 0 0 1.6rem; font-size: 0.95rem; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.step-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem 1.4rem;
}
.step-card h3 { margin: 0; color: var(--ink); font-size: 1.05rem; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.step-no {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: var(--primary-glow);
}

.landing-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  line-height: 1.7;
}

/* 登录卡片上的「返回首页」 */
.login-back {
  align-self: flex-start;
  min-height: 0;
  margin-bottom: 0.4rem;
  padding: 0.3rem 0;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.login-back:hover { color: var(--primary-dark); background: transparent; transform: none; filter: none; }

/* 落地页响应式：窄屏单列、不重叠 */
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; }
  .landing-hero-img { order: -1; }
  .landing-features { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .steps-grid { grid-template-columns: 1fr; }
  .landing-nav { flex-wrap: wrap; }
  .landing-hero-actions .btn { flex: 1 1 auto; }
}

/* ---------- 登录卡片 ---------- */
.login-card {
  width: 100%;
  max-width: 420px;
  margin: 0;
  display: block;
  padding: 2.4rem 2.2rem;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 40px 0 rgba(148, 163, 184, 0.18);
}
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary-gradient);
  box-shadow: var(--primary-glow);
}
.login-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
}
.login-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.login-card .form-group { margin-bottom: 1.35rem; }
.login-card .form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}
.input-with-icon { position: relative; }
.input-with-icon .input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.login-card .input-field {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 1rem;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--ink);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.login-card .input-field::placeholder { color: #94a3b8; }
.login-card .input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.login-card .login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}
.login-card .login-remember input { accent-color: var(--primary); }
.login-card button[type="submit"],
.login-card .btn-primary {
  width: 100%;
  margin-top: 0.4rem;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--primary-gradient);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 600;
  box-shadow: var(--primary-glow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.login-card button[type="submit"]:hover,
.login-card .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
}
.login-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.2rem;
}
.login-card .login-actions .btn-primary,
.login-card .login-actions .login-register-switch {
  flex: 0 1 148px;
  width: auto;
  min-height: 42px;
  margin-top: 0;
  padding-inline: 1.1rem;
}
.login-card .login-actions .login-register-switch {
  color: var(--ink);
  background: #fff;
  box-shadow: none;
}
.login-card .login-submit.hidden {
  display: none;
}
.login-card .login-hint {
  margin: 1.1rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* ---------- 侧边栏：浅色玻璃（青绿高亮当前项） ---------- */
.sidebar {
  background: rgba(241, 245, 249, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: none;
  border-right: 1px solid var(--line);
}
.brand-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
}
.brand-badge {
  background: var(--primary-gradient);
  box-shadow: var(--primary-glow);
}
.brand-card strong,
.sidebar-note strong { color: var(--ink); }
.brand-card p,
.sidebar-note p { color: var(--muted); }
.nav-item {
  color: var(--muted);
  font-weight: 500;
  border: 1px solid transparent;
}
.nav-item:hover {
  color: var(--ink);
  background: rgba(15, 23, 42, 0.04);
  transform: none;
}
.nav-item.is-active {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid rgba(13, 148, 136, 0.18);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.06);
}
.nav-dot {
  background: rgba(100, 116, 139, 0.4);
  box-shadow: none;
}
.nav-item.is-active .nav-dot {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}
.sidebar-note {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
}
.sidebar-link {
  color: var(--muted);
}
.sidebar-link:hover { color: var(--primary-dark); }

/* ---------- 主操作按钮：青绿→青蓝渐变 ---------- */
button,
.toolbar button {
  background: var(--primary-gradient);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: var(--primary-glow);
}
button:hover,
.toolbar button:hover {
  background: var(--primary-gradient);
  filter: brightness(1.04);
  transform: translateY(-1px);
}

/* ---------- 表格：统一为浅石板表头 + 轻柔悬停（参考 .custom-table） ---------- */
.preview-table,
.history-table-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.preview-table thead th,
.history-table th {
  background: rgba(241, 245, 249, 0.95);
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.preview-table th,
.preview-table td,
.history-table th,
.history-table td {
  border-bottom: 1px solid var(--line);
}
.preview-table tbody tr:hover,
.preview-table tbody tr:hover td,
.history-table tbody tr:hover,
.history-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.75);
}

/* ============================================================
   按钮样式统一（参照 AlibabaRobotWeb 压缩包：
   主操作=青绿→青蓝渐变 / 次要=白底描边 / 危险=红 / 选中标签=青绿高亮）
   置于文件最末，统一覆盖各处历史按钮族的观感。.btn-* 类本身即参考站基线，不重复定义。
   ============================================================ */

/* —— 主操作按钮（青绿→青蓝渐变） —— */
button,
.toolbar button,
.login-card button[type="submit"] {
  min-height: 42px;
  padding: 0.66rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--primary-gradient);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: var(--primary-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
button:hover,
.toolbar button:hover,
.login-card button[type="submit"]:hover {
  background: var(--primary-gradient);
  filter: brightness(1.03);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.42);
}
button:disabled,
button[disabled] {
  opacity: 0.5;
  transform: none;
  filter: none;
  box-shadow: none;
  cursor: not-allowed;
}

/* —— 次要按钮（白底描边，对齐 .btn-secondary） —— */
.ghost-button,
.ghost-button-sm,
.floating-help-trigger,
.help-close,
.hint-reset,
.action-link,
.action-button.action-link:not(.mh-icon-btn),
.module-tab,
.subsection-tab,
.history-pager .pager-btn,
.material-pager .pager-btn {
  min-height: 38px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: none;
}
.ghost-button:hover,
.ghost-button-sm:hover,
.floating-help-trigger:hover,
.help-close:hover,
.hint-reset:hover,
.action-link:hover,
.action-button.action-link:not(.mh-icon-btn):hover,
.module-tab:hover,
.subsection-tab:hover,
.history-pager .pager-btn:hover:not(:disabled),
.material-pager .pager-btn:hover:not(:disabled) {
  background: #ffffff;
  border-color: #94a3b8;
  color: var(--ink);
  transform: none;
  filter: none;
}

/* —— 选中态标签页：青绿描边高亮 —— */
.module-tab.is-active,
.subsection-tab.is-active {
  background: var(--primary-soft);
  border-color: rgba(13, 148, 136, 0.4);
  color: var(--primary-dark);
}

/* —— 危险/删除按钮（红，对齐 .btn-danger） —— */
.tiny-danger-button {
  min-height: 0;
  border: 1px solid rgba(225, 29, 72, 0.25);
  border-radius: var(--radius-md);
  background: rgba(225, 29, 72, 0.08);
  color: #be123c;
  font-weight: 600;
  box-shadow: none;
}
.tiny-danger-button:hover {
  background: rgba(225, 29, 72, 0.16);
  border-color: rgba(225, 29, 72, 0.4);
  color: #be123c;
  transform: none;
  filter: none;
}

/* —— 历史表「操作」列图标按钮：重申方形外观，避免被上面的主/次规则改成胶囊或渐变 —— */
.mh-actions .mh-icon-btn {
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: #475569;
  box-shadow: none;
}
.mh-actions .mh-icon-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}
.mh-actions .mh-icon-btn[data-action="delete-job"] {
  border-color: #fecaca;
  color: #b91c1c;
}
.mh-actions .mh-icon-btn[data-action="delete-job"]:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

/* ============================================================
   Final UI pass - Codex 2026-06-23
   Scope: 主流程 / 历史任务 / 任务详情 / 翻译配置弹窗
   ============================================================ */

/* 通用页签：下划线样式，白底无大块卡片感 */
.prototype-kind-tabs,
.detail-tabs,
.subsection-tabs:not([data-subsection-group-nav="workflow"]) {
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid #e2e8f0;
  background: transparent !important;
  box-shadow: none !important;
}
.prototype-kind-tab,
.detail-tab,
.subsection-tab {
  width: auto !important;
  min-height: 40px !important;
  padding: 0 0 9px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #334155 !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
.prototype-kind-tab.is-active,
.detail-tab.is-active,
.subsection-tab.is-active {
  color: #7c3aed !important;
  border-bottom: 2px solid #7c3aed !important;
}
.prototype-kind-tab:hover,
.detail-tab:hover,
.subsection-tab:hover {
  color: #7c3aed !important;
  transform: none !important;
  filter: none !important;
}
.prototype-workflow [data-subsection-group-nav="workflow"] { display: none !important; }

/* 主流程布局 */
.prototype-workflow {
  max-width: none !important;
  margin: 0 !important;
  text-align: left !important;
}
.prototype-workflow > h2 {
  margin: 0 0 8px !important;
  color: #0f172a !important;
  font-size: 30px !important;
  line-height: 1.2 !important;
}
.prototype-workflow > .section-subtitle {
  margin: 0 0 20px !important;
  color: #475569 !important;
  font-size: 15px !important;
}
.prototype-workflow .prototype-kind-tabs {
  max-width: 520px !important;
  margin: 0 0 18px !important;
}
.prototype-workflow .wf-3col {
  max-width: 1120px !important;
  margin: 18px 0 0 !important;
  display: grid !important;
  grid-template-columns: 270px minmax(390px, 1fr) 270px !important;
  gap: 14px !important;
  align-items: stretch !important;
}
.prototype-workflow .wf-col {
  display: flex !important;
  flex-direction: column !important;
  min-height: 410px !important;
  padding: 18px !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 10px !important;
  background: #fffdfa !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important;
  text-align: left !important;
}
.prototype-workflow .wf-step {
  margin: 0 0 14px !important;
  color: #0f172a !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}
.prototype-workflow .wf-col .form-card {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.prototype-workflow .upload-dropzone {
  width: 100% !important;
  min-height: 0 !important;
  display: block !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: left !important;
  cursor: default !important;
}
.prototype-workflow .upload-dropzone > .form-card-head,
.prototype-workflow .prototype-upload-icon,
.prototype-upload-form .upload-dropzone .form-card-head p::after,
.upload-dropzone .form-card-head p::after,
#workflowModule.is-pdf-source .prototype-upload-form .upload-dropzone .form-card-head p::after {
  display: none !important;
  content: none !important;
}
.prototype-workflow .workflow-upload-fields {
  display: grid !important;
  gap: 16px !important;
}
.prototype-workflow .workflow-task-name-field {
  display: grid !important;
  gap: 8px !important;
  color: #0f172a !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}
.prototype-workflow .workflow-task-name-field input {
  width: 100% !important;
  min-height: 40px !important;
  padding: 8px 10px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}
.prototype-workflow .workflow-upload-label {
  cursor: pointer !important;
  user-select: none !important;
  color: #0f172a !important;
}
.prototype-workflow .workflow-upload-label strong {
  display: block !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}
.prototype-workflow .workflow-upload-label small,
.prototype-workflow .upload-file-summary {
  display: block !important;
  margin-top: 4px !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
.prototype-workflow .wf-fnlabel,
.prototype-workflow .wf-rangefield,
.prototype-workflow .prototype-language-row label {
  color: #0f172a !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}
.prototype-workflow .wf-fnlabel[hidden] { display: none !important; }
.prototype-workflow .wf-fn-hint {
  margin: 10px 0 18px !important;
  color: #475569 !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
}
.prototype-workflow .wf-fnbar {
  display: flex !important;
  gap: 24px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
.prototype-workflow .wf-fnbar button {
  width: auto !important;
  min-height: 38px !important;
  padding: 0 0 9px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #334155 !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
.prototype-workflow .wf-fnbar button.is-active {
  color: #7c3aed !important;
  border-bottom-color: #7c3aed !important;
}
.prototype-workflow .wf-seg {
  display: flex !important;
  gap: 3px !important;
  padding: 3px !important;
  border: 1px solid #cfe1dc !important;
  border-radius: 9px !important;
  background: #fff !important;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.10) !important;
}
.prototype-workflow .wf-seg button {
  flex: 1 1 0 !important;
  min-height: 38px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: #334155 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}
.prototype-workflow .wf-seg button.is-active {
  background: var(--primary-gradient) !important;
  color: #fff !important;
  box-shadow: var(--primary-glow) !important;
}
.prototype-workflow .prototype-language-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) !important;
  align-items: end !important;
  gap: 12px !important;
  margin: 16px 0 0 !important;
}
.prototype-workflow .prototype-language-row > span,
.prototype-workflow .prototype-language-row .language-arrow {
  align-self: center !important;
  justify-self: center !important;
  text-align: center !important;
}
.prototype-workflow input,
.prototype-workflow select {
  min-height: 38px !important;
  font-size: 15px !important;
}
.prototype-workflow .toolbar {
  margin-top: auto !important;
  width: 100% !important;
}
.prototype-workflow .toolbar button[type="submit"] {
  width: 100% !important;
  min-height: 44px !important;
  border-radius: 9px !important;
  background: var(--primary-gradient) !important;
  color: #fff !important;
}

/* 历史任务 */
#historyModule {
  padding-top: 28px !important;
}
#historyModule .history-page-head h2,
#historyModule > h2:first-child {
  margin: 0 0 18px !important;
  color: #0f172a !important;
  font-size: 30px !important;
  line-height: 1.2 !important;
}
#historyFilterForm.history-filter-bar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 14px !important;
  border: 1px solid #e3edf5 !important;
  border-radius: 14px 14px 0 0 !important;
  background: rgba(255, 255, 255, 0.78) !important;
  overflow-x: auto !important;
}
.history-filter-search {
  min-width: 240px !important;
  flex: 0 0 240px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 38px !important;
  padding: 0 12px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 10px !important;
  background: #fff !important;
}
.history-filter-search input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.material-history-list {
  border: 1px solid #e6eaf0 !important;
  border-radius: 0 0 14px 14px !important;
  overflow-x: auto !important;
  background: #fff !important;
}
.mh-head,
.mh-row {
  grid-template-columns: minmax(150px, 0.9fr) minmax(190px, 1.2fr) 118px 150px 120px 80px 100px 92px minmax(168px, max-content) !important;
  min-width: 1240px !important;
  gap: 16px !important;
}
#historyModule .mh-head {
  font-size: 14px !important;
  font-weight: 700 !important;
}
#historyModule .mh-name,
#historyModule .mh-notes-text,
#historyModule .mh-generated-time,
#historyModule .mh-task-type,
#historyModule .mh-count,
#historyModule .mh-annotation span,
#historyModule .mh-status,
#historyModule .mh-amount,
#historyModule .mh-amount-value,
#historyModule .mh-empty {
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}
#historyModule .mh-meta { display: none !important; }
#historyModule .mh-annotation small {
  font-size: 12px !important;
  font-weight: 500 !important;
}
#historyModule .mh-status {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  max-width: 100% !important;
  padding: 4px 10px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 任务详情 */
#detailModal .detail-panel {
  width: min(1080px, calc(100vw - 64px)) !important;
  max-height: calc(100vh - 48px) !important;
}
#detailModal .help-panel-head strong {
  font-size: 18px !important;
  font-weight: 800 !important;
}
#detailModal .detail-tabs {
  margin: 0 0 16px !important;
}
#detailModal .detail-columns {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr) !important;
  gap: 14px !important;
  align-items: stretch !important;
}
#detailModal .detail-col:first-child {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  height: 100% !important;
}
#detailModal .detail-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px 14px !important;
  margin: 0 0 12px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
#detailModal .detail-grid > div {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}
#detailModal .detail-grid strong {
  margin-right: 4px !important;
  color: #64748b !important;
  font-size: 13px !important;
}
.detail-task-name-edit {
  display: grid !important;
  gap: 7px !important;
  margin: 0 0 12px !important;
}
.detail-task-name-edit > strong {
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}
.detail-task-name-input {
  width: 100% !important;
  min-height: 40px !important;
  padding: 8px 10px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 8px !important;
  font-size: 15px !important;
}
#detailModal .detail-stage-block {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: auto !important;
}
#detailModal .preview-block > strong,
#detailModal .detail-billing-block h3 {
  font-size: 17px !important;
  font-weight: 800 !important;
}
#detailModal .detail-export-editor .export-section-title {
  display: none !important;
}
#detailModal .detail-import-excel .hint {
  display: inline-flex !important;
  max-width: 340px !important;
  vertical-align: middle !important;
}
#detailModal .detail-import-excel .actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
#detailModal .detail-import-excel [data-detail-import-excel] {
  min-width: 110px !important;
  padding-inline: 14px !important;
}

/* 翻译配置弹窗 */
.translate-config-modal {
  width: min(880px, calc(100vw - 28px)) !important;
  max-height: calc(100vh - 32px) !important;
  overflow: hidden !important;
  font-size: 15px !important;
}
.translate-config-modal .material-modal-head {
  padding: 18px 22px !important;
}
.translate-config-modal .material-modal-head strong {
  font-size: 17px !important;
  font-weight: 800 !important;
}
.translate-config-modal .material-modal-body {
  display: grid !important;
  gap: 14px !important;
  padding: 16px 18px !important;
  overflow: hidden !important;
}
.translate-config-modal .material-modal-foot {
  padding: 14px 18px !important;
}
.translate-config-modal .setting-group,
.translate-config-modal #translateConfigAdvancedSlot .cad-export-settings,
.translate-config-modal .setting-check-grid,
.translate-config-modal .detail-export-editor .export-section,
.translate-config-modal .detail-export-editor .check-row,
.translate-config-modal .detail-export-editor .chk {
  background: transparent !important;
  box-shadow: none !important;
}
.translate-config-modal #translateConfigAdvancedSlot .cad-export-settings {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.translate-config-modal #translateConfigAdvancedSlot .cad-export-settings .form-card-head {
  display: none !important;
}
.translate-config-modal .translate-config-advanced-wrap {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
/* PDF 翻译时整块 CAD 高级配置要靠 hidden 属性隐藏；上面的 display:block !important
   会压过 hidden 自带的 display:none，必须显式让 [hidden] 重新生效，否则 PDF 弹窗里
   会同时出现 PDF 字体和 CAD 译文字体两套配置。 */
.translate-config-modal .translate-config-advanced-wrap[hidden] {
  display: none !important;
}
.translate-config-modal .setting-label-row {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.translate-config-modal .translate-config-write-row {
  grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 1fr) 60px minmax(230px, 1.4fr) !important;
  gap: 10px 12px !important;
  align-items: end !important;
}
.translate-config-modal label,
.translate-config-modal .checkbox-line,
.translate-config-modal .setting-label,
.translate-config-modal .reference-dropdown-button {
  font-size: 14px !important;
}
.translate-config-modal input[type="text"],
.translate-config-modal input[type="number"],
.translate-config-modal select,
.translate-config-modal .reference-dropdown-button {
  min-height: 40px !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
}
.translate-config-modal input[type="color"] {
  width: 48px !important;
  min-width: 48px !important;
  min-height: 38px !important;
  padding: 4px !important;
}
.translate-config-modal .translate-config-write-row .checkbox-line {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 40px !important;
  white-space: normal !important;
  word-break: keep-all !important;
}
.translate-config-modal .translate-config-source-checks {
  display: none !important;
}
.translate-config-modal .translate-config-multi-row {
  display: grid !important;
  gap: 7px !important;
  min-width: 0 !important;
}
.translate-config-modal .translate-config-multi-row .detail-multi {
  position: relative !important;
  margin-top: 0 !important;
}
.translate-config-modal .translate-config-multi-row .detail-multi-control {
  width: 100% !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 12px !important;
  border: 1px solid #d7e2ef !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #0f172a !important;
  font-size: 14px !important;
  box-shadow: 0 0 0 0 transparent !important;
}
.translate-config-modal .translate-config-multi-row .detail-multi-panel {
  display: none !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(100% + 6px) !important;
  z-index: 140 !important;
  max-height: 180px !important;
  padding: 6px !important;
  overflow-y: auto !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18) !important;
}
.translate-config-modal .translate-config-multi-row .detail-multi.open .detail-multi-panel {
  display: block !important;
}
.translate-config-modal .translate-config-multi-row[data-translate-config-multi="processing_scope"] .detail-multi-panel {
  top: auto !important;
  bottom: calc(100% + 6px) !important;
}
.translate-config-modal .detail-multi-option {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 34px !important;
  padding: 7px 9px !important;
  border-radius: 7px !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}
.translate-config-modal .detail-multi-option input {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.translate-config-modal .detail-multi-option .box {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
  display: grid !important;
  place-items: center !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 4px !important;
  background: #fff !important;
}
.translate-config-modal .detail-multi-option .box svg {
  width: 10px !important;
  height: 10px !important;
  opacity: 0 !important;
}
.translate-config-modal .detail-multi-option input:checked + .box {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
.translate-config-modal .detail-multi-option input:checked + .box svg {
  opacity: 1 !important;
}
.translate-config-modal .checkbox-line[data-tooltip],
.translate-config-modal label[data-tooltip],
.translate-config-modal .setting-label[data-tooltip] {
  position: relative !important;
  cursor: help !important;
}
.translate-config-modal .checkbox-line[data-tooltip]::after,
.translate-config-modal label[data-tooltip]::after,
.translate-config-modal .setting-label[data-tooltip]::after {
  content: attr(data-tooltip) !important;
  position: absolute !important;
  left: 0 !important;
  bottom: calc(100% + 8px) !important;
  z-index: 160 !important;
  width: max-content !important;
  max-width: min(340px, 70vw) !important;
  padding: 8px 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16) !important;
  color: #1f2a44 !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  white-space: normal !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transform: translateY(4px) !important;
  transition: opacity 0.16s ease, transform 0.16s ease !important;
}
.translate-config-modal .checkbox-line[data-tooltip]:hover::after,
.translate-config-modal .checkbox-line[data-tooltip]:focus-within::after,
.translate-config-modal label[data-tooltip]:hover::after,
.translate-config-modal label[data-tooltip]:focus-within::after,
.translate-config-modal .setting-label[data-tooltip]:hover::after,
.translate-config-modal .setting-label[data-tooltip]:focus-within::after {
  opacity: 1 !important;
  transform: translateY(0) !important;
}
/* 顶部（如「参考表」）的说明气泡改为向下展开，避免被弹窗顶边裁切。 */
.translate-config-modal .setting-label.tooltip-below[data-tooltip]::after {
  bottom: auto !important;
  top: calc(100% + 8px) !important;
}

@media (max-width: 1100px) {
  .prototype-workflow .wf-3col,
  #detailModal .detail-columns {
    grid-template-columns: 1fr !important;
  }
}

/* History page cleanup - remove top row and normalize filters */
.main-shell > .topbar {
  display: none !important;
}

.main-shell {
  padding-top: 18px !important;
}

#historyModule {
  padding-top: 22px !important;
}

#historyFilterForm.history-filter-bar {
  display: grid !important;
  grid-template-columns: minmax(220px, 260px) max-content minmax(128px, 148px) minmax(112px, 132px) max-content minmax(170px, 1fr) 18px minmax(170px, 1fr) !important;
  align-items: end !important;
  gap: 10px !important;
  padding: 14px 16px !important;
  overflow: visible !important;
  background: #fff !important;
  border: 1px solid #dbe7f1 !important;
  border-radius: 14px 14px 0 0 !important;
  box-shadow: none !important;
}

#historyFilterForm .history-filter-search,
#historyFilterForm .history-filter-refresh,
#historyFilterForm .history-filter-compact select,
#historyFilterForm .history-filter-chip,
#historyFilterForm .history-filter-date-input {
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd8e6 !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

#historyFilterForm .history-filter-search {
  min-width: 0 !important;
  width: 100% !important;
  flex: none !important;
  padding: 0 12px !important;
}

#historyFilterForm .history-filter-icon {
  color: #7f95b2 !important;
  font-size: 14px !important;
}

#historyFilterForm .history-filter-search input {
  height: 100% !important;
  min-height: 0 !important;
  font-size: 14px !important;
}

#historyFilterForm .history-filter-refresh {
  min-width: 76px !important;
  width: auto !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
}

#historyFilterForm .history-filter-refresh span,
#historyFilterForm .history-refresh-icon {
  display: inline !important;
  writing-mode: horizontal-tb !important;
  line-height: 1 !important;
}

/* 刷新按钮：点击/刷新中给和「今日」一致的绿色反馈，图标转一圈，让用户看到"已点到"。 */
#historyFilterForm .history-filter-refresh:active,
#historyFilterForm .history-filter-refresh.is-refreshing {
  background: #fff !important;
  color: #078475 !important;
  border-color: #14b8a6 !important;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12) !important;
}
#historyFilterForm .history-filter-refresh.is-refreshing .history-refresh-icon {
  display: inline-block !important;
  animation: history-refresh-spin 0.6s linear infinite;
}
@keyframes history-refresh-spin {
  to { transform: rotate(360deg); }
}

#historyFilterForm .history-filter-compact {
  display: grid !important;
  grid-template-rows: auto 38px !important;
  gap: 4px !important;
  min-width: 0 !important;
  color: #52657d !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

#historyFilterForm .history-filter-compact span,
#historyFilterForm .history-filter-chip-group > span {
  color: #52657d !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

#historyFilterForm .history-filter-compact select,
#historyFilterForm .history-filter-date-input {
  width: 100% !important;
  padding: 0 12px !important;
  font-size: 14px !important;
}

#historyFilterForm .history-filter-chip-group {
  display: grid !important;
  grid-template-columns: auto repeat(3, max-content) !important;
  align-items: end !important;
  gap: 8px !important;
  white-space: nowrap !important;
}

#historyFilterForm .history-filter-chip-group > span {
  align-self: center !important;
  padding-bottom: 1px !important;
}

#historyFilterForm .history-filter-chip {
  min-width: 58px !important;
  padding: 0 12px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

#historyFilterForm .history-filter-chip:hover,
#historyFilterForm .history-filter-chip:focus-visible,
#historyFilterForm .history-filter-chip.is-active,
#historyFilterForm .history-filter-chip.active {
  background: #fff !important;
  color: #078475 !important;
  border-color: #14b8a6 !important;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12) !important;
}

#historyFilterForm .history-filter-separator {
  align-self: center !important;
  justify-self: center !important;
  color: #52657d !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding-top: 18px !important;
}

@media (max-width: 1280px) {
  #historyFilterForm.history-filter-bar {
    grid-template-columns: minmax(220px, 1fr) max-content minmax(128px, 148px) minmax(112px, 132px) !important;
  }
  #historyFilterForm .history-filter-chip-group,
  #historyFilterForm .history-filter-date-input,
  #historyFilterForm .history-filter-separator {
    grid-column: auto !important;
  }
}

/* History title outside the card and detail refinements */
body[data-active-module="historyModule"] #historyModule.panel,
body[data-active-module="historyModule"] #historyModule.module-panel {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-active-module="historyModule"] #historyModule .history-page-head {
  margin: 0 0 12px !important;
  padding: 0 !important;
}

body[data-active-module="historyModule"] #historyModule .history-page-head h2 {
  margin: 0 !important;
}

#detailModal .detail-stage-block {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

#detailModal .detail-stage-block .detail-history {
  max-height: none !important;
  overflow: visible !important;
}

#detailModal .detail-stage-toggle {
  margin-top: 10px !important;
  min-height: 36px !important;
  padding: 0 14px !important;
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid #cbd8e6 !important;
  box-shadow: none !important;
}

#detailModal .detail-export-multi-row {
  position: relative !important;
  display: grid !important;
  gap: 7px !important;
  min-width: 0 !important;
}

#detailModal .detail-export-multi-row .setting-label {
  color: #334155 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

#detailModal .detail-export-multi-row .detail-multi {
  position: relative !important;
}

#detailModal .detail-export-multi-row .detail-multi-control {
  width: 100% !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 8px 12px !important;
  border: 1px solid #d7e2ef !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-align: left !important;
  box-shadow: 0 0 0 0 transparent !important;
}

#detailModal .detail-export-multi-row .detail-multi-control span:first-child {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#detailModal .detail-export-multi-row .detail-multi.open .detail-multi-control {
  border-color: #14b8a6 !important;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12) !important;
}

#detailModal .detail-export-multi-row .detail-multi-panel {
  display: none !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(100% + 6px) !important;
  z-index: 80 !important;
  max-height: 188px !important;
  padding: 6px !important;
  overflow-y: auto !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18) !important;
}

#detailModal .detail-export-multi-row .detail-multi.open .detail-multi-panel {
  display: block !important;
}

#detailModal .detail-export-multi-row[data-detail-export-multi="processing_scope"] .detail-multi-panel {
  top: auto !important;
  bottom: calc(100% + 6px) !important;
}

#detailModal .detail-export-multi-row .detail-multi-option {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 34px !important;
  padding: 7px 9px !important;
  border-radius: 7px !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

#detailModal .detail-export-multi-row .detail-multi-option:hover {
  background: #f8fafc !important;
}

#detailModal .detail-export-multi-row .detail-multi-option input {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#detailModal .detail-export-multi-row .detail-multi-option .box {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
  display: grid !important;
  place-items: center !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 4px !important;
  background: #fff !important;
}

#detailModal .detail-export-multi-row .detail-multi-option .box svg {
  width: 10px !important;
  height: 10px !important;
  opacity: 0 !important;
}

#detailModal .detail-export-multi-row .detail-multi-option input:checked + .box {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

#detailModal .detail-export-multi-row .detail-multi-option input:checked + .box svg {
  opacity: 1 !important;
  stroke: #fff !important;
  stroke-width: 2.6 !important;
}

/* Detail page light typography and compact history */
#detailModal .detail-grid > div,
#detailModal .detail-grid > div div {
  font-weight: 400 !important;
}

#detailModal .detail-grid strong {
  font-weight: 500 !important;
}

#detailModal .detail-stage-block {
  max-height: 360px !important;
  overflow: hidden !important;
}

#detailModal .detail-stage-block .detail-history[data-stage-history="latest"] .detail-history-item:nth-child(n+4) {
  display: none !important;
}

#detailModal .detail-stage-block .detail-history[data-stage-history="all"] {
  max-height: 520px !important;
  overflow: auto !important;
}

#detailModal .export-reference,
#detailModal .setting-group.export-reference {
  background: transparent !important;
  background-color: transparent !important;
  border-color: #dbe7f1 !important;
  box-shadow: none !important;
}

#detailModal .export-reference .reference-dropdown-button,
#detailModal .export-reference .detail-reference-select,
#detailModal .export-reference select {
  background: #fff !important;
}

#detailModal .detail-stage-block {
  max-height: none !important;
  overflow: visible !important;
}

#detailModal .detail-history.hidden {
  display: none !important;
}

/* Detail controls: lighter select text and one-line Excel import */
#detailModal select,
#detailModal option,
#detailModal .detail-multi-control,
#detailModal .reference-dropdown-button,
#detailModal .detail-reference-select,
#detailModal .detail-export-editor input,
#detailModal .detail-import-excel .hint {
  font-weight: 400 !important;
}

#detailModal .detail-export-multi-row .detail-multi-option {
  font-weight: 400 !important;
}

#detailModal .detail-import-excel {
  display: grid !important;
  grid-template-columns: max-content max-content max-content minmax(70px, 1fr) max-content !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 12px !important;
  padding-top: 12px !important;
}

#detailModal .detail-import-excel > .setting-label {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  min-height: 30px !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: help !important;
  white-space: nowrap !important;
}

#detailModal .detail-import-excel > .setting-label[data-tooltip]::after {
  content: attr(data-tooltip) !important;
  position: absolute !important;
  left: 0 !important;
  bottom: calc(100% + 8px) !important;
  z-index: 120 !important;
  width: max-content !important;
  max-width: 340px !important;
  padding: 8px 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16) !important;
  color: #1f2a44 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  white-space: normal !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transform: translateY(4px) !important;
  transition: opacity 0.16s ease, transform 0.16s ease !important;
}

#detailModal .detail-import-excel > .setting-label[data-tooltip]:hover::after,
#detailModal .detail-import-excel > .setting-label[data-tooltip]:focus-visible::after {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* 任务详情：导出配置项 / 多选标题的浮动说明气泡。 */
#detailModal .detail-export-editor label[data-tooltip],
#detailModal .detail-export-multi-row .setting-label[data-tooltip] {
  position: relative !important;
  cursor: help !important;
}
#detailModal .detail-export-editor label[data-tooltip]::after,
#detailModal .detail-export-multi-row .setting-label[data-tooltip]::after {
  content: attr(data-tooltip) !important;
  position: absolute !important;
  left: 0 !important;
  bottom: calc(100% + 8px) !important;
  z-index: 130 !important;
  width: max-content !important;
  max-width: min(320px, 70vw) !important;
  padding: 8px 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16) !important;
  color: #1f2a44 !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  white-space: normal !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transform: translateY(4px) !important;
  transition: opacity 0.16s ease, transform 0.16s ease !important;
}
#detailModal .detail-export-editor label[data-tooltip]:hover::after,
#detailModal .detail-export-editor label[data-tooltip]:focus-within::after,
#detailModal .detail-export-multi-row .setting-label[data-tooltip]:hover::after,
#detailModal .detail-export-multi-row .setting-label[data-tooltip]:focus-within::after {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* 主流程功能按钮（直接翻译 / 抽取 Excel / 原文检查）的浮动说明气泡。 */
.wf-fnbar button[data-tooltip],
.wf-rangefield[data-tooltip] {
  position: relative;
}
.wf-fnbar button[data-tooltip]::after,
.wf-rangefield[data-tooltip]::after {
  content: attr(data-tooltip) !important;
  display: block !important;
  position: absolute !important;
  left: 0 !important;
  top: calc(100% + 8px) !important;
  z-index: 170 !important;
  width: max-content !important;
  max-width: min(340px, 78vw) !important;
  padding: 9px 11px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
  color: #1f2a44 !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  text-align: left !important;
  white-space: pre-line !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transform: translateY(4px) !important;
  transition: opacity 0.16s ease, transform 0.16s ease !important;
}
.wf-fnbar button[data-tooltip]:hover::after,
.wf-fnbar button[data-tooltip]:focus-visible::after,
.wf-rangefield[data-tooltip]:hover::after,
.wf-rangefield[data-tooltip]:focus-within::after {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

#detailModal .detail-import-excel > p.hint {
  display: none !important;
}

#detailModal .detail-import-excel .actions {
  display: contents !important;
}

#detailModal .detail-import-excel .detail-file-pick {
  min-height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid #cbd8e6 !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

#detailModal .detail-import-excel [data-detail-import-name] {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-weight: 400 !important;
}

#detailModal .detail-import-excel [data-detail-import-excel] {
  width: auto !important;
  min-width: 0 !important;
  min-height: 30px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  background: var(--primary-gradient) !important;
  color: #fff !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

/* 翻译处理区「下载 Excel」按钮：与上传/生成同样的紧凑尺寸、文字不加粗 */
#detailModal .detail-import-excel .action-button[data-action="save-download"] {
  width: auto !important;
  min-width: 0 !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
}

/* Sidebar collapse button: compact menu style */
.sidebar .brand-card {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) 38px !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 14px 12px !important;
  border-radius: 12px !important;
}

.sidebar .brand-text {
  min-width: 0 !important;
}

.sidebar .sidebar-collapse-btn {
  width: 34px !important;
  height: 42px !important;
  min-width: 34px !important;
  min-height: 42px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #d8e2ed !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #334155 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.sidebar .sidebar-collapse-btn:hover,
.sidebar .sidebar-collapse-btn:focus-visible {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd8e6 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.sidebar .sidebar-collapse-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2 !important;
}

/* Workflow page left alignment and plain function tabs */
body[data-active-module="workflowModule"] .content-shell {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 36px !important;
  padding-right: 36px !important;
}

body[data-active-module="workflowModule"] #workflowModule.panel,
body[data-active-module="workflowModule"] #workflowModule.module-panel,
#workflowModule.prototype-workflow {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: left !important;
}

#workflowModule .prototype-workflow-eyebrow,
#workflowModule > .prototype-workflow-eyebrow,
#workflowModule > .eyebrow {
  display: none !important;
}

#workflowModule.prototype-workflow > h2,
#workflowModule.prototype-workflow > .prototype-kind-tabs,
#workflowModule.prototype-workflow > .wf-3col,
#workflowModule.prototype-workflow > .section-subtitle {
  margin-left: 0 !important;
  margin-right: auto !important;
}

#workflowModule.prototype-workflow .prototype-kind-tabs {
  justify-content: flex-start !important;
}

#workflowModule.prototype-workflow .wf-3col {
  max-width: 1120px !important;
}

#workflowModule.prototype-workflow .wf-fnbar {
  display: flex !important;
  align-items: center !important;
  gap: 24px !important;
  padding: 0 !important;
  margin: 0 0 16px !important;
  border: 0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#workflowModule.prototype-workflow .wf-fnbar button {
  width: auto !important;
  min-height: 38px !important;
  padding: 0 0 9px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #334155 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

#workflowModule.prototype-workflow .wf-fnbar button.is-active {
  color: #7c3aed !important;
  border-bottom-color: #7c3aed !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Sidebar brand without card and bottom user bar */
.sidebar .brand-card {
  padding: 10px 8px 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  grid-template-columns: 44px minmax(0, 1fr) 34px !important;
}

.sidebar .brand-badge {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
}

.sidebar .brand-card strong {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.sidebar .brand-card p {
  margin-top: 2px !important;
  font-size: 12px !important;
  color: #64748b !important;
}

.sidebar .sidebar-footer {
  margin-top: auto !important;
  display: block !important;
  padding: 12px 8px 0 !important;
}

.sidebar .sidebar-note,
.sidebar .sidebar-link,
.sidebar .sidebar-user-avatar {
  display: none !important;
}

.sidebar .sidebar-user {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 34px 34px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 0 10px !important;
  border-top: 1px solid #dbe7f1 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar .sidebar-user-info {
  min-width: 0 !important;
  display: grid !important;
  gap: 3px !important;
}

.sidebar .sidebar-user-info .user-pill,
.sidebar .sidebar-user-info strong {
  display: block !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.sidebar .sidebar-user-info small {
  color: #7c3aed !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.sidebar .sidebar-user-action,
.sidebar .sidebar-logout-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #cbd8e6 !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #334155 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.sidebar .sidebar-user-action:hover,
.sidebar .sidebar-logout-btn:hover,
.sidebar .sidebar-user-action:focus-visible,
.sidebar .sidebar-logout-btn:focus-visible {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.sidebar .sidebar-user-action svg,
.sidebar .sidebar-logout-btn svg {
  width: 17px !important;
  height: 17px !important;
}

/* Translate config modal: no filled selected state and normal dropdown text */
.translate-config-modal select,
.translate-config-modal option,
.translate-config-modal input,
.translate-config-modal .reference-dropdown-button,
.translate-config-modal .detail-multi-control,
.translate-config-modal [data-translate-config-multi-summary],
.translate-config-modal .detail-multi-option,
.translate-config-modal .setting-label {
  font-weight: 400 !important;
}

.translate-config-modal .reference-dropdown-button,
.translate-config-modal .detail-multi-control {
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

.translate-config-modal .reference-dropdown-button:hover,
.translate-config-modal .reference-dropdown-button:focus-visible,
.translate-config-modal .reference-dropdown.is-open .reference-dropdown-button,
.translate-config-modal .detail-multi.open .detail-multi-control,
.translate-config-modal .detail-multi-control:hover,
.translate-config-modal .detail-multi-control:focus-visible {
  background: #fff !important;
  color: #0f172a !important;
  border-color: #14b8a6 !important;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.10) !important;
}

.translate-config-modal .reference-option,
.translate-config-modal .detail-multi-option {
  background: #fff !important;
  color: #0f172a !important;
  font-weight: 400 !important;
}

.translate-config-modal .reference-option:hover,
.translate-config-modal .detail-multi-option:hover {
  background: #f8fafc !important;
}

.translate-config-modal .reference-option input:checked + span,
.translate-config-modal .detail-multi-option input:checked ~ span:last-child {
  color: #0f172a !important;
  font-weight: 400 !important;
}

.translate-config-modal .detail-multi-option input:checked + .box,
.translate-config-modal .reference-option input:checked + .box {
  background: #14b8a6 !important;
  border-color: #14b8a6 !important;
}

.translate-config-modal .detail-multi-option input:checked + .box svg,
.translate-config-modal .reference-option input:checked + .box svg {
  opacity: 1 !important;
  stroke: #fff !important;
  stroke-width: 2.6 !important;
}

/* Translate config: keep untranslated-color checkbox on one line */
.translate-config-modal .translate-config-write-row {
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) 58px minmax(360px, 1.8fr) !important;
  align-items: end !important;
}

.translate-config-modal .translate-config-write-row .checkbox-line {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow: visible !important;
  min-width: 340px !important;
}

.translate-config-modal .translate-config-write-row .checkbox-line span,
.translate-config-modal .translate-config-write-row .checkbox-line {
  font-size: 14px !important;
  line-height: 1.35 !important;
}

/* Sidebar top menu button without border */
.sidebar .sidebar-collapse-btn {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar .sidebar-collapse-btn:hover,
.sidebar .sidebar-collapse-btn:focus-visible {
  border: 0 !important;
  background: rgba(15, 23, 42, 0.04) !important;
  box-shadow: none !important;
}

/* Workflow title spacing */
#workflowModule.prototype-workflow > h2 {
  margin-bottom: 20px !important;
}

#workflowModule.prototype-workflow .prototype-kind-tabs {
  margin-bottom: 26px !important;
}

/* History filters compact and table normal weight */
#historyFilterForm.history-filter-bar {
  grid-template-columns: 260px max-content 128px 116px max-content 150px 18px 150px !important;
  align-items: end !important;
  column-gap: 10px !important;
}

#historyFilterForm .history-filter-compact {
  width: 100% !important;
  min-width: 0 !important;
  white-space: nowrap !important;
}

#historyFilterForm .history-filter-compact span {
  white-space: nowrap !important;
}

#historyFilterForm .history-filter-compact select {
  min-width: 0 !important;
  width: 100% !important;
}

#historyFilterForm .history-filter-date-input {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
}

#historyModule .mh-name,
#historyModule .mh-notes-text,
#historyModule .mh-generated-time,
#historyModule .mh-task-type,
#historyModule .mh-count,
#historyModule .mh-annotation span,
#historyModule .mh-status,
#historyModule .mh-amount,
#historyModule .mh-amount-value,
#historyModule .mh-empty,
#historyModule .mh-row,
#historyModule .mh-row * {
  font-weight: 400 !important;
}

#historyModule .mh-head,
#historyModule .mh-head * {
  font-weight: 700 !important;
  color: #1f2937 !important;
}

/* Detail modal wider and single-line basic info */
#detailModal .detail-panel {
  width: min(1280px, calc(100vw - 48px)) !important;
}

#detailModal .detail-columns {
  grid-template-columns: minmax(0, 1.05fr) minmax(500px, 0.95fr) !important;
}

#detailModal .detail-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px 18px !important;
  margin: 0 0 14px !important;
  padding: 0 0 12px !important;
}

#detailModal .detail-grid > div {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 5px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#detailModal .detail-grid > div:first-child {
  max-width: min(360px, 100%) !important;
}

#detailModal .detail-grid > div strong {
  flex: 0 0 auto !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

#detailModal .detail-grid > div div {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Detail export controls normal weight */
#detailModal .detail-export-editor select,
#detailModal .detail-export-editor option,
#detailModal .detail-export-editor input,
#detailModal .detail-export-editor .detail-multi-control,
#detailModal .detail-export-editor [data-detail-export-multi-summary],
#detailModal .detail-reference-select,
#detailModal .reference-dropdown-button,
#detailModal .detail-multi-option,
#detailModal .detail-file-pick {
  font-weight: 400 !important;
}

/* History filter labels inline */
#historyFilterForm.history-filter-bar {
  grid-template-columns: 260px max-content 180px 150px max-content 140px 18px 140px !important;
}

#historyFilterForm .history-filter-compact {
  display: inline-grid !important;
  grid-template-columns: max-content minmax(88px, 1fr) !important;
  grid-template-rows: 38px !important;
  align-items: center !important;
  gap: 8px !important;
}

#historyFilterForm .history-filter-compact span {
  align-self: center !important;
  padding: 0 !important;
  line-height: 38px !important;
}

#historyFilterForm .history-filter-date-input {
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
}

/* Global readability pass: avoid tiny text */
body,
button,
input,
select,
textarea,
label,
table,
.panel,
.module-panel,
.preview-block,
.form-card,
.result-card,
.material-table,
.wallet-ledger-table,
.history-table,
.material-history-list,
.detail-panel,
.material-modal {
  font-size: 14px !important;
}

.hint,
.meta,
small,
.summary-pill,
.metric-label,
.stage-text,
.section-subtitle,
.form-card-head p,
.preview-block p,
.wallet-ledger-table th,
.wallet-ledger-table td,
.material-table th,
.material-table td,
#detailModal .detail-grid strong,
#detailModal .detail-grid > div,
#detailModal .detail-grid > div div,
#detailModal .detail-billing-block,
#detailModal .detail-billing-block *,
#historyModule .mh-annotation small,
#historyModule .mh-head,
#historyModule .mh-row,
#historyModule .mh-row * {
  font-size: 14px !important;
}

.nav-item,
.sidebar .brand-card p,
.sidebar .sidebar-user-info small,
.history-filter-compact span,
.history-filter-chip-group > span {
  font-size: 14px !important;
}

#detailModal .detail-tabs .detail-tab,
.prototype-kind-tab,
.subsection-tab,
.module-tab {
  font-size: 15px !important;
}

#detailModal .preview-block > strong,
#detailModal .detail-billing-block h3,
.form-card-head strong,
.preview-block > strong {
  font-size: 16px !important;
}

/* Material library layout like history page + underline tabs */
body[data-active-module="referenceModule"] #referenceModule.panel,
body[data-active-module="referenceModule"] #referenceModule.module-panel {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#referenceModule .material-head {
  display: block !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#referenceModule .material-title {
  margin: 0 0 18px !important;
  color: #0f172a !important;
  font-size: 30px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

#referenceModule .material-subtabs {
  width: 100% !important;
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#referenceModule .material-subtab {
  width: auto !important;
  min-height: 40px !important;
  padding: 0 0 9px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #334155 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

#referenceModule .material-subtab.is-active {
  color: #7c3aed !important;
  border-bottom-color: #7c3aed !important;
  background: transparent !important;
  box-shadow: none !important;
}

#referenceModule .material-subtab:hover {
  color: #7c3aed !important;
  background: transparent !important;
  transform: none !important;
}

#referenceModule .material-subpanel {
  margin-top: 16px !important;
}

/* Reference package table + filters */
#referenceModule .reference-batch-list {
  display: grid !important;
  gap: 12px !important;
  margin-bottom: 22px !important;
}

#referenceModule .reference-filter-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}

#referenceModule .reference-filter-search {
  width: 320px !important;
  min-width: 260px !important;
  flex: 0 0 320px !important;
}
/* 输入框撑满容器，否则默认宽度只有约 20 字符，占位文字“…语种搜索”会被截断 */
#referenceModule .reference-filter-search input {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
}

#referenceModule .reference-batch-table {
  height: 260px !important;
  overflow: auto !important;
  border: 1px solid #e6eaf0 !important;
  border-radius: 10px !important;
  background: #fff !important;
}

#referenceModule .reference-batch-head,
#referenceModule .reference-batch-row {
  display: grid !important;
  grid-template-columns: 140px minmax(260px, 1fr) 160px 100px 120px !important;
  align-items: center !important;
  gap: 14px !important;
  min-width: 860px !important;
}

#referenceModule .reference-batch-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  padding: 11px 16px !important;
  background: #f8fafc !important;
  color: #64748b !important;
  border-bottom: 1px solid #e6eaf0 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

#referenceModule .reference-batch-row {
  width: 100% !important;
  padding: 12px 16px !important;
  border: 0 !important;
  border-bottom: 1px solid #eef2f7 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}

#referenceModule .reference-batch-row:hover,
#referenceModule .reference-batch-row.is-active {
  background: #fff !important;
  box-shadow: inset 3px 0 0 #14b8a6 !important;
}

#referenceModule .reference-batch-row.is-hidden {
  display: none !important;
}

#referenceModule .reference-batch-row .rb-date,
#referenceModule .reference-batch-row .rb-name,
#referenceModule .reference-batch-row .rb-name-meta,
#referenceModule .reference-batch-row .rb-lang,
#referenceModule .reference-batch-row .rb-count,
#referenceModule .reference-batch-row .rb-arrow {
  font-size: 14px !important;
  font-weight: 400 !important;
}

#referenceModule .reference-batch-row .rb-name {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#referenceModule .reference-batch-row .rb-count {
  color: #0e7490 !important;
}

#referenceModule .reference-batch-row .rb-arrow {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  color: #64748b !important;
}

#referenceModule .reference-batch-row .rb-delete {
  padding: 3px 8px !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 7px !important;
  color: #e11d48 !important;
  background: #fff !important;
}

#referenceModule [data-reference-data-tabs] {
  margin: 22px 0 16px !important;
  padding: 0 !important;
  display: flex !important;
  justify-content: flex-start !important;
  gap: 28px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#referenceModule [data-reference-data-tabs] .subsection-tab {
  width: auto !important;
  min-height: 40px !important;
  padding: 0 0 9px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #334155 !important;
}

#referenceModule [data-reference-data-tabs] .subsection-tab.is-active {
  color: #7c3aed !important;
  border-bottom-color: #7c3aed !important;
}

/* Sidebar icon navigation and collapsed mode */
.workspace-shell {
  transition: grid-template-columns 0.2s ease !important;
  overflow: visible !important;
}

.sidebar {
  overflow: visible !important;
}

.sidebar .brand-card {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 32px !important;
  align-items: center !important;
  gap: 12px !important;
}

.sidebar .sidebar-collapse-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #334155 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.sidebar .sidebar-collapse-btn:hover {
  background: #eef8f7 !important;
  color: #0f766e !important;
}

.sidebar .sidebar-collapse-btn svg {
  width: 18px !important;
  height: 18px !important;
}

.sidebar .sidebar-nav {
  display: grid !important;
  gap: 8px !important;
  overflow: visible !important;
}

.sidebar .nav-item {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

.sidebar .nav-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 22px !important;
  color: #475569 !important;
}

.sidebar .nav-icon svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

.sidebar .nav-item.is-active .nav-icon,
.sidebar .nav-item:hover .nav-icon {
  color: #0f766e !important;
}

.workspace-shell.sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr) !important;
}

.workspace-shell.sidebar-collapsed .sidebar {
  width: 84px !important;
  min-width: 84px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  align-items: center !important;
}

.workspace-shell.sidebar-collapsed .brand-card {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 60px !important;
  min-height: 56px !important;
  padding: 8px 0 14px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.workspace-shell.sidebar-collapsed .brand-text,
.workspace-shell.sidebar-collapsed .nav-item > span:not(.nav-icon),
.workspace-shell.sidebar-collapsed .sidebar-user-info {
  display: none !important;
}

.workspace-shell.sidebar-collapsed .sidebar-collapse-btn {
  position: absolute !important;
  right: -18px !important;
  top: 12px !important;
  z-index: 40 !important;
  width: 32px !important;
  height: 32px !important;
  border: 1px solid #d7e2ee !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08) !important;
}

.workspace-shell.sidebar-collapsed .sidebar-nav {
  width: 60px !important;
  justify-items: center !important;
  gap: 10px !important;
}

.workspace-shell.sidebar-collapsed .nav-item {
  width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 !important;
  justify-content: center !important;
  gap: 0 !important;
  border-radius: 14px !important;
}

.workspace-shell.sidebar-collapsed .nav-icon {
  width: 24px !important;
  height: 24px !important;
  flex-basis: 24px !important;
}

.workspace-shell.sidebar-collapsed .nav-icon svg {
  width: 20px !important;
  height: 20px !important;
}

.workspace-shell.sidebar-collapsed .nav-item::after,
.workspace-shell.sidebar-collapsed .sidebar-user-action::after,
.workspace-shell.sidebar-collapsed .sidebar-logout-btn::after {
  position: absolute !important;
  left: calc(100% + 12px) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 3000 !important;
  padding: 6px 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.12s ease, transform 0.12s ease !important;
}

.workspace-shell.sidebar-collapsed .nav-item::after {
  content: attr(data-sidebar-label) !important;
}

.workspace-shell.sidebar-collapsed .sidebar-user-action::after {
  content: "修改密码" !important;
}

.workspace-shell.sidebar-collapsed .sidebar-logout-btn::after {
  content: "退出登录" !important;
}

.workspace-shell.sidebar-collapsed .nav-item:hover::after,
.workspace-shell.sidebar-collapsed .nav-item:focus-visible::after,
.workspace-shell.sidebar-collapsed .sidebar-user-action:hover::after,
.workspace-shell.sidebar-collapsed .sidebar-user-action:focus-visible::after,
.workspace-shell.sidebar-collapsed .sidebar-logout-btn:hover::after,
.workspace-shell.sidebar-collapsed .sidebar-logout-btn:focus-visible::after {
  opacity: 1 !important;
  transform: translateY(-50%) translateX(2px) !important;
}

.workspace-shell.sidebar-collapsed .sidebar-footer {
  width: 60px !important;
}

.workspace-shell.sidebar-collapsed .sidebar-user {
  display: grid !important;
  grid-template-columns: 34px !important;
  justify-content: center !important;
  justify-items: center !important;
  gap: 8px !important;
  padding: 12px 0 !important;
}

.workspace-shell.sidebar-collapsed .sidebar-user-action,
.workspace-shell.sidebar-collapsed .sidebar-logout-btn {
  position: relative !important;
}

/* Align history date range separator with date inputs */
#historyFilterForm .history-filter-separator {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 4px !important;
  line-height: 38px !important;
  align-self: center !important;
  transform: none !important;
  margin-top: 0 !important;
}

/* Material glossary action buttons: plain text buttons, no icons or filled color */
#referenceModule #termUploadExcel,
#referenceModule #termManualAdd {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 0 18px !important;
  border: 1px solid #c8bda9 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

#referenceModule #termUploadExcel:hover,
#referenceModule #termManualAdd:hover,
#referenceModule #termUploadExcel:focus-visible,
#referenceModule #termManualAdd:focus-visible {
  border-color: #0f766e !important;
  background: #fff !important;
  color: #0f766e !important;
  box-shadow: none !important;
}

/* Material library page buttons: keep actions plain and text-only */
#referenceModule .reference-manage-toggle,
#referenceModule .material-upload-btn,
#referenceModule .ghost-button,
#referenceModule .action-button:not(.tiny-danger-button):not(.mh-icon-btn),
#referenceModule .action-link:not(.tiny-danger-button),
#referenceModule .pager-btn,
#referenceModule .row-icon-btn,
#referenceModule #referenceReviewRefresh,
#referenceModule #termExportAll,
#referenceModule .reference-support-trigger {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  padding: 0 16px !important;
  border: 1px solid #c8bda9 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
}

#referenceModule .reference-manage-toggle:hover,
#referenceModule .material-upload-btn:hover,
#referenceModule .ghost-button:hover,
#referenceModule .action-button:not(.tiny-danger-button):not(.mh-icon-btn):hover,
#referenceModule .action-link:not(.tiny-danger-button):hover,
#referenceModule .pager-btn:hover,
#referenceModule .row-icon-btn:hover,
#referenceModule #referenceReviewRefresh:hover,
#referenceModule #termExportAll:hover,
#referenceModule .reference-support-trigger:hover {
  border-color: #0f766e !important;
  background: #fff !important;
  color: #0f766e !important;
  box-shadow: none !important;
}

#referenceModule .reference-manage-toggle {
  width: auto !important;
  gap: 8px !important;
}

#referenceModule .reference-manage-chevron {
  color: inherit !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

#referenceModule .row-icon-btn {
  min-width: 0 !important;
  width: auto !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 10px !important;
}

#referenceModule .row-icon-btn:disabled,
#referenceModule .material-upload-btn:disabled,
#referenceModule .pager-btn:disabled {
  border-color: #e2e8f0 !important;
  background: #fff !important;
  color: #94a3b8 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
}

#referenceModule .tiny-danger-button,
#referenceModule .rb-delete {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: #e11d48 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

#referenceModule .tiny-danger-button:hover,
#referenceModule .rb-delete:hover {
  border-color: #fb7185 !important;
  background: #fff !important;
  color: #be123c !important;
}

#referenceModule form button[type="submit"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  padding: 0 16px !important;
  border: 1px solid #c8bda9 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
}

#referenceModule form button[type="submit"]:hover,
#referenceModule form button[type="submit"]:focus-visible {
  border-color: #0f766e !important;
  background: #fff !important;
  color: #0f766e !important;
  box-shadow: none !important;
}

/* Detail reference package selector: plain, compact one-line control */
#detailModal #detailReferenceMulti.multi,
#detailModal .export-reference #detailReferenceMulti.multi {
  width: 100% !important;
}

#detailModal #detailReferenceMulti .multi-control {
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 10px !important;
  border: 1px solid #d8cdbb !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  overflow: hidden !important;
}

#detailModal #detailReferenceMulti .multi-control:hover,
#detailModal #detailReferenceMulti.open .multi-control,
#detailModal #detailReferenceMulti .multi-control:focus-visible {
  background: #fff !important;
  border-color: #14b8a6 !important;
  box-shadow: none !important;
}

#detailModal #detailReferenceMulti .multi-chips {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

#detailModal #detailReferenceMulti .multi-chips:empty::before {
  content: "（不使用参考包）" !important;
  color: #64748b !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}

#detailModal #detailReferenceMulti .chip {
  max-width: 220px !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 8px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#detailModal #detailReferenceMulti .chip-x {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: #64748b !important;
  box-shadow: none !important;
  line-height: 18px !important;
}

#detailModal #detailReferenceMulti .chip-x:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
}

#detailModal #detailReferenceMulti .multi-caret {
  flex: 0 0 auto !important;
  color: #475569 !important;
  line-height: 1 !important;
}

/* Task detail pairs tab: use the same sentence editor inline instead of a modal */
#detailModal .detail-pairs-inline {
  display: flex !important;
  flex-direction: column !important;
  min-height: 560px !important;
  max-height: calc(100vh - 210px) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #fff !important;
  overflow: hidden !important;
}

#detailModal .detail-pairs-inline .material-modal-head,
#detailModal .detail-pairs-inline .material-modal-foot {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  border-color: #e2e8f0 !important;
  background: #fff !important;
}

#detailModal .detail-pairs-inline .material-modal-head {
  border-bottom: 1px solid #e2e8f0 !important;
}

#detailModal .detail-pairs-inline .material-modal-foot {
  border-top: 1px solid #e2e8f0 !important;
}

#detailModal .detail-pairs-inline .material-modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 14px 16px !important;
  overflow: auto !important;
  background: #fff !important;
}

#detailModal .detail-pairs-inline .td-summary-cards {
  margin-bottom: 12px !important;
}

#detailModal .detail-pairs-inline .material-table {
  max-height: none !important;
  overflow: auto !important;
}

#detailModal .detail-pairs-inline table {
  min-width: 900px !important;
}

#detailModal .detail-pairs-inline .td-foot-left,
#detailModal .detail-pairs-inline .td-foot-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

/* Detail pairs tab compact header and filters */
#detailModal .detail-pairs-inline .material-modal-head {
  align-items: center !important;
  min-height: 60px !important;
}

#detailModal .detail-pairs-inline .material-modal-head > div:first-child {
  display: flex !important;
  align-items: baseline !important;
  gap: 8px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

#detailModal .detail-pairs-inline .material-modal-head > div:first-child > strong {
  flex: 0 0 auto !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

#detailModal .detail-pairs-inline .td-stats {
  min-width: 0 !important;
  margin: 0 !important;
  color: #0f172a !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  font-weight: 400 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#detailModal .detail-pairs-inline .td-summary-cards {
  gap: 8px !important;
  margin-bottom: 10px !important;
}

#detailModal .detail-pairs-inline .td-summary-card {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

#detailModal .detail-pairs-inline .td-summary-card strong {
  font-size: 13px !important;
  font-weight: 600 !important;
}

/* 图纸校对工具栏：文字按钮改为图标按钮，悬浮显示具体功能 */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#detailModal .review-canvas-bar .review-icon-btn,
#detailModal .review-state-group .review-icon-btn {
  position: relative;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  color: var(--ink, #0f172a);
  line-height: 1;
}

#detailModal .review-canvas-bar .review-icon-btn .review-icon,
#detailModal .review-state-group .review-icon-btn .review-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

#detailModal .review-canvas-bar .review-icon-btn:hover:not(:disabled),
#detailModal .review-canvas-bar .review-icon-btn:focus-visible:not(:disabled),
#detailModal .review-state-group .review-icon-btn:hover:not(:disabled),
#detailModal .review-state-group .review-icon-btn:focus-visible:not(:disabled) {
  border-color: #0f9aa8;
  color: #078391;
  box-shadow: 0 8px 18px rgba(15, 154, 168, 0.14);
}

#detailModal .review-state-btn.is-active[data-state-target="pass"] {
  background: #e8faf4;
  color: #047857;
  border-color: #10b981;
}

#detailModal .review-state-btn.is-active[data-state-target="fail"] {
  background: #fff1f2;
  color: #be123c;
  border-color: #fb7185;
}

#detailModal .review-pin-btn.is-active {
  background: #e6f7f8;
  color: #078391;
  border-color: #0f9aa8;
}

#detailModal .review-icon-btn::after {
  content: attr(data-help-text);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 50;
  min-width: 160px;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

#detailModal .review-icon-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  z-index: 51;
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.94);
  transform: translate(-50%, 4px) rotate(45deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

#detailModal .review-icon-btn:hover::after,
#detailModal .review-icon-btn:focus-visible::after,
#detailModal .review-icon-btn:hover::before,
#detailModal .review-icon-btn:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

#detailModal .review-icon-btn:hover::before,
#detailModal .review-icon-btn:focus-visible::before {
  transform: translate(-50%, 0) rotate(45deg);
}

#detailModal .review-icon-btn.is-loading .review-icon {
  animation: reviewIconSpin 0.9s linear infinite;
}

@keyframes reviewIconSpin {
  to { transform: rotate(360deg); }
}

/* 句对编辑：离开输入框自动保存 */
#detailModal .detail-pairs-inline textarea[data-td-edit].is-saving {
  border-color: #0f9aa8 !important;
  box-shadow: 0 0 0 3px rgba(15, 154, 168, 0.12) !important;
  background: #f8ffff !important;
}

#detailModal .detail-pairs-inline .td-foot-msg.is-saving {
  color: #0f766e !important;
}

#detailModal .detail-pairs-inline .td-foot-msg.is-saved {
  color: #047857 !important;
}

#detailModal .detail-pairs-inline .td-foot-msg.is-error {
  color: #dc2626 !important;
}

/* 历史任务操作列固定为：原稿、译稿、任务详情、删除 */
#historyModule .mh-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
}

#historyModule .mh-actions .mh-icon-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
}

#historyModule .mh-actions .mh-icon-btn.is-disabled,
#historyModule .mh-actions .mh-icon-btn:disabled {
  border-color: #e2e8f0 !important;
  background: #fff !important;
  color: #cbd5e1 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

#historyModule .mh-actions .mh-icon-btn.is-disabled:hover,
#historyModule .mh-actions .mh-icon-btn:disabled:hover {
  border-color: #e2e8f0 !important;
  background: #fff !important;
  color: #cbd5e1 !important;
  transform: none !important;
}

#historyModule .mh-head,
#historyModule .mh-row {
  grid-template-columns: minmax(150px, 0.9fr) minmax(190px, 1.2fr) 118px 150px 120px 80px 100px 92px 176px !important;
}

/* Review toolbar: keep preview controls together beside zoom controls. */
#detailModal .review-canvas-bar {
  justify-content: flex-start !important;
  gap: 8px !important;
}

#detailModal .review-canvas-title {
  flex: 1 1 auto !important;
  min-width: 140px !important;
  margin-right: auto !important;
}

#detailModal .review-variant-tabs,
#detailModal .review-canvas-bar > .review-zoom:not(.review-variant-tabs),
#detailModal .review-action-group {
  flex: 0 0 auto !important;
}

#detailModal .review-action-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-left: 4px !important;
  padding-left: 6px !important;
}

#detailModal .review-action-separator {
  width: 1px !important;
  height: 24px !important;
  margin: 0 4px !important;
  background: #e2e8f0 !important;
}

#detailModal .review-action-group .review-icon-btn {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  border-radius: 9px !important;
}

#detailModal .review-action-group .review-pin-btn .review-icon {
  width: 20px !important;
  height: 20px !important;
}

/* 任务详情独立页签（?detail=<jobId>）：整页只显示详情，不再是居中的小弹窗。
   隐藏登录/工作台外壳，详情面板铺满整页、去掉遮罩与圆角。 */
body.detail-page {
  overflow: auto;
}
body.detail-page > :not(#detailModal):not(#detailPageLoading) {
  display: none !important;
}
/* ?detail= 打开后、详情还没渲染出来这段空档铺的占位，避免先闪登录/落地页。 */
.detail-page-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #64748b;
  background: #f8fafc;
  z-index: 1;
}
body.detail-page #detailModal {
  position: static !important;
  display: block !important;
}
body.detail-page #detailModal .help-backdrop {
  display: none !important;
}
body.detail-page #detailModal .detail-panel {
  position: static !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Tables aligned with task history table */
.wallet-ledger.panel,
.home-recent.panel,
#usersModule .home-side > .panel {
  border-color: #e6eaf0 !important;
  background: #fff !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

.wallet-ledger.panel,
.home-recent.panel {
  padding-top: 0 !important;
}

.wallet-ledger-table,
.billing-config-table,
.history-table,
.material-table table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: #fff !important;
  color: #0f172a !important;
  font-size: 14px !important;
}

.wallet-ledger-table,
.billing-config-table,
.history-table {
  border: 1px solid #e6eaf0 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
}

.history-table-shell .wallet-ledger-table,
.history-table-shell .billing-config-table,
.history-table-shell .history-table,
.wallet-ledger.panel .wallet-ledger-table,
.home-recent.panel .wallet-ledger-table {
  border: 0 !important;
  border-radius: 0 !important;
}

.material-table {
  border-color: #e6eaf0 !important;
  border-radius: 14px !important;
  background: #fff !important;
}

.wallet-ledger-table th,
.billing-config-table th,
.history-table th,
.material-table th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid #e6eaf0 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.wallet-ledger-table td,
.billing-config-table td,
.history-table td,
.material-table td {
  background: #fff !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  padding: 13px 16px !important;
  border-bottom: 1px solid #eef2f7 !important;
  vertical-align: middle !important;
}

.wallet-ledger-table tbody tr:nth-child(even) td,
.billing-config-table tbody tr:nth-child(even) td,
.history-table tbody tr:nth-child(even) td,
.material-table tbody tr:nth-child(even) td {
  background: #fbfdff !important;
}

.wallet-ledger-table tbody tr:hover td,
.billing-config-table tbody tr:hover td,
.history-table tbody tr:hover td,
.material-table tbody tr:hover td {
  background: #f8fbff !important;
}

.wallet-ledger-table tbody tr:last-child td,
.billing-config-table tbody tr:last-child td,
.history-table tbody tr:last-child td,
.material-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.wallet-ledger-table .num,
.billing-config-table .num,
.history-table .num,
.material-table .num {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}

.table-header-hint {
  cursor: help !important;
  text-decoration: underline dotted rgba(100, 116, 139, 0.45);
  text-underline-offset: 3px;
}

.mh-head .table-header-hint {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.wallet-empty {
  color: #64748b !important;
  font-weight: 500 !important;
  padding: 18px 16px !important;
}

.role-matrix-wrap {
  border-color: #e6eaf0 !important;
  border-radius: 10px !important;
  overflow: auto !important;
  background: #fff !important;
}

.role-matrix-wrap .wallet-ledger-table {
  border: 0 !important;
}

.role-matrix th,
.role-matrix td {
  text-align: center !important;
}

.role-matrix th:first-child,
.role-matrix td:first-child {
  text-align: left !important;
}
.payment-exception-panel .history-table-shell,
.home-recent .history-table-shell {
  border-radius: 18px;
}

.payment-exception-table,
.admin-todo-table {
  min-width: 920px;
}

.payment-exception-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
}

/* ===== 规则中心（rulesModule） ===== */
.rules-view.is-hidden { display: none; }
.rules-subtabs { border-bottom: none; gap: 4px; }
.rules-subtabs .detail-tab { font-size: 12.5px; padding: 5px 11px; border-radius: 8px; border-bottom: 0; }
.rules-subtabs .detail-tab.is-active { background: var(--bg-accent); color: var(--primary-dark); border-bottom-color: transparent; }
.rules-cat .history-table td.rules-no, .history-table td.rules-no { font-family: var(--mono); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.history-table td.rules-stage { color: var(--muted); font-size: 12px; }
.history-table td.rules-title { font-weight: 600; }
.history-table td.rules-detail { color: var(--muted); font-size: 12.8px; line-height: 1.55; }
.history-table td.rules-no, .history-table td.rules-stage, .history-table td.rules-title, .history-table td.rules-detail { vertical-align: top; }
.rules-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.rules-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rules-filter select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); font-size: 13px; color: var(--ink); font-weight: 500; }
.history-table td.rules-major { color: var(--ink); font-size: 12.5px; white-space: nowrap; vertical-align: top; }
.history-table td.rules-major strong { font-weight: 700; }
.rules-search { flex: 1; min-width: 180px; max-width: 320px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 13px; color: var(--ink); }
.rules-search:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.rules-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rules-cat { margin-bottom: 22px; }
.rules-cat > h3 { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 0 0 10px; }
.rules-cat > h3 .rules-step { font-size: 11px; color: var(--muted); font-weight: 700; background: var(--bg-accent); padding: 1px 9px; border-radius: 20px; font-variant-numeric: tabular-nums; }
.rules-cat > h3 .rules-n { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.rules-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rules-dot.cad { background: #2563eb; } .rules-dot.pdf { background: var(--primary); }
.rules-cat .history-table td { vertical-align: top; }
.rules-cat .history-table td.rules-id { font-family: var(--mono); color: var(--muted); font-size: 12px; width: 44px; }
.rules-cat .history-table td.rules-title { font-weight: 600; width: 240px; }
.rules-cat .history-table td.rules-detail { color: var(--muted); font-size: 12.8px; line-height: 1.55; }
.rules-pill { display: inline-block; padding: 2.5px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.rules-pill.ok { background: #e4f1ea; color: #2c7a52; } .rules-pill.warn { background: #f6edd6; color: #976400; } .rules-pill.neu { background: #eaedf0; color: #4b5563; }
.rules-sev { font-weight: 600; } .rules-sev.high { color: #b23b3b; } .rules-sev.mid { color: #976400; } .rules-sev.low { color: var(--muted); }
.rules-act { border: 0; background: transparent; cursor: pointer; color: var(--primary); font-size: 12.5px; padding: 3px 6px; border-radius: 6px; }
.rules-act:hover { background: var(--bg-accent); } .rules-act.del { color: #b23b3b; } .rules-act.del:hover { background: #f7e7e7; }
.rules-tag { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; margin: 2px 3px 2px 0; background: #e7eefb; color: #2563eb; }
.rules-tag.pdf { background: #e1f1ed; color: var(--primary-dark); }
.rules-modal-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.42); display: none; place-items: center; z-index: 1200; padding: 20px; }
.rules-modal-scrim.on { display: grid; }
.rules-modal { background: #fff; border-radius: 16px; width: min(520px, 100%); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); overflow: hidden; }
.rules-modal h3 { margin: 0; padding: 16px 20px; font-size: 15px; border-bottom: 1px solid var(--line); }
.rules-modal .rules-form { padding: 18px 20px; display: grid; gap: 13px; }
.rules-modal label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.rules-modal input, .rules-modal select, .rules-modal textarea { font-family: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; }
.rules-modal textarea { resize: vertical; min-height: 56px; }
.rules-modal .rules-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg-accent); }

.wallet-review-remark {
  max-width: 260px;
  white-space: normal;
  color: var(--muted);
  line-height: 1.45;
}
.billing-reconcile-panel {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.billing-reconcile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.billing-reconcile-head span { color: var(--muted); font-size: 12px; }
.billing-reconcile-lines { display: grid; gap: 4px; }
.billing-reconcile-lines p,
.billing-reconcile-alert p { margin: 0; color: var(--ink); font-size: 13px; }
.billing-reconcile-alert {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--danger);
}
.wallet-txn-grid { margin-bottom: 10px; }
#walletTxnBody .detail-billing-block { margin-top: 12px; }
.float-tip[data-tooltip] {
  position: relative;
  cursor: help;
}
.float-tip[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 180;
  width: max-content;
  max-width: min(360px, 72vw);
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  color: #1f2a44;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.float-tip[data-tooltip]:hover::after,
.float-tip[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.billing-admin-actions .float-tip[data-tooltip]::after {
  left: auto;
  right: 0;
}
.note-line.float-tip[data-tooltip]::after {
  bottom: auto;
  top: calc(100% + 6px);
}
.billing-exception-head {
  gap: 16px;
}
.billing-exception-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.billing-exception-tabs {
  margin: 0;
}
.billing-exception-risk {
  max-width: 360px;
  white-space: normal;
  line-height: 1.45;
  color: var(--muted);
}
.payment-exception-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.wallet-monthly-panel {
  margin: 0 16px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.wallet-monthly-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.wallet-monthly-head span {
  color: var(--muted);
  font-size: 12px;
}
.wallet-monthly-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}
.wallet-monthly-grid > div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.wallet-monthly-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.wallet-monthly-grid strong {
  font-size: 15px;
  color: var(--ink);
}
@media (max-width: 900px) {
  .wallet-monthly-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallet-monthly-head { align-items: flex-start; flex-direction: column; }
}
.low-balance-admin-panel .history-table-shell {
  max-height: 320px;
  overflow: auto;
}
.low-balance-table .wallet-out {
  font-weight: 700;
}
