/* ==================== 全局样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f6fa;
    height: 100%;
    display: flex;
    min-width: 0;}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: #1F3864;
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 28px 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-icon {
    font-size: 36px;
    margin-bottom: 8px;
    color: #FFD700;
}

.sidebar-header h1 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar-header p {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 13px 24px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

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

.nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #FFD700;
    border-left-color: #FFD700;
}

.nav-item.disabled {
    color: rgba(255,255,255,0.3);
    cursor: not-allowed;
    pointer-events: none;
}

.nav-icon { margin-right: 10px; font-size: 12px; }

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 8px 20px;
}

.current-user {
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 4px;
    word-break: break-all;
}

.sidebar-footer {
    padding: 16px 20px;
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ==================== 主内容区 ==================== */
.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 24px 30px;
    min-height: 100vh;
    overflow-y: auto;
    min-width: 0;}

/* ==================== 页面头部 ==================== */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    color: #1F3864;
    font-weight: 600;
    margin-bottom: 6px;
}

.page-header p {
    font-size: 13px;
    color: #666;
}

/* ==================== 卡片容器 ==================== */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 20px 24px;
    margin-bottom: 20px;
    min-width: 0;}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F3864;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1F3864;
    box-shadow: 0 0 0 2px rgba(31,56,100,0.1);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group { flex: 1; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 6px;
}

.btn-primary {
    background: #1F3864;
    color: #fff;
}

.btn-primary:hover { background: #2a4a7f; }

.btn-success {
    background: #2ecc71;
    color: #fff;
}

.btn-success:hover { background: #27ae60; }

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover { background: #c0392b; }

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-warning:hover { background: #d68910; }

.btn-edit-shop {
    background: #fff;
    color: #4A90D9;
    border: 1px solid #4A90D9;
}
.btn-edit-shop:hover { background: #eaf2fb; }

.btn-delete-shop {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}
.btn-delete-shop:hover { background: #c0392b; }

.btn-outline {
    background: #fff;
    color: #1F3864;
    border: 1px solid #1F3864;
}

.btn-outline:hover { background: #f0f3f8; }

.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==================== 表格 ==================== */
.table-container { overflow-x: auto; min-width: 0; }

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

table th {
    background: #f8f9fb;
    color: #1F3864;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #e0e3e8;
    white-space: nowrap;
}

table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    color: #555;
}

table tbody tr:hover { background: #f8f9fb; }

/* ==================== 标签/徽章 ==================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: #e6f9ee; color: #27ae60; }
.badge-danger { background: #fdeaea; color: #e74c3c; }
.badge-warning { background: #fef3e2; color: #f39c12; }
.badge-info { background: #e8f0fe; color: #1F3864; }
.badge-default { background: #f0f0f0; color: #666; }

/* ==================== 安全报备看板 ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.shop-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 18px;
    border-left: 4px solid #ccc;
    transition: transform 0.2s, box-shadow 0.2s;
}

.shop-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.shop-card.completed { border-left-color: #2ecc71; }
.shop-card.partial { border-left-color: #f39c12; }
.shop-card.unreported { border-left-color: #e74c3c; }
.shop-card.not_applicable { border-left-color: #bbb; background: #f9f9f9; }

.shop-card .shop-name { font-size: 15px; font-weight: 600; color: #1F3864; margin-bottom: 4px; }
.shop-card .shop-location { font-size: 12px; color: #666; margin-bottom: 12px; }

.shop-card .status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.shop-card .status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.shop-card .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-green { background: #2ecc71; }
.dot-yellow { background: #f39c12; }
.dot-red { background: #e74c3c; }

.shop-card .photo-types {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.photo-tag {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    background: #f0f0f0;
    color: #666;
}

.photo-tag.completed-tag { background: #e6f9ee; color: #27ae60; }
.photo-tag.missing-tag { background: #fdeaea; color: #e74c3c; }

/* ==================== 工具栏 ==================== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.toolbar-left, .toolbar-right { display: flex; gap: 10px; align-items: center; }

.toolbar input[type="date"],
.toolbar select {
    padding: 7px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

/* ==================== 巡检检查表 ==================== */
.inspection-checklist { }

.checklist-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

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

.checklist-item .item-info { flex: 1; min-width: 150px; }

.checklist-item .item-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.checklist-item .item-desc {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.checklist-item .item-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist-item .max-score {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.checklist-item input[type="number"] {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
}

.checklist-item input[type="text"] {
    width: 160px;
    padding: 5px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 12px;
}

/* ==================== 模态框 ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-container {
    background: #fff;
    border-radius: 10px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px 30px;
}

.modal-container h3 {
    font-size: 18px;
    color: #1F3864;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* ==================== 二维码区域 ==================== */
.qr-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.qr-card {
    background: #fff;
    border: 1px solid #e0e3e8;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.qr-card canvas { margin-bottom: 8px; }

.qr-card .qr-shop-name {
    font-size: 13px;
    font-weight: 600;
    color: #1F3864;
}

.qr-card .qr-shop-location {
    font-size: 12px;
    color: #666;
}

/* ==================== 报告区域 ==================== */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 18px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1F3864;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.stat-card.accent-green .stat-value { color: #2ecc71; }
.stat-card.accent-red .stat-value { color: #e74c3c; }
.stat-card.accent-orange .stat-value { color: #f39c12; }

/* ==================== 提醒列表 ==================== */
.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fef3e2;
    border-radius: 6px;
    border-left: 3px solid #f39c12;
}

.reminder-item .reminder-info { display: flex; gap: 12px; align-items: center; }

.reminder-item .reminder-shop { font-weight: 600; color: #333; }

.reminder-item .reminder-missing {
    font-size: 12px;
    color: #e74c3c;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #bbb;
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ==================== 费用缴纳管理 - 标签页 ==================== */
.tab-nav {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #e0e3e8;
    margin-bottom: 0;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover { color: #1F3864; }

.tab-btn.active {
    color: #1F3864;
    font-weight: 600;
    border-bottom-color: #1F3864;
}

.fee-info-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: #f8f9fb;
    border-radius: 6px;
    margin-bottom: 16px;
}

.fee-info-item {
    flex: 1;
    min-width: 180px;
}

.fee-info-item label {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.fee-info-item .value {
    font-size: 18px;
    font-weight: 700;
    color: #1F3864;
}

.fee-info-item .value.accent { color: #e67e22; }

/* ==================== 响应式 ==================== */
/* ==================== 汉堡菜单按钮 ==================== */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 200;
    width: 38px; height: 38px;
    background: #1F3864;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 9px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: background 0.2s;
}
.hamburger-btn:hover { background: #2a4d80; }
.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
/* 打开时变形为 X */
.sidebar.open ~ .hamburger-btn span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.sidebar.open ~ .hamburger-btn span:nth-child(2) {
    opacity: 0;
}
.sidebar.open ~ .hamburger-btn span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 侧边栏遮罩 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.show { display: block; }

/* ==================== 响应式 - 平板与手机 ==================== */
@media (max-width: 768px) {
    .hamburger-btn { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        width: 240px;
        min-width: 240px;
        transition: transform 0.3s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,0.3);
    }
    .sidebar.open { transform: translateX(0); }

    /* 侧边栏打开时保持完整文字 */
    .sidebar.open .sidebar-header h1,
    .sidebar.open .sidebar-header p,
    .sidebar.open .nav-item span:last-child,
    .sidebar.open .sidebar-footer { display: block; }
    .sidebar.open .sidebar-header { padding: 28px 20px 20px; }
    .sidebar.open .logo-icon { font-size: 36px; }
    .sidebar.open .nav-item { padding: 12px 20px; justify-content: flex-start; }
    .sidebar.open .nav-icon { margin-right: 10px; }

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

    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-left, .toolbar-right { flex-wrap: wrap; width: 100%; }
    .toolbar-left input[type="date"], .toolbar-left select,
    .toolbar-left input[type="text"], .toolbar-left .ms-wrap { width: 100%; min-width: 0; }

    .form-row { flex-direction: column; gap: 0; }

    .dashboard-grid { grid-template-columns: 1fr; }

    .qr-list { grid-template-columns: 1fr; }
}

/* 小屏手机优化 (375px~480px) — 侧边栏打开时文字完整可读 */
@media (max-width: 480px) {
    .form-group .fo-check-grid { grid-template-columns: 1fr; }
    .sidebar.open {
        width: 220px;
        min-width: 220px;
    }
    .sidebar.open .sidebar-header { padding: 20px 12px 16px; }
    .sidebar.open .sidebar-header h1 { font-size: 14px; }
    .sidebar.open .sidebar-header p { font-size: 12px; }
    .sidebar.open .logo-icon { font-size: 28px; }
    .sidebar.open .nav-item { padding: 10px 14px; font-size: 13px; }
    .sidebar.open .nav-icon { font-size: 15px; margin-right: 8px; }
}

/* ==================== 巡检表单新版样式 ==================== */
.checklist-item-new {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px 16px;
    background: #fff;
    transition: all 0.3s ease;
    overflow: hidden;
}

.checklist-item-new.item-pass {
    border-left: 3px solid #2ecc71;
}

.checklist-item-new.item-fail {
    border-left: 3px solid #e74c3c;
    background: #fef9f9;
}

.checklist-item-new .item-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.checklist-item-new .item-info {
    flex: 1;
    min-width: 180px;
}

.checklist-item-new .item-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.checklist-item-new .item-desc {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* 单选按钮组 */
.item-radio-group {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #d9d9d9;
    transition: all 0.2s;
    user-select: none;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-pass {
    color: #27ae60;
    background: #f0faf4;
    border-color: #c3e6d1;
}

.radio-pass:hover {
    background: #d9f2e3;
}

/* 当合格被选中时的高亮样式 */
.radio-pass:has(input:checked) {
    background: #27ae60;
    color: #fff;
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

.radio-fail {
    color: #e74c3c;
    background: #fef5f5;
    border-color: #f5c6cb;
}

.radio-fail:hover {
    background: #fde8e8;
}

/* 当不合格被选中时的高亮样式 */
.radio-fail:has(input:checked) {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

/* 不合格详情展开区（带动画） */
.item-fail-detail {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.item-fail-detail[style*="display: block"],
.item-fail-detail[style*="display:block"] {
    max-height: 200px;
    opacity: 1;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e8d0d0;
}

/* fallback for JS-set display:block */
.item-fail-detail.show {
    max-height: 200px;
    opacity: 1;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e8d0d0;
}

.fail-deduct-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.deduct-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #fdeaea;
    color: #e74c3c;
}

.deduct-score-result {
    font-size: 13px;
    color: #e67e22;
    font-weight: 500;
}

.fail-photo-upload {
    background: #fafafa;
    border: 1px dashed #d9d9d9;
    border-radius: 4px;
    padding: 10px 14px;
}

.fail-photo-upload label {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 6px;
}

.fail-photo-upload input[type="file"] {
    font-size: 12px;
    font-family: inherit;
}

.fail-photo-preview img {
    max-width: 200px;
    max-height: 120px;
    border-radius: 4px;
    margin-top: 6px;
    border: 1px solid #ddd;
}

/* 巡检详情 */
.fail-detail-row {
    background: #fef9f9;
    border-left: 3px solid #e74c3c;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.fail-detail-row .fail-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* ==================== 首页 ==================== */
.home-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.home-hero {
    text-align: center;
    padding: 48px 0 36px;
}

.home-hero-logo {
    margin-bottom: 16px;
}

.home-hero-logo-icon {
    display: inline-block;
    font-size: 80px;
    line-height: 1;
    color: #FFD700;
}

.home-hero-title {
    font-size: 32px;
    font-weight: 700;
    color: #1F3864;
    margin-bottom: 8px;
}

.home-hero-subtitle {
    font-size: 16px;
    color: #666;
}

.home-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 36px;
}

.home-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(31,56,100,0.15);
}

.home-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #fff;
}

.home-card-icon.gas-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.home-card-icon.inspection-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.home-card-icon.entry-icon {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.home-card-icon.fee-icon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}
.home-card-icon.contract-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}
.home-card-icon.shop-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.home-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1F3864;
    margin-bottom: 8px;
}

.home-card p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.home-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.home-stat-item {
    background: #fff;
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.home-stat-item.stat-clickable {
    cursor: pointer;
}

.home-stat-item.stat-clickable:hover {
    box-shadow: 0 4px 16px rgba(31,56,100,0.12);
    transform: translateY(-2px);
}

.home-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1F3864;
    margin-bottom: 6px;
}

.home-stat-label {
    font-size: 13px;
    color: #666;
}

.home-footer {
    text-align: center;
    padding: 16px 0 32px;
    color: #888;
    font-size: 12px;
}

/* ========== 合同到期提醒 ========== */
.home-expiry-section {
    margin: 0 32px 32px;
    padding: 20px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.home-expiry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.home-expiry-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}
.home-expiry-count {
    font-size: 13px;
    color: #e67e22;
    font-weight: 600;
}
.home-expiry-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.home-expiry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
}
.home-expiry-item.expiry-critical {
    background: #fde8e8;
    border-left: 4px solid #c0392b;
}
.home-expiry-item.expiry-warning {
    background: #fef3e2;
    border-left: 4px solid #e67e22;
}
.home-expiry-item.expiry-caution {
    background: #fefce8;
    border-left: 4px solid #d4a017;
}
.expiry-shop-name {
    font-weight: 600;
    color: #333;
}
.expiry-info {
    display: flex;
    gap: 16px;
    color: #666;
    font-size: 12px;
}
.expiry-days {
    font-weight: 600;
}
.expiry-critical .expiry-days { color: #c0392b; }
.expiry-warning .expiry-days { color: #e67e22; }
.expiry-caution .expiry-days { color: #d4a017; }
.home-expiry-safe {
    text-align: center;
    color: #27ae60;
}
.home-expiry-safe h3 {
    color: #27ae60;
    margin-bottom: 4px;
}
.home-expiry-safe p {
    color: #666;
    font-size: 13px;
}

/* ==================== 合同到期提醒独立页面 ==================== */
.contract-expiry-page .page-header {
    margin-bottom: 24px;
}
.expiry-stats {
    margin-bottom: 16px;
}
.expiry-stats-total {
    font-size: 14px;
    color: #e67e22;
    font-weight: 600;
}
.expiry-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    color: #666;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.legend-item i {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}
.legend-critical i { background: #c0392b; }
.legend-warning i { background: #e67e22; }
.legend-caution i { background: #d4a017; }

.expiry-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.expiry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
}
.expiry-item.expiry-critical {
    background: #fde8e8;
    border-left: 4px solid #c0392b;
}
.expiry-item.expiry-warning {
    background: #fef3e2;
    border-left: 4px solid #e67e22;
}
.expiry-item.expiry-caution {
    background: #fefce8;
    border-left: 4px solid #d4a017;
}
.expiry-item-shop {
    font-weight: 600;
    color: #333;
}
.expiry-item-info {
    display: flex;
    gap: 16px;
    color: #666;
    font-size: 12px;
}
.expiry-item-days {
    font-weight: 600;
}
.expiry-critical .expiry-item-days { color: #c0392b; }
.expiry-warning .expiry-item-days { color: #e67e22; }
.expiry-caution .expiry-item-days { color: #d4a017; }

/* renewed status */
.expiry-item.expiry-renewed {
    background: #e8f8ef;
    border-left: 4px solid #27ae60;
}
.expiry-renewed .expiry-item-days { color: #1e8449; }
.expiry-renewed-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #27ae60;
    vertical-align: middle;
}
.legend-item.legend-renewed i { background: #27ae60; }

.expiry-empty {
    text-align: center;
    padding: 40px 0;
}
.expiry-empty p {
    color: #27ae60;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

@media (max-width: 768px) {
    .home-cards {
        grid-template-columns: 1fr;
    }
    .home-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   商铺管理表格 - 表头冻结 + 左侧多列冻结
   注意：左侧冻结列的 left 偏移由 JS 动态计算
   ================================================ */

.shop-table-wrapper {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: auto;
}

/* 表头行冻结（垂直滚动时固定） */
.shop-table thead th {
    position: sticky;
    top: 0;
    z-index: 20 !important;
    background-color: #f5f7fa;
}

/* ==================== 首页煤气状态卡片 ==================== */
.home-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F3864;
    margin: 24px 0 14px 0;
    padding-left: 4px;
}

.gas-shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.gas-shop-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 20px 18px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-top: 4px solid #ccc;
}

.gas-shop-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.gas-shop-card.reported {
    border-top-color: #28a745;
}

.gas-shop-card.unreported {
    border-top-color: #dc3545;
}

.gas-shop-card .gas-shop-name {
    font-size: 15px;
    font-weight: 700;
    color: #1F3864;
    margin-bottom: 6px;
}

.gas-shop-card .gas-shop-location {
    font-size: 12px;
    color: #999;
    margin-bottom: 14px;
}

.gas-shop-card .gas-shop-status {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.gas-shop-card.reported .gas-shop-status {
    background: #28a745;
}

.gas-shop-card.unreported .gas-shop-status {
    background: #dc3545;
}

/* 响应式：小屏转两列 */
@media (max-width: 768px) {
    .gas-shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 数据看板 ==================== */
.dashboard-page { }
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.dash-kpi {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 18px 20px;
    border-left: 4px solid #1F3864;
}
.dash-kpi.accent-warn { border-left-color: #f39c12; }
.dash-kpi-label { font-size: 13px; color: #666; margin-bottom: 8px; }
.dash-kpi-value { font-size: 28px; font-weight: 700; color: #1F3864; line-height: 1.2; }
.dash-kpi.accent-warn .dash-kpi-value { color: #e67e22; }
.dash-kpi-value span { font-size: 13px; font-weight: 400; color: #666; margin-left: 4px; }
.dash-kpi-sub { font-size: 12px; color: #888; margin-top: 6px; }
.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    min-width: 0;}
.dash-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 16px 18px;
    min-width: 0;}
.dash-card-title { font-size: 15px; font-weight: 600; color: #1F3864; margin-bottom: 4px; }
.dash-card-note { font-size: 12px; color: #888; margin-bottom: 10px; }
.dash-chart-wrap { position: relative; height: 280px; }
.dash-chart-error { font-size: 12px; color: #e74c3c; margin-top: 6px; }

/* ==================== Ping Xiao (efficiency) dashboard ==================== */
.eff-sort-btns { display: flex; gap: 6px; }
.eff-sort-btn {
    padding: 5px 14px;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #555;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all .15s;
}
.eff-sort-btn:hover { border-color: #1F3864; color: #1F3864; }
.eff-sort-btn.active { background: #1F3864; color: #fff; border-color: #1F3864; }
.eff-biz-filter {
    padding: 5px 12px;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #333;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    outline: none;
    transition: all .15s;
}
.eff-biz-filter:hover, .eff-biz-filter:focus { border-color: #1F3864; }
@media (max-width: 900px) {
    .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .dash-kpi-grid { grid-template-columns: 1fr; }
}

/* 设施费总览 - 多选筛选复选组（费用类型 / 收款状态） */
.form-group .fo-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px 16px;
    padding: 10px 12px;
    background: #f6f8fb;
    border: 1px solid #e3e8f0;
    border-radius: 6px;
}
.form-group .fo-check-grid label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 3px 4px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
}
.form-group .fo-check-grid input[type="checkbox"] {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    margin: 0;
}


/* ==================== ɸѡ���ؼ�ͳһ���루Ӧ�շ������� / ���ý��ɹ����� ==================== */
.form-row .form-group { margin-bottom: 0; }
.form-row .form-group input,
.form-row .form-group select,
.form-row .form-group .ms-wrap { box-sizing: border-box; }
.form-row .form-group .ms-wrap { width: 100%; }
.form-row .form-group input[type="month"] { width: 170px; min-width: 170px; }
.form-row .form-group .btn { height: 38px; box-sizing: border-box; }
/* �������ڶ�ѡ��ť�����̹���ɸѡ�ȣ����ֽ��� */
.toolbar .ms-btn { height: 30px; line-height: 28px; padding: 0 26px 0 10px; min-width: 90px; }


/* ==================== 租金计算器（rent-calc-page）专属样式 ==================== */
.rent-calc-page .card-title {
    color: #1F3864;
}
/* 收费类型：限制宽度，避免整行拉宽 */
.rent-calc-page #rc-billing-type {
    max-width: 360px;
}
/* 面积 / 起止日期 / 单价 参数区：3 列栅格，标签与输入框对齐 */
.rent-calc-page #rc-area-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 16px;
    align-items: stretch;
}
.rent-calc-page #rc-area-fields .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    min-width: 0;
}
.rent-calc-page #rc-area-fields .form-group input {
    margin-top: auto;
    box-sizing: border-box;
    width: 100%;
}
/* 固定年类型：单字段限宽 */
.rent-calc-page #rc-annual-fields .form-group {
    max-width: 360px;
}
/* 外摆区勾选行：底色边框区分，与其它区块视觉一致 */
.rent-calc-page #rc-outdoor-wrap {
    margin-top: 4px;
}
.rent-calc-page #rc-outdoor-wrap .form-group {
    display: flex;
    align-items: center;
    background: #f6f8fb;
    border: 1px solid #e3e8f0;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0;
}
.rent-calc-page #rc-outdoor-wrap label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}
.rent-calc-page #rc-outdoor-wrap input[type="checkbox"] {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}
/* 外摆区字段区：与勾选行一体、底色边框、3 列栅格；显隐切换时自身不跳动错位 */
.rent-calc-page #rc-outdoor-fields {
    margin-top: 8px;
    padding: 12px 16px;
    background: #f6f8fb;
    border: 1px solid #e3e8f0;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 16px;
}
.rent-calc-page #rc-outdoor-fields .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    min-width: 0;
}
.rent-calc-page #rc-outdoor-fields .form-group input {
    margin-top: auto;
    box-sizing: border-box;
    width: 100%;
}
/* 结果表格：列右对齐、总额行底色区分 */
.rent-calc-page .rc-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #1F3864;
    margin-bottom: 8px;
}
.rent-calc-page .rc-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.rent-calc-page .rc-result-table th,
.rent-calc-page .rc-result-table td {
    padding: 9px 12px;
    border: 1px solid #e3e8f0;
    text-align: left;
    vertical-align: middle;
}
.rent-calc-page .rc-result-table thead th {
    background: #f4f6f8;
    font-weight: 600;
    color: #1F3864;
    white-space: nowrap;
}
.rent-calc-page .rc-result-table .rc-cell {
    text-align: right;
}
.rent-calc-page .rc-total-row {
    background: #eef7ee;
    font-weight: 600;
}
.rent-calc-page .rc-total-row td {
    color: #1a7f37;
}
/* 金额汇总表转置版（2026-08-22）：维度标签列 + 合计列 */
.rent-calc-page .rc-result-table .rc-dim-label {
    white-space: nowrap;
    color: #1F3864;
    font-weight: 600;
    background: #f8fafc;
}
/* 维度分组隔断：每个维度一个 tbody，首行（维度·税前）上方加粗分隔线 */
.rent-calc-page .rc-result-table tbody {
    border-top: 2px solid #c9d3e2;
}
/* 非转置表（单价税项表等）首行前不加粗隔断；转置版金额汇总表每个维度组（含首个「月」）均需隔断 */
.rent-calc-page .rc-result-table:not(.rc-transposed-table) tbody:first-of-type {
    border-top: none;
}
.rent-calc-page .rc-result-table .rc-dim-head {
    background: #eef3fb;
    border-top: 2px solid #c9d3e2;
}
/* 金额汇总表（转置版）：全表统一左对齐（表头/维度/金额数字方向一致） */
.rent-calc-page .rc-result-table.rc-transposed-table .rc-cell,
.rent-calc-page .rc-result-table.rc-transposed-table .rc-total-cell,
.rent-calc-page .rc-result-table.rc-transposed-table thead th.rc-total-cell {
    text-align: left;
}
.rent-calc-page .rc-result-table.rc-transposed-table .rc-dim-label {
    background: #f8fafc;
    color: #1F3864;
}
.rent-calc-page .rc-result-table.rc-transposed-table .rc-dim-head {
    background: #eef3fb;
    color: #1F3864;
}
.rent-calc-page .rc-result-table.rc-transposed-table .rc-total-cell {
    color: #1a7f37;
}
.rent-calc-page .rc-result-table.rc-transposed-table thead th.rc-total-cell {
    background: #e3f0e3;
    color: #14532d;
}
.rent-calc-page .rc-result-table .rc-total-cell {
    text-align: right;
    background: #eef7ee;
    font-weight: 600;
    color: #1a7f37;
    white-space: nowrap;
}
.rent-calc-page .rc-result-table thead th.rc-total-cell {
    background: #e3f0e3;
    color: #14532d;
}
.rent-calc-page .rc-result-table tbody tr:hover .rc-cell,
.rent-calc-page .rc-result-table tbody tr:hover .rc-dim-label {
    background: #f6f9ff;
}
.rent-calc-page .rc-result-table tbody tr:hover .rc-total-cell {
    background: #e5f4e5;
}
.rent-calc-page .rc-result-table td[data-fee-col="outdoor"] {
    background: #f7faf5;
}
.rent-calc-page .rc-result-table th[data-fee-col="outdoor"] {
    background: #eef5ea;
}
.rent-calc-page .rc-contract-row {
    background: #eef4f7;
    font-weight: 600;
}
.rent-calc-page .rc-contract-row td {
    color: #1F3864;
}
.rent-calc-page .rc-result-table #rc-note {
    color: #777;
    font-size: 12px;
    background: #fafbfc;
}
/* ============ 分期支付区块美化（rent-calc-page 作用域） ============ */
/* 各期输入区容器：栅格自动换行，每行 4 项左右，期数 6~12 自动折行不挤压 */
.rent-calc-page .rc-inst-splits {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px 18px;
    margin-top: 12px;
    padding: 14px 16px;
    background: #fafbfc;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
}
/* 单个分期项：标签在上、输入框在下，纵向统一对齐 */
.rent-calc-page .rc-inst-split-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 6px;
}
.rent-calc-page .rc-inst-split-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-align: center;
}
.rent-calc-page .rc-inst-split-val {
    width: 100%;
    box-sizing: border-box;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #d4d9e2;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    color: #1F3864;
    background: #fff;
}
.rent-calc-page .rc-inst-split-val:hover {
    border-color: #b9c2d3;
}
.rent-calc-page .rc-inst-split-val:focus {
    border-color: #1F3864;
    outline: none;
    box-shadow: 0 0 0 2px rgba(31, 56, 100, 0.12);
}
/* 分期明细表：列间距、表头、合计行、校验提示排版 */
#rc-inst-table-wrap { overflow-x: auto; min-width: 0; }
.rent-calc-page .rc-inst-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
    background: #fff;
}
.rent-calc-page .rc-inst-table th,
.rent-calc-page .rc-inst-table td {
    padding: 8px 14px;
    text-align: center;
    border: 1px solid #e5e9f0;
    vertical-align: middle;
}
.rent-calc-page .rc-inst-table thead th {
    background: #f3f6fb;
    font-weight: 600;
    color: #1F3864;
    white-space: nowrap;
}
.rent-calc-page .rc-inst-table .rc-inst-sub {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #667085;
    margin-top: 2px;
    white-space: nowrap;
}
.rent-calc-page .rc-inst-table tbody tr:hover {
    background: #f8fafd;
}
.rent-calc-page .rc-inst-table .rc-inst-fee,
.rent-calc-page .rc-inst-table .rc-inst-total {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #444;
}
.rent-calc-page .rc-inst-table tr.rc-inst-sum {
    background: #eef7ee;
    font-weight: 600;
}
.rent-calc-page .rc-inst-table tr.rc-inst-sum td {
    color: #1a7f37;
}
.rent-calc-page .rc-inst-check {
    display: block;
    margin-top: 8px;
    font-size: 12px;
}
.rent-calc-page .rc-inst-check.ok {
    color: #1a7f37;
}
.rent-calc-page .rc-inst-check.warn {
    color: #b26a00;
    background: #fdf6ec;
    border: 1px solid #f0e2c8;
    border-radius: 4px;
    padding: 6px 10px;
}

