* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 20px;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.container {
    width: 100%;
    padding: 10px;
    margin: 0 auto;
    max-width: 1920px;
}

.title {
    text-align: center;
    padding: 14px 10px;
    background: #2c3e50;
    color: #fff;
    border-radius: 8px;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
}

.modal.help-modal {
    display: none;
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5) !important;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    transform: none !important;
    padding: 0 !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.help-content {
    background: white;
    border-radius: 12px;
    width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.help-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-icon {
    font-size: 24px;
}

.help-header h3 {
    font-size: 20px;
    margin: 0;
}

.help-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    background: #fff;
}

.help-doc {
    color: #333;
    line-height: 1.8;
    font-size: 14px;
}

.help-doc h2 {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin: 20px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #667eea;
}

.help-doc h2:first-child {
    margin-top: 0;
}

.help-doc h3 {
    font-size: 15px;
    font-weight: bold;
    color: #34495e;
    margin: 14px 0 6px 0;
}

.help-doc p {
    margin: 6px 0;
    color: #555;
}

.help-doc b {
    color: #2c3e50;
    font-weight: bold;
}

.help-doc ol, .help-doc ul {
    margin: 6px 0 6px 22px;
    color: #555;
}

.help-doc li {
    margin: 3px 0;
    line-height: 1.7;
}

.help-info-box {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 10px 0;
}

.help-info-box p {
    margin: 4px 0;
    color: #444;
}

.help-faq {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 8px 0;
}

.help-faq p {
    margin: 0 0 4px 0;
}

.help-faq ul {
    margin: 4px 0 4px 20px;
}

.help-thanks {
    text-align: center;
    color: #27ae60;
    font-weight: bold;
    font-size: 15px;
    margin-top: 16px;
}

.help-footer {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid #e9ecef;
    background: white;
}

.help-footer .btn {
    height: 40px;
    padding: 0 50px;
    font-size: 15px;
}

.page {
    background: white;
    border-radius: 8px;
    padding: 15px 10px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.tip {
    background: #e8f4fd;
    border-left: 4px solid #3498db;
    padding: 10px 8px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.6;
}

.quickin-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.quickin-toolbar .toolbar-row {
    display: flex;
    gap: 3px;
    align-items: center;
    flex-wrap: nowrap;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.quickin-toolbar .quickin-scan-input {
    flex: 1 1 auto;
    min-width: 80px;
    max-width: none;
    padding: 6px 10px;
    border: 1px solid #3498db;
    border-radius: 5px;
    font-size: 13px;
    height: 34px;
    outline: none;
    box-sizing: border-box;
}

.quickin-toolbar .quickin-scan-input:focus {
    border-color: #1abc9c;
}

.quickin-toolbar .toolbar-row .btn {
    height: 34px;
    padding: 5px 10px;
    font-size: 12px;
    white-space: nowrap;
    min-width: auto;
    flex-shrink: 0;
}

.stat {
    padding: 4px 8px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    font-size: 12px;
    height: 34px;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.stat-orange { background: #e67e22; }
.stat-green { background: #27ae60; }
.stat-blue { background: #3498db; }

.btn {
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    height: 38px;
    min-width: 90px;
    touch-action: manipulation;
    white-space: nowrap;
}

.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }

.btn-import { background: #2ecc71; }
.btn-import:hover { background: #27ae60; }

.file { display: none; }

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(46, 204, 113, 0.95);
    color: white;
    padding: 30px 25px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    z-index: 9999;
    display: none;
    font-size: 28px;
    font-weight: bold;
    width: 80vw;
    height: 80vw;
    max-width: 380px;
    max-height: 380px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    white-space: pre-line;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px 25px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    z-index: 9998;
    display: none;
    width: 320px;
    max-width: 90vw;
    overflow: auto;
    text-align: center;
}

.modal h3 {
    text-align: center;
    margin: 10px 0 20px 0;
    font-size: 22px;
    line-height: 1.6;
    color: #333;
    font-weight: bold;
}

.modal .confirm-seq {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.modal .confirm-name {
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: center;
}

.modal .confirm-question {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 25px;
    color: #555;
    text-align: center;
}

.modal-btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn-group .btn {
    font-size: 18px;
    padding: 12px 30px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
}

.modal .btn-undo { background: #f39c12; }
.modal .btn-import { background: #2ecc71; }

.grid-container {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 8px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.grid-item {
    aspect-ratio: 1;
    background: #e0e0e0;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    padding: 4px;
}

.grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.grid-item.success {
    background: #27ae60;
    color: white;
    border-color: #1e8449;
}

.grid-item .seq-num {
    font-size: 16px;
    font-weight: bold;
}

.grid-item .grid-name {
    font-size: 10px;
    font-weight: normal;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
    text-align: center;
}

.tooltip {
    position: fixed;
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 250px;
}

.tooltip.show {
    opacity: 1;
    visibility: visible;
}

.tooltip-title {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 15px;
    color: #3498db;
    white-space: nowrap;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 20px;
}

.tooltip-label { color: #bdc3c7; white-space: nowrap; }
.tooltip-value { color: #fff; font-weight: 500; }

.mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9997;
    display: none;
}

@media (max-width: 540px) {
    body {
        padding-bottom: env(safe-area-inset-bottom, 30px);
        font-size: 13px;
    }

    .container {
        padding: 5px;
    }

    .title {
        font-size: 14px;
        padding: 10px 8px;
        margin-bottom: 6px;
    }

    .page {
        padding: 8px 5px;
        margin-bottom: 6px;
    }

    .toast {
        width: 90vw !important;
        height: 90vw !important;
        max-width: 420px !important;
        max-height: 420px !important;
        font-size: 24px !important;
        font-weight: bold !important;
        padding: 20px 15px !important;
        line-height: 1.5 !important;
        white-space: pre-line !important;
    }

    .modal {
        width: 90vw !important;
        height: 90vw !important;
        max-width: 420px !important;
        max-height: 420px !important;
        bottom: auto !important;
        padding: 20px !important;
    }

    .quickin-toolbar {
        flex-direction: column;
        gap: 6px;
        margin-bottom: 10px;
    }

    .quickin-toolbar .quickin-scan-input {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        opacity: 0 !important;
        width: 1px !important;
        height: 1px !important;
        z-index: 9999 !important;
    }

    .tooltip {
        display: none !important;
    }

    .quickin-stats {
        gap: 4px;
    }

    .quickin-stats .stat {
        font-size: 11px;
        padding: 8px 3px;
        height: 34px;
    }

    .mobile-bottom-stats .stat {
        font-size: 11px;
        padding: 8px 3px;
        height: 34px;
    }

    .grid-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 3px;
        padding: 6px 3px;
    }

    .grid-item {
        font-size: 10px;
        padding: 3px 2px;
        min-height: 38px;
        pointer-events: none;
    }

    .grid-item .seq-num {
        font-size: 12px;
    }

    .grid-item .grid-name {
        font-size: 8px;
    }

    .tip {
        font-size: 12px;
        padding: 8px;
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 16px;
        padding: 12px 10px;
    }

    .toast {
        width: 90vw !important;
        height: 90vw !important;
        max-width: 420px !important;
        max-height: 420px !important;
        font-size: 26px !important;
        padding: 25px !important;
        font-weight: bold !important;
        line-height: 1.6 !important;
    }

    .modal {
        width: 90vw !important;
        height: 90vw !important;
        max-width: 420px !important;
        max-height: 420px !important;
        bottom: auto !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        position: fixed !important;
        z-index: 1001 !important;
    }

    .quickin-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .quickin-toolbar .quickin-scan-input {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        opacity: 0 !important;
        width: 1px !important;
        height: 1px !important;
        z-index: 9999 !important;
    }

    .quickin-stats {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .quickin-stats .stat {
        font-size: 13px;
        padding: 10px 4px;
        min-width: auto;
        height: 38px;
    }

    #quickinShipDate, #quickinVolume, #quickinReceiveDate {
        display: none !important;
    }

    .quickin-stats {
        gap: 4px;
        margin-bottom: 6px;
    }

    .mobile-bottom-stats {
        display: flex !important;
        gap: 4px;
        margin-top: 6px;
        width: 100%;
    }

    .mobile-bottom-stats .stat {
        flex: 1;
        font-size: 13px;
        padding: 10px 4px;
        min-width: auto;
        height: 38px;
    }

    .btn-hide-mobile {
        display: none !important;
    }

    .tooltip {
        display: none !important;
    }

    .grid-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 8px 4px;
    }

    .grid-item {
        font-size: 11px;
        padding: 4px 2px;
        min-height: 45px;
        pointer-events: none;
    }

    .grid-item .seq-num {
        font-size: 13px;
    }

    .grid-item .grid-name {
        font-size: 9px;
    }

    .tip {
        font-size: 13px;
        padding: 10px;
    }
}

/* ===== 扫码记录弹窗 ===== */
.btn-scanlog { background: #9b59b6; }
.btn-scanlog:hover { background: #8e44ad; }

.modal.scanlog-modal {
    width: 90vw !important;
    height: 85vh !important;
    max-width: 1100px !important;
    max-height: 85vh !important;
    padding: 0 !important;
    overflow: hidden !important;
    flex-direction: column;
    display: none;
}

.scanlog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #2c3e50;
    color: #fff;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}

.scanlog-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}

.scanlog-sub {
    font-size: 12px;
    font-weight: normal;
    color: #bdc3c7;
    margin-left: 10px;
}

.scanlog-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    line-height: 1;
    flex-shrink: 0;
}

.scanlog-close:hover { background: rgba(255,255,255,0.15); }

.scanlog-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.scanlog-toolbar input {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #3498db;
    border-radius: 6px;
    font-size: 14px;
    height: 38px;
    outline: none;
}

.scanlog-toolbar input:focus { border-color: #1abc9c; }

.scanlog-count {
    font-size: 13px;
    color: #7f8c8d;
    white-space: nowrap;
}

.scanlog-list-wrap {
    flex: 1;
    overflow: auto;
}

.scanlog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.scanlog-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.scanlog-table th {
    background: #34495e;
    color: #fff;
    padding: 10px 8px;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
}

.scanlog-table td {
    padding: 8px;
    border-bottom: 1px solid #ecf0f1;
    white-space: nowrap;
}

.scanlog-table tbody tr:hover { background: #f4f9fd; }

.scanlog-table .col-seq { font-weight: bold; color: #2c3e50; width: 60px; }
.scanlog-table .col-name { color: #27ae60; }
.scanlog-table .col-code { color: #7f8c8d; font-family: Consolas, monospace; }
.scanlog-table .col-time { color: #34495e; }
.scanlog-table .col-last { color: #e67e22; font-weight: bold; }
.scanlog-table .col-count { text-align: center; width: 60px; }

.scanlog-loading, .scanlog-empty {
    text-align: center !important;
    padding: 40px 8px !important;
    color: #95a5a6 !important;
}

@media (max-width: 768px) {
    .modal.scanlog-modal {
        width: 96vw !important;
        height: 92vh !important;
        max-width: 96vw !important;
        max-height: 92vh !important;
    }
    .scanlog-table { font-size: 12px; }
    .scanlog-table th, .scanlog-table td { padding: 6px 4px; }
    .scanlog-header h3 { font-size: 14px; }
    .scanlog-sub { display: none; }
}

/* ===== 交接单弹窗 ===== */
.modal.handover-modal {
    width: 90vw !important;
    max-width: 800px !important;
    max-height: 90vh !important;
    padding: 0 !important;
    overflow: hidden !important;
    flex-direction: column;
    display: none;
}

.handover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #27ae60;
    color: #fff;
    flex-shrink: 0;
}

.handover-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}

.handover-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
    background: #f8f9fa;
}

.handover-preview {
    background: #fff;
    padding: 25px 30px;
    border: 2px solid #000;
    border-radius: 4px;
}

.handover-title {
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.handover-summary {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    font-family: 'SimHei', '黑体', 'Microsoft YaHei', sans-serif;
    margin-bottom: 15px;
    color: #000;
    background: #f0f0f0;
    padding: 10px 15px;
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
}

.handover-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
}

.handover-table td {
    border: 2px solid #000;
    padding: 12px 15px;
    vertical-align: middle;
}

.handover-table .ho-label {
    background: #f0f0f0;
    width: 120px;
    font-weight: 900;
    text-align: center;
    font-size: 18px;
}

.handover-table .ho-value {
    width: auto;
    min-width: 300px;
}

.handover-table .ho-value input,
.handover-table .ho-value textarea {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    padding: 0;
    resize: none;
    font-weight: 700;
}

.handover-table .ho-value input:focus,
.handover-table .ho-value textarea:focus {
    background: #fffbe6;
}

.handover-table .ho-remark-row .ho-value {
    min-height: 80px;
}

.handover-sign-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    font-weight: 700;
}

.handover-sign-table td {
    border: none;
    padding: 10px 12px;
}

.handover-sign-table .ho-sign-label {
    width: 140px;
    text-align: right;
    font-weight: 700;
}

.handover-sign-table .ho-sign-line {
    border-bottom: 2px solid #000;
    height: 35px;
    min-width: 200px;
}

.handover-sign-table .ho-warehouse-phone-label {
    text-align: right;
    padding-left: 30px;
}

.handover-sign-table .ho-warehouse-phone-value {
    min-width: 180px;
}

.handover-sign-table .ho-warehouse-phone-value input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #999;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    background: transparent;
    padding: 2px 0;
}

.handover-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* ============ 通用：mask + panel 双层弹窗（accessGateModal / userInfoModal） ============ */
/* 外层：全屏半透明遮罩 + flex 居中 */
.modal.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    padding: 20px;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    text-align: left;
}
/* 内层：白色圆角面板 */
.modal-mask .modal-panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: popIn 0.18s ease-out;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.96) translateY(6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

@media print {
    .handover-modal, .handover-header, .handover-footer { display: none !important; }
    .handover-body, .handover-preview { all: unset; }
}

/* ============ 登录页样式 ============ */
/* ============ 登录页 login-wrap ============ */
/* 默认隐藏！显式由 showLoginPage/hideLoginPage 通过 class="show" 控制。
   这样即使 HTML/JS 缓存了旧版本（没写 style="display:none"），页面打开也不会被登录页直接盖满。 */
.login-wrap {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;   /* ← 核心修复：默认不显示 */
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}
.login-wrap.show {
    display: flex;  /* 调 showLoginPage 时加 .show，才显示 */
    animation: popIn 0.18s ease-out;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 36px 32px 28px 32px;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 36px;
    line-height: 72px;
    margin: 0 auto 14px auto;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-title {
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
    letter-spacing: 1px;
}

.login-subtitle {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-row label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
    padding-left: 2px;
}

.login-row input {
    height: 44px;
    border: 1.5px solid #e0e6ed;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    font-family: inherit;
    background: #f8fafc;
    outline: none;
    transition: all 0.2s;
}

.login-row input:focus {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
    height: 46px !important;
    margin-top: 8px;
    font-size: 16px !important;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 10px !important;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
    transition: transform 0.1s;
}

.btn-login:hover { transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
}

/* ============ 顶部用户菜单 ============ */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-bottom: 10px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.top-bar-title {
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar-title-icon {
    font-size: 22px;
}

.top-bar .user-menu-wrap {
    position: relative;
    display: inline-block;
}

.top-bar .user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
    color: #fff;
}

.top-bar .user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.28);
}

.top-bar .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    color: #667eea;
    font-weight: bold;
    text-align: center;
    line-height: 30px;
    font-size: 14px;
}

.top-bar .user-plan-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #ffc107;
    color: #7a5b00;
    font-weight: bold;
}

.top-bar .user-plan-badge.free {
    background: #e9ecef;
    color: #555;
}

.top-bar .user-plan-badge.monthly {
    background: #ffd54f;
    color: #7a5b00;
}

.top-bar .user-plan-badge.yearly {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: #fff;
}

.top-bar .user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #fff;
    color: #333;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    display: none;
    z-index: 9998;
}

.top-bar .user-menu-dropdown.show {
    display: block;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.top-bar .user-menu-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #f4edff 100%);
    border-bottom: 1px solid #eef0f4;
}

.top-bar .user-menu-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar .user-menu-name {
    font-weight: bold;
    font-size: 15px;
    color: #2c3e50;
}

.top-bar .user-menu-sub {
    font-size: 12px;
    color: #777;
    margin-top: 3px;
}

.quota-bar-wrap {
    padding: 12px 16px;
    border-bottom: 1px solid #eef0f4;
}

.quota-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 4px;
}

.quota-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s;
}

.quota-fill.warn { background: linear-gradient(90deg, #ffc107, #ff9800); }
.quota-fill.block { background: linear-gradient(90deg, #ef5350, #e53935); }

.quota-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.top-bar .user-menu-item {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s;
    color: #333;
    text-decoration: none;
}

.top-bar .user-menu-item:hover {
    background: #f5f7fa;
}

.top-bar .user-menu-divider {
    height: 1px;
    background: #eef0f4;
    margin: 4px 0;
}

/* ============ 授权卡点弹窗 ============ */
.modal.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.auth-modal.show {
    display: flex;
}

.auth-content {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.2s ease;
}

.auth-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 24px auto 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: #fff3cd;
    color: #ff9800;
}

.auth-icon.warn { background: #fff3cd; color: #ff9800; }
.auth-icon.error { background: #ffebee; color: #ef5350; }

.auth-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    padding: 0 24px;
}

.auth-desc {
    text-align: center;
    font-size: 13px;
    color: #777;
    padding: 8px 24px 16px 24px;
    line-height: 1.6;
}

.auth-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px 24px 18px 24px;
}

.auth-stat {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}

.auth-stat-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.auth-stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.auth-stat-value.warn { color: #ef5350; }
.auth-stat-value.ok { color: #27ae60; }

.plan-price-info {
    background: linear-gradient(135deg, #fff8e1 0%, #fff0e6 100%);
    margin: 0 24px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px dashed #ffca28;
}

.plan-price-info .ppi-title {
    font-weight: bold;
    color: #7a5b00;
    font-size: 14px;
    margin-bottom: 6px;
    text-align: center;
}

.plan-price-info .ppi-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #555;
    padding: 2px 0;
}

.plan-price-info .ppi-price {
    color: #e53935;
    font-weight: bold;
}

.plan-price-info .ppi-hint {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
    text-align: center;
}

.plan-features {
    padding: 12px 24px 4px 24px;
}

.plan-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    padding: 4px 0;
}

.plan-feature-item.ok { color: #27ae60; }
.plan-feature-item.no { color: #bbb; text-decoration: line-through; }

.auth-actions {
    padding: 16px 24px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-btn {
    height: 44px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: transform 0.1s;
}

.auth-btn:active { transform: scale(0.98); }

.btn-auth-upgrade {
    background: linear-gradient(135deg, #ff9800 0%, #f44336 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.3);
}

.btn-auth-upgrade:hover {
    filter: brightness(1.05);
}

.btn-auth-downgrade {
    background: #e9ecef;
    color: #555;
    font-weight: normal;
}

.btn-auth-downgrade:hover {
    background: #dde2e8;
}

.btn-auth-close {
    background: transparent;
    color: #999;
    font-size: 13px;
    height: 32px;
}

/* ============ 额度提醒气泡 ============ */
.toast.quota-toast-warn {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe0b2 100%) !important;
    color: #7a5b00 !important;
    border-left: 4px solid #ff9800;
    font-weight: 500;
}

.toast.quota-toast-block {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%) !important;
    color: #c62828 !important;
    border-left: 4px solid #e53935;
    font-weight: 600;
}

/* 用户信息弹窗 */
.user-info-modal-body {
    padding: 20px 24px;
}

.uinfo-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
}

.uinfo-row:last-child {
    border-bottom: none;
}

.uinfo-label {
    width: 100px;
    color: #888;
    flex-shrink: 0;
}

.uinfo-value {
    color: #2c3e50;
    font-weight: 500;
    flex: 1;
    word-break: break-all;
}

.uinfo-value.ok { color: #27ae60; font-weight: bold; }
.uinfo-value.warn { color: #ff9800; font-weight: bold; }
.uinfo-value.error { color: #e53935; font-weight: bold; }
