/* ============================================
   7xMetal Base Mobile Styles — 所有页面共享的移动端覆盖
   通过 <link media="(max-width: 768px)"> 加载
   仅在移动设备上生效
   ============================================ */

/* ========================================
   iPhone SE (320px) 变量覆盖
   ======================================== */
@media screen and (max-width: 375px) {
    :root {
        --mobile-header-height: 36px;
        --mobile-control-height: 32px;
        --mobile-padding: 6px;
        --mobile-margin: 6px;
        --mobile-gap: 4px;
        --mobile-font-xs: 9px;
        --mobile-font-sm: 11px;
        --mobile-font-base: 13px;
        --mobile-font-lg: 15px;
        --mobile-font-xl: 16px;
    }
}

/* ========================================
   移动端基础布局 (≤768px)
   ======================================== */
@media screen and (max-width: 768px) {
    html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        overflow-x: hidden;
        overflow-y: auto; /* 确保所有页面移动端可垂直滚动 */
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
        -webkit-overflow-scrolling: touch; /* iOS 惯性滚动 */
    }

    body {
        font-size: var(--mobile-font-base);
        line-height: 1.4;
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }

    .app-container {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        padding: 0;
    }

    .app-main {
        width: 100%;
        flex: 1;
        padding: var(--mobile-padding);
        padding-top: calc(var(--mobile-header-height) + var(--mobile-space-sm));
        padding-bottom: var(--mobile-space-lg);
        display: flex;
        flex-direction: column;
        gap: var(--mobile-space-md);
        box-sizing: border-box;
    }

    /* iOS Safari 输入缩放防护：select 字号 12px < 16px 会触发自动缩放
       用 max-height + 视觉字号控制，input 触发键盘时也会缩放（iOS 16+ 已修复） */
}

/* ========================================
   导航栏移动端样式
   ======================================== */
@media screen and (max-width: 768px) {
    .app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: calc(36px + env(safe-area-inset-top, 0px));
        z-index: 1000;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        padding-top: env(safe-area-inset-top, 0px);
        box-sizing: border-box;
    }

    .app-main {
        padding-top: calc(36px + env(safe-area-inset-top, 0px) + var(--mobile-space-sm)) !important;
    }

    .header-content {
        height: 100%;
        padding: 2px 4px;
        gap: 4px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .header-left {
        flex: 0 0 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .app-title {
        font-size: 10px;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 70px;
        margin: 0;
    }

    .back-link {
        font-size: 9px;
        color: var(--text-secondary);
        text-decoration: none;
        padding: 1px 3px;
        border-radius: 3px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .back-link:hover,
    .back-link:active {
        color: var(--accent-color, #2196f3);
        background: rgba(33, 150, 243, 0.15);
    }

    .header-left .brand-tagline {
        display: none;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 1px;
        flex: 1 1 auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .header-right::-webkit-scrollbar {
        display: none;
    }
    /* 移动端沿用整条头部横向滑动，还原导航直接参与 flex 布局 */
    .nav-scroll {
        display: contents;
    }

    .nav-link,
    .back-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        font-size: 8px;
        padding: 2px 4px;
        min-width: 20px;
        min-height: 22px;
        background: var(--bg-tertiary);
        border-radius: 3px;
        text-decoration: none;
        color: var(--text-secondary);
        white-space: nowrap;
        flex-shrink: 0;
        border: 1px solid var(--border-color);
        transition: all 0.2s ease;
        line-height: 1;
    }
    .nav-link:hover,
    .nav-link:active,
    .nav-link.active,
    .back-btn:hover,
    .back-btn:active {
        background: var(--accent-light, #e6f2ff);
        color: var(--text-primary);
        border-color: var(--accent-color, #2196f3);
    }

    .nav-link[data-mobile] {
        font-size: 0;
    }
    .nav-link[data-mobile]::after {
        content: attr(data-mobile);
        font-size: 8px;
    }
    /* 登录链接在移动端只显示 data-mobile 短标签，避免文字重复 */
    .nav-link[data-mobile].user-login-link {
        font-size: 0 !important;
    }

    .theme-toggle,
    .language-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 1px;
        font-size: 10px;
        padding: 2px 4px;
        min-width: 20px;
        min-height: 22px;
        background: var(--bg-tertiary);
        border-radius: 3px;
        border: 1px solid var(--border-color);
        cursor: pointer;
        flex-shrink: 0;
        color: var(--text-secondary);
    }
    .language-toggle span#language-text,
    .theme-toggle span#theme-text {
        display: none;
    }
    .language-toggle span#language-flag,
    .theme-toggle span#theme-icon {
        font-size: 12px;
    }
    .theme-toggle:hover,
    .language-toggle:hover {
        background: var(--accent-light, #e6f2ff);
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: var(--mobile-control-height);
        height: var(--mobile-control-height);
        font-size: var(--mobile-font-lg);
        color: var(--text-primary);
        background: transparent;
        border: none;
        cursor: pointer;
    }

    /* 主题切换文字隐藏 */
    .theme-toggle .theme-label {
        display: none;
    }
    .theme-toggle {
        padding: 3px 5px;
        min-width: 28px;
        justify-content: center;
    }
    .theme-toggle #theme-icon {
        font-size: 14px;
    }
}

/* ========================================
   控制面板移动端样式
   ======================================== */
@media screen and (max-width: 768px) {
    .control-panel,
    .controls-panel,
    .holding-controls,
    .seat-controls,
    .kline-controls,
    .term-structure-controls {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 4px;
        margin-bottom: 4px;
        background: var(--bg-secondary);
        border-radius: 4px;
        box-sizing: border-box;
    }

    .sparkline-controls {
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 4px;
        padding: 2px 4px;
        margin-bottom: 4px;
        background: var(--bg-secondary);
        border-radius: 4px;
        box-sizing: border-box;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sparkline-controls::-webkit-scrollbar {
        display: none;
    }

    .panel-header {
        padding: 2px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .panel-title {
        font-size: 10px;
        font-weight: 600;
        color: var(--text-secondary);
        margin: 0;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .panel-body {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 1px 2px !important;
    }

    .controls-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        width: 100%;
        padding: 2px 0;
        box-sizing: border-box;
    }
    .controls-row::-webkit-scrollbar {
        display: none;
    }

    .control-item {
        flex: 0 0 auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
    }

    .control-label {
        display: none;
    }

    /* ========================================
       移动端控件统一规范 (v20260713c)
       与 PC 端 lme-pc.css .lme-select-bar select 保持视觉一致
       标准：高度 20px / 字号 11px / 圆角 3px
       ======================================== */
    .control-input,
    input[type="text"],
    input[type="date"],
    input[type="number"],
    select {
        flex: 0 0 auto;
        height: 20px !important;
        min-height: 20px !important;
        line-height: 1.1 !important;
        padding: 0 18px 0 4px !important;
        font-size: 11px !important;
        color: var(--text-primary) !important;
        background: var(--bg-primary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 3px !important;
        box-sizing: border-box !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='5' viewBox='0 0 10 10'%3E%3Cpath fill='%23888' d='M5 7L1 3h8z'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 2px center !important;
        cursor: pointer !important;
        min-width: 50px !important;
        max-width: none !important;
    }

    select:hover {
        border-color: var(--accent-color, #2196f3);
    }
    select:active {
        background-color: var(--bg-tertiary);
        border-color: var(--accent-color, #2196f3);
    }

    /* select 下拉选项显式样式，确保亮色主题下可见 */
    select option {
        background: var(--bg-primary, #f8fafc) !important;
        color: var(--text-primary, #0f172a) !important;
        padding: 4px 2px;
    }

    /* .control-select 继承统一 select 规范（line 354-410） */
    .control-select {
        flex: 0 0 auto;
        width: auto;
        min-width: 90px;
        max-width: 100%;
    }

    .control-input:focus,
    .control-select:focus,
    input:focus,
    select:focus {
        outline: none;
        border-color: var(--accent-color, #2196f3);
        box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
    }

    .date-input-wrapper {
        flex: 0 0 auto;
        width: auto;
    }
    .date-input-wrapper input {
        width: auto;
        min-width: 100px;
        max-width: 100%;
    }
    .date-nav-buttons {
        display: none;
    }

    /* 复选框行 */
    .checkbox-row {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        width: 100%;
        padding: 1px 0;
        margin: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .checkbox-row::-webkit-scrollbar {
        display: none;
    }

    .checkbox-item {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 4px;
        cursor: pointer;
        white-space: nowrap;
        margin: 0;
        padding: 1px 3px;
        min-height: 20px;
    }

    .checkbox-input {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
        margin: 0;
    }

    .checkbox-label {
        font-size: 10px;
        color: var(--text-muted);
        white-space: nowrap;
        letter-spacing: -0.02em;
        line-height: 11px;
        margin: 0;
    }

    /* 按钮 - 移动端统一规范 (20px 高度 / 11px 字号 / 3px 圆角) */
    .control-btn,
    .btn,
    button {
        height: 20px;
        min-height: 20px;
        padding: 0 6px;
        font-size: 11px;
        font-weight: 500;
        color: var(--text-primary);
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 3px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
        white-space: nowrap;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    .control-btn:hover,
    .btn:hover,
    button:hover {
        background: var(--bg-tertiary);
    }
    .control-btn.primary,
    .btn.primary,
    button.primary {
        color: white;
        background: var(--accent-color, #2196f3);
        border-color: var(--accent-color, #2196f3);
    }
}

/* ========================================
   图表容器移动端样式
   ======================================== */
@media screen and (max-width: 768px) {
    .chart-panel {
        display: flex !important;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        width: 100%;
        padding: 2px;
        margin: 0;
        background: transparent;
        border-radius: 0;
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
    }

    .chart-container-wrapper,
    .chart-wrapper {
        width: 100%;
        padding: 2px;
        margin: 0;
        background: transparent;
        border-radius: 0;
        box-sizing: border-box;
        flex: 1;
        position: relative;
        min-height: 0;
    }

    .tab-content {
        display: none !important;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    .tab-content.active {
        display: flex !important;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .chart-container {
        position: relative;
        height: 200px;
        padding: 0;
        margin: 0;
        min-height: 150px;
    }
    .chart-container canvas {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    #term-chart,
    #holding-chart,
    #kline-chart,
    #seat-chart,
    #sparkline-chart {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    .echarts-container,
    [id$="-chart"] {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    /* 热力图移动端 */
    .heatmap-container {
        height: calc(100vh - 140px) !important;
        height: calc(100dvh - 140px) !important;
        padding: 4px !important;
        flex-direction: column;
        gap: 4px;
        overflow: hidden;
    }
    .heatmap-container .section-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 4px;
        padding-bottom: 4px;
        margin-bottom: 2px;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }
    .heatmap-controls {
        display: flex;
        gap: 4px;
        flex-shrink: 0;
    }
    /* 继承统一控件规范 (20px / 11px) — 仅调整最小宽度适应 heatmap 紧凑布局 */
    .heatmap-controls .control-input,
    .heatmap-controls select {
        flex: 0 0 auto;
        min-width: 80px !important;
        max-width: 120px !important;
    }
    .heatmap-subtabs {
        display: flex;
        gap: 4px;
        padding: 2px 0;
        flex-shrink: 0;
        border-bottom: 1px solid var(--border-color);
    }
    .heatmap-subtab {
        flex: 1;
        height: 24px;
        line-height: 24px;
        padding: 0 6px;
        font-size: 8px;
        font-weight: 600;
        color: var(--text-muted);
        background: transparent;
        border: 1px solid var(--border-color);
        border-radius: 3px 3px 0 0;
        cursor: pointer;
        text-align: center;
        transition: all 0.2s;
    }
    .heatmap-subtab.active {
        color: var(--text-primary);
        background: var(--accent-light);
        border-bottom-color: var(--accent-color);
    }
    .heatmap-subcontent {
        display: none;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    .heatmap-subcontent.active {
        display: flex;
    }
    .comparison-chart-wrapper {
        padding: 2px;
        width: 100%;
        height: 100%;
    }
    #heatmap-comparison {
        width: 100% !important;
        height: 100% !important;
    }
    .heatmap-wrapper {
        padding: 2px;
        width: 100%;
        height: 100%;
    }
    #heatmap-long,
    #heatmap-short {
        width: 100% !important;
        height: 100% !important;
    }
    .heatmap-container .section-title {
        font-size: 10px !important;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
}

/* ========================================
   数据表格移动端样式
   ======================================== */
@media screen and (max-width: 768px) {
    .data-table-container,
    .table-container,
    .holding-table-container,
    .position-table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--bg-secondary);
        border-radius: 6px;
        padding: var(--mobile-space-xs);
        box-sizing: border-box;
    }

    .data-table,
    .holding-table,
    .position-table,
    table {
        width: 100%;
        table-layout: fixed;
        font-size: var(--mobile-font-xs);
        border-collapse: collapse;
    }

    .data-table th,
    .data-table td,
    table th,
    table td {
        padding: 2px 3px;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-all;
    }

    .term-structure-table {
        min-width: 0 !important;
        table-layout: fixed !important;
    }
    .term-structure-table th,
    .term-structure-table td {
        white-space: normal !important;
        min-width: 0 !important;
        padding: 0 !important;
    }

    .data-table th {
        font-size: var(--mobile-font-xs);
        font-weight: 600;
        color: var(--text-secondary);
        background: var(--bg-primary);
        position: sticky;
        top: 0;
    }
    .data-table td {
        font-size: var(--mobile-font-xs);
        color: var(--text-primary);
    }

    .watermark {
        font-size: var(--mobile-font-xs);
        color: var(--text-secondary);
        opacity: 0.5;
        text-align: right;
        padding: var(--mobile-space-xs);
    }
}

/* ========================================
   加载状态移动端样式
   ======================================== */
@media screen and (max-width: 768px) {
    .loading-overlay,
    .loading,
    .spinner {
        display: none !important;
    }
}

/* ========================================
   工具提示移动端样式
   ======================================== */
@media screen and (max-width: 768px) {
    .tooltip,
    .echarts-tooltip,
    .custom-tooltip {
        position: fixed;
        max-width: 280px;
        padding: var(--mobile-space-sm);
        font-size: var(--mobile-font-xs);
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 6px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
        z-index: 9999 !important;
        pointer-events: none;
    }
    .tooltip-title {
        font-size: var(--mobile-font-sm);
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: var(--mobile-space-xs);
    }
    .tooltip-content {
        color: var(--text-secondary);
        line-height: 1.5;
    }
}

/* ========================================
   全屏模式移动端样式
   ======================================== */
@media screen and (max-width: 768px) {
    .fullscreen-mode,
    .fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 9999;
        background: var(--bg-primary);
        padding: 0 !important;
    }
    .fullscreen-mode .app-header,
    .fullscreen .app-header {
        display: none;
    }
    .fullscreen-mode .app-main,
    .fullscreen .app-main {
        padding-top: var(--mobile-space-xs);
    }
    .exit-fullscreen-btn {
        position: fixed;
        top: var(--mobile-space-sm);
        right: var(--mobile-space-sm);
        width: 36px;
        height: 36px;
        font-size: var(--mobile-font-lg);
        background: rgba(0, 0, 0, 0.7);
        border: none;
        border-radius: 50%;
        color: white;
        cursor: pointer;
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ========================================
   平板横屏 (769-1024px)
   ======================================== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    :root {
        --mobile-header-height: 48px;
        --mobile-control-height: 40px;
        --mobile-padding: 12px;
        --mobile-font-base: 15px;
    }
    .control-item {
        flex: 1 1 calc(33.333% - var(--mobile-space-sm));
        min-width: calc(33.333% - var(--mobile-space-sm));
    }
}

/* ========================================
   暗色主题移动端适配
   ======================================== */
@media screen and (max-width: 768px) {
    [data-theme="dark"],
    .dark-theme {
        --bg-primary: #0a0e1a;
        --bg-secondary: #111827;
        --bg-tertiary: #1f2937;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        --border-color: #374151;
        --accent-color: #3b82f6;
    }
    [data-theme="black"] {
        --bg-primary: #000000;
        --bg-secondary: #0a0a0a;
        --bg-tertiary: #141414;
        --text-primary: #ffffff;
        --text-secondary: #b3b3b3;
        --text-muted: #666666;
        --border-color: #2a2a2a;
        --accent-color: #3b82f6;
    }
    [data-theme="light"],
    .light-theme {
        --bg-primary: #ffffff;
        --bg-secondary: #f5f5f5;
        --bg-tertiary: #e5e7eb;
        --text-primary: #111827;
        --text-secondary: #4b5563;
        --text-muted: #9ca3af;
        --border-color: #e5e7eb;
        --accent-color: #2563eb;
    }
}

/* ========================================
   安全区域适配 (iPhone X+)
   ======================================== */
@supports (padding: max(0px)) {
    @media screen and (max-width: 768px) {
        .app-header {
            padding-top: max(0px, env(safe-area-inset-top));
        }
        .app-main {
            padding-bottom: max(var(--mobile-space-lg), env(safe-area-inset-bottom));
        }
    }
}

/* ========================================
   common.css 移动端覆盖
   ======================================== */
@media screen and (max-width: 768px) {
    .brand-tagline {
        display: none;
    }

    .holding-page .share-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        padding: 2px 4px;
        min-width: 28px;
        min-height: 24px;
        background: rgba(30, 136, 229, 0.2);
        border-radius: 3px;
        text-decoration: none;
        color: #1e88e5;
        white-space: nowrap;
        flex-shrink: 0;
        border: 1px solid rgba(30, 136, 229, 0.3);
        transition: all 0.2s ease;
    }
    .holding-page .share-btn:hover,
    .holding-page .share-btn:active {
        background: rgba(30, 136, 229, 0.35);
        color: #64b5f6;
        border-color: rgba(30, 136, 229, 0.5);
    }

    .holding-page .language-toggle {
        font-size: 10px;
        padding: 2px 4px;
        min-width: 24px;
        min-height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
    }
    .holding-page .language-toggle span#language-text {
        display: none;
    }

    .holding-page .theme-toggle {
        font-size: 10px;
        padding: 2px 4px;
        min-width: 24px;
        min-height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
    }
    .holding-page .theme-toggle span#theme-text {
        display: none;
    }

    /* iOS 微信 mobile 修复：flex-wrap: nowrap 在 iOS 微信 WebView 不可靠（横向滚动失效）
       改为 wrap 让 4 个 select 自动换行 */
    .holding-page .controls-row {
        display: flex;
        flex-wrap: wrap;
        overflow-x: visible;
        gap: 4px;
        padding: 2px 0;
        width: 100%;
        box-sizing: border-box;
    }
    .holding-page .controls-row::-webkit-scrollbar {
        display: none;
    }
    .holding-page .control-item {
        flex: 0 0 auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
    }
    /* iOS 微信 mobile 修复：让 .controls-row 直接子元素（select）在 wrap 时合理分配宽度 */
    .holding-page .controls-row > .control-select,
    .holding-page .controls-row > select {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    .holding-page .controls-row > .product-info-inline {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
    .holding-page .control-label {
        display: none;
    }
    /* 继承统一控件规范 (20px / 11px)，仅覆盖 max-width 让 holding 的 4 个 select 平分宽度 */
    .holding-page .control-input,
    .holding-page select {
        max-width: 100% !important;
    }
    .holding-page .control-select {
        max-width: 100% !important;
    }

    .holding-page .product-info-inline {
        margin-right: 0;
        padding-right: 0;
        border-right: none;
        justify-content: flex-start;
        padding-top: 2px;
        padding-bottom: 2px;
        border-top: none;
        border-bottom: none;
        flex-shrink: 0;
    }
    .holding-page .product-code {
        font-size: 10px;
        font-weight: 600;
    }
    .holding-page .product-date {
        font-size: 9px;
        color: var(--text-secondary);
    }

    .holding-page .panel-body {
        padding: 4px 8px;
    }
    .holding-page .control-panel {
        margin-bottom: 4px;
    }

    .tab-navigation {
        padding: 8px 12px;
        overflow-x: auto;
    }
    .tab-navigation .tab-btn,
    .tab-btn {
        padding: 4px 10px;
        font-size: 10px;
        white-space: nowrap;
    }
    /* 亮色主题下 active tab 可见性修复 */
    .tab-navigation .tab-btn.active {
        background: var(--bg-tertiary, #e2e8f0);
        color: var(--accent-color, #3b82f6);
        border: 1px solid var(--border-color, #e2e8f0);
        border-bottom: 2px solid var(--accent-color, #3b82f6);
    }

    .app-footer {
        font-size: 8px;
        padding: 6px 10px 8px;
        line-height: 1.6;
    }

    .holding-page select#date-select,
    .holding-page select#product-select,
    .holding-page select#contract-select {
        /* 继承统一规范，仅允许 wrap 时按 flex-basis 平分宽度 */
        max-width: 100%;
    }
}

/* ========================================
   用户菜单移动端覆盖
   ======================================== */
@media screen and (max-width: 768px) {
    .user-icon-btn {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }
    .user-avatar {
        font-size: 10px;
    }
    .user-dropdown {
        right: -4px;
        min-width: 160px;
    }
    .user-login-link {
        font-size: 8px !important;
        padding: 2px 6px !important;
        min-height: 22px;
    }
}

/* ========================================
   styles.css 响应式系统（多断点）
   ======================================== */

/* PC端优化 (≥992px) */
@media (min-width: 992px) {
    .controls-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        max-width: 900px;
    }
    .control-input {
        font-size: var(--text-base);
        padding: 8px 12px;
        min-height: 36px;
        max-width: none;
    }
    .control-label {
        font-size: var(--text-sm);
        margin-bottom: 4px;
    }
    .checkbox-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
    }
    .checkbox-input {
        width: 18px;
        height: 18px;
    }
    .checkbox-label {
        font-size: var(--text-base);
    }
    .checkbox-item {
        padding: 5px 6px;
        gap: 8px;
    }
    select.control-input {
        padding-right: 32px;
        background-position: right 10px center;
    }
    .panel-body {
        padding: var(--spacing-xl);
    }
}

/* 大屏幕PC (1920px+) */
@media (min-width: 1920px) {
    .app-main {
        max-width: 2400px;
    }
    .controls-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1000px;
    }
    .checkbox-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .chart-container {
        height: 600px;
    }
}

/* 中等屏幕PC (1200px - 1919px) */
@media (min-width: 1200px) and (max-width: 1919px) {
    .controls-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 950px;
    }
    .checkbox-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 小屏幕PC和大平板 (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .controls-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 850px;
    }
    .checkbox-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 平板横屏 (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .header-content {
        padding: 0 var(--spacing-md);
        height: 48px;
    }
    .app-title {
        font-size: var(--text-lg);
    }
    .app-main {
        padding: var(--spacing-md);
    }
    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .checkbox-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .chart-container {
        height: 450px;
    }
}

/* 平板竖屏 (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .header-content {
        padding: 0 var(--spacing-sm);
        height: 44px;
    }
    .app-title {
        font-size: var(--text-base);
    }
    .app-main {
        padding: var(--spacing-sm);
    }
    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-container {
        height: 400px;
    }
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
        padding: 2px var(--spacing-sm);
    }
    .status-items {
        flex-wrap: wrap;
        gap: 4px 10px;
    }
    .status-item {
        white-space: nowrap;
    }
}

/* 大手机 (480px - 575px) */
@media (min-width: 480px) and (max-width: 575px) {
    .header-content {
        padding: 0 var(--spacing-sm);
        height: 42px;
    }
    .app-title {
        font-size: var(--text-sm);
    }
    .app-main {
        padding: var(--spacing-xs);
    }
    .panel-body {
        padding: var(--spacing-sm);
    }
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    .chart-container {
        height: 350px;
        padding: var(--spacing-xs);
    }
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
        padding: 2px var(--spacing-sm);
        font-size: var(--text-xs);
    }
    .status-items {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 3px 8px;
        width: 100%;
    }
    .status-item {
        white-space: nowrap;
        gap: 2px;
    }
    .language-dropdown {
        min-width: 110px;
    }
}

/* 小手机 (320px - 479px) */
@media (max-width: 479px) {
    .header-content {
        padding: 0 var(--spacing-xs);
        height: 40px;
    }
    .app-title {
        font-size: var(--text-xs);
    }
    .app-main {
        padding: var(--spacing-xs);
    }
    .panel-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    .panel-title {
        font-size: var(--text-xs);
    }
    .panel-body {
        padding: var(--spacing-xs);
    }
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .control-item {
        gap: 2px;
    }
    .control-label {
        font-size: var(--text-xs);
    }
    .control-input {
        padding: 0 14px 0 3px;
        font-size: 10px;
        min-height: 20px;
    }
    .checkbox-grid {
        grid-template-columns: 1fr;
        gap: 3px;
    }
    .checkbox-item {
        padding: 2px;
    }
    .checkbox-label {
        font-size: var(--text-xs);
    }
    .chart-container {
        height: 300px;
        padding: var(--spacing-xs);
    }
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
        padding: 2px 3px;
        font-size: 0.6rem;
        line-height: 1.3;
    }
    .status-items {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2px 6px;
        width: 100%;
    }
    .status-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        gap: 1px;
    }
    .status-item span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .status-item strong {
        white-space: nowrap;
    }
    .status-indicator {
        width: 6px;
        height: 6px;
    }
    .language-toggle, .theme-toggle {
        padding: 2px 4px;
        font-size: var(--text-xs);
    }
    .language-dropdown {
        min-width: 100px;
    }
    .language-option {
        padding: 2px 4px;
        font-size: var(--text-xs);
    }
    .flag {
        font-size: var(--text-base);
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .checkbox-input {
        width: 16px;
        height: 16px;
    }
    .checkbox-item {
        padding: 4px;
    }
    .language-option {
        padding: 6px 10px;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .header-content {
        height: 36px;
    }
    .chart-container {
        height: calc(100vh - 200px);
        min-height: 250px;
    }
    .control-panel {
        margin-bottom: var(--spacing-sm);
    }
}

/* 打印样式 */
@media print {
    .header,
    .control-panel,
    .status-bar {
        display: none;
    }
    .chart-container {
        height: auto;
        page-break-inside: avoid;
    }
}
