/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    z-index: 9999;
    font-size: 14px;
    animation: toastFadeIn 0.3s ease;
}

.toast-error {
    background: #E53E38;
}

.toast-success {
    background: #22c55e;
}

.toast-info {
    background: #3b82f6;
}

mark{
    font-weight: bold;
    color:#E53E38;
    background: transparent;
}

/* 侧边栏折叠样式 transition: width 0.3s ease;*/
#sidebar {
    display: flex;
    flex-direction: column;
    height: 100% !important;
    overflow: hidden;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto !important;
    min-height: 0;
    padding: 8px 0;
}

.sidebar-collapsed {
    width: 64px !important;
}

.sidebar-collapsed .sidebar-link-text {
    display: none;
}

.sidebar-collapsed .sidebar-link i {
    margin-right: 0 !important;
}

.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 12px 0;
}

/* 折叠按钮图标旋转 */
#sidebar-toggle-icon {
    transition: transform 0.3s ease;
}

.sidebar-collapsed #sidebar-toggle-icon {
    transform: rotate(180deg);
}

#summary-section .table-hover tbody tr:not(.cursor-pointer):hover {
    cursor: default !important;
    background-color: transparent !important;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 深色主题 select 下拉选项 */
select option,
select optgroup {
    background-color: #2D3748 !important;
    color: #F7FAFC !important;
}

/* 确保下拉选项 hover 时也有深色背景 */
select option:hover,
select option:checked {
    background-color: #D4AF37 !important;
    color: #1A202C !important;
}

/* ===================== 个人资料下拉菜单 ===================== */
#profile-dropdown {
    min-width: 160px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#profile-dropdown a {
    cursor: pointer;
}

#profile-dropdown a:hover {
    background-color: rgba(212, 175, 55, 0.1);
}

#profile-arrow {
    transition: transform 0.25s ease;
}

#profile-arrow.rotate-180 {
    transform: rotate(180deg);
}

/* ===================== Flatpickr 深色主题适配 ===================== */

.flatpickr-calendar {
    background: #2D3748 !important;
    border: 1px solid rgba(160, 174, 192, 0.2) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
    font-family: inherit !important;
}

.flatpickr-calendar .flatpickr-months {
    background: #1A202C !important;
    border-radius: 8px 8px 0 0 !important;
}

.flatpickr-calendar .flatpickr-months .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-months .flatpickr-next-month {
    fill: #A0AEC0 !important;
}

.flatpickr-calendar .flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-calendar .flatpickr-months .flatpickr-next-month:hover {
    fill: #D4AF37 !important;
}

.flatpickr-calendar .flatpickr-month {
    color: #F7FAFC !important;
}

.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months {
    color: #F7FAFC !important;
    background: #1A202C !important;
}

.flatpickr-calendar .flatpickr-weekday {
    color: #A0AEC0 !important;
}

.flatpickr-calendar .flatpickr-day {
    color: #F7FAFC !important;
    border-color: transparent !important;
}

.flatpickr-calendar .flatpickr-day:hover {
    background: rgba(212, 175, 55, 0.2) !important;
    color: #F7FAFC !important;
}

.flatpickr-calendar .flatpickr-day.selected {
    background: #D4AF37 !important;
    color: #1A202C !important;
    border-color: #D4AF37 !important;
}

.flatpickr-calendar .flatpickr-day.inRange {
    background: rgba(212, 175, 55, 0.2) !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}

.flatpickr-calendar .flatpickr-day.startRange {
    background: #D4AF37 !important;
    color: #1A202C !important;
    border-color: #D4AF37 !important;
}

.flatpickr-calendar .flatpickr-day.endRange {
    background: #D4AF37 !important;
    color: #1A202C !important;
    border-color: #D4AF37 !important;
}

.flatpickr-calendar .flatpickr-day.selected.startRange,
.flatpickr-calendar .flatpickr-day.selected.endRange {
    background: #D4AF37 !important;
    color: #1A202C !important;
}

.flatpickr-calendar .flatpickr-day.flatpickr-disabled {
    color: #4A5568 !important;
}

.flatpickr-calendar .flatpickr-day.today {
    border-color: #D4AF37 !important;
}

.flatpickr-calendar .flatpickr-day.today:hover {
    background: rgba(212, 175, 55, 0.2) !important;
}

.flatpickr-calendar .flatpickr-day.prevMonthDay,
.flatpickr-calendar .flatpickr-day.nextMonthDay {
    color: #4A5568 !important;
}

.flatpickr-calendar .flatpickr-day.flatpickr-disabled:hover {
    background: transparent !important;
}

.flatpickr-calendar .flatpickr-time {
    border-top: 1px solid rgba(160, 174, 192, 0.2) !important;
}

.flatpickr-calendar .flatpickr-time input {
    color: #F7FAFC !important;
    background: #2D3748 !important;
}

.flatpickr-calendar .flatpickr-time .flatpickr-am-pm {
    color: #A0AEC0 !important;
}

/* 输入框样式适配 */
input.flatpickr-input {
    background: transparent !important;
    color: #F7FAFC !important;
    border: 1px solid rgba(160, 174, 192, 0.3) !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    width: 100% !important;
}

input.flatpickr-input:focus {
    outline: none !important;
    border-color: #D4AF37 !important;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2) !important;
}

input.flatpickr-input::placeholder {
    color: #A0AEC0 !important;
}

/* ========================================
   Summary + Quantitative 表格表头锁定
   ======================================== */

/* 给表格容器设置固定高度 + 滚动 
    overflow-y: auto;
*/
.table-container {
    overflow-x: auto;
    max-height: 90vh;
    overflow-y: auto;
}

/* 表头固定在顶部 */
.table-container thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #2D3748 !important;
    padding: 8px 12px !important;
    border-bottom: 2px solid rgba(160, 174, 192, 0.2);
}

/* ========================================
   移动端横屏适配（基于 b12b377）
   ======================================== */

/* 汉堡菜单按钮（默认隐藏） */
#hamburger-btn {
    display: none !important;
}

/* 移动端横屏适配 */
@media (max-width: 1024px) {
    /* 显示汉堡菜单 */
    #hamburger-btn {
        display: inline-flex !important;
    }

    /* 侧边栏默认收缩为 56px（覆盖 PC 端 sidebar-collapsed 的 64px） */
    #sidebar,
    #sidebar.sidebar-collapsed {
        width: 56px !important;
        min-width: 56px !important;
        transition: width 0.25s ease;
        overflow: hidden;
    }

    /* 隐藏侧边栏文字 */
    #sidebar .sidebar-link .sidebar-link-text {
        display: none !important;
    }
    #sidebar .sidebar-link {
        justify-content: center !important;
        padding: 12px 0 !important;
    }
    #sidebar .sidebar-link i {
        margin-right: 0 !important;
        font-size: 20px !important;
    }

    /* 侧边栏展开状态 */
    #sidebar.mobile-expanded {
        width: 200px !important;
        min-width: 200px !important;
    }
    #sidebar.mobile-expanded .sidebar-link .sidebar-link-text {
        display: inline !important;
    }
    #sidebar.mobile-expanded .sidebar-link {
        justify-content: flex-start !important;
        padding: 10px 16px !important;
    }
    #sidebar.mobile-expanded .sidebar-link i {
        margin-right: 12px !important;
        font-size: 18px !important;
    }

    /* 隐藏系统设置子菜单（移动端） */
    #system-submenu {
        display: none !important;
    }
    #system-arrow {
        display: none !important;
    }

    /* 主内容区全宽 */
    #main-body {
        height: 100vh !important;
        height: 100dvh !important;
    }

    /* 内容区占满 */
    #content-area {
        width: 100% !important;
        flex: 1 !important;
    }
}

/* 顶栏滑出动画 */
#top-nav {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 移动端顶栏隐藏（默认） */
@media (max-width: 1024px) {
    #top-nav {
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        height: auto !important;
        min-height: 56px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }

    /* 顶栏滑出状态 */
    #top-nav.mobile-visible {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* 移动端顶栏内元素紧凑 */
    #top-nav .h-16 {
        height: 48px !important;
        min-height: 48px !important;
    }
    #top-nav .text-xl {
        font-size: 16px !important;
    }
    #top-nav .h-8 {
        height: 28px !important;
    }
    #top-nav .space-x-4 {
        gap: 8px !important;
    }
}

/* ========================================
   Red Flag 移动端卡片布局
   ======================================== */

@media (max-width: 1024px) {
    /* 关闭表格横向滚动 */
    #red-flag-section .table-container {
        overflow-x: visible !important;
        border: none !important;
        background: transparent !important;
    }

    #red-flag-section .table-container table {
        min-width: unset !important;
        width: 100% !important;
    }

    /* 隐藏表头 */
    #red-flag-section .table-container table thead {
        display: none !important;
    }

    #red-flag-section .table-container table tbody {
        display: block !important;
    }

    /* 每行数据变为卡片 */
    #red-flag-section .table-container table tbody tr {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 2px 12px !important;
        background: #2D3748 !important;
        border-radius: 8px !important;
        padding: 10px 14px !important;
        margin-bottom: 10px !important;
        border: 1px solid rgba(160, 174, 192, 0.08) !important;
    }

    /* 每个单元格：左对齐 */
    #red-flag-section .table-container table tbody td {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: baseline !important;
        padding: 2px 0 !important;
        border: none !important;
        background: transparent !important;
        font-size: 12px !important;
        gap: 6px !important;
        max-width: 100% !important;
    }

    /* ===== 详情列特殊处理：用 block 防止内联标签被拆分 ===== */
    #red-flag-section .table-container table tbody td[data-label="詳情"] {
        display: block !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* 详情列的字段名单独显示一行 */
    #red-flag-section .table-container table tbody td[data-label="詳情"]::before {
        display: block !important;
        content: attr(data-label) "：" !important;
        font-weight: 600 !important;
        color: #D4AF37 !important;
        margin-bottom: 2px !important;
        font-size: 11px !important;
    }

    /* 字段名（金色） */
    #red-flag-section .table-container table tbody td::before {
        content: attr(data-label) "：" !important;
        font-weight: 600 !important;
        color: #D4AF37 !important;
        flex-shrink: 0 !important;
        font-size: 11px !important;
        min-width: 50px !important;
    }

    /* 食品詳情和詳情占满整行（分組列插入后，食品詳情=第8列，詳情=第9列） */
    #red-flag-section .table-container table tbody td:nth-child(8),
    #red-flag-section .table-container table tbody td:nth-child(9) {
        grid-column: 1 / -1 !important;
    }

    /* 分页样式 */
    #red-flag-section .pagination {
        background: #2D3748 !important;
        border-radius: 8px !important;
        padding: 8px 12px !important;
        font-size: 11px !important;
    }

    
}

@media (max-width: 768px) {
    #quant-body td:nth-child(2),
    #quant-table-header th:nth-child(2) {
        width: 40px !important;
        max-width: 40px !important;
        min-width: 40px !important;
        padding: 6px 4px;
        text-align: center;
    }

    #quant-body td:nth-child(n+1):not(:nth-child(2)),
    #quant-table-header th:nth-child(n+1):not(:nth-child(2)) {
        width: 60px !important;
        max-width: 60px !important;
        min-width: 60px !important;
        padding: 6px 4px;
        text-align: center;
    }
}


/* ===== PC 端强制不显示汉堡菜单 ===== */
@media (min-width: 1025px) {
    #hamburger-btn {
        display: none !important;
    }
    #top-nav {
        position: relative !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

}

/* ========================================
   Open-ended 移动端卡片布局（复用 Red Flag 样式）
   ======================================== */

@media (max-width: 1024px) {
    #open-ended-section .table-container {
        overflow-x: visible !important;
        border: none !important;
        background: transparent !important;
    }

    #open-ended-section .table-container table {
        min-width: unset !important;
        width: 100% !important;
    }

    #open-ended-section .table-container table thead {
        display: none !important;
    }

    #open-ended-section .table-container table tbody {
        display: block !important;
    }

    #open-ended-section .table-container table tbody tr {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 2px 12px !important;
        background: #2D3748 !important;
        border-radius: 8px !important;
        padding: 10px 14px !important;
        margin-bottom: 10px !important;
        border: 1px solid rgba(160, 174, 192, 0.08) !important;
    }

    #open-ended-section .table-container table tbody td {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: baseline !important;
        padding: 2px 0 !important;
        border: none !important;
        background: transparent !important;
        font-size: 12px !important;
        gap: 6px !important;
        max-width: 100% !important;
    }

    #open-ended-section .table-container table tbody td::before {
        content: attr(data-label) "：" !important;
        font-weight: 600 !important;
        color: #D4AF37 !important;
        flex-shrink: 0 !important;
        font-size: 11px !important;
        min-width: 50px !important;
    }

    /* 食品詳情和詳情占满整行 */
    #open-ended-section .table-container table tbody td:nth-child(7),
    #open-ended-section .table-container table tbody td:nth-child(8) {
        grid-column: 1 / -1 !important;
    }

    #open-ended-section .table-container table tbody td:nth-child(7)::before,
    #open-ended-section .table-container table tbody td:nth-child(8)::before {
        display: block !important;
        content: attr(data-label) "：" !important;
        font-weight: 600 !important;
        color: #D4AF37 !important;
        margin-bottom: 2px !important;
    }

    #open-ended-section .pagination {
        background: #2D3748 !important;
        border-radius: 8px !important;
        padding: 8px 12px !important;
        font-size: 11px !important;
    }
}

/* ===================== 封面V2 ===================== */
.cover-v2-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 36px;
    background: #2D3748;
    border-radius: 32px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(160, 174, 192, 0.15);
}

.cover-v2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(160, 174, 192, 0.2);
    padding-bottom: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.cover-v2-brand h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #F7FAFC;
    margin: 0;
}
.cover-v2-date {
    font-size: 14px;
    color: #A0AEC0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.cover-v2-period {
    text-align: right;
}
.cover-v2-date i {
    color: #D4AF37;
}

.cover-v2-update {
    font-size: 12px;
    color: #718096;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.cover-v2-update i {
    color: #A0AEC0;
    opacity: 0.7;
}

/* KPI 三卡 */
.cover-v2-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    /* 不加 align-items: start，恢复默认 stretch 让卡片等高 */
}
@media (max-width: 820px) {
    .cover-v2-kpi-grid { grid-template-columns: 1fr; }
}

.cover-v2-kpi-card {
    background: rgba(26, 32, 44, 0.6);
    border-radius: 20px;
    padding: 16px 20px;
    border: 1px solid rgba(160, 174, 192, 0.12);
    min-height: 150px;
    position: relative;
    display: flex;
    flex-direction: column;
}
.cover-v2-kpi-card-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 卡1 */
/* 卡1 内容较少，等高时让内容垂直居中，避免「上满下空」
   注意：用 :not(.hidden) 限制，避免 ID 选择器覆盖 Tailwind 的 .hidden{display:none} */
#cover-v2-overall-card .real-content:not(.hidden) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}
.kpi-label {
    font-size: 13px;
    color: #A0AEC0;
    letter-spacing: 0.3px;
    font-weight: 500;
}
.kpi-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}
.kpi-left {
    display: flex;
    flex-direction: column;
}
.kpi-score {
    font-size: 36px;
    font-weight: 700;
    color: #22c55e;
    line-height: 1.2;
}
.kpi-gap {
    font-size: 14px;
    margin-top: 8px;
}

/* 卡1 环形目标图：环形图在左，「目標 / ≥70」文字在右，水平并排 */
.kpi-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.ring-svg {
    width: 68px;
    height: 68px;
    transform: rotate(-90deg);
    flex-shrink: 0;
}
.ring-bg {
    fill: none;
    stroke: rgba(160, 174, 192, 0.18);
    stroke-width: 6;
}
.ring-progress {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    /* 注意：此处严禁声明 stroke-dasharray / stroke-dashoffset。
       SVG 中 CSS 声明优先于 presentation attribute，一旦在此声明，
       会覆盖 coverV2.js 里 setAttribute 设置的进度值，导致弧线永久不可见。
       初始「隐藏进度」由 index.html 上 circle 的 presentation attribute 提供，
       运行期由 JS 更新（r=16 → 周长 ≈ 100.53）。 */
    transition: stroke-dashoffset 0.6s ease, stroke 0.6s ease;
}
.ring-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ring-target-label {
    font-size: 12px;
    color: #718096;
    line-height: 1.2;
}
.ring-target-value {
    font-size: 14px;
    font-weight: 600;
    color: #F7FAFC;
    line-height: 1.3;
}

/* 卡2 */
.periods-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.periods-count {
    font-size: 15px;
    color: #F7FAFC;
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 4px;
}
.periods-icon {
    font-size: 18px;
    color: #D4AF37;
    opacity: 0.6;
}
.periods-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: 5px;
}
.periods-grid .p-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 10px 10px;
    text-align: center;
    border: 1px solid rgba(160, 174, 192, 0.05);
}
.periods-grid .p-label {
    font-size: 12px;
    color: #A0AEC0;
    line-height: 1.8;
}
.periods-grid .p-score {
    font-size: 15px;
    font-weight: 700;
    margin-top: 1px;
    line-height: 1.15;
}
.periods-grid .p-change {
    font-size: 10px;
    font-weight: 600;
    margin-top: 1px;
    line-height: 1.15;
    /* 关键：无背景、无边框、无内边距（纯文本 + 箭头） */
    background: none;
    border: none;
    padding: 0;
    /* 默认色：无 Gap 时只显示灰色的 "-" */
    color: #A0AEC0;
}

/* Gap 颜色（加在 .p-change 自身） */
.periods-grid .p-change.up { color: #22c55e; }
.periods-grid .p-change.down { color: #E53E38; }
.periods-grid .p-change.flat { color: #eab308; }

/* p-score 颜色 */
.periods-grid .p-score.high { color: #22c55e; }
.periods-grid .p-score.mid { color: #eab308; }
.periods-grid .p-score.low { color: #E53E38; }
.periods-grid .periods-empty {
    grid-column: 1 / -1;
    padding: 8px 0;
    font-size: 12px;
}

/* 卡3 */
/* 卡3 内容垂直居中（同卡1，:not(.hidden) 保护 Tailwind .hidden 的隐藏语义） */
#cover-v2-trend-card .real-content:not(.hidden) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}
.trend-stats-row {
    display: flex;
    gap: 20px;
    margin: 12px 0;
}
.trend-stat .num {
    font-size: 28px;
    font-weight: 700;
    margin-right: 4px;
}
.trend-stat .lbl {
    font-size: 14px;
    color: #A0AEC0;
}
.trend-detail-row {
    font-size: 13px;
    margin: 4px 0;
}
.trend-highest-lowest {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(160, 174, 192, 0.1);
    margin-top: 8px;
}
.trend-metric-item {
    font-size: 13px;
    color: #A0AEC0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 颜色 */
.up { color: #22c55e; }
.down { color: #E53E38; }
.flat { color: #eab308; }
.high { color: #22c55e; }
.mid { color: #eab308; }
.low { color: #E53E38; }

/* TOP3 卡片 */
.cover-v2-change-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
@media (max-width: 640px) {
    .cover-v2-change-grid { grid-template-columns: 1fr; }
}
.cover-v2-change-grid .change-box {
    background: rgba(26, 32, 44, 0.5);
    border-radius: 18px;
    padding: 18px 22px;
    border: 1px solid rgba(160, 174, 192, 0.08);
    min-height: 200px;
}
.change-title {
    font-size: 13px;
    font-weight: 600;
    color: #A0AEC0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.change-icon-up { color: #22c55e; }
.change-icon-down { color: #E53E38; }
.change-icon-flat { color: #eab308; }

.change-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(160, 174, 192, 0.06);
    font-size: 14px;
}
.change-item:last-child { border-bottom: none; }
.change-item .name { color: #F7FAFC; }
.change-item .right {
    display: flex;
    gap: 12px;
    align-items: center;
}
.change-item .current-value {
    font-weight: 700;
    font-size: 16px;
    min-width: 52px;
    text-align: right;
}
.change-item .change-value {
    font-weight: 600;
    font-size: 13px;
    min-width: 60px;
    text-align: right;
}

/* 区域排名表 */
.region-table-wrap {
    background: rgba(26, 32, 44, 0.5);
    border-radius: 18px;
    padding: 18px 22px;
    border: 1px solid rgba(160, 174, 192, 0.08);
    margin-bottom: 24px;
}
.region-table-title {
    font-size: 13px;
    font-weight: 600;
    color: #A0AEC0;
    margin-bottom: 14px;
}
.table-scroll {
    width: 100%;
    overflow-x: auto;
}
.region-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.region-table th {
    text-align: left;
    color: #718096;
    font-weight: 500;
    font-size: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(160, 174, 192, 0.08);
    white-space: nowrap;
}
.region-table td {
    padding: 10px 10px;
    border-bottom: 1px solid rgba(160, 174, 192, 0.05);
    white-space: nowrap;
}
.region-table .rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: rgba(160, 174, 192, 0.1);
    color: #A0AEC0;
}
.region-table .rank-1 { background: rgba(212, 175, 55, 0.25); color: #D4AF37; }
.region-table .rank-2 { background: rgba(160, 174, 192, 0.2); color: #A0AEC0; }
.region-table .rank-3 { background: rgba(205, 127, 50, 0.2); color: #CD7F32; }
.region-table .score-main {
    font-weight: 700;
    font-size: 16px;
}
.change-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
}
.change-badge.up { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.change-badge.down { color: #E53E38; background: rgba(229, 62, 56, 0.12); }
.change-badge.flat { color: #eab308; background: rgba(234, 179, 8, 0.12); }
.dim-tag-sm {
    display: inline-block;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(160, 174, 192, 0.1);
}
.dim-tag-sm.best { border-color: rgba(34, 197, 94, 0.3); color: #22c55e; }
.dim-tag-sm.worst { border-color: rgba(229, 62, 56, 0.3); color: #E53E38; }
.dim-tag-sm.flat { border-color: rgba(234, 179, 8, 0.3); color: #eab308; }

/* 底部统计 */
.cover-v2-footer-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding-top: 14px;
    border-top: 1px solid rgba(160, 174, 192, 0.08);
    font-size: 13px;
    color: #718096;
}
.cover-v2-footer-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cover-v2-footer-stats .num {
    font-size: 14px;
    font-weight: 700;
    color: #F7FAFC;
}
.cover-v2-footer-stats i { color: #D4AF37; }

/* ===================== 骨架屏 ===================== */
.skeleton-block {
    background: linear-gradient(
        90deg,
        rgba(160, 174, 192, 0.05) 0%,
        rgba(160, 174, 192, 0.15) 50%,
        rgba(160, 174, 192, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card1 { width: 100%; height: 140px; }
.skeleton-card2 { width: 100%; height: 160px; }
.skeleton-card3 { width: 100%; height: 180px; }
.skeleton-top { width: 100%; height: 160px; }
.skeleton-table { width: 100%; height: 200px; }

/* 移动端适配 */
@media (max-width: 700px) {
    .cover-v2-wrapper { padding: 20px 16px; }
    .periods-grid { grid-template-columns: repeat(2, 1fr); }
    .cover-v2-footer-stats { flex-direction: column; gap: 8px; }
    .region-table { font-size: 12px; }
    .region-table th, .region-table td { padding: 6px 4px; }
}

/* ===================== 加载失败重试按钮（封面V2） ===================== */
.retry-btn {
    background: rgba(212, 175, 55, 0.15);
    color: #D4AF37;
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.retry-btn:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.5);
}
.retry-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================== 封面V2 打印支持 ===================== */
@media print {
    /* 隐藏侧边栏、顶部导航、打印按钮、菜单 */
    #sidebar,
    #top-nav,
    #hamburger-btn,
    #print-btn,
    #profile-dropdown-container,
    .sidebar-menu {
        display: none !important;
    }

    /* 主内容区全宽 */
    #main-body,
    #content-area {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 封面V2 容器调整 */
    #cover-v2-section {
        padding: 0 !important;
    }

    .cover-v2-wrapper {
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 20px !important;
        background: #fff !important;
        color: #000 !important;
    }

    /* 深色文字转黑色 */
    .cover-v2-wrapper,
    .cover-v2-wrapper * {
        color: #000 !important;
        border-color: #ccc !important;
    }

    /* 卡片背景简化 */
    .cover-v2-kpi-card,
    .cover-v2-change-grid .change-box,
    .region-table-wrap {
        background: #f5f5f5 !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }

    /* 数值颜色保留（须在「文字转黑」之后，保持同等特异性下后者胜出） */
    .up, .high { color: #16a34a !important; }
    .down, .low { color: #dc2626 !important; }
    .flat, .mid { color: #ca8a04 !important; }

    /* 打印时隐藏骨架屏 */
    .skeleton-block {
        display: none !important;
    }

    /* 打印时隐藏重试按钮 */
    .retry-btn {
        display: none !important;
    }

    /* 页面尺寸 */
    @page {
        size: A4 landscape;
        margin: 10mm;
    }
}
