:root {
    --navy: #202124;
    --navy-2: #e8f2f1;
    --blue: #087f7c;
    --blue-soft: #edf7f6;
    --ink: #202124;
    --muted: #6f7378;
    --line: #e1e3e5;
    --line-dark: #cfd3d6;
    --surface: #ffffff;
    --canvas: #f5f5f7;
    --success: #187552;
    --success-soft: #edf7f1;
    --warning: #91610c;
    --warning-soft: #fff8e8;
    --danger: #bb3e3e;
    --danger-soft: #fff0f0;
    --focus: #087f7c;
    --shadow: 0 1px 2px rgba(20, 24, 28, 0.04), 0 12px 32px rgba(20, 24, 28, 0.06);
    --shadow-raised: 0 16px 48px rgba(20, 24, 28, 0.12);
}

html {
    color-scheme: light;
    background: var(--canvas);
}

body {
    color: var(--ink);
    background: var(--canvas);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    letter-spacing: 0;
}

::selection {
    color: #173c3a;
    background: #cce9e6;
}

:focus-visible {
    outline: 3px solid rgba(8, 127, 124, 0.2);
    outline-offset: 2px;
}

.app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
    color: var(--ink);
    background: rgba(250, 250, 251, 0.96);
    border-right: 1px solid var(--line);
    box-shadow: 6px 0 24px rgba(20, 24, 28, 0.025);
    backdrop-filter: saturate(150%) blur(20px);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
}

.brand {
    min-height: 86px;
    gap: 11px;
    padding: 18px 18px;
    border-bottom-color: var(--line);
}

.brand-mark {
    width: 40px;
    height: 40px;
    color: #fff;
    background: #202124;
    border: 1px solid #202124;
    border-radius: 8px;
    box-shadow: 0 5px 14px rgba(20, 24, 28, 0.14);
    font-size: 17px;
    font-weight: 760;
}

.brand-title {
    color: #25272a;
    font-size: 15px;
    font-weight: 720;
}

.brand-subtitle {
    margin-top: 2px;
    color: #8a8e93;
    font-size: 9px;
    font-weight: 650;
}

.nav-label {
    padding: 24px 18px 9px;
    color: #969a9f;
    font-size: 10px;
    font-weight: 700;
}

.module-nav {
    padding: 0 10px;
}

.nav-button {
    min-height: 46px;
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    gap: 7px;
    margin-bottom: 3px;
    padding: 5px 10px;
    color: #62666b;
    border: 1px solid transparent;
    border-radius: 7px;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.nav-button:hover {
    color: #24272a;
    background: #f0f1f2;
}

.nav-button.active {
    color: #145d5b;
    background: #fff;
    border-color: #dfe7e6;
    box-shadow: 0 1px 2px rgba(20, 24, 28, 0.04), 0 6px 18px rgba(20, 24, 28, 0.05);
}

.nav-icon {
    width: 29px;
    height: 29px;
    color: #74797e;
    background: #eceeef;
    border: 1px solid #e2e4e6;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 750;
}

.nav-button.active .nav-icon {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.nav-name {
    font-weight: 650;
}

.nav-arrow {
    color: #a7aaae;
    font-size: 16px;
}

.sidebar-foot {
    margin: auto 10px 10px;
    padding: 14px 10px 9px;
    border-top: 1px solid var(--line);
}

.service-state {
    color: #565a5f;
    font-size: 11px;
}

.state-dot {
    width: 7px;
    height: 7px;
    background: #2ca475;
    box-shadow: 0 0 0 3px rgba(44, 164, 117, 0.12);
}

.retention {
    margin-top: 6px;
    color: #9b9ea2;
    font-size: 10px;
}

.workspace {
    background: var(--canvas);
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    height: 76px;
    padding: 0 34px;
    background: rgba(255, 255, 255, 0.84);
    border-bottom: 1px solid rgba(213, 216, 219, 0.88);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
}

.page-title {
    color: #1f2124;
    font-size: 20px;
    font-weight: 720;
}

.page-context {
    margin-top: 3px;
    color: #85898e;
    font-size: 11px;
}

.top-actions {
    gap: 8px;
}

.quiet-button,
.icon-button,
.primary-button,
.download-button,
.danger-button {
    border-radius: 7px;
    transition: color 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.quiet-button {
    min-height: 36px;
    padding: 0 12px;
    color: #50545a;
    background: rgba(255, 255, 255, 0.76);
    border-color: #d8dbde;
    box-shadow: 0 1px 2px rgba(20, 24, 28, 0.03);
}

.quiet-button:hover {
    color: #202124;
    background: #fff;
    border-color: #c8ccd0;
    box-shadow: 0 4px 12px rgba(20, 24, 28, 0.06);
}

.account-name {
    color: #767a7f;
    font-size: 11px;
}

.main-content {
    width: min(1200px, 100%);
    padding: 34px 36px 54px;
}

.work-panel {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid #dedfe2;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel-head {
    min-height: 82px;
    align-items: center;
    padding: 18px 22px;
    background: #fff;
    border-bottom-color: #e6e7e9;
}

.panel-title-row {
    gap: 13px;
}

.panel-symbol {
    width: 40px;
    height: 40px;
    color: #12625f;
    background: #e8f4f3;
    border: 1px solid #d1e8e5;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 780;
}

.panel-title {
    color: #25272a;
    font-size: 16px;
    font-weight: 700;
}

.panel-meta {
    margin-top: 4px;
    color: #85898e;
    font-size: 11px;
}

.mode-control {
    gap: 11px;
    padding-left: 18px;
    border-left: 1px solid #eceef0;
}

.mode-name {
    color: #45494e;
    font-size: 11px;
    font-weight: 680;
}

.mode-note {
    color: #969a9f;
    font-size: 10px;
}

.switch {
    width: 40px;
    height: 23px;
}

.switch-track {
    background: #c8cccf;
    border: 1px solid #bcc1c4;
    border-radius: 12px;
}

.switch-track::after {
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    box-shadow: 0 1px 4px rgba(20, 24, 28, 0.24);
}

.switch input:checked + .switch-track {
    background: var(--blue);
    border-color: var(--blue);
}

.switch input:checked + .switch-track::after {
    transform: translateX(17px);
}

.panel-body {
    padding: 22px;
    background: #fcfcfd;
}

.crew-source {
    margin-bottom: 14px;
}

.crew-source-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.crew-source-field {
    min-width: 0;
}

.crew-source-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.crew-source-label {
    margin-bottom: 7px;
    color: #5f6368;
    font-size: 11px;
}

.crew-source-button {
    width: 100%;
    min-height: 60px;
    background: #fff;
    border-color: #dfe1e3;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(20, 24, 28, 0.025);
}

.crew-reference-clear {
    width: 38px;
    height: 38px;
}

.crew-source-icon.reference {
    color: #7a5510;
    background: #fff8e8;
    border-color: #f1dfb5;
}

.crew-source-button:hover {
    background: #f8fbfa;
    border-color: #9bc8c5;
}

.crew-source-icon {
    color: #176966;
    background: #edf7f6;
    border-color: #d5eae8;
    border-radius: 7px;
}

.crew-source-action {
    color: #0e6f6c;
}

.manual-comparison {
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.manual-comparison-head {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.manual-comparison-head strong,
.manual-comparison-head span {
    display: block;
}

.manual-comparison-head span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.manual-comparison-status {
    color: #176966;
    font-size: 12px;
    font-weight: 700;
}

.manual-comparison.has-differences .manual-comparison-status {
    color: #9a5d00;
}

.manual-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.manual-comparison-table th,
.manual-comparison-table td {
    padding: 9px 10px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.manual-comparison-table th {
    background: #f5f7f7;
    font-weight: 700;
}

.dropzone {
    min-height: 216px;
    padding: 30px;
    background: #fff;
    border: 1px dashed #bdc3c7;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.dropzone:hover,
.dropzone.dragging {
    background: #f4faf9;
    border-color: #4d9f9b;
    box-shadow: inset 0 0 0 1px rgba(8, 127, 124, 0.06);
}

.upload-symbol {
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    color: #176966;
    background: #edf7f6;
    border: 1px solid #d6eae8;
    border-radius: 8px;
    font-size: 23px;
    font-weight: 500;
}

.drop-title {
    color: #34373b;
    font-size: 14px;
    font-weight: 650;
}

.drop-action {
    color: #087f7c;
    text-decoration: none;
}

.drop-meta {
    margin-top: 7px;
    color: #8d9196;
    font-size: 11px;
}

.selection {
    margin-top: 16px;
    border-top-color: #e5e7e9;
}

.selection-head {
    min-height: 46px;
}

.selection-summary {
    color: #44484d;
    font-size: 12px;
    font-weight: 650;
}

.clear-button {
    color: #a63e3e;
    font-size: 11px;
}

.file-list,
.pdf-list,
.table-scroll {
    background: #fff;
    border-color: #dfe2e4;
    border-radius: 7px;
}

.file-row {
    border-bottom-color: #eceef0;
}

.file-row:hover {
    background: #f8faf9;
}

.file-type {
    color: #a54949;
}

.file-name {
    color: #383c40;
    font-weight: 600;
}

.action-bar {
    margin-top: 18px;
}

.primary-button {
    min-height: 40px;
    min-width: 148px;
    padding: 0 18px;
    color: #fff;
    background: #087f7c;
    box-shadow: 0 5px 14px rgba(8, 127, 124, 0.18);
    font-weight: 680;
}

.primary-button:hover {
    background: #076e6b;
    box-shadow: 0 7px 18px rgba(8, 127, 124, 0.23);
    transform: translateY(-1px);
}

.primary-button:active {
    transform: translateY(0);
}

.primary-button:disabled {
    color: #92969a;
    background: #e4e6e8;
    box-shadow: none;
}

.progress-wrap {
    background: #fff;
    border-color: #dfe2e4;
    border-radius: 8px;
}

.progress-track {
    height: 6px;
    background: #e6e8ea;
    border-radius: 3px;
}

.progress-bar {
    background: #087f7c;
}

.result-panel {
    border-color: #b9dccc;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(24, 117, 82, 0.06);
}

.result-summary {
    background: #edf7f1;
}

.confidence-score {
    border-radius: 7px;
}

.download-button {
    border-radius: 7px;
    box-shadow: 0 4px 12px rgba(24, 117, 82, 0.14);
}

.preview {
    background: #fff;
}

th,
td {
    padding: 11px 13px;
    border-bottom-color: #e8eaec;
}

th {
    color: #696e73;
    background: #f7f8f9;
    font-size: 11px;
    font-weight: 680;
}

td {
    color: #3f4348;
}

tbody tr:hover td {
    background: #f7fbfa;
}

.task-section {
    margin-top: 28px;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.section-head {
    min-height: 48px;
    padding: 0 2px;
    border: 0;
}

.section-title {
    color: #303337;
    font-size: 14px;
    font-weight: 700;
}

.section-count {
    color: #8b8f94;
    font-size: 11px;
}

.task-table-wrap {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dfe1e3;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(20, 24, 28, 0.03), 0 8px 24px rgba(20, 24, 28, 0.045);
}

.task-table th,
.task-table td {
    padding: 12px 15px;
}

.status-badge {
    font-size: 11px;
    font-weight: 680;
}

.task-link {
    color: #087f7c;
    font-weight: 650;
}

.empty-state {
    color: #8a8e93;
}

.correction-section {
    background: #f8f9fa;
    border-top-color: #e3e5e7;
}

.correction-table input,
.login-input {
    color: #272a2e;
    background: #fff;
    border-color: #d4d7da;
    border-radius: 7px;
}

.correction-table input:focus,
.login-input:focus {
    border-color: #4a9a96;
    outline: 3px solid rgba(8, 127, 124, 0.11);
}

.correction-table input {
    min-width: 118px;
}

.correction-table td.rank-other-cell,
.correction-table tbody tr:hover td.rank-other-cell {
    color: #5d4600;
    background: #fff2a8;
    box-shadow: inset 3px 0 0 #d7a900;
    font-weight: 700;
}

.correction-table input.rank-other-input {
    color: #5d4600;
    background: #fff9d6;
    border-color: #d7a900;
    font-weight: 700;
}

.row-confirm {
    display: grid;
    justify-items: center;
    gap: 5px;
    min-width: 74px;
    color: #656a70;
    font-size: 11px;
}

.row-confirm input {
    min-width: 0;
    width: 16px;
    height: 16px;
    accent-color: #087f7c;
}

.crew-evidence-row td {
    padding: 0 12px 14px;
    background: #f4f6f7;
}

.crew-evidence {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 12px;
    border: 1px solid #dfe3e5;
    border-radius: 6px;
    background: #fff;
}

.evidence-copy strong {
    display: block;
    margin-bottom: 8px;
    color: #35393d;
    font-size: 12px;
}

.evidence-token {
    display: inline-block;
    margin: 0 8px 6px 0;
    color: #656a70;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.evidence-images {
    display: flex;
    gap: 8px;
}

.evidence-image-link {
    display: block;
    width: 148px;
    height: 92px;
    overflow: hidden;
    border: 1px solid #d6dadd;
    border-radius: 6px;
    background: #eef0f1;
}

.evidence-image-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 800px) {
    .crew-evidence {
        grid-template-columns: 1fr;
    }

    .evidence-images {
        overflow-x: auto;
    }
}

.login-overlay {
    padding: 24px;
    background: #f1f2f4;
}

.login-dialog {
    width: min(400px, 100%);
    background: #fff;
    border: 1px solid #dcdfe1;
    border-radius: 8px;
    box-shadow: var(--shadow-raised);
}

.login-head {
    position: relative;
    padding: 28px 28px 22px 84px;
    color: #232629;
    background: #fff;
    border-bottom: 1px solid #eceef0;
}

.login-head::before {
    content: "海";
    position: absolute;
    top: 24px;
    left: 28px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #202124;
    border-radius: 8px;
    box-shadow: 0 5px 14px rgba(20, 24, 28, 0.14);
    font-weight: 750;
}

.login-title {
    color: #25272a;
    font-size: 18px;
    font-weight: 720;
}

.login-subtitle {
    margin-top: 4px;
    color: #878b90;
    font-size: 11px;
}

.login-form {
    padding: 26px 28px 28px;
}

.auth-mode {
    height: 38px;
    margin-bottom: 20px;
    padding: 3px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    background: #f0f2f3;
    border: 1px solid #e2e5e7;
    border-radius: 6px;
}

.auth-mode-button {
    color: #687078;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
}

.auth-mode-button.active {
    color: #202124;
    background: #fff;
    box-shadow: 0 1px 3px rgba(20, 24, 28, 0.1);
}

.login-label {
    color: #5b6065;
    font-size: 11px;
    font-weight: 650;
}

.login-input {
    height: 44px;
    padding: 0 12px;
}

.login-submit {
    min-height: 44px;
    margin-top: 6px;
}

.login-error {
    border: 1px solid #f0c9c9;
    border-radius: 7px;
}

.toast {
    color: #fff;
    background: #303337;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(20, 24, 28, 0.22);
}

@media (max-width: 860px) {
    .sidebar {
        position: sticky;
        z-index: 40;
        top: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .brand {
        min-height: 62px;
        padding: 11px 16px;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
    }

    .module-nav {
        gap: 4px;
        padding: 6px 8px 8px;
    }

    .nav-button {
        min-height: 42px;
        margin: 0;
        padding: 5px 3px;
        border-radius: 7px;
    }

    .nav-button.active {
        box-shadow: 0 1px 4px rgba(20, 24, 28, 0.06);
    }

    .topbar {
        position: static;
        min-height: 66px;
        padding: 11px 18px;
    }

    .main-content {
        padding: 22px 16px 40px;
    }
}

@media (max-width: 600px) {
    .crew-source-options {
        grid-template-columns: 1fr;
    }

    .manual-comparison-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        padding: 12px 0;
    }

    .brand-subtitle {
        display: none;
    }

    .brand-title {
        font-size: 14px;
    }

    .page-title {
        font-size: 17px;
    }

    .top-actions .quiet-button span:first-child {
        display: inline;
    }

    .top-actions .quiet-button span:last-child {
        display: none;
    }

    .panel-head {
        padding: 16px;
    }

    .mode-control {
        padding: 13px 0 0;
        border-top-color: #e7e9eb;
        border-left: 0;
    }

    .panel-body {
        padding: 15px;
    }

    .dropzone {
        min-height: 170px;
        padding: 22px 13px;
    }

    .upload-symbol {
        width: 44px;
        height: 44px;
    }

    .task-table-wrap {
        overflow-x: auto;
    }

    .login-overlay {
        padding: 14px;
    }

    .login-head {
        padding: 24px 22px 20px 76px;
    }

    .login-head::before {
        top: 21px;
        left: 22px;
    }

    .login-form {
        padding: 23px 22px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .primary-button:hover {
        transform: none;
    }
}
