/* 对齐华通 3.0 底座：左侧菜单、浅色顶栏、浅色侧栏、主色 #2f54eb、圆角主题 6px / 4px、simple 页签。
   主题色、暗黑模式、侧栏/顶栏风格沿用底座「主题风格设置」。后续不要另加配色或圆角。 */
:root {
  --primary: #2f54eb;
  --primary-light-3: #6d87f1;
  --primary-light-8: #d5dcfb;
  --primary-light-9: #eaeffd;
  --success: #52c41a;
  --success-light-9: #eef9e8;
  --warning: #faad14;
  --warning-light-8: #feeed0;
  --warning-light-9: #fef7e8;
  --danger: #ff4d4f;
  --danger-light-9: #ffeded;
  --text: rgba(0, 0, 0, 0.88);
  --text-primary: rgba(0, 0, 0, 0.92);
  --text-secondary: rgba(0, 0, 0, 0.6);
  --text-placeholder: rgba(0, 0, 0, 0.36);
  --border: #d9d9d9;
  --border-light: #e3e3e3;
  --border-lighter: #e8e8e8;
  --fill: #f0f0f0;
  --fill-light: #f5f5f5;
  --fill-lighter: #f7f7f7;
  --bg: #ffffff;
  --page: #f7f7f9;
  --radius: 6px;
  --radius-sm: 4px;
  --header-h: 54px;
  --sidebar: 220px;
  --tab-h: 40px;
  --shadow-lighter: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
  --shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
  --hairline: 0 0 0 0.8px var(--border-lighter);
}

* { box-sizing: border-box; outline: none; }
html, body, #app { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, Roboto, Arial, Helvetica, "Segoe UI", "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color: var(--text);
  background: var(--page);
  font-size: 14px;
  line-height: 1.58;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

.layout { display: flex; flex-direction: column; height: 100%; background: var(--page); }
.layout-body { flex: 1; min-height: 0; display: flex; }
.layout-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.top {
  height: var(--header-h);
  flex: none;
  display: flex;
  align-items: stretch;
  background: var(--bg);
  box-shadow: var(--hairline);
  z-index: 10;
}
.logo {
  display: flex;
  align-items: center;
  flex: none;
  width: var(--sidebar);
  height: var(--header-h);
  padding: 0 16px;
  color: var(--text-primary);
  text-decoration: none;
}
.logo img { width: 30px; height: 30px; }
.logo h1 { margin: 0 0 0 10px; font-size: 18px; font-weight: normal; line-height: 1; white-space: nowrap; }
.top-tools { display: flex; align-items: center; flex: none; margin-left: auto; padding-right: 6px; }
.menu-search {
  width: 148px;
  height: 32px;
  margin-right: 6px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: var(--bg);
  color: var(--text);
}
.menu-search::placeholder { color: var(--text-placeholder); }
.menu-search:hover { border-color: var(--primary); }
.menu-search:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light-8); }
.msg-btn {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 14px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.msg-btn:hover { background: rgba(0, 0, 0, 0.04); }
.msg-badge {
  position: absolute;
  top: 16px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--danger);
  vertical-align: 1px;
}
.user-box { position: relative; height: var(--header-h); }
.tool-user {
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  white-space: nowrap;
}
.tool-user:hover { background: rgba(0, 0, 0, 0.04); }
.user-drop {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  min-width: 148px;
  padding: 6px 0;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 30;
}
.user-drop button {
  display: block;
  width: 100%;
  height: 32px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.user-drop button:hover { background: var(--fill-light); color: var(--text-primary); }
.dark-switch {
  position: relative;
  width: 40px;
  height: 22px;
  margin: 0 6px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--fill);
  flex: none;
}
.dark-switch:after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='none' stroke='%23595959' stroke-width='2'/%3E%3Cpath d='M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M19.1 4.9l-1.4 1.4M6.3 17.7l-1.4 1.4' stroke='%23595959' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  transition: left .2s;
}
.dark-switch.is-on { background: var(--fill); }
.dark-switch.is-on:after {
  left: 19px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 13a6 6 0 0 1-8.5-8.5A7 7 0 1 0 16 13z' fill='none' stroke='%23595959' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.dark-switch.sm { width: 36px; height: 18px; margin: 0; }
.dark-switch.sm:after { width: 14px; height: 14px; background-size: 10px; }
.dark-switch.sm.is-on:after { left: 19px; }

.side {
  width: var(--sidebar);
  flex: none;
  min-height: 0;
  background: var(--bg);
  box-shadow: var(--hairline);
  overflow: auto;
}
.nav { padding: 4px 0 12px; }
.group-name {
  padding: 4px 16px 2px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: normal;
}
.nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin: 0 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  line-height: 22px;
  white-space: normal;
}
.nav a:hover { color: var(--primary); background: transparent; }
.nav a.active {
  color: var(--primary);
  background: var(--primary-light-9);
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav .empty { padding: 12px 16px; color: var(--text-placeholder); }
.folder { margin: 0; }
.folder-toggle {
  display: flex;
  width: calc(100% - 12px);
  min-height: 40px;
  align-items: flex-start;
  gap: 8px;
  margin: 0 6px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  font-size: 14px;
  line-height: 22px;
  white-space: normal;
}
.folder-toggle:hover { color: var(--primary); }
.folder-toggle .caret { width: 14px; flex: none; margin-top: 6px; color: var(--text-placeholder); font-size: 10px; }
.folder .sub a { padding-left: 36px; }
.folder .folder { margin-top: 2px; }
.folder .folder > .folder-toggle { padding-left: 28px; font-size: 13px; }
.folder .folder .sub a { padding-left: 48px; }
.folder.closed .sub { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.tabbar {
  height: var(--tab-h);
  flex: none;
  display: flex;
  align-items: stretch;
  background: var(--bg);
  box-shadow: var(--hairline);
}
.tabbar-main { display: flex; min-width: 0; }
.tabbar-item {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--primary);
  background: var(--primary-light-9);
  font-weight: normal;
}
.tabbar-item.on:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--primary);
}
.tabbar-extra { margin-left: auto; display: flex; align-items: center; padding-right: 12px; }

.content { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.banner, .talk, .card, .pending, .query, .form-grid, .portal-hero {
  background: var(--bg);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lighter);
}
.banner, .talk, .pending { padding: 8px 12px; margin-bottom: 16px; }
.banner { background: var(--primary-light-9); border-color: var(--primary-light-8); color: var(--text); }
.talk h3, .card h3, .pending h3, .block-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: normal;
  color: var(--text-primary);
  line-height: 24px;
}
.block-title { margin: 16px 0 8px; }
.talk ul, .pending ul { margin: 0; padding-left: 18px; }
.talk li, .pending li { margin: 4px 0; line-height: 1.58; }
.pending { background: var(--warning-light-9); border-color: var(--warning-light-8); }
.pending h3, .pending li { color: var(--text); }

.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.sources .label { color: var(--text-secondary); }
.ref-list { margin: 0 0 16px; padding-left: 18px; }
.ref-list li { margin: 6px 0; line-height: 1.58; }
.ref-list a { color: var(--primary); text-decoration: none; }
.ref-list a:hover { text-decoration: underline; }

.doc-history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.doc-history-item { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 12px 14px; background: #fafbfc; display: grid; gap: 10px; }
.doc-history-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.doc-history-hd b { font-size: 15px; color: var(--primary, #1d4ed8); }
.doc-history-hd span { color: #64748b; font-size: 13px; }
.summary { margin: 0 0 12px; color: var(--text); line-height: 1.58; }

.scope {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.scope b { font-weight: normal; }
.scope label { display: inline-flex; gap: 4px; align-items: center; }

table { width: 100%; border-collapse: collapse; background: var(--bg); }
th, td { border-bottom: 1px solid var(--border-lighter); text-align: left; padding: 8px 12px; vertical-align: top; color: var(--text); }
th { background: var(--bg); font-weight: 600; color: var(--text-secondary); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--fill-light); }
th:last-child, td.ops { position: sticky; right: 0; background: var(--bg); box-shadow: inset -10px 0 10px -10px rgb(0 0 0 / 15%); }
tbody tr:hover td.ops { background: var(--fill-light); }
.th-src { display: block; margin-top: 4px; font-weight: 400; }
.note, .foot-note { color: var(--text-secondary); font-size: 13px; }
.card { padding: 0; overflow: hidden; margin-bottom: 16px; }
.card .hd { padding: 14px 22px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.card .hd h3 { margin: 0; }
.card .hd a { color: var(--primary); text-decoration: none; font-size: 14px; }
.table-wrap { overflow: auto; }

.fields { width: 100%; }
.fields td:nth-child(1) { width: 180px; color: var(--text-secondary); font-weight: normal; }
.fields td:nth-child(2) { width: 120px; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat {
  background: var(--bg);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lighter);
  padding: 16px 20px;
}
.stat .k { color: var(--text-secondary); font-size: 14px; }
.stat .v { font-size: 24px; font-weight: normal; margin-top: 4px; color: var(--primary); line-height: 1.2; }
a.stat { text-decoration: none; color: inherit; display: block; }
a.stat:hover { border-color: var(--primary); }
.matrix td, .matrix th { white-space: nowrap; }
.matrix td.wrap, .wrap { white-space: normal; min-width: 220px; }

.drawer-mask, .modal-mask, .sheet-mask, .file-preview {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20;
}
.modal-mask, .file-preview { z-index: 30; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; }
.drawer, .sheet {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  background: var(--bg);
  z-index: 21;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: sheet-in .2s ease;
}
.drawer { width: min(460px, 100%); overflow: auto; padding: 0; }
.drawer.wide { width: min(860px, 100%); }
.drawer h3 { margin: 8px 0; font-size: 16px; font-weight: normal; color: var(--text-primary); }
.drawer .close { float: right; }
.drawer-hd, .sheet-hd, .modal-hd {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}
.drawer-hd { position: sticky; top: 0; }
.drawer-hd h3, .sheet-hd h3, .modal-hd h3 { margin: 0; font-size: 16px; font-weight: normal; line-height: 24px; color: var(--text-primary); }
.drawer-bd { padding: 20px; }
.drawer-bd h4 { margin: 16px 0 8px; font-size: 14px; font-weight: normal; color: var(--text-primary); }
.sheet { z-index: 31; width: min(920px, 100%); background: var(--page); }
.sheet-hd, .sheet-ft { background: var(--bg); }
.sheet-kicker { color: var(--primary); font-size: 12px; }
.sheet-bd { flex: 1; overflow: auto; }
.sheet .tabs { margin: 0; padding: 0 16px; background: var(--bg); }
.sheet-ft, .modal-ft { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border-light); background: var(--bg); }
.sheet-ft [data-fmea-report], .modal-ft [data-fmea-report] { margin-right: auto; }
@keyframes sheet-in { from { transform: translateX(16px); } to { transform: none; } }

.btn {
  height: 32px;
  padding: 0 15px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: normal;
  line-height: 30px;
}
.btn:hover { color: var(--primary); border-color: var(--primary); background: var(--bg); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-light-3); border-color: var(--primary-light-3); color: #fff; }
.btn.ghost { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn.ghost:hover { color: var(--primary); border-color: var(--primary); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.switcher { display: flex; flex-wrap: wrap; gap: 12px; }
.switcher button.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.query {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  padding: 20px 20px 8px;
  margin-bottom: 16px;
}
.query label { display: flex; flex-direction: column; gap: 4px; color: var(--text); font-size: 14px; }
.query input, .query select, .form-grid input, .form-grid select, .form-grid textarea, .qa-compose input {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  min-width: 180px;
  color: var(--text);
  background: var(--bg);
}
.query input:hover, .query select:hover, .form-grid input:hover, .form-grid select:hover, .form-grid textarea:hover, .qa-compose input:hover { border-color: var(--primary); }
.query input:focus, .query select:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .qa-compose input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light-8);
}
.query .grow { margin-left: auto; }

.pager { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text); font-size: 14px; }
.ops { white-space: nowrap; }
.ops .btn, .ops button {
  height: auto;
  margin-right: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  line-height: 1.58;
  border-radius: 0;
}
.ops .btn:hover, .ops button:hover { color: var(--primary-light-3); background: transparent; }

.legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.legend button, .tag, .badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 22px;
  background: var(--fill);
  color: var(--text);
}
.legend button { cursor: pointer; }
.legend button.on { border-color: var(--primary); color: var(--primary); }
.badge.wait { background: var(--warning-light-9); color: var(--warning); border-color: var(--warning); }
.badge.ok { background: var(--success-light-9); color: var(--success); border-color: var(--success); }
.badge.stop { background: var(--danger-light-9); color: var(--danger); border-color: var(--danger); }
.badge.skip { background: var(--fill); color: var(--text-secondary); border-color: var(--border); }
.badge { white-space: nowrap; flex: none; }
td.col-fit { white-space: nowrap; width: 1%; }
.accept-counts { grid-template-columns: repeat(4, 1fr); }
.accept-num.ok { color: var(--success); }
.accept-num.wait { color: var(--warning); }
.accept-num.stop { color: var(--danger); }
.accept-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 8px; }
.accept-groups { display: flex; flex-direction: column; gap: 12px; }
.accept-group { background: #fff; border: 1px solid var(--border-lighter); border-radius: var(--radius); overflow: hidden; }
.accept-group.is-skip { background: var(--bg); }
.accept-quote { padding: 12px 14px 10px; line-height: 1.7; }
.accept-quote .k { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.accept-quote p { margin: 0 0 6px; }
.accept-quote p:last-child { margin-bottom: 0; }
.accept-group table { margin: 0; }
.accept-group th:last-child,
.accept-group td.go { position: static; box-shadow: none; width: 56px; white-space: nowrap; }
.accept-group tbody tr { cursor: default; }
.accept-group td.clause { font-weight: 600; white-space: nowrap; }
.accept-group td.status { white-space: nowrap; }

.modal, .file-preview-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 96px);
  overflow: auto;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.file-preview-card { width: min(840px, 100%); height: min(720px, calc(100vh - 96px)); display: flex; flex-direction: column; overflow: hidden; }
.modal-hd, .modal-ft { padding: 14px 20px; }
.modal-ft { padding: 10px 20px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-light); margin-bottom: 12px; background: var(--bg); }
.tabs button {
  height: 40px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 0 16px;
  border-radius: 0;
}
.tabs button:hover { color: var(--primary); }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: normal; }
.pane { display: none; }
.pane.on { display: block; }
.modal .tabs { margin: 0 20px 12px; }
.flow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 4px; padding: 8px 0 16px; }
.flow-pad { padding: 16px 20px 20px; }
.step { width: 132px; text-align: center; }
.step .role {
  min-height: 32px;
  margin: 0 0 8px;
  padding: 4px 6px;
  border-radius: var(--radius-sm, 4px);
  background: var(--primary-light-9, #ecf5ff);
  color: var(--primary, #409eff);
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}
.step.done .role { background: #f0f9eb; color: var(--success, #67c23a); }
.step.current .role { background: var(--primary-light-8, #d9ecff); color: var(--primary, #409eff); font-weight: normal; }
.step .dot { width: 28px; height: 28px; line-height: 28px; border-radius: 50%; margin: 0 auto 6px; background: var(--fill); color: var(--text-secondary); font-weight: normal; }
.step.done .dot { background: var(--success); color: #fff; }
.step.current .dot { background: var(--primary); color: #fff; }
.step .nm { font-weight: normal; line-height: 1.4; font-size: 14px; color: var(--text); }
.arrow { color: var(--text-placeholder); padding-top: 40px; font-size: 16px; align-self: flex-start; }

.qa-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 25;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.qa-float.folded { height: auto; width: 168px; }
.qa-float.folded .qa-log, .qa-float.folded .qa-suggest, .qa-float.folded .qa-compose { display: none; }
.qa-float-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}
.qa-float-hd b { font-size: 14px; font-weight: normal; }
.qa-fold { border: 0; background: transparent; color: var(--text-secondary); font-size: 14px; padding: 0 4px; }
.qa-fold:hover { color: var(--primary); }
.qa-log { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--page); }
.qa-msg { max-width: 86%; padding: 8px 12px; border-radius: var(--radius); line-height: 1.58; font-size: 14px; white-space: pre-wrap; }
.qa-msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--border-lighter); }
.qa-msg.user { align-self: flex-end; background: var(--primary-light-9); color: var(--text); }
.qa-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px 0; background: var(--bg); }
.qa-tip {
  height: 24px;
  border: 1px solid var(--primary-light-8);
  background: var(--primary-light-9);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-size: 12px;
}
.qa-compose { display: flex; gap: 12px; padding: 12px; background: var(--bg); }
.qa-compose input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px; padding: 20px; }
.form-grid label, .form-grid .form-field, .field-ro { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text); }
.span-2 { grid-column: 1 / -1; }
.field-label { color: var(--text-secondary); }
.field-value { min-height: 32px; padding: 4px 10px; border-radius: var(--radius); background: var(--fill-light); color: var(--text); line-height: 1.58; font-size: 14px; white-space: pre-wrap; }
.form-grid .dept-scope, .form-grid .person-scope { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0; background: var(--bg); border: 0; padding: 0; box-shadow: none; }
.form-grid .dept-scope label, .form-grid .person-scope label { flex-direction: row; align-items: center; gap: 4px; font-size: 14px; color: var(--text); }
.form-grid .person-scope .person-opt { min-width: 200px; padding: 6px 8px; border: 1px solid var(--border-lighter); border-radius: var(--radius-sm, 4px); }
.form-grid .person-scope .person-opt b { font-weight: normal; color: var(--text-primary); }
.form-grid .person-scope .person-meta { color: var(--text-secondary); font-size: 12px; margin-left: 2px; }
.tpl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; }
.tpl-row .field-hint { margin: 0; }
.uploader { position: relative; }
.form-grid .uploader-input { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; }
.uploader-drop {
  display: block;
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--fill-lighter);
  padding: 16px 12px;
  text-align: center;
  color: var(--text-secondary);
  font: inherit;
}
.uploader-drop:hover, .uploader-drop.over { border-color: var(--primary); background: var(--primary-light-9); }
.uploader-drop b, .uploader-ico { color: var(--primary); }
.uploader-ico { display: block; margin-bottom: 4px; font-size: 16px; font-weight: normal; }
.uploader-tip, .uploader-empty { display: block; margin-top: 4px; font-size: 12px; color: var(--text-placeholder); }
.uploader-empty { margin-top: 0; padding: 10px 0; }
.uploader-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--bg);
}
.uploader-mark {
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--primary-light-9);
  color: var(--primary);
  flex: none;
}
.uploader-item .meta { flex: 1; min-width: 0; }
.uploader-item .meta b { display: block; color: var(--text-primary); font-size: 14px; font-weight: normal; word-break: break-all; }
.uploader-status { color: var(--text-secondary); font-size: 12px; }
.uploader-bar { height: 3px; margin-top: 6px; background: var(--fill); border-radius: 2px; overflow: hidden; }
.uploader-bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s ease; }
.file-preview-body { flex: 1; overflow: auto; padding: 16px; background: var(--page); }
.file-preview-body img { max-width: 100%; }
.file-preview-body iframe { width: 100%; height: 100%; min-height: 520px; border: 0; background: var(--bg); }
.file-preview-text { white-space: pre-wrap; margin: 0; font-family: inherit; line-height: 1.58; }
.form-grid textarea { height: auto; min-height: 96px; padding: 8px 10px; resize: vertical; line-height: 1.58; }
.cell-clip { max-width: 360px; max-height: 4.8em; overflow: hidden; }
.cert-list, .related-list { display: flex; flex-direction: column; gap: 12px; }
.cert-list-hd, .related-list-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cert-list-hd .field-hint, .related-list-hd .field-hint { display: block; margin-top: 4px; }
.cert-card, .related-card { border: 1px solid var(--border-lighter); border-radius: var(--radius); background: var(--fill-lighter); padding: 12px; }
.cert-card-hd, .related-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cert-card-hd b, .related-card-hd b { color: var(--text-primary); font-size: 14px; font-weight: normal; }
.cert-card-grid, .related-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.related-card-grid .span-2 { grid-column: 1 / -1; }
.cert-empty { padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-secondary); background: var(--bg); }
.timeline { list-style: none; margin: 8px 0 0; padding: 4px 8px 8px; }
.tl { position: relative; padding: 0 0 18px 28px; }
.tl:before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 0; width: 2px; background: var(--border-lighter); }
.tl:last-child:before { display: none; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border); }
.tl.done .tl-dot { background: var(--success); border-color: var(--success); }
.tl.current .tl-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light-8); }
.tl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tl-top b { color: var(--text-primary); font-size: 14px; font-weight: normal; }
.tl-meta { margin-top: 4px; color: var(--text-secondary); font-size: 12px; }
.tl-desc { margin-top: 4px; color: var(--text); line-height: 1.58; }
.field-hint { display: block; margin-top: 4px; font-weight: 400; color: var(--text-placeholder); }

.portal-hero { padding: 20px; margin-bottom: 16px; color: var(--text); }
.portal-hero h3 { margin: 0 0 6px; font-size: 16px; color: var(--text-primary); }
.portal-hero p { margin: 0; line-height: 1.58; }
.portal-links { margin-bottom: 16px; }
.portal-orders { margin: 0 0 8px; }
.policy-order.in-card { min-height: 0; margin: 8px 0 4px; padding: 36px 48px 28px; }
.policy-order .policy-line { text-indent: 2em; }
.policy-demo { margin: 16px 16px 0; }
.policy-demo-steps { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.policy-demo-steps li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 108px;
  padding: 8px 10px;
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  color: var(--text-secondary);
  background: var(--bg);
  text-align: center;
}
.policy-demo-steps .step-role {
  min-height: 28px;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: var(--radius-sm, 4px);
  background: var(--fill-lighter, #f5f7fa);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
  word-break: break-word;
  white-space: normal;
}
.policy-demo-steps li.on { border-color: var(--primary); color: var(--primary); }
.policy-demo-steps li.done { border-color: var(--success); color: var(--success); }
.policy-demo-steps li.on .step-role { background: var(--primary-light-9, #ecf5ff); color: var(--primary); }
.policy-demo-steps li.done .step-role { background: #f0f9eb; color: var(--success, #67c23a); }
.policy-demo-steps b { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--fill); font-weight: normal; }
.policy-demo-steps li.on b { background: var(--primary); color: #fff; }
.policy-demo-steps li.done b { background: var(--success); color: #fff; }
.policy-demo-steps li > span:last-child { white-space: nowrap; }
.policy-demo .note { margin: 8px 0 0; }
.sign-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sign-people li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-lighter); border-radius: var(--radius-sm, 4px); }
.sign-people li b { font-weight: 600; }
.sign-people .person-meta { color: var(--text-secondary); font-size: 12px; flex: 1; }
.sign-people .badge { margin-left: auto; }
.policy-train-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.tl-role { color: var(--primary); }
.form-grid input[type="hidden"] { display: none; }
.policy-sign { margin-top: 48px; text-align: right; line-height: 1.9; }
.portal-bd { padding: 0 22px 14px; }
.policy-update-banner { margin: 0 0 10px; padding: 10px 12px; background: #fdf6ec; border: 1px solid #f5dab1; border-radius: var(--radius-sm, 4px); }
.policy-update-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.policy-update-item + .policy-update-item { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #f5dab1; }
.policy-update-item b { color: var(--warning, #e6a23c); }
.portal-list { list-style: none; margin: 0; padding: 0; }
.portal-list li { padding: 8px 0; border-top: 1px solid var(--border-lighter); }
.portal-list a { color: var(--text-primary); text-decoration: none; }
.portal-list a:hover { color: var(--primary); }
.portal-list .note { display: block; margin-top: 2px; }
.doc-sheet {
  max-width: 680px;
  margin: 8px auto 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-lighter);
  padding: 48px 56px 40px;
  min-height: 560px;
  box-shadow: var(--shadow);
}
.doc-sheet.pdf { background: var(--fill-lighter); }
.doc-sheet h1 { margin: 12px 0 0; text-align: center; font-size: 22px; color: var(--text-primary); font-weight: 600; }
.doc-sheet h2 { margin: 22px 0 8px; font-size: 15px; color: var(--text-primary); }
.doc-sheet p { margin: 0 0 10px; line-height: 1.75; }
.doc-kicker, .doc-meta, .doc-foot, .doc-page-no { color: var(--text-secondary); font-size: 12px; }
.doc-kicker, .doc-meta, .doc-page-no { text-align: center; }
.doc-meta { margin-top: 8px; }
.doc-foot { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--border-lighter); }
.doc-page-no { margin-top: 16px; }
.kb-layout { display: flex; align-items: flex-start; gap: 16px; }
.kb-tree {
  width: 268px;
  flex: none;
  background: var(--bg);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  padding: 8px 0;
  max-height: calc(100vh - 140px);
  overflow: auto;
}
.kb-main { flex: 1; min-width: 0; }
.kb-node { display: flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 8px; }
.kb-node.sub { padding-left: 28px; }
.kb-node.on { background: var(--primary-light-9); }
.kb-twist, .kb-label, .kb-act { border: 0; background: transparent; color: var(--text); padding: 0; }
.kb-twist { width: 16px; flex: none; color: var(--text-secondary); }
.kb-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.kb-node.on .kb-label { color: var(--primary); }
.kb-act { flex: none; color: var(--primary); font-size: 12px; }
.kb-edit { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 28px; }
.kb-edit input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}
.kb-empty { padding: 2px 8px 8px 28px; color: var(--text-secondary); font-size: 12px; }
.links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.links a {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lighter);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
}
.links a:hover { border-color: var(--primary); }
.links a b { display: block; margin-bottom: 4px; font-weight: normal; color: var(--text-primary); }
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-lighter);
  box-shadow: var(--shadow);
  z-index: 40;
}
.foot-note { margin-top: 8px; }

.tag-local { background: #e5f6ee; color: #0f7b4c; }
.tag-nc { background: #e7f0fb; color: #0b4f9c; }
.tag-oa { background: #fff1e0; color: #9a5b00; }
.tag-bpm { background: #fde8e8; color: #b42318; }
.tag-mes { background: #f3e8ff; color: #6b21a8; }
.tag-eim { background: #e0f7fa; color: #0e7490; }
.tag-plm { background: #ece7ff; color: #5b21b6; }
.tag-yxt { background: #e7f6e9; color: #1b5e20; }
.tag-hr { background: #fce4ec; color: #ad1457; }
.tag-fin { background: #fff8e1; color: #8a6a00; }
.tag-asset { background: #efebe9; color: #5d4037; }
.tag-doc { background: #e3f2fd; color: #1565c0; }
.tag-portal { background: #e0f2f1; color: #00695c; }
.tag-tdm { background: #f1f8e9; color: #558b2f; }
.tag-oldq { background: #eceff1; color: #455a64; }
.tag-sam { background: #f9fbe7; color: #827717; }
.tag-pending { background: #fff4e5; color: #c2410c; }
.tag-kb { background: #e8eaf6; color: #283593; }

@media (max-width: 1100px) {
  .grid, .links { grid-template-columns: 1fr 1fr; }
}

html:not(.rounded) { --radius: 3px; --radius-sm: 2px; }

.side.is-dark { background: #191a23; box-shadow: none; }
.side.is-dark .group-name { color: rgba(255, 255, 255, 0.6); }
.side.is-dark .nav a,
.side.is-dark .folder-toggle { color: rgba(255, 255, 255, 0.8); }
.side.is-dark .nav a:hover,
.side.is-dark .folder-toggle:hover { color: #fff; }
.side.is-dark .nav a.active { color: #fff; background: var(--primary); box-shadow: none; }
.side.is-dark .folder-toggle .caret,
.side.is-dark .nav .empty { color: rgba(255, 255, 255, 0.4); }

.top.is-dark,
.top.is-primary { box-shadow: none; }
.top.is-dark { background: #191a23; }
.top.is-primary {
  background: linear-gradient(12deg, var(--primary), var(--primary-light-3) 28%, var(--primary-light-5) 46%, var(--primary-light-3) 72%, var(--primary) 92%, var(--primary-dark-2));
}
.top.is-dark .logo,
.top.is-dark .logo h1,
.top.is-dark .tool-user,
.top.is-primary .logo,
.top.is-primary .logo h1,
.top.is-primary .tool-user { color: #fff; }
.top.is-dark .tool-user:hover,
.top.is-primary .tool-user:hover { background: rgba(255, 255, 255, 0.12); }
.top.is-primary .logo img { filter: contrast(0) brightness(1000%); }
.top.is-dark .dark-switch,
.top.is-primary .dark-switch { border: 0; background: rgba(255, 255, 255, 0.38); }

.theme-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: 268px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.theme-drawer[hidden] { display: none; }
.theme-close {
  position: absolute;
  top: calc(50vh - 18px);
  left: -36px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px 0 0 8px;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  line-height: 36px;
}
.theme-close:hover { background: var(--primary-light-3); }
.theme-bd { flex: 1; overflow: auto; padding: 10px 12px 18px; }
.theme-styles { display: flex; flex-wrap: wrap; padding: 0 6px; }
.theme-item { width: 73px; margin-bottom: 16px; font-size: 13px; color: var(--text); line-height: 1.4; }
.theme-cover {
  display: block;
  width: 52px;
  height: 36px;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--page);
  box-shadow: 0 0 0 0.8px var(--border-light), 0 0 4px 1px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.theme-cover:before,
.theme-cover:after { content: ""; position: absolute; left: 0; top: 0; background: var(--bg); }
.theme-cover:before { width: 100%; height: 10px; }
.theme-cover:after { width: 14px; height: 100%; }
.theme-cover.sidebar-dark:after,
.theme-cover.header-dark:before { background: #262626; }
.theme-cover.header-primary:before {
  background: linear-gradient(12deg, var(--primary), var(--primary-light-3) 28%, var(--primary-light-5) 46%, var(--primary-light-3) 72%, var(--primary) 92%, var(--primary-dark-2));
}
.theme-cover.header-light:before,
.theme-cover.header-dark:before,
.theme-cover.header-primary:before { z-index: 1; }
.theme-cover.on { outline: 1px solid var(--primary); outline-offset: 2px; }
.theme-colors { padding: 0 6px 18px; line-height: 0; }
.theme-color {
  width: 20px;
  height: 20px;
  margin: 8px 8px 0 0;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  vertical-align: top;
}
.theme-color.on { outline: 1px solid currentColor; outline-offset: 2px; }
.theme-row {
  display: flex;
  align-items: center;
  height: 32px;
  margin-bottom: 6px;
  padding: 0 6px;
  border-radius: var(--radius);
  color: var(--text);
}
.theme-row span { flex: 1; }
.theme-row:hover { background: var(--fill-light); }

html.dark {
  --text: rgba(255, 255, 255, 0.85);
  --text-primary: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.4);
  --text-placeholder: rgba(255, 255, 255, 0.3);
  --border: #424242;
  --border-light: #363636;
  --border-lighter: #303030;
  --fill: #303030;
  --fill-light: #282828;
  --fill-lighter: #232323;
  --bg: #181818;
  --page: #0f0f0f;
  --success: #49aa19;
  --warning: #d89614;
  --danger: #dc4446;
  --success-light-9: #162312;
  --warning-light-8: #2b2111;
  --warning-light-9: #2b2111;
  --danger-light-9: #2a1215;
  --shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48), 0 9px 28px 8px rgba(0, 0, 0, 0.2);
}
html.dark .nav a.active { background: color-mix(in srgb, var(--primary) 20%, var(--bg)); }
html.dark .side.is-dark .nav a.active { background: var(--primary); color: #fff; }


.biz-map-spine {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px 4px;
  list-style: none;
  margin: 0;
  padding: 8px 4px 4px;
}
.biz-map-step {
  min-width: 108px;
  max-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--border, #d0d5dd);
  border-radius: 6px;
  background: var(--card, #fff);
}
.biz-map-step b { display: block; font-size: 13px; margin-bottom: 4px; }
.biz-map-step span { display: block; font-size: 12px; color: var(--muted, #667085); }
.biz-map-arrow {
  display: flex;
  align-items: center;
  color: var(--muted, #98a2b3);
  font-size: 14px;
  padding: 0 2px;
}


.biz-map-img-wrap {
  padding: 12px;
  overflow: auto;
  max-height: min(70vh, 720px);
  background: #f7f8fa;
}
.biz-map-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 1600px;
  margin: 0 auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: #fff;
}

.cfield-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cfield-row input { flex: 1; }
.cfield-row select { width: 88px; }
