/* ============================================================
   asomer.cn — AutoIND product UI recreations
   Faithful HTML/CSS rebuilds of real AutoIND screens.
   Tokens mirror AutoIND frontend/styles/base.css. Scoped to .pui.
   ============================================================ */

.pui {
  --p-bg: #f5f6f8;
  --p-surface: #ffffff;
  --p-surface-2: #fafbfc;
  --p-surface-3: #f3f4f6;
  --p-border: #e5e7eb;
  --p-border-strong: #d1d5db;
  --p-divider: #eef0f3;
  --p-text: #111827;
  --p-text-2: #374151;
  --p-text-3: #6b7280;
  --p-text-4: #9ca3af;
  --p-brand: #2563eb;
  --p-brand-hover: #1d4ed8;
  --p-brand-active: #1e40af;
  --p-brand-soft: #eff6ff;
  --p-brand-soft-2: #dbeafe;
  --p-wordmark: #60a5fa;
  --p-success: #059669; --p-success-soft: #ecfdf5;
  --p-warning: #b45309; --p-warning-soft: #fffbeb;
  --p-danger: #b91c1c;  --p-danger-soft: #fef2f2;
  --p-info: #0369a1;    --p-info-soft: #f0f9ff;
  --p-neutral: #4b5563; --p-neutral-soft: #f3f4f6;
  --p-r-sm: 6px; --p-r-md: 8px; --p-r-lg: 12px;
  --p-sh-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --p-sh-2: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --p-sh-3: 0 12px 32px rgba(15, 23, 42, 0.10);

  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--p-bg);
  color: var(--p-text);
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  letter-spacing: 0;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.pui * { box-sizing: border-box; }
.pui svg { width: 16px; height: 16px; flex: 0 0 auto; stroke-width: 2; }
.pui .num { font-variant-numeric: tabular-nums; }
.pui [data-icon] { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- App header (dark glass) ---------- */
.pui-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 16px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0, rgba(255, 255, 255, 0) 1px),
    rgba(22, 22, 24, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 24px rgba(0, 0, 0, 0.16);
  flex: 0 0 auto;
}
.pui-header-left, .pui-header-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pui-header-right { gap: 8px; }
.pui-logo { font-family: "Helvetica Neue", "PingFang SC", sans-serif; font-size: 18px; font-weight: 600; white-space: nowrap; }
.pui-logo span { color: var(--p-wordmark); }
.pui-back {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px;
  background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--p-r-sm); font-size: 13px; white-space: nowrap;
}
.pui-back svg { width: 14px; height: 14px; }
.pui-domain { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.2); font-size: 14px; white-space: nowrap; }
.pui-domain-badge { padding: 4px 10px; background: rgba(255, 255, 255, 0.15); border-radius: 4px; font-size: 12px; font-weight: 600; }
.pui-hbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px;
  border-radius: var(--p-r-sm); background: rgba(255, 255, 255, 0.10); color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.pui-hbtn--icon { padding: 0 10px; }
.pui-hbtn--primary { background: var(--p-brand); }
.pui-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%); color: #fff; font-size: 11px; font-weight: 700; flex: 0 0 auto;
}
.pui-avatar--sm { width: 22px; height: 22px; font-size: 9px; }

/* ---------- Buttons, badges, chips ---------- */
.pui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--p-border-strong); border-radius: var(--p-r-sm); background: var(--p-surface);
  color: var(--p-text); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.pui-btn svg { width: 14px; height: 14px; }
.pui-btn--primary { background: var(--p-brand); border-color: var(--p-brand); color: #fff; }
.pui-btn--ghost { border-color: transparent; background: transparent; color: var(--p-text-2); }
.pui-btn--soft { border-color: var(--p-brand-soft-2); background: var(--p-brand-soft); color: var(--p-brand); }
.pui-btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.pui-btn--icon { width: 30px; padding: 0; border-color: transparent; background: transparent; color: var(--p-text-3); }

.pui-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap;
  background: var(--p-neutral-soft); color: var(--p-neutral);
}
.pui-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pui-badge--plain::before { display: none; }
.pui-badge--success { background: var(--p-success-soft); color: var(--p-success); }
.pui-badge--warning { background: var(--p-warning-soft); color: var(--p-warning); }
.pui-badge--danger { background: var(--p-danger-soft); color: var(--p-danger); }
.pui-badge--info { background: var(--p-info-soft); color: var(--p-info); }
.pui-badge--brand { background: var(--p-brand-soft); color: var(--p-brand); }

.pui-page-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--p-border);
  border-radius: 4px; background: var(--p-surface); color: var(--p-text-2); font-size: 11px; font-weight: 600;
}
.pui-mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--p-text-3); }

.pui-card { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-r-lg); box-shadow: var(--p-sh-1); }
.pui-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--p-divider); }
.pui-card-title { font-size: 16px; font-weight: 600; }
.pui-card-title small { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--p-text-3); }
.pui-card-body { padding: 20px; }

/* underline tabs (add-file-tabs / pd-tab pattern) */
.pui-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--p-border); }
.pui-tab { position: relative; padding: 10px 12px; font-size: 13px; font-weight: 500; color: var(--p-text-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.pui-tab.is-active { color: var(--p-brand); }
.pui-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--p-brand); border-radius: 2px; }
.pui-tab-count { padding: 0 7px; border-radius: 999px; background: var(--p-surface-3); color: var(--p-text-2); font-size: 11px; line-height: 18px; }
.pui-tab.is-active .pui-tab-count { background: var(--p-brand-soft); color: var(--p-brand); }
.pui-card-head .pui-tabs { border-bottom: 0; margin-bottom: -17px; }

/* ============================================================
   Screen: 上传与生成选项 (auto-generate-upload)
   ============================================================ */
.pui-upload { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding: 24px; align-items: start; }
.pui-drop {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 22px; margin-bottom: 16px;
  border: 1px dashed var(--p-border-strong); border-radius: var(--p-r-md); color: var(--p-text-2); font-size: 14px;
}
.pui-drop svg { width: 22px; height: 22px; color: var(--p-text-3); }
.pui-drop small { display: block; font-size: 12px; color: var(--p-text-3); }
.pui-study { border: 1px solid var(--p-border); border-radius: var(--p-r-md); overflow: hidden; margin-bottom: 12px; }
.pui-study-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--p-surface-2); border-bottom: 1px solid var(--p-divider); font-size: 13px; color: var(--p-text-3); }
.pui-study-head strong { color: var(--p-text); font-size: 14px; }
.pui-study-head em { margin-left: auto; font-style: normal; font-size: 12px; }
.pui-study--warn { border-color: #e7b37a; }
.pui-study--warn .pui-study-head { background: var(--p-warning-soft); }
.pui-study--warn .pui-study-head em { color: var(--p-warning); font-weight: 600; font-size: 13px; }
.pui-study-alert {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fffaf0;
  border-bottom: 1px solid var(--p-divider); color: var(--p-warning); font-size: 13px;
}
.pui-study-alert > span { flex: 1; }
.pui-file { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--p-divider); }
.pui-study-head + .pui-file { border-top: 0; }
.pui-file > svg { color: var(--p-text-3); }
.pui-file-name { flex: 1; min-width: 0; font-size: 13px; }
.pui-file-name small { display: block; font-size: 11px; color: var(--p-text-3); }
.pui-select {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 150px; height: 32px; padding: 0 10px;
  border: 1px solid var(--p-border-strong); border-radius: var(--p-r-sm); background: var(--p-surface); font-size: 13px; color: var(--p-text);
}
.pui-select::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--p-text-2); border-bottom: 1.5px solid var(--p-text-2); transform: rotate(45deg) translateY(-2px); }
.pui-select--block { width: 100%; }
.pui-foot-note { margin-top: 12px; font-size: 12px; color: var(--p-text-3); }

.pui-opt-label { margin: 18px 0 8px; font-size: 13px; font-weight: 600; }
.pui-opt-label:first-child { margin-top: 0; }
.pui-radio {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 8px;
  border: 1px solid var(--p-border); border-radius: var(--p-r-md); font-size: 13px;
}
.pui-radio::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--p-border-strong); flex: 0 0 auto; }
.pui-radio.is-on { border-color: var(--p-brand); background: var(--p-brand-soft); }
.pui-radio.is-on::before { border: 3.5px solid var(--p-brand); background: #fff; }
.pui-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: var(--p-r-md); background: var(--p-surface-3); font-size: 13px; text-align: center; }
.pui-seg span { padding: 6px 0; border-radius: 6px; color: var(--p-text-2); }
.pui-seg span.is-on { background: var(--p-surface); color: var(--p-text); font-weight: 600; box-shadow: var(--p-sh-1); }
.pui-template { padding: 12px 14px; border: 1px solid var(--p-border); border-radius: var(--p-r-md); font-size: 13px; }
.pui-template .pui-badge { margin-top: 6px; }

/* ============================================================
   Screen: 核对提取结果 (auto-generate-extract)
   ============================================================ */
.pui-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px;
  background: var(--p-surface); border-bottom: 1px solid var(--p-border); flex: 0 0 auto;
}
.pui-topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.pui-topbar-title strong { font-size: 17px; font-weight: 700; white-space: nowrap; }
.pui-topbar-title span { font-size: 13px; color: var(--p-text-3); white-space: nowrap; }
.pui-topbar-right { display: flex; align-items: center; gap: 12px; }
.pui-topbar-status { text-align: right; font-size: 12px; color: var(--p-text-3); line-height: 1.35; }
.pui-topbar-status strong { display: block; font-size: 13px; color: var(--p-text); }
.pui-review { display: grid; grid-template-columns: 248px minmax(0, 1fr); flex: 1; min-height: 0; }
.pui-side { padding: 16px 12px; background: var(--p-surface); border-right: 1px solid var(--p-border); }
.pui-side .pui-select { width: 100%; margin-bottom: 16px; }
.pui-side-progress { padding: 0 4px; font-size: 13px; }
.pui-side-progress-row { display: flex; justify-content: space-between; }
.pui-side-progress-row strong { font-variant-numeric: tabular-nums; }
.pui-bar { height: 6px; margin: 8px 0; border-radius: 999px; background: var(--p-surface-3); overflow: hidden; }
.pui-bar > span { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--p-brand); transition: width 900ms cubic-bezier(0.22, 1, 0.36, 1); }
.pui-conf-line { font-size: 12px; color: var(--p-text-3); }
.pui-conf-line b { margin-left: 6px; font-weight: 700; }
.pui-hi { color: var(--p-success); }
.pui-mid { color: var(--p-warning); }
.pui-lo { color: var(--p-danger); }
.pui-nav-group { margin: 18px 12px 6px; font-size: 12px; font-weight: 700; color: var(--p-text-2); }
.pui-nav-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: var(--p-r-md); font-size: 14px; color: var(--p-text); }
.pui-nav-item.is-active { background: var(--p-brand-soft); color: var(--p-brand); font-weight: 700; }
.pui-nav-item small { font-size: 11px; color: var(--p-text-4); font-weight: 400; }
.pui-main { padding: 28px 28px 32px; min-width: 0; }
.pui-main-title { font-size: 20px; font-weight: 700; }
.pui-main-sub { margin-bottom: 22px; font-size: 13px; color: var(--p-text-3); }
.pui-group-label { margin: 0 0 10px 4px; font-size: 13px; color: var(--p-text-3); }
.pui-group-label strong { color: var(--p-text); margin-right: 4px; }
.pui-rows { margin-bottom: 24px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-r-lg); box-shadow: var(--p-sh-1); overflow: hidden; }
.pui-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 64px auto; gap: 16px; align-items: start; padding: 16px 20px; border-top: 1px solid var(--p-divider); transition: background 400ms ease; }
.pui-row:first-child { border-top: 0; }
.pui-row-label { font-size: 13px; color: var(--p-text-3); padding-top: 2px; }
.pui-row-value { font-size: 15px; font-weight: 700; }
.pui-row-quote { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--p-text-2); font-weight: 400; }
.pui-row-quote mark { background: transparent; color: var(--p-text); font-weight: 600; }
.pui-row-hint { margin-top: 6px; font-size: 13px; color: var(--p-warning); font-weight: 400; }
.pui-row-hint::before { content: "●"; margin-right: 6px; font-size: 8px; vertical-align: 2px; }
.pui-conf { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; padding-top: 2px; }
.pui-conf i { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.pui-conf i::before, .pui-conf i::after, .pui-conf i b { content: ""; width: 3px; border-radius: 1px; background: var(--p-border-strong); }
.pui-conf i::before { height: 5px; }
.pui-conf i b { height: 8px; display: block; }
.pui-conf i::after { height: 11px; }
.pui-conf--hi i::before, .pui-conf--hi i b, .pui-conf--hi i::after { background: var(--p-success); }
.pui-conf--mid i::before, .pui-conf--mid i b { background: var(--p-warning); }
.pui-conf--lo i::before { background: var(--p-danger); }
.pui-row-actions { display: flex; align-items: center; gap: 4px; }
.pui-row-actions .pui-btn { height: 30px; }
.pui-row.is-confirmed { background: #f6fbf8; }
.pui-row.is-confirmed .pui-confirm { border-color: var(--p-success); background: var(--p-success-soft); color: var(--p-success); }
.pui-kbd { font-size: 12px; color: var(--p-text-3); }

/* ============================================================
   Screen: 生成的申报章节 (auto-generate-review, document editor)
   ============================================================ */
.pui-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; flex: 1; min-height: 0; }
.pui-editor-canvas { display: flex; flex-direction: column; min-width: 0; background: #e9ebef; }
.pui-oo-bar { display: flex; align-items: center; gap: 18px; height: 34px; padding: 0 16px; background: #f7f7f7; border-bottom: 1px solid #dcdcdc; font-size: 12px; color: #444; }
.pui-oo-bar span.is-on { color: var(--p-brand); font-weight: 600; }
.pui-oo-tools { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px; background: #f7f7f7; border-bottom: 1px solid #dcdcdc; }
.pui-oo-tools i { display: block; width: 18px; height: 14px; border-radius: 3px; background: #d6d8dc; }
.pui-oo-tools i.w { width: 60px; }
.pui-oo-tools b { width: 1px; height: 18px; background: #d6d8dc; }
.pui-paper { width: 86%; margin: 22px auto 0; padding: 36px 44px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); font-family: "Times New Roman", "Songti SC", serif; color: #111; }
.pui-paper h4 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.pui-paper p { margin: 0 0 14px; font-size: 12px; color: #333; }
.pui-paper table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.pui-paper th, .pui-paper td { border: 1px solid #333; padding: 5px 7px; text-align: left; vertical-align: top; }
.pui-paper th { background: #f2f2f2; font-weight: 700; }
.pui-paper td.fill { background: rgba(37, 99, 235, 0.07); transition: background 500ms ease; }
.pui-pending { display: inline-block; padding: 0 4px; border-radius: 3px; background: #fff3cd; color: #8a5300; font-family: "Lato", "PingFang SC", sans-serif; font-size: 11px; font-weight: 600; }
.pui-panel { display: flex; flex-direction: column; background: var(--p-surface); border-left: 1px solid var(--p-border); min-width: 0; }
.pui-panel .pui-tabs { padding: 0 12px; }
.pui-panel-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pui-result { padding: 10px 12px; border: 1px solid var(--p-border); border-radius: var(--p-r-md); font-size: 12px; }
.pui-result-k { color: var(--p-text-3); }
.pui-result-v { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--p-text); }
.pui-qa { padding: 10px 12px; border-radius: var(--p-r-md); border: 1px solid var(--p-border); font-size: 12px; color: var(--p-text-2); }
.pui-qa strong { display: block; margin-bottom: 2px; font-size: 13px; color: var(--p-text); }
.pui-qa--warn { background: var(--p-warning-soft); border-color: #f5d9a8; }

/* ============================================================
   Source View (docked) + TK evidence cards
   ============================================================ */
.pui-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); flex: 1; min-height: 0; }
.pui-split > .pui-main { border-right: 1px solid var(--p-border); }
.pui-source { display: flex; flex-direction: column; background: var(--p-surface); min-width: 0; }
.pui-source-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--p-border); font-size: 13px; }
.pui-source-head strong { font-size: 14px; }
.pui-source-head .pui-mono { margin-left: auto; }
.pui-source-page { position: relative; flex: 1; margin: 16px; padding: 26px 30px; background: #fff; border: 1px solid var(--p-border); border-radius: 4px; box-shadow: var(--p-sh-2); font-family: "Times New Roman", "Songti SC", serif; font-size: 12.5px; line-height: 1.75; color: #222; }
.pui-source-page h5 { margin: 0 0 10px; font-size: 13px; font-weight: 700; font-family: inherit; }
.pui-source-page p { margin: 0 0 10px; }
.pui-source-line { display: block; height: 8px; margin: 9px 0; border-radius: 2px; background: #eceef1; }
.pui-source-line.s { width: 62%; }
.pui-source-line.m { width: 84%; }
.pui-hl {
  background-image: linear-gradient(rgba(250, 204, 21, 0.45), rgba(250, 204, 21, 0.45));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition: background-size 900ms cubic-bezier(0.22, 1, 0.36, 1) 300ms;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  padding: 1px 0;
}
.is-lit .pui-hl, .pui-hl.is-lit { background-size: 100% 100%; }
.pui-page-no { position: absolute; right: 16px; bottom: 10px; font-family: "Lato", sans-serif; font-size: 11px; color: var(--p-text-4); }
.pui-located { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid #a7e3c6; border-radius: 999px; background: var(--p-success-soft); color: var(--p-success); font-size: 11px; font-weight: 600; }

.pui-tk { padding: 16px; background: var(--p-surface); }
.pui-tk-head { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 15px; font-weight: 700; }
.pui-tk-head span { font-size: 13px; font-weight: 500; color: var(--p-text-2); }
.pui-tk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pui-tk-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--p-border); border-radius: var(--p-r-md); transition: border-color 400ms ease, box-shadow 400ms ease; }
.pui-tk-card h6 { margin: 0 0 2px; font-size: 14px; font-weight: 700; }
.pui-tk-kv { padding: 8px 10px; border-radius: var(--p-r-sm); background: var(--p-surface-2); font-size: 12px; color: var(--p-text-3); }
.pui-tk-kv strong { display: block; font-size: 13px; color: var(--p-text); }
.pui-tk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pui-tk-chips span { padding: 2px 10px; border: 1px solid var(--p-border); border-radius: 999px; font-size: 12px; color: var(--p-text-2); }
.pui-evidence { padding: 10px; border: 1px solid var(--p-border); border-radius: var(--p-r-md); font-size: 12px; color: var(--p-text-2); }
.pui-evidence-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-weight: 700; color: var(--p-text); }
.pui-evidence-head::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--p-brand); }
.pui-evidence-head .pui-page-tag { margin-left: auto; font-weight: 500; color: var(--p-text-3); background: var(--p-surface-3); border-color: transparent; border-radius: 999px; }
.pui-tk-card.is-active { border-color: var(--p-brand); box-shadow: 0 10px 28px rgba(37, 99, 235, 0.14); }
.pui-tk-card.is-active .pui-evidence { border-color: var(--p-brand-soft-2); background: var(--p-brand-soft); }

/* ============================================================
   Document detail drawer (submission material) + versions
   ============================================================ */
.pui-drawer { display: flex; flex-direction: column; background: var(--p-surface); min-height: 100%; }
.pui-drawer-head { padding: 20px 22px 0; }
.pui-drawer-title { display: flex; justify-content: space-between; align-items: flex-start; font-size: 19px; font-weight: 700; }
.pui-drawer-title svg { color: var(--p-text-3); width: 18px; height: 18px; }
.pui-drawer-sub { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; }
.pui-drawer .pui-tabs { gap: 0; }
.pui-drawer .pui-tab { flex: 1; justify-content: center; }
.pui-drawer-body { flex: 1; padding: 18px 22px; background: var(--p-surface-2); display: flex; flex-direction: column; gap: 10px; }
.pui-kv { border: 1px solid var(--p-border); border-radius: var(--p-r-lg); background: var(--p-surface); overflow: hidden; }
.pui-kv > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--p-divider); font-size: 13px; }
.pui-kv > div:first-child { border-top: 0; }
.pui-kv dt { color: var(--p-text-3); }
.pui-kv dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.pui-drawer-foot { display: flex; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--p-border); background: var(--p-surface); }
.pui-drawer-foot .pui-btn--primary { margin-left: auto; }

.pui-version { padding: 11px 12px; border: 1px solid var(--p-border); border-radius: var(--p-r-md); background: var(--p-surface); box-shadow: var(--p-sh-1); font-size: 13px; }
.pui-version.is-current { border-color: var(--p-brand); background: var(--p-brand-soft); }
.pui-version-top { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.pui-version-top .pui-btn { margin-left: auto; }
.pui-version-file { margin-top: 3px; font-size: 12px; color: var(--p-text-3); }
.pui-version-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--p-text-3); }

.pui-comment { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--p-border); border-radius: var(--p-r-md); background: var(--p-surface); font-size: 13px; }
.pui-comment-body { flex: 1; min-width: 0; }
.pui-comment-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--p-text-3); }
.pui-comment-meta strong { color: var(--p-text); font-size: 13px; }
.pui-comment p { margin: 4px 0 0; color: var(--p-text-2); }
.pui-impact { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #f5d9a8; border-radius: var(--p-r-md); background: var(--p-warning-soft); font-size: 13px; color: var(--p-text-2); }
.pui-impact svg { color: var(--p-warning); margin-top: 2px; }
.pui-impact strong { display: block; color: var(--p-text); }

.pui-approval { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--p-border); border-radius: var(--p-r-lg); background: var(--p-surface); }
.pui-approval-step { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--p-divider); font-size: 13px; }
.pui-approval-step:first-child { border-top: 0; }
.pui-approval-step small { display: block; font-size: 12px; color: var(--p-text-3); }
.pui-step-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--p-border-strong); color: var(--p-text-3); font-size: 11px; }
.pui-step-dot.is-done { border-color: var(--p-success); background: var(--p-success-soft); color: var(--p-success); }
.pui-step-dot.is-done svg { width: 12px; height: 12px; }
.pui-sign { padding: 14px; border: 1px solid var(--p-border); border-radius: var(--p-r-lg); background: var(--p-surface); box-shadow: var(--p-sh-3); font-size: 13px; }
.pui-sign strong { display: block; margin-bottom: 4px; font-size: 14px; }
.pui-sign p { margin: 0 0 10px; color: var(--p-text-3); font-size: 12px; }
.pui-input { display: flex; align-items: center; height: 34px; padding: 0 10px; border: 1px solid var(--p-border-strong); border-radius: var(--p-r-sm); color: var(--p-text-4); font-size: 13px; letter-spacing: 3px; }
.pui-sign-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ============================================================
   Screen: 管线看板 (project-dashboard)
   ============================================================ */
.pui-pd { display: flex; flex-direction: column; gap: 20px; padding: 24px 32px 32px; background: var(--p-surface-2); }
.pui-pd-title { display: flex; align-items: baseline; gap: 12px; }
.pui-pd-title strong { font-size: 22px; font-weight: 600; }
.pui-pd-title span { font-size: 13px; color: var(--p-text-3); }
.pui-pd-section { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 8px; }
.pui-pd-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pui-pd-section-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--p-brand); }
.pui-pd-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pui-pd-summary-title { font-size: 15px; font-weight: 600; }
.pui-pd-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 2px 9px; border: 1px solid rgba(37, 99, 235, 0.25); border-radius: 999px; background: rgba(37, 99, 235, 0.10); color: var(--p-brand); font-size: 12px; font-weight: 500; }
.pui-pd-chip svg { width: 12px; height: 12px; }
.pui-pd-actions { display: flex; gap: 8px; }
.pui-sbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--p-brand); color: #fff; font-size: 11px; font-weight: 600; }
.pui-life { padding: 14px; border: 1px solid var(--p-border); border-radius: 8px; background: var(--p-surface-2); }
.pui-life-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.pui-life-title { font-size: 14px; font-weight: 600; }
.pui-ring {
  --deg: 0deg;
  position: relative; display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  background: conic-gradient(from 220deg, #2563eb 0deg, #0f766e var(--deg), #e5e7eb var(--deg) 360deg);
}
.pui-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--p-surface); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08); }
.pui-ring > span { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pui-ring strong { font-size: 18px; font-weight: 700; color: var(--p-brand); font-variant-numeric: tabular-nums; }
.pui-ring small { margin-top: 2px; font-size: 9px; color: var(--p-text-3); }
.pui-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pui-stage-bar { display: block; height: 8px; border-radius: 999px; overflow: hidden; background: var(--p-border); }
.pui-stage-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--p-brand); transition: width 1100ms cubic-bezier(0.22, 1, 0.36, 1); }
.pui-stage--active .pui-stage-bar > span { background: var(--p-success); }
.pui-stage--planned .pui-stage-bar > span { background: var(--p-text-4); }
.pui-stage-label { display: block; margin-top: 6px; text-align: center; font-size: 12px; font-weight: 600; }
.pui-stage-pct { display: block; text-align: center; font-size: 11px; color: var(--p-text-3); font-variant-numeric: tabular-nums; }
.pui-pd-sub { margin-bottom: -6px; font-size: 12px; font-weight: 600; color: var(--p-text-3); }
.pui-plist { display: flex; flex-direction: column; gap: 8px; }
.pui-pitem { display: grid; grid-template-columns: 180px 1fr 60px; gap: 12px; align-items: center; font-size: 13px; color: var(--p-text-2); }
.pui-pitem > span:last-child { text-align: right; color: var(--p-text-3); font-variant-numeric: tabular-nums; }
.pui-pitem .pui-bar { height: 4px; margin: 0; }
.pui-upcoming { padding: 12px 14px; border: 1px solid var(--p-border); border-radius: 8px; background: var(--p-surface-2); }
.pui-upcoming-title { margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--p-text-3); }
.pui-upcoming li { display: flex; gap: 10px; font-size: 13px; list-style: none; margin: 0 0 4px; }
.pui-upcoming ul { margin: 0; padding: 0; }
.pui-upcoming li span:first-child { min-width: 92px; color: var(--p-text-3); font-variant-numeric: tabular-nums; }
.pui-risk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--p-warning); }
.pui-risk--low { background: var(--p-success); }
.pui-overview { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border: 1px solid var(--p-brand-soft-2); border-radius: 10px; background: linear-gradient(180deg, var(--p-brand-soft) 0%, var(--p-surface) 40%); box-shadow: var(--p-sh-1); }
.pui-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pui-overview-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.pui-riskbadge { padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; background: var(--p-warning-soft); color: var(--p-warning); }
.pui-subject { align-self: flex-start; display: inline-flex; gap: 8px; padding: 4px 12px; border: 1px solid var(--p-brand-soft-2); border-radius: 999px; background: var(--p-brand-soft); font-size: 13px; }
.pui-subject span { font-size: 11px; color: var(--p-brand); }
.pui-subject strong { color: #1e3a8a; }
.pui-study-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 12px; border: 1px solid var(--p-border); border-radius: var(--p-r-md); background: var(--p-surface); }
.pui-study-top { display: flex; align-items: center; gap: 8px; }
.pui-study-idx { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--p-brand); color: #fff; font-size: 11px; font-weight: 600; }
.pui-study-name { font-size: 14px; font-weight: 600; }
.pui-study-src { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--p-brand); }
.pui-study-src svg { width: 13px; height: 13px; }
.pui-study-concl { font-size: 13px; line-height: 1.6; color: var(--p-text-2); }
.pui-cites { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--p-text-3); }
.pui-cites b { display: inline-grid; place-items: center; min-width: 26px; height: 22px; border: 1px solid var(--p-border); border-radius: 999px; background: var(--p-surface-2); color: var(--p-brand-active); font-weight: 500; }
.pui-cites b:first-of-type { border-color: var(--p-brand-soft-2); background: var(--p-brand-soft); font-weight: 700; }
.pui-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.pui-metric { padding: 2px 8px; border: 1px solid var(--p-border); border-radius: 4px; background: var(--p-surface); font-size: 12px; color: var(--p-text-3); }
.pui-metric b { color: var(--p-text); font-weight: 500; }
.pui-inbox-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--p-border); border-radius: var(--p-r-md); background: var(--p-surface); font-size: 13px; }
.pui-inbox-item strong { display: block; font-size: 13px; }
.pui-inbox-item small { color: var(--p-text-3); font-size: 12px; }
.pui-inbox-actions { display: flex; gap: 6px; }

/* ============================================================
   Dialog: 共享与权限  /  Toolbox
   ============================================================ */
.pui-dialog { margin: 28px auto; width: 88%; max-width: 560px; background: var(--p-surface); border-radius: var(--p-r-lg); box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18); overflow: hidden; }
.pui-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--p-divider); font-size: 16px; font-weight: 600; }
.pui-dialog-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.pui-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--p-divider); background: var(--p-surface-2); }
.pui-search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--p-border-strong); border-radius: var(--p-r-sm); color: var(--p-text-4); font-size: 13px; }
.pui-member { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.pui-member-name { flex: 1; min-width: 0; }
.pui-member-name small { display: block; font-size: 12px; color: var(--p-text-3); }
.pui-member .pui-select { min-width: 110px; }
.pui-scope { display: flex; gap: 8px; padding: 10px 12px; border-radius: var(--p-r-md); background: var(--p-brand-soft); color: var(--p-brand-active); font-size: 12px; }

.pui-plot { display: grid; grid-template-columns: minmax(0, 1fr) 220px; flex: 1; min-height: 0; }
.pui-plot-area { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.pui-grid { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--p-surface); border: 1px solid var(--p-border); }
.pui-grid th, .pui-grid td { padding: 5px 8px; border: 1px solid var(--p-divider); text-align: right; font-variant-numeric: tabular-nums; }
.pui-grid th { background: var(--p-surface-3); color: var(--p-text-2); font-weight: 600; }
.pui-grid th:first-child, .pui-grid td:first-child { text-align: left; }
.pui-chart { padding: 12px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-r-md); color: var(--p-text-3); }
.pui-chart svg { width: 100%; height: auto; }
.pui-plot-aside { padding: 16px; background: var(--p-surface); border-left: 1px solid var(--p-border); display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.pui-plot-aside .pui-select { width: 100%; margin-bottom: 6px; }
.pui-plot-aside label { color: var(--p-text-3); font-weight: 600; }
.pui-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--p-text-2); padding: 4px 0; }
.pui-toggle::before { content: ""; width: 26px; height: 15px; border-radius: 999px; background: var(--p-brand); box-shadow: inset -11px 0 0 2px var(--p-brand), inset -11px 0 0 9px #fff; flex: 0 0 auto; }
.pui-trans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px; }
.pui-trans-pane { padding: 14px; border: 1px solid var(--p-border); border-radius: var(--p-r-md); background: var(--p-surface); font-size: 13px; line-height: 1.7; color: var(--p-text-2); min-height: 150px; }
.pui-trans-pane small { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--p-text-3); }
.pui-term { padding: 0 3px; border-radius: 3px; background: var(--p-brand-soft); color: var(--p-brand-active); font-weight: 600; }

/* ---------- Grouped result table, template slots, chart draw ---------- */
.pui-table-note { padding: 8px 20px; border-bottom: 1px solid var(--p-border); font-size: 12px; color: var(--p-text-3); }
.pui-table-note .pui-mid { margin-left: 8px; }
.pui-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pui-table th { padding: 10px 20px; border-bottom: 1px solid var(--p-border); border-right: 1px solid var(--p-divider); text-align: left; font-size: 12px; font-weight: 700; color: var(--p-text-2); background: var(--p-surface-2); }
.pui-table td { padding: 11px 20px; border-top: 1px solid var(--p-divider); border-right: 1px solid var(--p-divider); font-variant-numeric: tabular-nums; }
.pui-table th:last-child, .pui-table td:last-child { border-right: 0; }
.pui-dot { display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: var(--p-warning); vertical-align: 2px; }
.pui-slot {
  display: inline-block; padding: 0 6px; border: 1px solid rgba(37, 99, 235, 0.35); border-radius: 3px;
  background: var(--p-brand-soft); color: var(--p-brand-active); font-family: "Lato", "PingFang SC", sans-serif; font-size: 11px; font-weight: 600;
}
.pui-slot::before { content: "⟦ "; opacity: 0.6; }
.pui-slot::after { content: " ⟧"; opacity: 0.6; }
.pui-slot--new { opacity: 0; transform: translateY(4px) scale(0.9); transition: opacity 600ms ease 900ms, transform 600ms cubic-bezier(0.22, 1, 0.36, 1) 900ms; }
.pui-slot--new.is-lit { opacity: 1; transform: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.pui-draw { stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 1400ms cubic-bezier(0.22, 1, 0.36, 1) 200ms; }
.pui-draw.is-lit { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .pui-slot--new, .pui-draw { opacity: 1; transform: none; stroke-dashoffset: 0; }
  .pui-hl { background-size: 100% 100%; }
}
