:root {
    --ink: #17212b;
    --ink-2: #33414f;
    --muted: #6b7785;
    --muted-2: #8c97a3;
    --paper: #f2efe7;
    --panel: #fffdf8;
    --panel-2: #faf7f0;
    --panel-3: #f5f1e8;
    --line: #e2dccf;
    --line-strong: #d0c6b5;
    --accent: #8b2e2e;
    --accent-dark: #6f2323;
    --accent-soft: #f5e7e4;
    --gold: #b08a4a;
    --gold-soft: #f4ede0;
    --green: #2f6b4f;
    --green-soft: #e8f2ec;
    --amber: #95651b;
    --amber-soft: #fbf2df;
    --red: #a33a3a;
    --red-soft: #f8e9e7;
    --shadow: 0 1px 2px rgba(23, 33, 43, .05), 0 8px 24px rgba(23, 33, 43, .06);
    --radius: 10px;
    --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
    --font-serif: "Songti SC", "SimSun", "Noto Serif SC", serif;
    --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

button, input, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-sm {
    width: 14px;
    height: 14px;
}

.mono {
    font-family: var(--font-mono);
}

.muted {
    color: var(--muted);
}

.eyebrow {
    margin: 0;
    color: var(--gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

/* Top bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 72px;
    padding: 12px 24px;
    background: #14202b;
    color: #f5f1e8;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.topbar-left,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-seal {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #e7c98f;
    border: 1px solid rgba(231, 201, 143, .55);
    border-radius: 8px;
    background: rgba(231, 201, 143, .07);
}

.brand-seal .icon {
    width: 23px;
    height: 23px;
    stroke-width: 1.35;
}

.brand-text {
    min-width: 0;
}

.brand-text h1 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .08em;
    white-space: nowrap;
}

.brand-text p {
    margin: 1px 0 0;
    color: #9fabb8;
    font-size: 11px;
    letter-spacing: .06em;
    white-space: nowrap;
}

.context-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 260px;
    padding: 7px 10px;
    color: #e9edf1;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.context-chip:hover {
    background: rgba(255, 255, 255, .12);
}

.context-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.primary-button,
.secondary-button,
.ghost-button,
.small-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.primary-button {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.primary-button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.secondary-button {
    color: var(--ink);
    background: var(--panel);
    border-color: var(--line-strong);
}

.secondary-button:hover {
    background: var(--panel-2);
    border-color: var(--gold);
}

.ghost-button {
    color: var(--ink-2);
    background: transparent;
    border-color: transparent;
}

.ghost-button:hover {
    background: var(--panel-3);
}

.small-button {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--panel);
    border-color: var(--line);
}

.small-button:hover {
    border-color: var(--gold);
    color: var(--ink);
}

.small-button.confirm {
    color: var(--green);
    background: var(--green-soft);
    border-color: #cfe3d7;
}

.small-button.confirm:hover {
    background: #dcece2;
}

.small-button.reject {
    color: var(--red);
    background: var(--red-soft);
    border-color: #ecd2ce;
}

.small-button.reject:hover {
    background: #f3dcd8;
}

.small-button.danger {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

.danger-button {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

.danger-button:hover {
    background: #8c2f2f;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #dce4eb;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
}

.icon-button:hover {
    background: rgba(255, 255, 255, .1);
}

.main .icon-button {
    color: var(--ink-2);
    border-color: var(--line);
    background: var(--panel);
}

.main .icon-button:hover {
    border-color: var(--gold);
}

.mobile-only {
    display: none;
}

/* Workspace */
.workspace {
    display: grid;
    grid-template-columns: 304px minmax(0, 1fr);
    min-height: calc(100vh - 72px);
}

.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 20px 16px 14px;
    background: var(--panel-2);
    border-right: 1px solid var(--line);
}

.sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px 14px;
}

.sidebar-head h2 {
    margin: 2px 0 0;
    font-family: var(--font-serif);
    font-size: 20px;
    letter-spacing: .04em;
}

.count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    color: var(--ink-2);
    background: var(--panel-3);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.search-box:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(176, 138, 74, .12);
}

.search-box input {
    width: 100%;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 13px;
}

.search-box input::placeholder {
    color: var(--muted-2);
}

.filing-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    margin: 14px -4px 0;
    padding: 0 4px 12px;
    overflow: auto;
}

.sidebar-empty {
    padding: 28px 12px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.filing-card {
    display: block;
    width: 100%;
    padding: 12px 12px 11px;
    text-align: left;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid transparent;
    border-radius: 9px;
    box-shadow: 0 1px 1px rgba(23, 33, 43, .02);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.filing-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

.filing-card.active {
    border-left-color: var(--accent);
    border-color: #d8c9b9;
    box-shadow: var(--shadow);
}

.filing-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.filing-report {
    overflow: hidden;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filing-court {
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filing-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 9px;
}

.filing-progress {
    flex: 1;
    height: 4px;
    overflow: hidden;
    background: #ece6da;
    border-radius: 999px;
}

.filing-progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: inherit;
    transition: width .3s ease;
}

.filing-progress-text {
    color: var(--muted);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sidebar-foot {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    padding: 12px 4px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 11px;
}

.connection-dot {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(47, 107, 79, .12);
}

.connection-dot.offline {
    background: var(--red);
    box-shadow: 0 0 0 3px rgba(163, 58, 58, .12);
}

/* Main */
.main {
    min-width: 0;
    padding: 26px 30px 48px;
    overflow: auto;
}

.empty-state {
    max-width: 600px;
    margin: 10vh auto 0;
    padding: 0 20px;
    text-align: center;
}

.empty-illustration {
    width: 132px;
    height: 132px;
    margin: 0 auto 18px;
}

.empty-illustration svg {
    width: 100%;
    height: 100%;
}

.empty-state h2 {
    margin: 6px 0 8px;
    font-family: var(--font-serif);
    font-size: 28px;
    letter-spacing: .03em;
}

.empty-state p {
    margin: 0 auto 20px;
    max-width: 470px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.8;
}

.loading-block {
    max-width: 760px;
    margin: 8vh auto 0;
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.skeleton-line {
    height: 12px;
    margin: 12px 0;
    background: linear-gradient(90deg, #eee8dc, #f7f3ea, #eee8dc);
    background-size: 200% 100%;
    border-radius: 999px;
    animation: shimmer 1.4s infinite linear;
}

.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-55 { width: 55%; }

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* Workbench header */
.workbench-head {
    padding: 20px 22px 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.workbench-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.workbench-title {
    min-width: 0;
}

.workbench-title h2 {
    margin: 3px 0 0;
    overflow: hidden;
    font-family: var(--font-serif);
    font-size: 25px;
    letter-spacing: .02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workbench-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-item strong {
    color: var(--ink-2);
    font-weight: 600;
}

.workbench-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.progress-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.progress-bar {
    flex: 1;
    height: 7px;
    overflow: hidden;
    background: #ece6da;
    border-radius: 999px;
}

.progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: inherit;
    transition: width .3s ease;
}

.progress-text {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.progress-text strong {
    color: var(--ink);
    font-size: 14px;
}

.completion-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 12px 16px;
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid #cfe3d7;
    border-radius: 8px;
    font-size: 13px;
}

.completion-banner strong {
    font-weight: 700;
}

.completion-banner .banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toolbar */
.queue-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 18px 0 12px;
}

.filter-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 11px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
}

.filter-tab:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, .6);
}

.filter-tab.active {
    color: var(--ink);
    background: var(--panel);
    box-shadow: 0 1px 2px rgba(23, 33, 43, .08);
}

.filter-tab .tab-count {
    color: var(--muted);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}

.queue-toolbar .search-box {
    width: min(320px, 100%);
    margin-left: auto;
}

.toolbar-note {
    color: var(--muted);
    font-size: 11.5px;
}

/* Groups */
.group {
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 1px rgba(23, 33, 43, .02);
}

.group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--panel-2);
    border-bottom: 1px solid var(--line);
    user-select: none;
}

.group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    text-align: left;
}

.group-toggle .icon {
    color: var(--muted);
    transition: transform .15s ease;
}

.group.collapsed .group-toggle .icon {
    transform: rotate(-90deg);
}

.group-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
}

.group-count {
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.group-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.group-body {
    display: flex;
    flex-direction: column;
}

.group.collapsed .group-body {
    display: none;
}

.group-empty {
    padding: 20px 16px;
    color: var(--muted);
    font-size: 12.5px;
}

/* Review item */
.review-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 18px;
    padding: 15px 16px 16px;
    border-bottom: 1px solid #eee8dc;
}

.review-item:last-child {
    border-bottom: 0;
}

.review-item.status-confirmed {
    background: linear-gradient(90deg, rgba(232, 242, 236, .55), transparent 34%);
}

.review-item.status-rejected {
    background: linear-gradient(90deg, rgba(248, 233, 231, .5), transparent 34%);
}

.item-main {
    min-width: 0;
}

.item-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.item-label {
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.item-context {
    margin-top: 3px;
    overflow: hidden;
    color: var(--ink-2);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-path {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted-2);
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-value {
    margin-top: 9px;
    min-width: 0;
}

.inline-input,
.inline-textarea {
    width: 100%;
    padding: 8px 10px;
    color: var(--ink);
    background: #fffefb;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.5;
}

.inline-input:hover,
.inline-textarea:hover {
    border-color: #bfae94;
}

.inline-input:focus,
.inline-textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(176, 138, 74, .12);
    outline: 0;
}

.inline-textarea {
    min-height: 64px;
    resize: vertical;
}

.value-text {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 13px;
}

.value-text.empty {
    color: var(--muted-2);
    font-style: italic;
}

.value-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.value-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    color: var(--ink-2);
    background: var(--gold-soft);
    border: 1px solid #e6d7bd;
    border-radius: 999px;
    font-size: 11.5px;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 16px;
    padding: 9px 11px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.kv-item {
    display: flex;
    gap: 8px;
    min-width: 0;
    font-size: 11.5px;
}

.kv-key {
    flex: 0 0 auto;
    color: var(--muted);
}

.kv-val {
    overflow: hidden;
    color: var(--ink-2);
    font-family: var(--font-mono);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.json-preview {
    max-height: 150px;
    margin: 0;
    padding: 9px 11px;
    overflow: auto;
    color: var(--ink-2);
    background: #f7f4ec;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.value-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
}

.item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 160px;
}

.item-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.item-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.resolved-line {
    color: var(--muted);
    font-size: 11px;
    text-align: right;
    line-height: 1.5;
}

.reject-note {
    margin-top: 7px;
    padding: 7px 9px;
    color: var(--red);
    background: var(--red-soft);
    border-left: 2px solid var(--red);
    border-radius: 0 6px 6px 0;
    font-size: 11.5px;
}

/* Badges */
.status-badge,
.confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}

.status-badge.pending,
.status-badge.in_review {
    color: var(--amber);
    background: var(--amber-soft);
    border-color: #ecdbb8;
}

.status-badge.confirmed {
    color: var(--green);
    background: var(--green-soft);
    border-color: #cfe3d7;
}

.status-badge.rejected {
    color: var(--red);
    background: var(--red-soft);
    border-color: #ecd2ce;
}

.status-badge.neutral {
    color: var(--muted);
    background: var(--panel-3);
    border-color: var(--line);
}

.confidence-badge.high {
    color: var(--green);
    background: var(--green-soft);
    border-color: #cfe3d7;
}

.confidence-badge.medium {
    color: var(--amber);
    background: var(--amber-soft);
    border-color: #ecdbb8;
}

.confidence-badge.low {
    color: var(--red);
    background: var(--red-soft);
    border-color: #ecd2ce;
}

.confidence-badge.unknown {
    color: var(--muted);
    background: var(--panel-3);
    border-color: var(--line);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(16, 24, 32, .56);
    backdrop-filter: blur(2px);
}

.modal {
    display: flex;
    flex-direction: column;
    width: min(680px, 100%);
    max-height: 88vh;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(8, 14, 20, .28);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 20px;
    letter-spacing: .03em;
}

.modal-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.modal-body {
    padding: 18px 20px;
    overflow: auto;
}

.modal-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    background: var(--panel-2);
    border-top: 1px solid var(--line);
}

.modal-foot .foot-left {
    margin-right: auto;
    color: var(--muted);
    font-size: 11.5px;
}

.modal-close {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 7px;
}

.modal-close:hover {
    color: var(--ink);
    background: var(--panel-3);
}

.form-field {
    margin-bottom: 14px;
}

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

.form-field label {
    display: block;
    margin-bottom: 5px;
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 700;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 9px 11px;
    background: #fffefb;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-size: 13px;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(176, 138, 74, .12);
    outline: 0;
}

.form-field textarea {
    min-height: 120px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
}

.form-hint {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11.5px;
}

.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 24px;
    text-align: center;
    background: var(--panel-2);
    border: 1.5px dashed var(--line-strong);
    border-radius: 10px;
    transition: border-color .15s ease, background .15s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    background: var(--gold-soft);
    border-color: var(--gold);
}

.drop-zone .icon {
    width: 30px;
    height: 30px;
    margin-bottom: 8px;
    color: var(--gold);
}

.drop-zone strong {
    font-size: 13px;
}

.drop-zone p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11.5px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.summary-cell {
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.summary-key {
    color: var(--muted);
    font-size: 10.5px;
}

.summary-val {
    margin-top: 2px;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 12px 0;
    padding: 10px 12px;
    color: #7c5517;
    background: var(--amber-soft);
    border: 1px solid #ecdbb8;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
}

.warning-box .icon {
    margin-top: 2px;
    color: var(--amber);
}

.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    color: var(--ink-2);
    font-size: 12px;
    line-height: 1.5;
}

.checkbox-line input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.error-list {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--red);
    font-size: 12px;
}

.error-list li {
    margin: 3px 0;
}

/* Toasts */
.toast-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(380px, calc(100vw - 40px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 14px;
    color: #f7f9fb;
    background: #1d2a36;
    border-left: 3px solid var(--green);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(8, 14, 20, .24);
    font-size: 12.5px;
    line-height: 1.55;
    pointer-events: auto;
    animation: toast-in .18s ease-out;
}

.toast.error {
    border-left-color: var(--red);
}

.toast.warning {
    border-left-color: var(--amber);
}

.toast .icon {
    margin-top: 1px;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.spinner.dark {
    border-color: rgba(23, 33, 43, .18);
    border-top-color: var(--ink);
}

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

/* Case fact summary */
.case-fact-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
}

.case-fact-json {
    max-height: 52vh;
    margin: 0;
    padding: 14px;
    overflow: auto;
    color: var(--ink-2);
    background: #f7f4ec;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 1080px) {
    .workspace {
        grid-template-columns: 264px minmax(0, 1fr);
    }

    .main {
        padding: 22px 22px 40px;
    }

    .context-chip {
        max-width: 190px;
    }
}

@media (max-width: 860px) {
    .topbar {
        flex-wrap: wrap;
        padding: 10px 14px;
    }

    .brand-text h1 {
        font-size: 18px;
    }

    .brand-text p {
        display: none;
    }

    .mobile-only {
        display: inline-flex;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 60;
        width: min(320px, 88vw);
        padding-top: 18px;
        border-right: 1px solid var(--line);
        box-shadow: 18px 0 50px rgba(8, 14, 20, .2);
        transform: translateX(-102%);
        transition: transform .2s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        padding: 16px 14px 36px;
    }

    .workbench-title-row {
        flex-direction: column;
    }

    .workbench-actions {
        justify-content: flex-start;
    }

    .workbench-title h2 {
        font-size: 21px;
    }

    .queue-toolbar .search-box {
        width: 100%;
        margin-left: 0;
    }

    .review-item {
        grid-template-columns: 1fr;
    }

    .item-side {
        align-items: flex-start;
        min-width: 0;
    }

    .item-badges,
    .item-actions {
        justify-content: flex-start;
    }

    .resolved-line {
        text-align: left;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .completion-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .context-chip {
        flex: 1;
        max-width: none;
    }

    .primary-button {
        padding: 7px 10px;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .filter-tab {
        flex: 1;
        justify-content: center;
        white-space: nowrap;
    }

    .kv-grid {
        grid-template-columns: 1fr;
    }
}

/* 样例标记与可访问性补充 */
.sample-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 0 5px;
    color: var(--amber);
    background: var(--amber-soft);
    border: 1px solid #e6d3ab;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 650;
    line-height: 16px;
    vertical-align: middle;
}

.sample-meta {
    color: var(--amber);
    font-weight: 600;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: 8px 12px;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0 0 6px 0;
}

.skip-link:focus {
    left: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
