* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

/* User Area */
.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1890ff;
}

.user-name-inline {
    font-size: 16px;
    font-weight: 600;
    color: #1890ff;
}

/* 全屏水印 */
.watermark-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9998;
    background-repeat: repeat; background-position: 0 0;
    opacity: .08; overflow: hidden;
}

.logout-btn {
    background: none;
    border: 1.5px solid #d9d9d9;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    border-color: #ff4d4f;
    color: #ff4d4f;
}

.privilege-pwd-btn {
    background: none;
    border: 1.5px solid #faad14;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 16px;
    color: #faad14;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}
.privilege-pwd-btn:hover {
    background: #faad14;
    color: #fff;
    border-color: #faad14;
}

/* Shop Selector */
.shop-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shop-selector select {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: 2px solid #1890ff;
    border-radius: 8px;
    height: 32px;
    padding: 0 28px 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1890ff;
    cursor: pointer;
    outline: none;
    text-align-last: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231890ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s;
}

.shop-selector select:hover {
    border-color: #096dd9;
}

.shop-selector select:focus {
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}

.add-shop-btn {
    background: #1890ff;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.add-shop-btn:hover { background: #096dd9; }

/* 顶栏按钮 tooltip */
.header-btn-wrap {
    position: relative;
    display: inline-flex;
}
.header-btn-wrap::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    z-index: 200;
}
.header-btn-wrap:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.qrcode-btn {
    background: #1890ff;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.qrcode-btn:hover {
    background: #096dd9;
}

.qrcode-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.calc-btn {
    background: #1890ff;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.calc-btn:hover { background: #096dd9; }
.calc-btn svg { width: 17px; height: 17px; fill: currentColor; }

/* 提成计算弹窗 */
.commission-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45); z-index: 2001;
    display: flex; align-items: center; justify-content: center;
}
.commission-box {
    background: #fff; border-radius: 12px; width: 620px; max-width: 92vw;
    max-height: 88vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.comm-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #f0f0f0;
}
.comm-header h3 { font-size: 17px; color: #333; }
.comm-close {
    background: none; border: none; font-size: 22px; color: #999; cursor: pointer;
    line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.comm-close:hover { color: #333; background: #f5f5f5; }

.comm-body { padding: 20px; }

/* 输入区域 */
.comm-input-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px;
}
.comm-field label {
    display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px;
}
.comm-field input,
.comm-field select {
    width: 100%; padding: 9px 11px; border: 1px solid #d9d9d9; border-radius: 8px;
    font-size: 14px; outline: none; transition: border-color 0.2s;
}
.comm-field input:focus,
.comm-field select:focus { border-color: #fa8c16; box-shadow: 0 0 0 2px rgba(250,140,22,.15); }

.comm-calc-row {
    text-align: center; margin-bottom: 18px;
}
.comm-calc-btn {
    background: linear-gradient(135deg,#fa8c16,#ff9c40);
    color: #fff; border: none; border-radius: 8px; padding: 10px 36px;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.comm-calc-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(250,140,22,.35); }
.comm-calc-btn:active { transform: translateY(0); }

/* 结果展示 */
.comm-result { display: none; }
.comm-result.visible { display: block; }
.comm-step {
    background: #fafbfc; border: 1px solid #eef0f3; border-radius: 10px;
    padding: 14px 16px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.7;
}
.comm-step-title {
    font-weight: 700; color: #333; margin-bottom: 6px; font-size: 14px;
    display: flex; align-items: center; gap: 6px;
}
.comm-step-title .step-num {
    background: #fa8c16; color: #fff; width: 20px; height: 20px;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; flex-shrink: 0;
}
.comm-step-body { color: #555; padding-left: 26px; }
.comm-step-body .hl { color: #1890ff; font-weight: 600; }
.comm-step-body .hl-green { color: #52c41a; font-weight: 600; }
.comm-step-body .hl-orange { color: #fa8c16; font-weight: 600; }
.comm-step-body .hl-red { color: #f5222d; font-weight: 600; }

.comm-summary-card {
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff; border-radius: 10px; padding: 18px 20px; margin-top: 14px;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.comm-summary-item { text-align: center; }
.comm-summary-label { font-size: 11.5px; opacity: .85; margin-bottom: 4px; }
.comm-summary-value { font-size: 19px; font-weight: 700; }

.comm-formula-note {
    margin-top: 14px; padding: 12px 14px; background: #fffbe6; border: 1px solid #ffe58f;
    border-radius: 8px; font-size: 12.5px; color: #ad6800; line-height: 1.8;
}
.comm-formula-note strong { color: #ad6800; }

.analysis-btn {
    background: #722ed1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex; align-items:center; justify-content:center;
    transition: background .2s;
}
.analysis-btn:hover { background: #531dab; }

.data-analysis-btn {
    background: #1890ff; color: #fff; border: none; border-radius: 8px;
    padding: 6px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.data-analysis-btn:hover { background: #096dd9; }

.back-home-btn {
    background: #52c41a; color: #fff; border: none; border-radius: 8px;
    padding: 6px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.back-home-btn:hover { background: #389e0d; }

/* Theme Toggle Button */
.theme-toggle-btn {
    background: #f0f0f0; color: #333; border: none; border-radius: 8px;
    padding: 6px 10px; font-size: 16px; cursor: pointer;
    transition: background 0.2s;
}
.theme-toggle-btn:hover { background: #e0e0e0; }

/* ===== Dark Mode ===== */
body.dark-mode { background: #1a1a2e; color: #e0e0e0; }
body.dark-mode .header { background: #16213e; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
body.dark-mode .user-name-inline { color: #40a9ff; }
body.dark-mode .logout-btn { border-color: #4a4a6a; color: #aaa; }
body.dark-mode .privilege-pwd-btn { border-color: #d48806; color: #d48806; }
body.dark-mode .privilege-pwd-btn:hover { background: #d48806; color: #fff; }
body.dark-mode .shop-selector select {
    background: #16213e; border-color: #40a9ff; color: #40a9ff;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2340a9ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    outline: none;
}
body.dark-mode .shop-selector select:focus {
    box-shadow: 0 0 0 2px rgba(64,169,255,0.2);
}
body.dark-mode .add-shop-btn,
body.dark-mode .qrcode-btn,
body.dark-mode .calc-btn { background: #40a9ff; }
body.dark-mode .theme-toggle-btn { background: #2a2a4a; color: #ffd700; }
body.dark-mode .theme-toggle-btn:hover { background: #3a3a5a; }
body.dark-mode .breadcrumb { color: #aaa; }
body.dark-mode .breadcrumb a { color: #40a9ff; }
body.dark-mode .month-selector,
body.dark-mode .chart-container,
body.dark-mode .mini-month,
body.dark-mode .month-detail,
body.dark-mode .as-summary-card,
body.dark-mode .as-card { background: #16213e; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
body.dark-mode .chart-container h3,
body.dark-mode .mini-month-title,
body.dark-mode .month-header h2,
body.dark-mode .sales-summary h3,
body.dark-mode .section-header h3,
body.dark-mode .as-header h2,
body.dark-mode .as-card h3,
body.dark-mode .modal-header h2 { color: #e0e0e0; }
body.dark-mode .mini-weekdays,
body.dark-mode .weekday-header,
body.dark-mode .as-subtitle,
body.dark-mode .as-sum-label,
body.dark-mode .summary-card label,
body.dark-mode .card-hint,
body.dark-mode .card-formula,
body.dark-mode .no-records { color: #888; }
body.dark-mode .month-wheel-item,
body.dark-mode .year-wheel-item { color: #666; }
body.dark-mode .month-wheel-item.active,
body.dark-mode .year-wheel-item.active { color: #40a9ff; }
body.dark-mode .month-wheel-item:hover,
body.dark-mode .year-wheel-item:hover { color: #40a9ff; }
body.dark-mode .month-wheel-highlight {
    background: linear-gradient(90deg, rgba(64,169,255,0.05), rgba(64,169,255,0.1), rgba(64,169,255,0.05));
    border-top-color: #40a9ff; border-bottom-color: #40a9ff;
}
body.dark-mode .month-dropdown { background: #16213e; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
body.dark-mode .month-dropdown-item:hover { background: #1a2744; }
body.dark-mode .month-dropdown-item.active { background: #40a9ff; color: #fff; }
body.dark-mode .mini-day { color: #bbb; }
body.dark-mode .mini-day.today { background: #40a9ff; color: #fff; }
body.dark-mode .mini-day.has-data { color: #ff7875; background: rgba(255,120,117,0.12); }
body.dark-mode .month-nav-btn { background: #16213e; border-color: #4a4a6a; }
body.dark-mode .month-nav-btn:hover { background: #40a9ff; border-color: #40a9ff; }
body.dark-mode .month-nav-btn svg { fill: #888; }
body.dark-mode .weekday-header { border-bottom-color: #2a2a4a; }
body.dark-mode .month-day { border-color: #2a2a4a; }
body.dark-mode .month-day:hover { border-color: #40a9ff; background: #1a2744; }
body.dark-mode .month-day .day-num { color: #ccc; }
body.dark-mode .month-day.has-data { background: rgba(255,120,117,0.08); border-color: rgba(255,120,117,0.2); }
body.dark-mode .month-day.has-data .day-num { color: #ff7875; }
body.dark-mode .month-day.today .day-num { background: #40a9ff; color: #fff; }
body.dark-mode .month-day.weekend .day-num { color: #ff7875; }
body.dark-mode .month-day.today.weekend .day-num { color: #fff; }
body.dark-mode .month-day .day-sales { color: #40a9ff; }
body.dark-mode .month-day .day-profit { color: #73d13d; }
body.dark-mode .month-day .day-rate { color: #ffa940; }
body.dark-mode .modal-content { background: #16213e; box-shadow: 0 8px 40px rgba(0,0,0,0.4); }
body.dark-mode .modal-header { border-bottom-color: #2a2a4a; }
body.dark-mode .close-btn { color: #888; }
body.dark-mode .close-btn:hover { background: #2a2a4a; color: #e0e0e0; }
body.dark-mode .sales-summary { border-bottom-color: #2a2a4a; }
body.dark-mode .summary-card { background: #1a1a2e; border-color: #2a2a4a; }
body.dark-mode .summary-card input { color: #e0e0e0; }
body.dark-mode .grid-table { border-top-color: #2a2a4a; }
body.dark-mode .grid-header { background: #1a1a2e; color: #aaa; }
body.dark-mode .grid-row:not(.grid-header) .grid-col { color: #ccc; border-bottom-color: #2a2a4a; }
body.dark-mode .grid-row:hover > .grid-col { background: #1a2744; }
body.dark-mode .col-subtotal { color: #ffa940; }
body.dark-mode .records-table .btn-edit { color: #40a9ff; }
body.dark-mode .records-table .btn-edit:hover { background: #1a2744; }
body.dark-mode .records-table .btn-delete { color: #ff7875; }
body.dark-mode .records-table .btn-delete:hover { background: rgba(255,120,117,0.1); }
body.dark-mode .form-group label { color: #ccc; }
body.dark-mode .form-group input,
body.dark-mode .form-group textarea { background: #1a1a2e; border-color: #4a4a6a; color: #e0e0e0; }
body.dark-mode .form-group input:focus { border-color: #40a9ff; box-shadow: 0 0 0 2px rgba(64,169,255,0.2); }
body.dark-mode .btn-cancel { background: #16213e; color: #aaa; border-color: #4a4a6a; }
body.dark-mode .btn-cancel:hover { border-color: #40a9ff; color: #40a9ff; }
body.dark-mode .btn-save { background: #40a9ff; border-color: #40a9ff; }
body.dark-mode .btn-danger { background: #16213e; color: #ff7875; border-color: #ff7875; }
body.dark-mode .btn-danger:hover { background: #ff4d4f; color: #fff; }
body.dark-mode .dialog-box { background: #16213e; }
body.dark-mode .dialog-msg { color: #e0e0e0; }
body.dark-mode .dialog-input { background: #1a1a2e; border-color: #4a4a6a; color: #e0e0e0; }
body.dark-mode .dialog-input:focus { border-color: #40a9ff; }
body.dark-mode .year-dropdown { background: #16213e; box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
body.dark-mode .year-dropdown-item { color: #aaa; }
body.dark-mode .year-dropdown-item:hover,
body.dark-mode .year-dropdown-item.active { color: #40a9ff; }
body.dark-mode .as-month-filter select { background: #1a1a2e; border-color: #4a4a6a; color: #e0e0e0; }
body.dark-mode .as-summary-card strong { color: #e0e0e0; }
body.dark-mode #asRankingTable th { background: #1a1a2e; color: #aaa; }
body.dark-mode #asRankingTable td { border-bottom-color: #2a2a4a; color: #ccc; }
body.dark-mode .data-analysis-btn { background: #40a9ff; }
body.dark-mode .data-analysis-btn:hover { background: #096dd9; }
body.dark-mode .back-home-btn { background: #389e0d; }
/* OCR Paste Dialog - Dark */
body.dark-mode .ocr-drop-zone { background: #1a1a2e; border-color: #4a4a6a; }
body.dark-mode .ocr-drop-zone:focus { background: #1a2744; border-color: #40a9ff; }
body.dark-mode .ocr-drop-zone:hover { border-color: #40a9ff; }
body.dark-mode .ocr-loading-box { background: #16213e; }
body.dark-mode .ocr-loading-box p { color: #e0e0e0; }
body.dark-mode .ocr-spinner { border-color: #1a2744; border-top-color: #40a9ff; }
/* Commission Calculator - Dark */
body.dark-mode .commission-box { background: #16213e; box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
body.dark-mode .comm-header { border-bottom-color: #2a2a4a; }
body.dark-mode .comm-header h3 { color: #e0e0e0; }
body.dark-mode .comm-close { color: #888; }
body.dark-mode .comm-close:hover { color: #e0e0e0; background: #2a2a4a; }
body.dark-mode .comm-field label { color: #aaa; }
body.dark-mode .comm-field input,
body.dark-mode .comm-field select { background: #1a1a2e; border-color: #4a4a6a; color: #e0e0e0; }
body.dark-mode .comm-field input:focus,
body.dark-mode .comm-field select:focus { border-color: #fa8c16; box-shadow: 0 0 0 2px rgba(250,140,22,.15); }
body.dark-mode .comm-step { background: #1a1a2e; border-color: #2a2a4a; }
body.dark-mode .comm-step-title { color: #e0e0e0; }
body.dark-mode .comm-step-body { color: #aaa; }
body.dark-mode .comm-formula-note { background: #2a2a1e; border-color: #5a4a1a; color: #d4a017; }
body.dark-mode .comm-formula-note strong { color: #d4a017; }
/* Ranking table sum row - Dark */
body.dark-mode #asRankingTable tr.sum-row { background: #1a1a2e !important; color: #e0e0e0; }

/* Year Wheel Selector (header) */
.year-wheel-container {
    position: relative;
    height: 40px;
    width: 90px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.year-wheel {
    position: absolute;
    width: 100%;
    transition: transform 0.2s ease-out;
    touch-action: none;
}

.year-wheel-item {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #bbb;
    transition: all 0.15s ease-out;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

.year-wheel-item.active {
    color: #1890ff;
    font-size: 17px;
    font-weight: 700;
}

.year-wheel-item:hover {
    color: #1890ff;
}

.year-wheel-highlight {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 36px;
    pointer-events: none;
}

/* Year Dropdown Panel */
.year-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    padding: 8px 0;
    min-width: 90px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 200;
}

.year-dropdown-item {
    padding: 8px 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: background 0.15s;
}

.year-dropdown-item:hover,
.year-dropdown-item.active {
    color: #1890ff;
}

.year-dropdown-item.active {
    font-weight: 700;
}

/* Year Title (center of header) */
.year-title {
    font-size: 20px;
    font-weight: 600;
    color: #1890ff;
    min-width: 80px;
    text-align: center;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.breadcrumb:empty { display: none; }

.breadcrumb a {
    color: #1890ff;
    text-decoration: none;
    cursor: pointer;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #ccc; }

/* Chart Section */
.chart-section {
    display: flex;
    gap: 20px;
    padding: 20px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Month Selector - Wheel Style */
.month-selector {
    background: #fff;
    border-radius: 12px;
    padding: 20px 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    min-width: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.month-wheel-container {
    position: relative;
    height: 180px;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.month-wheel {
    position: absolute;
    width: 100%;
    transition: transform 0.15s ease-out;
    touch-action: none;
}

.month-wheel-item {
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #999;
    transition: all 0.15s ease-out;
    cursor: pointer;
    user-select: none;
}

.month-wheel-item .month-name {
    font-weight: 500;
}

.month-wheel-item .month-sales {
    font-size: 11px;
    color: #bbb;
    margin-top: 2px;
}

.month-wheel-item.active {
    color: #1890ff;
    font-size: 22px;
    font-weight: 600;
}

.month-wheel-item.active .month-sales {
    color: #1890ff;
}

.month-wheel-item:hover {
    color: #1890ff;
}

.month-wheel-highlight {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 56px;
    background: linear-gradient(90deg, rgba(24,144,255,0.05), rgba(24,144,255,0.1), rgba(24,144,255,0.05));
    border-top: 2px solid #1890ff;
    border-bottom: 2px solid #1890ff;
    border-radius: 8px;
    pointer-events: none;
}

/* Month Dropdown */
.month-dropdown {
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    width: 128px;
    max-height: 60vh;
    height: auto;
    min-height: 60px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 8px;
    z-index: 200;
    display: none;
    overflow-y: auto;
}

.month-dropdown.open {
    display: block;
    animation: dropIn 0.2s ease-out;
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.month-dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all 0.15s;
}

.month-dropdown-item .month-name {
    font-weight: 500;
}

.month-dropdown-item:hover {
    background: #e6f7ff;
}

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

.month-dropdown-item .month-sales-info {
    font-size: 12px;
    color: #999;
}

.month-dropdown-item.active .month-sales-info {
    color: rgba(255,255,255,0.8);
}

.chart-container {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chart-container h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
    font-weight: 600;
}

.chart-container canvas {
    max-height: 300px;
}

/* Year View */
.year-view {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 24px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.mini-month {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.3s;
}

.mini-month:hover {
    box-shadow: 0 4px 16px rgba(24,144,255,0.15);
    transform: translateY(-2px);
}

.mini-month-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
    text-align: center;
}

.mini-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    gap: 1px;
}

.mini-day {
    padding: 3px 0;
    border-radius: 4px;
    position: relative;
}

.mini-day.today {
    background: #1890ff;
    color: #fff;
    font-weight: 600;
}

.mini-day.has-data {
    color: #ff4d4f;
    font-weight: 600;
    background: rgba(255, 77, 79, 0.12);
}

.mini-day.today.has-data {
    background: #ff4d4f;
}

/* Month View */
.month-view {
    padding: 24px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.month-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #d9d9d9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.month-nav-btn:hover {
    background: #1890ff;
    border-color: #1890ff;
    box-shadow: 0 4px 12px rgba(24,144,255,0.3);
}

.month-nav-btn:hover svg { fill: #fff; }

.month-nav-btn svg {
    width: 28px;
    height: 28px;
    fill: #666;
    transition: fill 0.2s;
}

.month-nav-prev { left: -26px; }
.month-nav-next { right: -26px; }

.month-detail {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.month-header {
    text-align: center;
    margin-bottom: 16px;
}

.month-header h2 {
    font-size: 24px;
    color: #1a1a1a;
}

.weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding-top: 8px;
}

.month-day {
    min-height: 100px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.month-day:hover {
    border-color: #1890ff;
    background: #f6fbff;
}

.month-day.empty {
    border: none;
    cursor: default;
    min-height: 0;
}

.month-day.empty:hover { background: none; }

.month-day .day-num {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    position: relative;
}

.month-day.has-data {
    background: rgba(255, 77, 79, 0.08);
    border-color: rgba(255, 77, 79, 0.2);
}

.month-day.has-data .day-num {
    color: #ff4d4f;
    font-weight: 600;
}

.month-day.today .day-num {
    background: #1890ff;
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.month-day.today.has-data .day-num {
    background: #ff4d4f;
}

.month-day .day-info {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.6;
}

.month-day .day-sales {
    color: #1890ff;
    font-weight: 500;
}

.month-day .day-profit {
    color: #52c41a;
    font-weight: 500;
}

.month-day .day-rate {
    color: #fa8c16;
    font-weight: 500;
}

.month-day.weekend .day-num { color: #ff4d4f; }
.month-day.today.weekend .day-num { color: #fff; }

/* Modal */
.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;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    animation: slideUp 0.3s;
}

.modal-wide { max-width: 860px; }

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h2 {
    font-size: 20px;
    color: #1a1a1a;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body { padding: 20px 24px; }

/* Sales Summary */
.sales-summary {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.sales-summary h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.summary-card {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 12px 16px;
}

.summary-card label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
    font-weight: 500;
}

.summary-card input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
    text-align: right;
    outline: none;
    transition: all 0.2s;
}

.summary-card input::placeholder {
    color: #ccc;
    opacity: 1;
}

.summary-card-primary input {
    color: #1890ff;
    border-bottom: 2px solid transparent;
    text-align: right;
    cursor: text;
}

.summary-card-primary input:focus {
    border-bottom-color: #1890ff;
    background: rgba(24,144,255,0.04);
    border-radius: 4px 4px 0 0;
    padding: 4px 6px;
    margin: -4px -6px -8px;
}

.summary-card-readonly input {
    color: #52c41a;
    cursor: default;
    font-size: 18px;
}

.summary-card-readonly:nth-child(3) input {
    color: #fa8c16;
}

.card-hint {
    display: block;
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
    text-align: center;
}

.card-formula {
    display: block;
    font-size: 11px;
    color: #ccc;
    margin-top: 4px;
    text-align: center;
}

.summary-actions {
    display: flex;
    gap: 10px;
}

/* Products Section */
.products-section { margin-top: 4px; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 16px;
    color: #333;
}

.add-btn {
    display: inline-block;
    background: #1890ff;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.add-btn:hover { background: #096dd9; }

/* Records Table (CSS Grid) */
.records-table { overflow-x: hidden; }

.grid-table {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-top: 2px solid #f0f0f0;
}

.grid-row {
    display: grid;
    grid-template-columns: 8% 32% 14% 10% 15% 21%;
    align-items: center;
}

.grid-header {
    background: #fafafa;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}
.grid-header .grid-col {
    padding: 11px 8px;
    text-align: center;
    white-space: nowrap;
}
.grid-header .col-name { text-align: left; }

.grid-row:not(.grid-header) .grid-col {
    padding: 12px 8px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.grid-row:hover > .grid-col { background: #f6fbff; }

.col-index { text-align: center; }
.col-price, .col-qty { text-align: center; font-variant-numeric: tabular-nums; }
.col-subtotal { text-align: right; color: #fa8c16; font-weight: 600; }
.col-actions { text-align: center; white-space: nowrap; }

.records-table .btn-edit { color: #1890ff; background:none;border:none;cursor:pointer;padding:2px 4px;font-size:13px }
.records-table .btn-edit:hover { background: #e6f7ff; border-radius:4px }
.records-table .btn-delete { color: #ff4d4f; background:none;border:none;cursor:pointer;padding:2px 4px;font-size:13px }
.records-table .btn-delete:hover { background: #fff1f0; border-radius:4px }

.no-records {
    text-align: center;
    color: #999;
    padding: 32px 0;
    font-size: 14px;
}

/* Form */
.form-modal { max-width: 480px; }

.record-form { padding: 20px 24px; }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn {
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #d9d9d9;
    transition: all 0.2s;
}

.btn-cancel { background: #fff; color: #666; }
.btn-cancel:hover { border-color: #1890ff; color: #1890ff; }
.btn-save { background: #1890ff; color: #fff; border-color: #1890ff; }
.btn-save:hover { background: #096dd9; }
.btn-danger { background: #fff; color: #ff4d4f; border-color: #ff4d4f; }
.btn-danger:hover { background: #ff4d4f; color: #fff; }

/* Custom Dialog */
.dialog-overlay {
    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: 2000;
    animation: fadeIn 0.2s;
}

.dialog-box {
    background: #fff;
    border-radius: 16px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    animation: slideUp 0.3s;
}

.dialog-body {
    padding: 28px 24px 20px;
}

.dialog-msg {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.dialog-input-wrap {
    margin-top: 14px;
}

.dialog-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

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

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
}

/* Login Page */
.login-page {
    background: url('/photo/bg2.webp') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 40px 32px 32px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: #999;
    text-align: center;
    margin-bottom: 28px;
}

.btn-login {
    width: 100%;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 24px;
    transition: background 0.2s;
}

.btn-login:hover { background: #096dd9; }

.login-remember {
    margin-bottom: 16px;
    text-align: right;
}
.remember-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: #666; cursor: pointer;
    user-select: none;
}
.remember-label input[type="checkbox"] {
    width: 15px; height: 15px; cursor: pointer;
    accent-color: #1890ff;
}

.login-error {
    background: #fff1f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    padding: 10px 14px;
    color: #ff4d4f;
    font-size: 13px;
    margin-bottom: 14px;
}

.login-hint {
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
    color: #bbb;
}

/* Viewer Only Page */
.viewer-only-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('/photo/bg1.webp') no-repeat center center fixed;
    background-size: cover;
}

.viewer-only-page img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}

/* OCR Loading */
.ocr-loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.ocr-loading-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.ocr-spinner {
    width: 40px; height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #e6f7ff;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: ocrSpin 0.8s linear infinite;
}
@keyframes ocrSpin { to { transform: rotate(360deg); } }
.ocr-loading-box p { font-size: 15px; color: #555; }

/* OCR Result Dialog */
.ocr-result-box { max-width: 520px !important; }

/* OCR Paste Dialog */
.ocr-paste-box { max-width: 480px !important; }

.ocr-drop-zone {
    border: 2px dashed #d9d9d9;
    border-radius: 12px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}
.ocr-drop-zone:focus {
    border-color: #1890ff;
    background: #e6f7ff;
}
.ocr-drop-zone:hover {
    border-color: #1890ff;
}

/* Utility */
.hidden { display: none !important; }

/* ==================== Responsive ==================== */

/* Tablet & small desktop (≤1100px) */
@media (max-width: 1100px) {
    .chart-section {
        flex-direction: column;
        align-items: center;
    }
    .month-selector {
        min-width: auto;
        width: 128px;
    }
    .month-dropdown {
        left: 0;
        top: calc(100% + 8px);
    }
}

/* Tablet (≤900px) */
@media (max-width: 900px) {
    .chart-section { flex-direction: column; align-items: center; }
    .month-selector { min-width: auto; width: 128px; }
    .year-view { grid-template-columns: repeat(3, 1fr); padding: 16px; }
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    .month-day { min-height: 80px; }
    .month-nav-btn { width: 48px; height: 48px; }
    .month-nav-btn svg { width: 22px; height: 22px; }
    .month-nav-prev { left: -12px; }
    .month-nav-next { right: -12px; }
    .comm-summary-card { grid-template-columns: repeat(3, 1fr); }

    /* Header 拆行 */
    .header { flex-direction: column; gap: 10px; padding: 10px 16px; }
    .header-left { flex-direction: column; gap: 8px; }
    .breadcrumb { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .as-summary-row { grid-template-columns: repeat(3, 1fr); }
    .as-summary-card strong { font-size: 17px; }
}

/* Large phone (≤768px) */
@media (max-width: 768px) {
    .year-view { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px; }
    .summary-cards { grid-template-columns: 1fr; }
    .modal-content { width: 95%; max-height: 90vh; padding: 16px; }
    .modal-wide { max-width: 100%; }
    .form-modal { max-width: 95%; width: 95%; }

    .month-view { padding: 16px 40px; }
    .month-detail { padding: 16px; }
    .month-header h2 { font-size: 20px; }
    .month-day { min-height: 64px; padding: 3px; }
    .month-day .day-num { font-size: 13px; }
    .month-day .day-info { font-size: 10px; }
    .month-nav-btn { width: 36px; height: 36px; }
    .month-nav-btn svg { width: 18px; height: 18px; }
    .month-nav-prev { left: -4px; }
    .month-nav-next { right: -4px; }

    .header { padding: 8px 12px; gap: 8px; }
    .header-left { gap: 6px; }
    .user-area { gap: 4px; flex-wrap: wrap; }
    .year-title { font-size: 18px; }
    .app-title { font-size: 18px; }
    .chart-section { padding: 12px; }
    .chart-container canvas { max-height: 240px; }

    .shop-selector { flex-wrap: wrap; gap: 4px; }
    .shop-selector select { max-width: 120px; font-size: 13px; }

    .dialog-box { width: 90vw; }
    .commission-box { width: 95vw; max-height: 85vh; padding: 16px; }
    .comm-summary-card { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; }
    .comm-summary-value { font-size: 16px; }

    /* 商品明细表格 */
    .records-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .grid-row { grid-template-columns: 8% 30% 12% 10% 15% 25%; }
    .grid-row .grid-col { font-size: 12px; padding: 8px 6px; }
    .grid-header .grid-col { font-size: 11px; padding: 8px 6px; }

    .as-summary-row { grid-template-columns: repeat(2, 1fr); }
    .as-tab { padding: 6px 12px; font-size: 12px; }
    .as-month-filter { flex-wrap: wrap; gap: 6px; }
    .as-card canvas { max-height: 260px !important; }
}

/* Small phone (≤480px) */
@media (max-width: 480px) {
    .year-view { grid-template-columns: 1fr; gap: 10px; padding: 8px; }
    .year-view .month-card { padding: 10px; }
    .year-view .month-title { font-size: 14px; margin-bottom: 6px; }

    .month-view { padding: 12px 36px; }
    .month-detail { padding: 12px; border-radius: 12px; }
    .month-header h2 { font-size: 18px; margin-bottom: 10px; }
    .month-day { min-height: 52px; padding: 2px; }
    .month-day .day-num { font-size: 12px; }
    .month-day .day-info { font-size: 9px; }
    .weekday-header span { font-size: 11px; padding: 4px 0; }
    .month-nav-btn { width: 30px; height: 30px; }
    .month-nav-btn svg { width: 16px; height: 16px; }
    .month-nav-prev { left: -2px; }
    .month-nav-next { right: -2px; }

    .header { padding: 6px 10px; gap: 6px; }
    .user-name-inline { font-size: 13px; }
    .data-analysis-btn,
    .back-home-btn,
    .logout-btn { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
    .privilege-pwd-btn { padding: 4px 8px; font-size: 14px; }

    .chart-section { padding: 8px; }
    .chart-container canvas { max-height: 200px; }
    .month-selector { width: 100px; }
    .month-wheel-container { height: 140px; }
    .month-wheel-item { height: 48px; font-size: 12px; }

    .dialog-box { width: 94vw; padding: 16px; }
    .dialog-msg { font-size: 14px; }
    .dialog-input { font-size: 14px; }
    .dialog-actions .btn { padding: 6px 16px; font-size: 13px; }

    .commission-box { padding: 12px; }
    .commission-box h3 { font-size: 15px; }
    .comm-summary-card { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px; }
    .comm-summary-value { font-size: 14px; }
    .comm-summary-label { font-size: 10px; }
    .comm-step-body { font-size: 12px; }

    .modal-content { width: 98%; padding: 12px; border-radius: 10px; }
    .day-title { font-size: 16px; }
    .sales-summary h3 { font-size: 14px; }
    .summary-card { padding: 10px 12px; }
    .summary-card label { font-size: 11px; }
    .summary-card input { font-size: 14px; }

    .records-table { overflow-x: auto; }
    .grid-row { grid-template-columns: 6% 28% 12% 10% 16% 28%; }
    .grid-row .grid-col { font-size: 11px; padding: 6px 4px; }
    .grid-header .grid-col { font-size: 10px; padding: 6px 4px; }
    .btn-edit, .btn-delete { font-size: 11px !important; padding: 2px 3px !important; }

    .as-summary-row { grid-template-columns: 1fr; gap: 8px; }
    .as-summary-card { padding: 12px; }
    .as-summary-card strong { font-size: 16px; }
    .as-tabs { gap: 4px; }
    .as-tab { padding: 5px 10px; font-size: 11px; border-radius: 8px; }
    .as-month-filter { flex-direction: column; align-items: center; }
    .as-month-filter select,
    .as-month-filter button { width: 100%; max-width: 200px; }
    .as-card { padding: 12px; }
    .as-card h3 { font-size: 13px; }
    .as-card canvas { max-height: 220px !important; }
    .all-shops-view { padding: 0 8px; margin-top: 8px; }

    .breadcrumb { font-size: 12px; }
    .year-wheel-container { width: 70px; height: 36px; }
    .year-wheel-item { font-size: 13px; height: 30px; }
    .year-dropdown { min-width: 70px; max-height: 200px; }
    .year-dropdown-item { font-size: 13px; }

    .ocr-paste-box { max-width: 95vw; }
    .ocr-drop-zone { min-height: 140px; }
}

/* Tiny phone (≤375px) */
@media (max-width: 375px) {
    .month-day { min-height: 46px; padding: 1px; }
    .month-day .day-num { font-size: 11px; }
    .month-day .day-info { font-size: 8px; }
    .month-nav-btn { width: 26px; height: 26px; }
    .month-nav-btn svg { width: 14px; height: 14px; }
    .month-nav-prev { left: -1px; }
    .month-nav-next { right: -1px; }

    .grid-row { grid-template-columns: 5% 26% 12% 10% 16% 31%; }
    .grid-row .grid-col { font-size: 10px; padding: 5px 2px; }
    .grid-header .grid-col { font-size: 9px; padding: 5px 2px; }

    .comm-summary-card { grid-template-columns: 1fr 1fr; }
    .comm-summary-value { font-size: 13px; }
}


/* ===== 全店铺综合分析页（仅admin） ===== */
.all-shops-view {
    max-width: 1100px;
    margin: 16px auto;
    padding: 0 12px;
}
.as-header {
    text-align: center;
    margin-bottom: 20px;
}
.as-header h2 { font-size: 22px; color: #1a1a2e; margin-bottom: 4px; }
.as-subtitle { color: #888; font-size: 13px; }
.as-month-filter {
    display:flex; justify-content:center; align-items:center; gap:10px; margin-top:12px;
}
.as-month-filter select {
    padding:6px 14px; border-radius:8px; border:1px solid #ddd; font-size:14px; outline:none;
}
.as-summary-row {
    display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:20px;
}
.as-summary-card {
    background:#fff; border-radius:12px; box-shadow:0 2px 8px rgba(0,0,0,.06);
    padding:18px; text-align:center;
}
.as-sum-label { display:block; font-size:12px; color:#888; margin-bottom:6px; }
.as-summary-card strong { font-size:20px; color:#333; }

/* 分析选项卡 */
.as-tabs {
    display:flex; gap:6px; margin-bottom:16px; flex-wrap:wrap; justify-content:center;
}
.as-tab {
    padding:8px 18px; border-radius:10px; border:1.5px solid #e0e0e0;
    background:#fff; font-size:13px; font-weight:500; color:#666;
    cursor:pointer; transition:all .2s; white-space:nowrap;
}
.as-tab:hover { border-color:#1890ff; color:#1890ff; }
.as-tab.active {
    background:#1890ff; color:#fff; border-color:#1890ff;
    box-shadow:0 2px 8px rgba(24,144,255,.25);
}

/* 分析内容面板 */
.as-tab-panel { display:none; }
.as-tab-panel.active { display:block; }

.as-card {
    background:#fff; border-radius:12px; box-shadow:0 2px 10px rgba(0,0,0,.06); padding:18px 20px;
}
.as-card h3 { font-size:15px; color:#333; margin-bottom:14px; display:flex; align-items:center; gap:6px; }
.as-card canvas { max-height:380px !important; }

/* 卡片内头部（标题+指标切换按钮） */
.as-card-header {
    display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; flex-wrap:wrap; gap:8px;
}
.as-card-header h3 { margin-bottom:0; }

/* 指标切换按钮组 */
.as-metric-toggle {
    display:flex; gap:4px; background:#f5f5f5; border-radius:8px; padding:3px;
}
.as-metric-btn,
.as-metric-btn-cmp {
    padding:5px 14px; border:none; border-radius:6px; font-size:12px; font-weight:500;
    color:#666; background:transparent; cursor:pointer; transition:all .2s;
}
.as-metric-btn:hover,
.as-metric-btn-cmp:hover { color:#1890ff; }
.as-metric-btn.active,
.as-metric-btn-cmp.active {
    background:#1890ff; color:#fff; box-shadow:0 1px 4px rgba(24,144,255,.2);
}

#asRankingTable { width: 100%; border-collapse: collapse; font-size: 13px; }
#asRankingTable th, #asRankingTable td {
    padding: 9px 12px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}
#asRankingTable th { background: #f8f9ff; font-weight: 600; color: #555; }
#asRankingTable tr.sum-row { background: #f8f9ff; }
#asRankingTable td:first-child { color: #667eea; font-weight: 600; }
#allShopsChart { max-height: 320px; }

/* 暗色模式 - 分析选项卡 */
body.dark-mode .as-tab { background: #1a1a2e; border-color: #4a4a6a; color: #aaa; }
body.dark-mode .as-tab:hover { border-color: #40a9ff; color: #40a9ff; }
body.dark-mode .as-tab.active { background: #40a9ff; color: #fff; border-color: #40a9ff; }
body.dark-mode .as-metric-toggle { background: #1a1a2e; }
body.dark-mode .as-metric-btn,
body.dark-mode .as-metric-btn-cmp { color: #aaa; }
body.dark-mode .as-metric-btn:hover,
body.dark-mode .as-metric-btn-cmp:hover { color: #40a9ff; }
body.dark-mode .as-metric-btn.active,
body.dark-mode .as-metric-btn-cmp.active { background: #40a9ff; color: #fff; }

/* ===== Admin User Management ===== */
.admin-manage-btn {
    background: #1890ff; color: #fff; border: none; border-radius: 8px;
    padding: 6px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.admin-manage-btn:hover { background: #096dd9; }
body.dark-mode .admin-manage-btn { background: #40a9ff; }
body.dark-mode .admin-manage-btn:hover { background: #096dd9; }

.admin-modal { max-width: 900px; }
.admin-toolbar {
    display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
}
.admin-hint { font-size: 13px; color: #999; }

.admin-user-list { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; }

.admin-user-card {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    background: #fafbfc; border: 1px solid #eef0f3; border-radius: 10px;
    transition: all .2s;
}
.admin-user-card:hover { border-color: #1890ff; }
body.dark-mode .admin-user-card { background: #1a1a2e; border-color: #2a2a4a; }
body.dark-mode .admin-user-card:hover { border-color: #40a9ff; }

.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-size: 15px; font-weight: 600; color: #333; }
.admin-user-meta { font-size: 12px; color: #888; margin-top: 3px; }
.admin-user-meta span { margin-right: 10px; }
body.dark-mode .admin-user-name { color: #e0e0e0; }
body.dark-mode .admin-user-meta { color: #888; }

.admin-user-actions { display: flex; gap: 6px; flex-shrink: 0; }
.admin-btn-edit, .admin-btn-delete {
    border: 1px solid #d9d9d9; border-radius: 6px; padding: 5px 12px;
    font-size: 12px; cursor: pointer; background: #fff; transition: all .2s;
}
.admin-btn-edit:hover { border-color: #1890ff; color: #1890ff; }
.admin-btn-delete { color: #ff4d4f; }
.admin-btn-delete:hover { border-color: #ff4d4f; background: #fff1f0; }
body.dark-mode .admin-btn-edit, body.dark-mode .admin-btn-delete { background: #1a2744; border-color: #4a4a6a; color: #aaa; }
body.dark-mode .admin-btn-edit:hover { border-color: #40a9ff; color: #40a9ff; }
body.dark-mode .admin-btn-delete:hover { border-color: #ff7875; color: #ff7875; background: rgba(255,120,117,0.1); }

/* Admin user form */
.admin-form-modal { max-width: 560px; }
.admin-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.admin-checkbox-item {
    display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
    background: #f5f5f5; border: 1.5px solid #e0e0e0; border-radius: 8px;
    font-size: 13px; cursor: pointer; transition: all .2s; user-select: none;
}
.admin-checkbox-item:hover { border-color: #1890ff; }
.admin-checkbox-item.checked { background: #e6f7ff; border-color: #1890ff; color: #1890ff; font-weight: 500; }
.admin-checkbox-item input { display: none; }
body.dark-mode .admin-checkbox-item { background: #1a1a2e; border-color: #4a4a6a; color: #aaa; }
body.dark-mode .admin-checkbox-item:hover { border-color: #40a9ff; }
body.dark-mode .admin-checkbox-item.checked { background: #1a2744; border-color: #40a9ff; color: #40a9ff; }

/* Admin role badge */
.admin-role-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.admin-role-badge.admin { background: #e6f7ff; color: #096dd9; }
.admin-role-badge.readonly { background: #fff7e6; color: #d48806; }
.admin-role-badge.viewer { background: #f5f5f5; color: #8c8c8c; }
body.dark-mode .admin-role-badge.admin { background: #1a2744; color: #40a9ff; }
body.dark-mode .admin-role-badge.readonly { background: #2a2a1e; color: #d4a017; }
body.dark-mode .admin-role-badge.viewer { background: #1a1a2e; color: #888; }
