/* 橙子学反馈分析助手 — 设计系统（warm stone + brand orange） */
:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --surface-2: #f5f5f4;
    --border: #e7e5e4;
    --border-strong: #d6d3d1;
    --text: #1c1917;
    --text-2: #44403c;
    --text-muted: #78716c;
    --text-faint: #a8a29e;

    --brand: #ea580c;
    --brand-hover: #c2410c;
    --brand-light: #fff7ed;
    --brand-ring: rgba(234, 88, 12, 0.15);

    --accent: #0891b2;
    --accent-hover: #0e7490;
    --accent-light: #ecfeff;

    --ok: #15803d;
    --ok-bg: #f0fdf4;
    --err: #b91c1c;
    --err-bg: #fef2f2;
    --info: #1d4ed8;
    --info-bg: #eff6ff;

    --sidebar-w: 248px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-sm: 6px;
    --sh-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
    --sh: 0 1px 3px rgba(28, 25, 23, 0.08), 0 1px 2px rgba(28, 25, 23, 0.04);
    --sh-lg: 0 10px 24px rgba(28, 25, 23, 0.08);

    --font: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;

    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 20px;
    --s6: 24px;
    --s8: 32px;
    --s10: 40px;
    --s12: 48px;

    /* 版面呼吸：侧栏与内容、区块之间 */
    --content-pad-x: clamp(28px, 3.5vw, 52px);
    --content-pad-y: var(--s8);
    --stack-gap: var(--s8);
    --section-gap: var(--s10);
    --card-pad: var(--s8);
    --field-gap: var(--s3);
    --row-gap: var(--s5);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── 侧边栏 ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--text);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: var(--s6) var(--s5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-top {
    display: flex;
    align-items: center;
    gap: var(--s4);
    margin-bottom: var(--s2);
}

.sidebar-logo {
    width: 64px;
    height: 92px;
    border-radius: var(--radius);
    object-fit: contain;
    object-position: center bottom;
    flex-shrink: 0;
    display: block;
    background: var(--brand-light);
}

.sidebar-brand h1 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-brand p {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 2px;
}

.sidebar-workflow {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--s3) var(--s5) var(--s2);
}

.nav {
    list-style: none;
    padding: var(--s2) var(--s3);
    flex: 1;
}

.nav-primary { flex: 1; }

.nav-settings {
    padding: var(--s2) var(--s3) var(--s4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-settings-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 10px var(--s3);
    margin-bottom: 2px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.55);
    transition: background 0.15s, color 0.15s;
}

.nav-settings-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.nav-settings-btn.active {
    background: rgba(234, 88, 12, 0.18);
    color: #fdba74;
}

.nav-settings-icon {
    width: 22px;
    text-align: center;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.85;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    margin-bottom: var(--s5);
    padding-bottom: var(--s3);
    border-bottom: 1px solid var(--border);
}

.settings-tab {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.settings-tab:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.settings-tab.active {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand-hover);
}

.settings-pane { display: none; }
.settings-pane.active { display: block; }

.settings-pane-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--s4);
    line-height: 1.6;
}

.page-header-compact { margin-bottom: var(--s4); }
.page-header-compact .page-title { font-size: 22px; }

.nav li {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 10px var(--s3);
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    transition: background 0.15s, color 0.15s;
    border: none;
}

.nav li:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.nav li.active {
    background: rgba(234, 88, 12, 0.18);
    color: #fdba74;
}

.nav li .nav-step {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.nav li.active .nav-step {
    background: var(--brand);
    color: #fff;
}

.nav li .nav-label { flex: 1; font-weight: 500; }

.sidebar-ft {
    padding: var(--s4) var(--s5);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

.sidebar-ft .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--s2);
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: #fdba74;
    font-weight: 600;
}

/* ── 主内容 ── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    padding: var(--content-pad-y) var(--content-pad-x) var(--s12);
    width: calc(100vw - var(--sidebar-w));
    max-width: none;
    background: var(--bg);
    border-left: 1px solid var(--border);
}

.page-stack {
    display: flex;
    flex-direction: column;
    gap: var(--stack-gap);
    width: 100%;
    max-width: none;
    margin: 0;
}

.page-stack > .page-header,
.page-stack > .page-header-stack {
    margin-bottom: 0;
}

.main > .panel {
    width: 100%;
    max-width: none;
    margin: 0;
}

.panel-classify {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.panel { display: none; }
.panel.active {
    display: block;
    opacity: 1;
    visibility: visible;
    animation: panelFadeIn 0.2s ease forwards;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel.active .page-stack {
    min-height: 320px;
}

/* 页面头 */
.page-header {
    margin-bottom: var(--s6);
}

.page-header-stack {
    margin-bottom: var(--s6);
}

.page-header-stack .page-title {
    font-size: 26px;
    margin-bottom: var(--s4);
}

.page-hint-banner {
    margin-top: var(--s5);
    padding: var(--s5) var(--s6);
    background: var(--info-bg);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    color: var(--info);
    font-size: 14px;
    line-height: 1.7;
}

.page-hint-banner code {
    background: rgba(255, 255, 255, 0.7);
    color: #1e40af;
}

.panel-classify .page-header {
    margin-bottom: var(--s5);
}

.panel-classify .page-title {
    font-size: 22px;
    margin-bottom: var(--s2);
}

.panel-classify .page-desc {
    max-width: 56rem;
    margin-bottom: var(--s3);
}

.panel-classify .page-hint-banner {
    margin-top: 0;
    margin-bottom: 0;
}

.page-hint-banner-muted {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-2);
}

/* 模块分区（结构重塑） */
.module-section {
    margin-bottom: var(--section-gap);
}

.module-section:last-child {
    margin-bottom: 0;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: var(--s4);
    margin-bottom: var(--s5);
    padding-bottom: var(--s3);
    border-bottom: 1px solid var(--border);
}

.section-num {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.module-card {
    margin-bottom: 0;
}

.path-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, 1.12fr);
    grid-template-rows: auto 1fr;
    column-gap: var(--s8);
    row-gap: var(--s5);
    align-items: start;
}

.report-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(480px, 1.15fr);
    grid-template-rows: auto 1fr;
    column-gap: var(--s8);
    row-gap: var(--s5);
    align-items: start;
}

.report-layout-head-left,
.path-layout-head-left {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
}

.report-layout-head-right,
.path-layout-head-right {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding-bottom: var(--s3);
    border-bottom: 1px solid var(--border);
    min-height: 40px;
}

.report-layout-head-right .section-title,
.path-layout-head-right .section-title {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.section-head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: var(--s2);
}

.section-head-with-actions {
    display: flex;
    align-items: center;
    gap: var(--s4);
    flex-wrap: wrap;
}

.section-head-with-actions .section-title {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.path-col-main,
.report-col-main {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
}

.path-col-result,
.report-col-result {
    grid-column: 2;
    grid-row: 2;
    position: sticky;
    top: var(--s5);
    min-width: 0;
    align-self: stretch;
}

.path-module-log {
    margin-top: var(--s8);
}

.section-head-sub {
    margin-bottom: var(--s5);
}

.path-block {
    margin-bottom: 0;
}

.path-layout .result-panel,
.report-layout .result-panel {
    display: flex;
    flex-direction: column;
    min-height: min(72vh, 560px);
    height: 100%;
    margin-top: 0;
}

.path-layout .result-panel {
    min-height: min(78vh, 640px);
}

.report-layout .result-panel {
    min-height: min(78vh, 640px);
}

.report-col-result .result-body.report-result-md {
    padding: var(--s6) var(--s8) var(--s10);
    font-size: 14px;
    line-height: 1.75;
    max-height: none;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    color: var(--text-2);
}

.report-result-md h1 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 var(--s6);
    padding-bottom: var(--s4);
    color: var(--text);
    border-bottom: 2px solid var(--brand);
}

.report-result-md > p:first-of-type {
    margin-top: 0;
    margin-bottom: var(--s6);
    padding: var(--s4) var(--s5);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-2);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.report-result-md h2 {
    font-size: 16px;
    font-weight: 700;
    margin: var(--s8) 0 var(--s4);
    padding: var(--s3) var(--s5);
    color: var(--text);
    background: var(--brand-light);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--brand);
    line-height: 1.5;
}

.report-result-md h2:first-of-type {
    margin-top: var(--s4);
}

.report-result-md h3 {
    font-size: 15px;
    font-weight: 600;
    margin: var(--s5) 0 var(--s3);
    color: var(--text);
    line-height: 1.5;
}

.report-result-md h4 {
    font-size: 14px;
    font-weight: 600;
    margin: var(--s4) 0 var(--s2);
    color: var(--text-2);
}

.report-result-md p {
    margin: var(--s3) 0 var(--s4);
    max-width: 72ch;
}

.report-result-md ul,
.report-result-md ol {
    margin: var(--s3) 0 var(--s5);
    padding-left: 1.35em;
    list-style: none;
}

.report-result-md ol {
    counter-reset: none;
    padding-left: 0;
}

.report-result-md li {
    margin: var(--s2) 0;
    line-height: 1.75;
    padding-left: var(--s1);
}

.report-result-md ul > li {
    position: relative;
    padding-left: var(--s4);
}

.report-result-md ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}

.report-result-md li ul,
.report-result-md li ol {
    margin-top: var(--s2);
    margin-bottom: var(--s2);
}

.report-result-md strong {
    font-weight: 600;
    color: var(--text);
}

.report-result-md hr {
    margin: var(--s6) 0;
    border: none;
    border-top: 1px dashed var(--border);
}

.report-result-md blockquote {
    margin: var(--s4) 0 var(--s5);
    padding: var(--s4) var(--s5);
    font-size: 14px;
    line-height: 1.7;
    border-left: 4px solid var(--brand);
    background: var(--brand-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-2);
}

.report-result-md .md-table-scroll {
    margin: var(--s4) 0 var(--s6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.report-result-md .report-md-table {
    width: 100%;
    min-width: 480px;
    font-size: 13px;
    border-collapse: collapse;
    margin: 0;
}

.report-result-md .report-md-table th {
    background: var(--surface-2);
    padding: 10px 12px;
    font-weight: 600;
    white-space: nowrap;
}

.report-result-md .report-md-table td {
    padding: 9px 12px;
    vertical-align: top;
    line-height: 1.55;
    max-width: 280px;
}

.report-result-md .report-md-table tr:hover td {
    background: var(--bg);
}

.path-col-result .result-body.path-result-md {
    padding: var(--s6) var(--s6) var(--s8);
    font-size: 14px;
    line-height: 1.65;
    max-height: none;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.path-result-md > p:first-child {
    margin-top: 0;
    color: var(--text-2);
}

.path-result-md h2 {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: 16px;
    margin: var(--s6) 0 var(--s4);
    padding: var(--s3) var(--s4);
    background: var(--brand-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--brand);
}

.path-result-md h2:first-of-type {
    margin-top: 0;
}

.path-result-md h3 {
    font-size: 14px;
    margin: var(--s5) 0 var(--s3);
    color: var(--text);
}

.path-step-cards {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    margin: var(--s4) 0 var(--s6);
}

.path-step-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--sh-sm);
    overflow: hidden;
}

.path-step-card-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.path-step-index {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-light);
    border-radius: 999px;
}

.path-step-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    word-break: break-word;
}

.path-step-dl {
    margin: 0;
    padding: var(--s4);
    display: flex;
    flex-direction: column;
    gap: var(--s3);
}

.path-step-field {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: var(--s3) var(--s4);
    align-items: start;
    margin: 0;
}

.path-step-field dt {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.5;
}

.path-step-field dd {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-2);
    word-break: break-word;
}

.path-step-field.is-long {
    grid-template-columns: 1fr;
    gap: var(--s2);
    padding-top: var(--s2);
    border-top: 1px dashed var(--border);
}

.path-step-field.is-long:first-child {
    border-top: none;
    padding-top: 0;
}

.path-step-field.is-long dt {
    color: var(--text);
    font-size: 13px;
}

.path-result-md .md-table-scroll {
    margin: var(--s4) 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.path-result-md .path-md-table-compact {
    min-width: 520px;
    font-size: 13px;
}

.path-result-md .path-md-table-compact th,
.path-result-md .path-md-table-compact td {
    padding: 8px 12px;
    white-space: normal;
    min-width: 88px;
    max-width: 220px;
}

.path-result-md blockquote {
    margin: var(--s4) 0;
    font-size: 14px;
}

.path-save-hint {
    margin: var(--s3) 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.path-saved-panel {
    margin-top: var(--s5);
    padding: var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
}

.path-saved-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 var(--s3);
}

.path-saved-empty {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.path-saved-empty[hidden] {
    display: none;
}

.path-saved-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s2);
}

.path-saved-item {
    margin: 0;
}

.path-saved-load {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: var(--s3) var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.path-saved-load:hover {
    border-color: var(--brand);
    box-shadow: var(--sh-sm);
}

.path-saved-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.path-saved-meta {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.4;
}

.path-saved-at {
    font-size: 11px;
    color: var(--text-muted);
}

.path-layout-head-right .section-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

#pathSaveBtn:disabled {
    opacity: 0.55;
}

.result-panel-flush {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--sh-sm);
    overflow: hidden;
    background: var(--surface);
}

.path-layout .result-panel-flush .result-placeholder,
.report-layout .result-panel-flush .result-placeholder {
    border-top: 1px dashed var(--border);
    border-radius: 0;
}

.path-layout .result-panel-flush .result-body:empty,
.report-layout .result-panel-flush .result-body:empty {
    display: none;
}

.path-layout .result-panel-flush .result-body:not(:empty) + .result-placeholder,
.report-layout .result-panel-flush .result-body:not(:empty) + .result-placeholder {
    display: none;
}

.path-layout .result-panel:not(.show),
.report-layout .result-panel:not(.show) {
    display: flex;
}

.result-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s8) var(--s6);
    margin: 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px dashed var(--border);
    background: var(--surface-2);
}

.result-panel.show .result-placeholder {
    display: none;
}

.result-panel.show .result-body {
    flex: 1;
    max-height: none;
}

@media (max-width: 1180px) {
    .path-layout,
    .report-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .path-layout-head-left,
    .path-layout-head-right {
        grid-column: 1;
        grid-row: auto;
    }

    .path-layout-head-right {
        margin-top: var(--s4);
    }

    .path-col-main,
    .path-col-result {
        grid-column: 1;
        grid-row: auto;
    }

    .path-col-result {
        position: static;
    }

    .path-layout .result-panel,
    .report-layout .result-panel {
        min-height: 360px;
    }

    .report-layout-head-left,
    .report-layout-head-right {
        grid-column: 1;
        grid-row: auto;
    }

    .report-layout-head-right {
        margin-top: var(--s4);
    }

    .report-col-main,
    .report-col-result {
        grid-column: 1;
        grid-row: auto;
    }

    .report-col-result {
        position: static;
    }
}

@media (max-width: 1024px) {
    .report-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .report-layout-head-left,
    .path-layout-head-left {
        grid-column: 1;
        grid-row: auto;
    }

    .report-col-main,
    .path-col-main {
        grid-column: 1;
        grid-row: auto;
    }

    .report-layout-head-right,
    .path-layout-head-right {
        grid-column: 1;
        grid-row: auto;
        margin-top: var(--s4);
    }

    .path-col-result,
    .report-col-result {
        grid-column: 1;
        grid-row: auto;
        position: static;
    }

    .path-layout .result-panel,
    .report-layout .result-panel {
        min-height: 320px;
    }
}

/* 反馈分类：导入区左右分栏（顶对齐 + 对称列标题） */
.card-import {
    padding: 0;
}

.card-import.module-card {
    padding: var(--s8);
}

.import-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: var(--s8);
    align-items: stretch;
}

.import-col-upload,
.import-col-text {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}

/* 卡片顶栏 / 底栏（全站统一） */
.card-head,
.import-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    min-height: 36px;
    margin-bottom: var(--s5);
}

.card-head-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.card-head-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--brand);
    border-radius: 2px;
    flex-shrink: 0;
}

.import-col-head .import-col-caption::before {
    display: none;
}

.card-head .btn-group {
    flex-shrink: 0;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    flex-wrap: wrap;
    margin-top: var(--s6);
    padding-top: var(--s5);
    border-top: 1px solid var(--border);
}

.card-foot .btn-group {
    margin-left: auto;
}

.batch-confirm-foot {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s3);
    margin-top: var(--s4);
    padding-top: var(--s4);
    border-top: 1px solid var(--border);
}

.batch-confirm-foot .classify-confirm-status {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.batch-confirm-foot .classify-confirm-status.is-confirmed {
    color: var(--brand);
}

.batch-confirm-foot #confirmClassifyBtn {
    align-self: flex-end;
}

.import-col-head .import-col-caption {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.import-col-caption {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    line-height: 1.4;
    min-height: 1.25rem;
    margin: 0 0 var(--s4);
}

.import-col-upload .upload-area {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--s6) var(--s5);
    min-height: 280px;
}

.import-col-text > textarea {
    flex: 1 1 auto;
    width: 100%;
    min-height: 280px;
    font-size: 14px;
    line-height: 1.65;
    background: var(--surface-2);
    resize: vertical;
}

.import-or {
    display: none !important;
}

.import-col-text > .import-section-label {
    display: none;
}

.classify-below[hidden] {
    display: none !important;
}

.import-col-text .card-foot.classify-below {
    margin-top: var(--s4);
    padding-top: var(--s4);
}

/* 表单行：末列放操作按钮（与标签+控件底对齐） */
.form-row-actions {
    align-items: flex-end;
}

.form-field-btn {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.form-field-btn .btn {
    white-space: nowrap;
}

.btn-file {
    cursor: pointer;
    margin: 0;
}

.btn-file input[type="file"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.status-text-block {
    display: block;
    min-height: 1.25rem;
    margin: 0 0 var(--s4);
    font-size: 13px;
    color: var(--text-muted);
}

.card-path-log > textarea {
    width: 100%;
    min-height: 200px;
    margin-bottom: 0;
}

.card-know-ai .know-ai-desc {
    margin: 0 0 var(--s5);
}

.batch-toolbar {
    min-height: 44px;
}

.batch-card {
    padding: 0;
    overflow: hidden;
}

.batch-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    padding: var(--s4) var(--s6);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.batch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    align-items: center;
}

.page-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand);
    background: var(--brand-light);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: var(--s3);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: var(--s2);
}

.page-desc {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 42em;
    line-height: 1.7;
    margin-bottom: var(--s2);
}

.page-desc + .page-desc { margin-top: var(--s2); }

.page-hint {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    margin-top: var(--s4);
    padding: var(--s3) var(--s4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.55;
}

.page-hint code {
    font-family: var(--mono);
    font-size: 11px;
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 卡片 */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--card-pad);
    margin-bottom: var(--s6);
    box-shadow: var(--sh-sm);
}

.module-card.card {
    padding: var(--s8) var(--s8) var(--s6);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--s5);
    display: flex;
    align-items: center;
    gap: var(--s3);
}

.module-section .card-title {
    margin-bottom: var(--s5);
    padding-bottom: var(--s3);
    border-bottom: 1px solid var(--surface-2);
}

.card-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--brand);
    border-radius: 2px;
}

/* 表单 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--row-gap) var(--s6);
    margin-bottom: var(--s5);
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row.full { grid-template-columns: 1fr; }

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--field-gap);
}

.form-field label,
.form-field .label-like {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    line-height: 1.4;
}

.form-field .label-hint {
    font-weight: 400;
    color: var(--text-muted);
}

.form-field input,
.form-field select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field input:focus,
.form-field select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.form-field input:read-only {
    background: var(--surface-2);
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.65;
}

textarea::placeholder { color: var(--text-faint); }

.bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s4);
    margin-top: var(--s6);
    padding-top: var(--s5);
    border-top: 1px solid var(--border);
}

.count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:active:not(:disabled) { transform: scale(0.98); }

.btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.btn-p {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--sh-sm);
}

.btn-p:hover:not(:disabled) { background: var(--brand-hover); }

.btn-p:disabled {
    background: var(--border-strong);
    color: var(--text-faint);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-s {
    background: var(--surface);
    color: var(--text-2);
    border: 1px solid var(--border);
}

.btn-s:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.btn-batch {
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    box-shadow: var(--sh-sm);
}

.btn-batch:hover:not(:disabled) { background: var(--accent-hover); }

.btn-batch:disabled {
    background: var(--border-strong);
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
}

/* 上传区 */
.upload-area {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: var(--s6) var(--s5);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--surface-2);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--s3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.upload-area p {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: var(--s2);
}

.upload-area label {
    color: var(--brand);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* 参考布局：垂直卡片栈 */
.card-stack {
    padding: var(--s6);
}

.card-stack .card-title::before,
.card-stack.card-upload .card-title {
    display: none;
}

.stack-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--s2);
}

.stack-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--s4);
    line-height: 1.55;
}

.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: var(--s8) var(--s6);
    text-align: center;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--sh-sm);
    transition: background 0.15s, transform 0.1s;
}

.btn-upload:hover {
    background: var(--brand-hover);
}

.btn-upload:active {
    transform: scale(0.98);
}

.upload-help {
    margin-top: var(--s4);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.upload-file-name {
    margin-top: var(--s3);
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
}

.upload-extra {
    margin-top: var(--s4);
    padding-top: var(--s4);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.card-text textarea {
    min-height: 200px;
    background: var(--surface-2);
    border-color: var(--border);
}

.bar-stack {
    margin-top: var(--s4);
    padding-top: var(--s4);
    border-top: 1px solid var(--border);
}

.divider {
    display: flex;
    align-items: center;
    margin: var(--s5) 0;
    color: var(--text-faint);
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span { padding: 0 var(--s4); }

/* 提示卡片 */
.tip-list {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.75;
}

.tip-list p { margin-bottom: var(--s3); }

.tip-list strong { color: var(--text); font-weight: 600; }

.tip-list code {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
}

.alert {
    padding: var(--s3) var(--s4);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.55;
    margin-top: var(--s4);
}

.alert-warn {
    background: var(--brand-light);
    border: 1px solid #fed7aa;
    color: var(--brand-hover);
}

.status-text {
    font-size: 13px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* 批量分析 */
.batch-card.card-stack {
    padding: 0;
    overflow: hidden;
    border-color: var(--border-strong);
}

.batch-head {
    padding: var(--s5) var(--s6);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.batch-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}

.batch-cta {
    padding: var(--s5) var(--s6);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s3);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.btn-primary-lg {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--sh);
    transition: background 0.15s, transform 0.1s;
}

.btn-primary-lg:hover:not(:disabled) {
    background: var(--brand-hover);
}

.btn-primary-lg:disabled {
    background: var(--border-strong);
    color: var(--text-faint);
    cursor: not-allowed;
    box-shadow: none;
}

.batch-cta-secondary {
    display: flex;
    justify-content: center;
    gap: var(--s2);
    flex-wrap: wrap;
}

.batch-alert {
    margin: 0 var(--s6);
    padding: var(--s3) var(--s4);
    background: var(--err-bg);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    color: var(--err);
    font-size: 13px;
    line-height: 1.55;
}

.batch-alert[hidden] {
    display: none !important;
}

.batch-progress-wrap {
    padding: var(--s5) var(--s6);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.batch-progress-track {
    height: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.batch-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ok), #4ade80);
    border-radius: 3px;
    transition: width 0.25s ease;
    width: 0;
}

.batch-progress-text {
    display: block;
    margin-top: var(--s2);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.batch-table-wrap {
    max-height: 62vh;
    overflow: auto;
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
}

.batch-table-feedback {
    table-layout: fixed;
    min-width: 1080px;
}

.batch-table th {
    position: sticky;
    top: 0;
    background: var(--text-2);
    z-index: 1;
    padding: 11px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.92);
    border-bottom: none;
    vertical-align: bottom;
    word-break: keep-all;
}

.batch-table-feedback th.col-analysis {
    background: #44403c;
}

.batch-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 13px;
}

.batch-table tbody tr:hover td { background: #fafaf9; }

.col-num {
    width: 3%;
    text-align: center;
    color: var(--text-faint);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.batch-table-feedback .col-l1 { width: 9%; }
.batch-table-feedback .col-l2-src { width: 9%; }
.batch-table-feedback .col-msg { width: 22%; min-width: 160px; }
.batch-table-feedback .col-member { width: 8%; text-align: center; vertical-align: middle; }
.batch-table-feedback .col-uid { width: 9%; font-size: 12px; font-variant-numeric: tabular-nums; vertical-align: middle; }
.batch-table-feedback .col-time { width: 11%; font-size: 12px; font-variant-numeric: tabular-nums; vertical-align: middle; word-break: break-word; }
.batch-table-feedback .col-l2-ai { width: 9%; vertical-align: middle; }
.batch-table-feedback .col-module { width: 8%; vertical-align: middle; }
.batch-table-feedback .col-result { width: 14%; }
.batch-table-feedback .col-path { width: 7%; text-align: center; vertical-align: middle; }

.batch-table-feedback td.col-analysis,
.batch-table-feedback th.col-analysis {
    border-left: 1px solid var(--border);
}

.batch-table-feedback th.col-l2-ai {
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.col-member { min-width: 72px; text-align: center; vertical-align: middle; }
.col-uid { min-width: 88px; font-size: 12px; font-variant-numeric: tabular-nums; vertical-align: middle; }

.cell-uid {
    font-weight: 600;
    color: var(--text);
}

.analysis-tag-member {
    background: #f5f5f4;
    color: #44403c;
    border: 1px solid #e7e5e4;
}

.membership-main {
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
}

.uid-sub {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.col-path { min-width: 96px; width: 9%; text-align: center; vertical-align: middle; }

.path-check-tag {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.15s, background 0.15s;
}

.path-check-tag:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.path-check-tag input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
    cursor: pointer;
}

.path-check-tag.checked {
    border-color: var(--ok);
    background: var(--ok-bg);
}

.path-check-lbl {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.path-check-tag.checked .path-check-lbl { color: var(--ok); }

.col-msg { min-width: 180px; }

.col-l2,
.col-l2-ai { min-width: 96px; vertical-align: middle; }

.cell-source-tag {
    display: inline-block;
    max-width: 100%;
    font-size: 12px;
    line-height: 1.45;
    word-break: break-word;
    color: var(--text-2);
}
.col-module { min-width: 100px; width: 11%; vertical-align: middle; }
.col-result { min-width: 220px; width: 24%; }

.analysis-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    max-width: 100%;
    word-break: break-word;
}

.analysis-tag-l2 {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.analysis-tag-human {
    background: #f5f5f4;
    color: #57534e;
    border: 1px dashed #d6d3d1;
}

.analysis-tag-module {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.analysis-tag.pending {
    color: var(--text-3);
    font-weight: 500;
    font-size: 11px;
}

.analysis-tag.empty {
    color: var(--text-3);
}

.tag-src {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-3);
}

.msg-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
    word-break: break-word;
    color: var(--text-2);
}

.msg-toggle {
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
}

.msg-toggle:hover { text-decoration: underline; }

.row-expanded .msg-preview { display: none; }

.msg-full {
    display: none;
    white-space: pre-wrap;
    line-height: 1.55;
    word-break: break-word;
}

.row-expanded .msg-full { display: block; }

.cell-result { font-size: 12px; line-height: 1.65; word-break: break-word; }
.cell-result.pending { color: var(--text-faint); }
.cell-result.running { color: var(--accent); font-weight: 500; }
.cell-result.error { color: var(--err); }
.cell-result.done { color: var(--text-2); }
.cell-result.done strong { color: var(--text); }

/* 结果区 */
.result {
    display: none;
    margin-top: var(--s5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--sh);
}

.result.show { display: block; }

.result-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s5) var(--s6);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.result-hd h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.result-body {
    padding: var(--s8);
    max-height: 60vh;
    overflow-y: auto;
    background: var(--surface);
    line-height: 1.7;
}

/* Markdown */
.md h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 20px 0 10px;
    border-bottom: 2px solid var(--brand-ring);
    padding-bottom: 6px;
}

.md h2 { font-size: 17px; font-weight: 600; margin: 18px 0 8px; }
.md h3 { font-size: 15px; font-weight: 600; margin: 14px 0 6px; }
.md h4 { font-size: 14px; font-weight: 600; margin: 10px 0 4px; }
.md p { margin: 6px 0; }
.md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.md li { margin: 3px 0; }
.md strong { font-weight: 600; color: var(--text); }
.md hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.md table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12px; }
.md th {
    background: var(--surface-2);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--border);
}
.md td { padding: 7px 10px; border: 1px solid var(--border); vertical-align: top; }
.md tr:hover td { background: var(--bg); }
.md code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: var(--mono);
}
.md pre {
    background: var(--text);
    color: #e7e5e4;
    padding: 14px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 10px 0;
}
.md pre code { background: none; padding: 0; color: inherit; }
.md blockquote {
    border-left: 4px solid var(--brand);
    background: var(--brand-light);
    padding: 10px 14px;
    margin: 10px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 分类表内修订 */
.batch-edit-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.batch-edit-l2,
.batch-edit-module {
    width: 100%;
    max-width: 140px;
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid var(--border, #e8e4df);
    border-radius: var(--radius-sm, 6px);
    background: #fff;
}
.batch-edit-module { max-width: 160px; }
.tag-revised {
    font-size: 11px;
    color: var(--brand, #f97316);
    background: var(--brand-light, #fff7ed);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.cell-result-view { position: relative; }
.btn-link.batch-edit-result-btn {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--brand, #f97316);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.btn-link.batch-edit-result-btn:hover { text-decoration: underline; }
.cell-result-edit .batch-edit-result {
    width: 100%;
    font-size: 13px;
    line-height: 1.5;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    resize: vertical;
}
.batch-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.batch-learned-panel {
    margin-top: var(--s4, 16px);
    padding-top: var(--s4);
    border-top: 1px solid var(--border);
}
.batch-learned-panel summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}
.batch-learned-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s4);
    margin-top: var(--s4);
}
.batch-learned-h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px;
}
@media (max-width: 900px) {
    .batch-learned-body { grid-template-columns: 1fr; }
}

/* 修订 */
.rules-box h3, .rev-box h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: var(--s4);
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    background: var(--info-bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--info);
    margin-bottom: var(--s2);
}

.rule-num {
    background: var(--info);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.rule-txt { font-size: 13px; line-height: 1.55; color: var(--text-2); }

.rev-item {
    padding: var(--s4);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: var(--s2);
}

.rev-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-from { background: var(--err-bg); color: var(--err); }
.badge-to { background: var(--ok-bg); color: var(--ok); }

.rev-meta { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

.empty {
    text-align: center;
    color: var(--text-faint);
    padding: var(--s8);
    font-size: 13px;
}

/* 产品知识 */
.k-table {
    width: 100%;
    border-collapse: collapse;
}

.k-table th {
    background: var(--surface-2);
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.k-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.mtag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--brand-light);
    color: var(--brand-hover);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin: 2px;
}

.mcards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--s4);
}

.mcard {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.mcard:hover { box-shadow: var(--sh); }

.mcard-hd {
    padding: 10px 14px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.mcard-bd { padding: var(--s4); }

.mcard-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-2);
}

.mcard-item:last-child { border: none; }

.mcard-item b { color: var(--text); }

.bg1 { background: #2563eb; }
.bg2 { background: var(--brand); }
.bg3 { background: #16a34a; }
.bg4 { background: #7c3aed; }
.bg5 { background: #db2777; }

.ftags { display: flex; flex-wrap: wrap; gap: var(--s2); }

.ftag {
    padding: 8px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.45;
}

.card-know-ai {
    margin-bottom: var(--s5);
    border-color: #fed7aa;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 48%);
}

.know-ai-desc {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.55;
    margin: 0 0 var(--s4);
}

.know-ai-extra textarea {
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
}

/* Loading */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay.show { display: flex; }

.spinner-box {
    background: var(--surface);
    padding: var(--s8) 48px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--sh-lg);
    min-width: 200px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto var(--s4);
}

.spinner-box p {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast-box {
    position: fixed;
    top: var(--s5);
    right: var(--s5);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--s2);
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--sh-lg);
    animation: tIn 0.25s ease;
    min-width: 220px;
    color: #fff;
}

.toast-ok { background: var(--ok); }
.toast-err { background: var(--err); }
.toast-info { background: var(--text); }

@keyframes tIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 产品知识 */
.know-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--s5);
}

/* 两栏布局（路径页） */
.split-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s5);
}

@media (max-width: 1024px) {
    .import-grid {
        grid-template-columns: 1fr;
        gap: var(--s5);
    }

    .import-or {
        display: block;
        text-align: center;
        font-size: 12px;
        color: var(--text-muted);
        margin: var(--s2) 0 0;
    }

    .import-col-upload .upload-area {
        min-height: 120px;
    }

    .import-col-text textarea {
        min-height: 220px;
    }
}

@media (max-width: 900px) {
    .split-card { grid-template-columns: 1fr; }
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-brand, .sidebar-ft, .sidebar-workflow { display: none; }
    .nav {
        display: flex;
        overflow-x: auto;
        padding: var(--s2);
        flex: 1;
    }
    .nav li {
        flex-direction: column;
        font-size: 11px;
        padding: 8px 12px;
        white-space: nowrap;
    }
    .nav-settings-btn { font-size: 12px; }
    .main { margin-left: 0; padding: var(--s5) var(--s4) var(--s8); border-left: none; }
    body { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    .page-title { font-size: 20px; }
}

/* 路径分析 — 快速填充（分区 + 对齐网格） */
.path-fill-setup {
    display: flex;
    flex-direction: column;
    gap: var(--s6);
    padding-bottom: var(--s6);
    margin-bottom: var(--s6);
    border-bottom: 1px dashed var(--border);
}

.path-fill-mode-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
}

.path-fill-mode-legend {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    line-height: 1.4;
    margin: 0;
}

.path-fill-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s4);
}

.path-mode-opt {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--s3);
    cursor: pointer;
    padding: var(--s4) var(--s5);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.path-mode-opt:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.path-mode-opt:has(input:checked) {
    background: var(--brand-light);
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand-ring);
}

.path-mode-opt input {
    margin: 3px 0 0;
    flex-shrink: 0;
    accent-color: var(--brand);
}

.path-mode-text {
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    min-width: 0;
}

.path-mode-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.path-mode-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.55;
    padding: 0;
    margin: 0;
}

.path-fill-details {
    display: flex;
    flex-direction: column;
    gap: var(--s6);
}

.path-fill-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--row-gap) var(--s6);
    align-items: start;
}

.path-fill-grid .form-field {
    margin: 0;
}

.path-mode-panel {
    margin: 0;
    padding: 0;
    border: none;
}

.path-fill-grid-common {
    padding-top: var(--s6);
    border-top: 1px dashed var(--border);
}

@media (max-width: 768px) {
    .path-fill-mode {
        grid-template-columns: 1fr;
    }

    .path-fill-grid {
        grid-template-columns: 1fr;
    }
}

.form-field-grow { flex: 1; min-width: 0; }

/* 汇总报告 */
.card-report-in .form-row-actions {
    margin-bottom: var(--s6);
}

.card-report-in .report-block {
    margin-top: var(--s6);
    padding-top: 0;
}

.card-report-in .report-block:first-of-type {
    margin-top: 0;
}

.card-report-in .form-field + .form-field.report-block {
    margin-top: var(--s6);
}

.card-report-in textarea {
    min-height: 200px;
}

.card-report-in .field-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: var(--s2) 0 var(--s3);
    line-height: 1.55;
}
.report-path-stories {
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    max-height: 280px;
    overflow-y: auto;
}

.report-story-item {
    display: grid;
    grid-template-columns: auto 1fr 1.4fr;
    align-items: center;
    gap: var(--s4);
    padding: var(--s3) var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

.report-story-item:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.report-story-item input.report-story-cb {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand);
    flex-shrink: 0;
    cursor: pointer;
}

.report-story-uid {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-story-time {
    font-size: 13px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}
