* {
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    color: #333;
}

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

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #001529;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.brand {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    height: 32px;
    width: auto;
    border-radius: 4px;
    object-fit: cover;
}

.brand-title {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 2px;
}

.brand-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    margin-top: 2px;
}

.menu {
    flex: 1;
    padding: 16px 0;
}

.menu-item {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.75);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.menu-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.menu-item.active {
    color: #fff;
    background: #1890ff;
}

.menu-item .icon {
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-btn {
    background: transparent;
    color: rgba(255,255,255,0.65);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
}

.logout-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

/* 主内容区 */
.content {
    flex: 1;
    margin-left: 220px;
    padding: 24px;
    min-height: 100vh;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    background: #fff;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: #1f1f1f;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filters label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    color: #666;
}

.filters select, .filters input {
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    min-width: 100px;
    font-size: 14px;
    background: #fff;
}

button, .btn-link {
    padding: 7px 16px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn-link:hover {
    background: #40a9ff;
}

.panel {
    background: #fff;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.panel h2 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #1f1f1f;
}

.panel .desc {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #888;
}

.legend {
    margin-bottom: 16px;
    font-size: 13px;
}

.legend span {
    margin-right: 16px;
}

.legend-up {
    color: #f5222d;
    font-weight: bold;
}

.legend-down {
    color: #1890ff;
    font-weight: bold;
}

.legend-na {
    color: #999;
}

.upload-box {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

#upload-msg {
    margin-top: 15px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    background: #001529;
    color: #fff;
    padding: 14px 24px;
    border-radius: 8px 8px 0 0;
    font-size: 16px;
    font-weight: bold;
}

.report-section {
    background: #fff;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.section-title {
    background: #f0f2f5;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 15px;
    text-align: left;
    color: #1f1f1f;
}

.sub-title {
    background: #e6f7ff;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 14px;
    color: #1890ff;
    margin-bottom: 0;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.report-table th, .report-table td {
    border: 1px solid #e8e8e8;
    padding: 5px 8px;
    text-align: left;
}

.report-table th {
    background: #fafafa;
    font-weight: normal;
    color: #666;
    width: 20%;
}

.report-table td {
    background: #fff;
    width: 30%;
}

.report-table td.number {
    text-align: right;
    font-family: Consolas, monospace;
}

.report-table tr:hover td {
    background: #f0f7ff;
}

.report-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: flex-start;
}

.report-left, .report-right {
    flex: 1;
    min-width: 0;
    max-width: 560px;
}

.report-single {
    max-width: 1400px;
}

.report-panel-title {
    background: #001529;
    color: #fff;
    padding: 12px 16px;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-left .report-section,
.report-right .report-section,
.report-single .report-section {
    margin-bottom: 12px;
}

.report-section .report-table th {
    width: 11%;
    white-space: normal;
    word-break: break-all;
}

.report-section .report-table td.number {
    width: 8%;
}

.report-section .report-table td.comparison-cell {
    width: 24%;
}

.field-value {
    font-weight: 500;
}

.field-changes {
    font-size: 12px;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-start;
}

.change-label {
    padding: 1px 5px;
    border-radius: 3px;
    background: #f5f5f5;
    color: #666;
    font-size: 12px;
    width: 8.5em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.change-label.change-up {
    color: #f5222d;
    background: #fff1f0;
}

.change-label.change-down {
    color: #1890ff;
    background: #e6f7ff;
}

.mom {
    margin-left: 8px;
    font-size: 12px;
    font-weight: bold;
}

.mom-up {
    color: #f5222d;
}

.mom-down {
    color: #1890ff;
}

.empty-tip {
    padding: 40px;
    text-align: center;
    color: #999;
}

.loading-tip {
    padding: 20px;
    text-align: center;
    color: #1890ff;
}

.report-msg {
    margin: 10px 0;
}

.report-toolbar {
    display: flex;
    gap: 10px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.report-toolbar button {
    padding: 6px 14px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.report-toolbar button:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.warning-tip {
    color: #fa8c16;
    padding: 8px 12px;
    background: #fff7e6;
    border-radius: 4px;
    display: inline-block;
}

.error {
    color: #f5222d;
    padding: 12px;
    background: #fff1f0;
    border-radius: 4px;
}

.success {
    color: #52c41a;
    padding: 12px;
    background: #f6ffed;
    border-radius: 4px;
}

.carried-row {
    color: #888;
    background: #fafafa;
}

.carried-tip {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    color: #fa8c16;
    background: #fff7e6;
    border-radius: 4px;
    cursor: help;
}

.auto-row {
    background: #f6ffed;
}

.auto-tip {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    color: #52c41a;
    background: #fff;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
}

.missing-field {
    color: #f5222d !important;
    background: #fff1f0;
}

.upload-type-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0;
}

.upload-type-card {
    width: 120px;
    padding: 20px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.upload-type-card:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.upload-type-card.active {
    border-color: #1890ff;
    background: #e6f7ff;
}

.upload-type-card.disabled {
    cursor: default;
    background: #f6ffed;
    border-color: #b7eb8f;
    position: relative;
}

.upload-type-card.disabled .upload-type-icon,
.upload-type-card.disabled .upload-type-name,
.upload-type-card.disabled .upload-type-label {
    opacity: 0.7;
}

.upload-type-auto {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 1px 6px;
    font-size: 11px;
    color: #52c41a;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
}

.upload-type-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.upload-type-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-type-label {
    font-size: 12px;
    color: #888;
}

.upload-type-file {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.page-analysis .panel {
    max-width: 760px;
}

.compare-table, .trend-table, .rank-table {
    width: auto;
    min-width: 0;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: auto;
}

.compare-table th, .compare-table td,
.trend-table th, .trend-table td,
.rank-table th, .rank-table td {
    border: 1px solid #e8e8e8;
    padding: 2px 4px;
    text-align: left;
    white-space: nowrap;
}

.compare-table th,
.trend-table th,
.rank-table th {
    background: #fafafa;
}

.compare-table td:first-child,
.rank-table td:nth-child(2),
.trend-table td:nth-child(2) {
    max-width: 120px;
    white-space: normal;
    word-break: break-all;
}

.compare-table td.number,
.trend-table td.number,
.rank-table td.number {
    text-align: right;
    font-family: Consolas, monospace;
}

.analysis-chart {
    margin-top: 16px;
    max-height: 320px;
}

.chart-bar {
    height: 6px;
    background: #1890ff;
    border-radius: 3px;
    margin-top: 3px;
    max-width: 100px;
}

.data-file-table, .column-config-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-file-table th, .data-file-table td,
.column-config-table th, .column-config-table td {
    border: 1px solid #e8e8e8;
    padding: 10px 12px;
    text-align: left;
}

.data-file-table th,
.column-config-table th {
    background: #fafafa;
}

.data-file-table td button,
.column-config-table td button {
    margin-right: 6px;
    padding: 4px 10px;
    font-size: 12px;
}

.column-config-table td button.active-rank {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

.column-config-table input[type="text"] {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}

.column-config-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 手机端适配 */
.mobile-header {
    display: none;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: #001529;
        color: #fff;
        padding: 0 16px;
        z-index: 150;
        gap: 12px;
    }

    .mobile-title {
        font-size: 16px;
        font-weight: bold;
    }

    .menu-toggle {
        background: transparent;
        border: none;
        color: #fff;
        font-size: 20px;
        padding: 8px;
        cursor: pointer;
        line-height: 1;
    }

    .sidebar {
        position: fixed;
        left: -220px;
        top: 0;
        width: 220px;
        height: 100vh;
        transition: left 0.25s ease;
        z-index: 200;
    }

    .sidebar.open {
        left: 0;
    }

    .content {
        margin-left: 0;
        padding: 72px 12px 16px;
    }

    .page-header {
        padding: 16px;
    }

    .page-header h1 {
        font-size: 16px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        font-size: 12px;
    }

    .filters label {
        width: 100%;
    }

    .filters select,
    .filters button,
    .filters input {
        width: 100%;
        box-sizing: border-box;
    }

    .legend {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 10px;
    }

    .report-toolbar {
        justify-content: space-between;
    }

    .report-toolbar button {
        flex: 1;
        padding: 8px 4px;
        font-size: 10px;
    }

    .report-single {
        max-width: 100%;
        overflow-x: auto;
    }

    .report-section .report-table,
    .report-table {
        table-layout: fixed;
        width: 100%;
        font-size: 9px;
    }

    .report-section .report-table th,
    .report-section .report-table td,
    .report-table th,
    .report-table td {
        padding: 3px 4px;
        border: 1px solid #e8e8e8;
    }

    .report-section .report-table th,
    .report-table th {
        width: 18%;
        white-space: normal;
        word-break: break-all;
        background: #fafafa;
        font-weight: normal;
    }

    .report-section .report-table td.number,
    .report-table td.number {
        width: 14%;
        text-align: right;
        font-size: 9px;
    }

    .report-section .report-table td.comparison-cell,
    .report-table td.comparison-cell {
        width: 18%;
    }

    .field-changes {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .change-label {
        display: block;
        width: 100%;
        text-align: left;
        font-size: 7px;
        padding: 1px 0;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .report-panel-title {
        font-size: 12px;
        padding: 10px 12px;
    }

    .section-title {
        padding: 10px 12px;
        font-size: 12px;
    }

    .page-analysis .panel {
        max-width: 100%;
        padding: 16px;
    }

    .compare-table, .trend-table, .rank-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        font-size: 9px;
    }

    .analysis-chart {
        max-height: 240px;
    }

    .panel {
        padding: 16px;
    }

    h2 {
        font-size: 14px;
    }
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    background-color: #f6f6f6;
    position: relative;
}

.login-bg-img {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 90%;
    height: auto;
    max-width: 1200px;
    object-fit: contain;
    pointer-events: none;
    z-index: 0;
}

.login-box {
    position: absolute;
    right: 3cm;
    top: 3cm;
    width: 640px;
    background: rgba(255, 255, 255, 0.96);
    padding: 48px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1;
}

@media (max-width: 768px) {
    .login-bg-img {
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
        width: 90%;
        max-width: 360px;
        margin: 2cm auto 0;
        display: block;
    }

    .login-page {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .login-box {
        position: relative;
        right: auto;
        top: auto;
        width: 90%;
        max-width: 400px;
        padding: 32px;
        margin: 0;
    }
}

.login-box h2 {
    margin: 0 0 32px 0;
    font-size: 26px;
    color: #1f1f1f;
    text-align: center;
}

.login-form-row {
    margin-bottom: 20px;
}

.login-form-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    color: #666;
}

.login-form-row input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 16px;
}

.login-form-row input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 17px;
    cursor: pointer;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .login-box h2 {
        font-size: 20px;
        margin-bottom: 24px;
    }

    .login-form-row {
        margin-bottom: 16px;
    }

    .login-form-row label {
        font-size: 14px;
    }

    .login-form-row input {
        padding: 11px 12px;
        font-size: 15px;
    }

    .login-btn {
        padding: 12px;
        font-size: 15px;
    }
}

.login-btn:hover {
    background: #40a9ff;
}

.login-error {
    margin-top: 12px;
    padding: 10px;
    background: #fff1f0;
    color: #f5222d;
    border-radius: 4px;
    font-size: 13px;
    display: none;
}

/* 缺失字段标红 */
.missing-field {
    color: #f5222d !important;
    background: #ffccc7 !important;
}

/* 已上传类型变红 */
.upload-type-card.uploaded .upload-type-icon,
.upload-type-card.uploaded .upload-type-name {
    color: #f5222d;
}

.upload-type-card.uploaded {
    border-color: #f5222d;
    background: #fff1f0;
}

.upload-type-desc {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    line-height: 1.4;
}

/* 对话框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1f1f1f;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #666;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 24px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #fff;
    color: #595959;
    border: 1px solid #d9d9d9;
}

.btn-secondary:hover {
    color: #40a9ff;
    border-color: #40a9ff;
}

.export-section {
    margin-bottom: 20px;
}

.export-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #1f1f1f;
}

.export-select-all {
    margin-bottom: 8px;
    font-size: 13px;
}

.export-checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 12px;
    background: #fafafa;
}

.export-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    width: calc(50% - 5px);
    cursor: pointer;
}

.export-checkbox-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 表单行 */
.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.form-row.inline {
    display: flex;
    gap: 24px;
    align-items: center;
}

.form-row.inline label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    cursor: pointer;
}

.user-dialog-content,
.type-dialog-content {
    max-width: 480px;
}

.hint {
    color: #999;
    font-size: 12px;
    font-weight: normal;
}

.admin-only {
    display: none;
}

/* 排名可点击样式 */
.rank-clickable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    color: #1890ff;
}

.rank-clickable:hover {
    color: #40a9ff;
}

/* 排名详情弹窗 */
.rank-dialog-content {
    width: 560px;
    max-width: 90vw;
}

.rank-dialog-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.rank-dialog-sort-label {
    font-size: 13px;
    color: #595959;
    margin-right: 4px;
}

.rank-dialog-sort-bar .btn-sort {
    padding: 4px 10px;
    font-size: 13px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #595959;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.rank-dialog-sort-bar .btn-sort:hover {
    color: #40a9ff;
    border-color: #40a9ff;
}

.rank-dialog-sort-bar .btn-sort.active {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

.rank-dialog-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* 月度报表缓存版本信息 */
.cache-version-info {
    display: inline-block;
    margin-left: 12px;
    padding: 4px 10px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
    font-size: 12px;
    color: #389e0d;
}

.cache-consistency-dialog-content {
    width: 640px;
    max-width: 90vw;
}

.cache-consistency-summary {
    margin-bottom: 12px;
    padding: 10px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
}

.cache-consistency-row {
    margin: 4px 0;
    font-size: 13px;
}

.cache-consistency-body {
    max-height: 50vh;
    overflow-y: auto;
}

.cache-consistency-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cache-consistency-table th,
.cache-consistency-table td {
    border: 1px solid #e8e8e8;
    padding: 8px 10px;
    text-align: left;
}

.cache-consistency-table th {
    background: #fafafa;
    font-weight: 600;
}

.cache-consistency-table tr.inconsistent {
    background: #fff1f0;
    color: #cf1322;
}

.cache-consistency-table tr.missing {
    background: #fffbe6;
    color: #d48806;
}

.cache-consistency-table tr.consistent {
    background: #f6ffed;
    color: #389e0d;
}

.rank-dialog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rank-dialog-table th,
.rank-dialog-table td {
    border: 1px solid #e8e8e8;
    padding: 10px 12px;
    text-align: left;
}

.rank-dialog-table th {
    background: #fafafa;
    font-weight: 600;
    color: #1f1f1f;
    position: sticky;
    top: 0;
    z-index: 1;
}

.rank-dialog-table td.number {
    text-align: right;
    font-family: Consolas, monospace;
}

.rank-dialog-table tbody tr:nth-child(odd) {
    background: #fafafa;
}

.rank-dialog-table tbody tr:hover {
    background: #e6f7ff;
}

.rank-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    min-width: 60px;
}

.rank-crown {
    font-size: 18px;
    line-height: 1;
}

.rank-current-store {
    background: #fff1f0 !important;
    color: #cf1322;
    font-weight: bold;
}

.rank-current-store .store-cell,
.rank-current-store .value-cell,
.rank-current-store .rank-cell {
    color: #cf1322;
    font-weight: bold;
}

.loading-tip {
    text-align: center;
    color: #999;
    padding: 30px 0;
}

/* 门店名映射确认弹窗 */
.store-mapping-dialog-content {
    width: 520px;
    max-width: 90vw;
}

.store-mapping-desc {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 14px;
}

.store-mapping-list {
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
}

.store-mapping-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.store-mapping-item:last-child {
    border-bottom: none;
}

.store-mapping-item:hover {
    background: #f6ffed;
}

.store-mapping-arrow {
    margin: 0 12px;
    color: #999;
    font-size: 16px;
}

.store-mapping-original {
    color: #595959;
    text-decoration: line-through;
    flex: 1;
    word-break: break-all;
}

.store-mapping-canonical {
    color: #1890ff;
    font-weight: 600;
    flex: 1;
    word-break: break-all;
}

/* 手机端排名弹窗适配 */
@media (max-width: 768px) {
    .rank-dialog-content {
        width: 94vw;
        max-height: 80vh;
    }

    .rank-dialog-body {
        max-height: calc(80vh - 120px);
        padding: 12px;
    }

    .rank-dialog-table {
        font-size: 15px;
    }

    .rank-dialog-table th,
    .rank-dialog-table td {
        padding: 12px 8px;
    }

    .rank-cell {
        min-width: 48px;
    }

    .rank-crown {
        font-size: 20px;
    }

    .store-cell {
        max-width: 160px;
        word-break: break-all;
    }
}

/* 月度报表状态与进度 */
.status-label {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
    background: #f5f5f5;
    color: #666;
}

.status-label.status-draft {
    background: #fff7e6;
    color: #fa8c16;
}

.status-label.status-completed {
    background: #f6ffed;
    color: #52c41a;
}

.status-label.status-modifying {
    background: #e6f7ff;
    color: #1890ff;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 16px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #52c41a;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: #666;
    min-width: 120px;
    text-align: right;
}

.preview-banner {
    padding: 10px 16px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    color: #fa8c16;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}

/* 管理员按钮默认由 .admin-only 隐藏 */
#btn-monthly-preview,
#btn-monthly-complete,
#btn-monthly-reopen {
    margin-left: 8px;
}

#btn-monthly-reopen {
    background: #fa8c16;
}

#btn-monthly-reopen:hover {
    background: #ff9c27;
}

/* 门店分组按钮 */
.store-group-btns {
    display: inline-flex;
    gap: 8px;
    margin-left: 8px;
    align-items: center;
}

.store-group-btns::before {
    content: '|';
    color: #d9d9d9;
    margin-right: 4px;
}

.btn-store-group {
    background: #fff;
    color: #1890ff;
    border: 1px solid #1890ff;
    padding: 6px 14px;
}

.btn-store-group:hover {
    background: #e6f7ff;
}

.btn-store-group.active {
    background: #1890ff;
    color: #fff;
}

/* 门店分组管理 */
.store-group-dialog-content {
    width: 560px;
    max-width: 90vw;
}

#store-group-edit-stores {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 10px;
    background: #fafafa;
}

#store-group-edit-stores label {
    display: block;
    padding: 6px 0;
    cursor: pointer;
}

#store-group-edit-stores input[type="checkbox"] {
    margin-right: 8px;
}
