/* ============================================================
   Apple-style theme layer + SINOTRANS brand watermark
   Loaded after premium.css so equal-specificity rules win.
   ============================================================ */

:root {
    --blue: #0071e3;
    --focus: #0071e3;
    --blue-soft: #eef5ff;
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --line: rgba(0, 0, 0, 0.08);
    --line-dark: rgba(0, 0, 0, 0.14);
    --canvas: #f5f5f7;
    --surface: #ffffff;
    --navy: #12304a;
    --navy-2: #1c4565;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.06);
    --shadow-raised: 0 24px 64px rgba(0, 0, 0, 0.18);
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ---------- typography ---------- */

html {
    background: var(--canvas);
}

body {
    color: var(--ink);
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    color: #fff;
    background: rgba(0, 113, 227, 0.85);
}

/* ---------- SINOTRANS watermark layer ---------- */

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='150' viewBox='0 0 260 150'%3E%3Cg transform='rotate(-28 130 75)'%3E%3Ctext x='130' y='72' text-anchor='middle' font-family='PingFang SC, Microsoft YaHei, sans-serif' font-size='24' font-weight='600' fill='%2312304a' fill-opacity='0.55'%3E中国外运%3C/text%3E%3Ctext x='130' y='96' text-anchor='middle' font-family='Arial, sans-serif' font-size='11' letter-spacing='3' fill='%2312304a' fill-opacity='0.55'%3ESINOTRANS%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 260px auto;
    background-position: center center;
    opacity: 0.14;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: rgba(245, 245, 247, 0.12);
}

.workspace,
.main-content,
.app-shell {
    background: transparent;
}

/* ---------- sidebar ---------- */

.sidebar {
    color: var(--ink);
    background: rgba(252, 252, 253, 0.72);
    border-right: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
}

.brand {
    min-height: 80px;
    gap: 11px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 38px;
    height: 38px;
    color: #fff;
    background: #12304a;
    border: 0;
    border-radius: 11px;
    box-shadow: 0 4px 12px rgba(18, 48, 74, 0.22);
    font-size: 16px;
    font-weight: 700;
}

.brand-title {
    color: var(--ink);
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.brand-subtitle {
    margin-top: 2px;
    color: #8e8e93;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.nav-label {
    padding: 22px 20px 8px;
    color: #a1a1a6;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

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

.nav-button {
    min-height: 44px;
    grid-template-columns: 32px minmax(0, 1fr) 14px;
    gap: 10px;
    margin-bottom: 4px;
    padding: 5px 10px;
    color: #4a4a4f;
    border: 1px solid transparent;
    border-radius: 11px;
    transition: color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}

.nav-button:hover {
    color: var(--ink);
    background: rgba(0, 0, 0, 0.04);
}

.nav-button.active {
    color: var(--blue);
    background: rgba(0, 113, 227, 0.1);
    border-color: transparent;
    box-shadow: none;
}

.nav-icon {
    width: 28px;
    height: 28px;
    color: #6e6e73;
    background: rgba(0, 0, 0, 0.05);
    border: 0;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
}

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

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

.nav-arrow {
    color: #c7c7cc;
}

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

.service-state {
    color: #6e6e73;
    font-size: 11px;
}

/* ---------- topbar ---------- */

.topbar {
    height: 68px;
    padding: 0 36px;
    background: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
}

.page-title {
    color: var(--ink);
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.page-context {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.main-content {
    width: min(1160px, 100%);
    padding: 40px 40px 64px;
}

/* ---------- buttons ---------- */

.quiet-button,
.icon-button,
.primary-button,
.download-button,
.danger-button {
    border-radius: 980px;
    transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.quiet-button {
    min-height: 36px;
    padding: 0 16px;
    color: #3a3a3c;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.quiet-button:hover {
    color: var(--ink);
    background: #fff;
    border-color: rgba(0, 0, 0, 0.16);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.primary-button {
    min-height: 44px;
    min-width: 152px;
    padding: 0 26px;
    color: #fff;
    background: var(--blue);
    border: 0;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.26);
    font-weight: 600;
}

.primary-button:hover {
    background: #0077ed;
    box-shadow: 0 10px 26px rgba(0, 113, 227, 0.32);
    transform: translateY(-1px);
}

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

.primary-button:disabled {
    color: #a1a1a6;
    background: rgba(0, 0, 0, 0.06);
    box-shadow: none;
}

/* ---------- work panel ---------- */

.work-panel {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.panel-head {
    min-height: 84px;
    padding: 20px 26px;
    background: transparent;
    border-bottom: 1px solid var(--line);
}

.panel-symbol {
    width: 40px;
    height: 40px;
    color: var(--blue);
    background: rgba(0, 113, 227, 0.1);
    border: 0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.panel-title {
    color: var(--ink);
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.panel-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.panel-body {
    padding: 26px;
    background: transparent;
}

.mode-control {
    border-left: 1px solid var(--line);
}

.mode-name {
    color: #3a3a3c;
    font-size: 11px;
    font-weight: 600;
}

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

/* ---------- switch ---------- */

.switch-track {
    background: rgba(120, 120, 128, 0.24);
    border: 0;
    border-radius: 980px;
}

.switch input:checked + .switch-track {
    background: #34c759;
    border: 0;
}

/* ---------- reference input ---------- */

.crew-source-label {
    color: var(--muted);
    font-size: 11px;
}

.crew-source-button {
    min-height: 60px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: none;
    transition: background 200ms var(--ease), border-color 200ms var(--ease);
}

.crew-source-button:hover {
    background: #fff;
    border-color: rgba(0, 113, 227, 0.4);
}

.crew-source-icon {
    color: var(--blue);
    background: rgba(0, 113, 227, 0.1);
    border: 0;
    border-radius: 10px;
}

.crew-source-action {
    color: var(--blue);
}

/* ---------- dropzone ---------- */

.dropzone {
    min-height: 224px;
    padding: 34px;
    background: rgba(255, 255, 255, 0.72);
    border: 1.5px dashed rgba(0, 0, 0, 0.14);
    border-radius: 18px;
    box-shadow: none;
    transition: background 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.dropzone:hover,
.dropzone.dragging {
    background: rgba(0, 113, 227, 0.04);
    border-color: rgba(0, 113, 227, 0.55);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.06);
}

.upload-symbol {
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    color: var(--blue);
    background: rgba(0, 113, 227, 0.1);
    border: 0;
    border-radius: 16px;
    font-size: 24px;
    font-weight: 500;
}

.drop-title {
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}

.drop-action {
    color: var(--blue);
    text-decoration: none;
}

.drop-meta {
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
}

/* ---------- tables ---------- */

th,
td {
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    background: rgba(0, 0, 0, 0.02);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

 td {
    color: #3a3a3c;
}

tbody tr:hover td {
    background: rgba(0, 113, 227, 0.03);
}

.file-list,
.pdf-list,
.table-scroll,
.preview {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--line);
    border-radius: 16px;
}

.task-table-wrap {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.task-link {
    color: var(--blue);
    font-weight: 600;
}

.correction-section {
    background: rgba(0, 0, 0, 0.015);
    border-top-color: var(--line);
}

/* ---------- progress & result ---------- */

.progress-wrap {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.progress-track {
    height: 6px;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 980px;
}

.progress-bar {
    background: var(--blue);
    border-radius: 980px;
}

.result-panel {
    border: 1px solid rgba(29, 138, 82, 0.28);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.result-summary {
    background: rgba(29, 138, 82, 0.08);
}

/* ---------- inputs ---------- */

.correction-table input,
.login-input {
    color: var(--ink);
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.correction-table input:focus,
.login-input:focus {
    background: #fff;
    border-color: rgba(0, 113, 227, 0.6);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

/* ---------- login ---------- */

.login-overlay {
    padding: 24px;
    background: rgba(245, 245, 247, 0.55);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
}

.login-dialog {
    width: min(400px, 100%);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    box-shadow: var(--shadow-raised);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.login-head {
    position: relative;
    padding: 30px 30px 22px 88px;
    color: var(--ink);
    background: transparent;
    border-bottom: 1px solid var(--line);
}

.login-head::before {
    content: '海';
    top: 26px;
    left: 30px;
    width: 42px;
    height: 42px;
    color: #fff;
    background: #12304a;
    border-radius: 13px;
    box-shadow: 0 6px 16px rgba(18, 48, 74, 0.22);
    font-weight: 700;
}

.login-title {
    color: var(--ink);
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.login-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

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

.auth-mode {
    height: 40px;
    margin-bottom: 20px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.04);
    border: 0;
    border-radius: 12px;
}

.auth-mode-button {
    color: #6e6e73;
    background: transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
}

.auth-mode-button.active {
    color: var(--ink);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.login-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.login-input {
    height: 46px;
    padding: 0 14px;
}

.login-submit {
    min-height: 46px;
    margin-top: 8px;
}

.login-error {
    border: 1px solid rgba(192, 57, 43, 0.28);
    border-radius: 12px;
}

/* ---------- toast ---------- */

.toast {
    color: #fff;
    background: rgba(28, 28, 30, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
}

/* ---------- scrollbar ---------- */

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border: 3px solid transparent;
    border-radius: 980px;
    background-clip: content-box;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
    .topbar {
        padding: 11px 20px;
    }

    .main-content {
        padding: 24px 18px 44px;
    }

    body::before {
        background-size: 200px auto;
        opacity: 0.08;
    }

    .login-overlay {
        background: rgba(245, 245, 247, 0.55);
    }
}

@media (max-width: 600px) {
    .work-panel,
    .login-dialog {
        border-radius: 20px;
    }

    .panel-head {
        padding: 18px;
    }

    .panel-body {
        padding: 18px;
    }

    .dropzone {
        min-height: 176px;
        padding: 24px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
