        :root {
            --primary: #c62828;
            --primary-light: #e53935;
            --danger: #b71c1c;
            --gray-light: #fafafa;
            --gray-border: #e0e0e0;
            --text-dark: #222;
            --text-gray: #666;
            --panel-width: 280px;
            --card-radius: 12px;
            --safe-bottom: env(safe-area-inset-bottom, 0px);
        }
        html,
        body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background: #fff;
            position: fixed;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeSpeed;
        }
        #main-container {
            display: flex;
            height: 100%;
            width: 100%;
            contain: layout style;
        }

        #filter-panel {
            width: var(--panel-width);
            flex-shrink: 0;
            background: #fff;
            border-right: 1px solid var(--gray-border);
            display: flex;
            flex-direction: column;
            height: 100%;
            box-sizing: border-box;
            transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
            z-index: 10;
            contain: layout style;
            will-change: transform;
        }
        #filter-panel.collapsed {
            width: 0 !important;
            overflow: hidden;
            opacity: 0;
            border-right: none;
            pointer-events: none;
        }
        .panel-header {
            padding: 16px;
            background: linear-gradient(135deg, #f35454, #99120e);
            color: #fff;
            text-align: center;
            flex-shrink: 0;
        }
        .panel-header a {
             text-decoration: none;
        }
        .panel-header h1 {
            color: white;
            margin: 0.2em auto;
        }
        .panel-body {
            flex: 1;
            overflow-y: auto;
            padding: 12px 16px;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
        }
        .panel-footer {
            font-size: 11px;
            text-align: center;
            color: #999;
            padding: 8px 16px;
            border-top: 1px solid #eee;
            background: #fafafa;
            flex-shrink: 0;
        }


    /* 免责声明主文字 */
    .disclaimer-text {
      margin: 0 0 0 0;
      font-size: 14px;
      font-weight: bold;
      color: #ff0000;
      letter-spacing: 0.3px;
    }

    /* 版权 & 备案区域 - 弹性布局 */
    .footer-meta {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      /*gap: 6px 12px;*/
      font-size: 0px;
      color: #94a3b8;
    }

    .copyright {
        margin: 0 auto;
      color: #94a3b8;
      font-size: 12px;
    }

    /* 备案链接 - 更小的字体 */
    .beian a {
      color: #94a3b8;
      text-decoration: none;
      margin-right: 10px;
      font-size: 9px;   /* 比版权字小一号 */
      transition: color 0.2s, text-decoration 0.2s;
    }
    .beian a:last-child {
      margin-right: 0;
    }
    .beian a:hover {
      color: #475569;
      text-decoration: underline;
    }

    /* ===== 移动端适配 ===== */
    @media (max-width: 640px) {
      .panel-footer {
        bottom: 16px;
        left: 16px;
        right: 16px;
        max-width: none;
        padding: 12px 16px;
        border-radius: 12px;
      }
      .disclaimer-text {
        font-size: 13px;
      }
      .footer-meta {
        font-size: 11px;
        gap: 4px 8px;
      }
      .copyright {
        font-size: 11px;
      }
      .beian a {
        font-size: 10px;
        margin-right: 6px;
      }
    }

        .card {
            background: #fef5f5;
            border-radius: 8px;
            margin-bottom: 12px;
            border: 1px solid #f9d6d6;
            contain: layout style;
        }
        .card-header {
            padding: 8px 12px;
            font-weight: 600;
            font-size: 13px;
            color: #b71c1c;
        }
        .card-body {
            padding: 8px 12px;
        }

        .board-options {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .board-btn {
            padding: 4px 5px;
            border: 1px solid #ccc;
            border-radius: 14px;
            font-size: 12px;
            background: #fff;
            cursor: pointer;
            user-select: none;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
            will-change: transform;
            -webkit-tap-highlight-color: transparent;
        }
        .board-btn:active {
            transform: scale(0.96);
        }
        .board-btn.active {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            color: #fff;
            border: none;
            border-radius: 20px;
            padding: 8px 16px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            transition: opacity 0.15s, transform 0.15s;
            will-change: transform;
            -webkit-tap-highlight-color: transparent;
        }
        .btn-primary:active {
            transform: scale(0.97);
            opacity: 0.85;
        }
        .btn-danger {
            background: var(--danger);
        }

        .search-box {
            position: relative;
            margin-bottom: 10px;
        }
        .search-box input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 20px;
            font-size: 13px;
            box-sizing: border-box;
            outline: none;
            transition: border-color 0.15s, box-shadow 0.15s;
            -webkit-appearance: none;
        }
        .search-box input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.15);
        }
        .search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            max-height: 200px;
            overflow-y: auto;
            z-index: 20;
            display: none;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            -webkit-overflow-scrolling: touch;
        }
        .search-results .item {
            padding: 6px 12px;
            cursor: pointer;
            font-size: 12px;
            border-bottom: 1px solid #eee;
            transition: background 0.1s;
            -webkit-tap-highlight-color: transparent;
        }
        .search-results .item:hover {
            background: #fef0f0;
        }
        .search-results .item .code {
            color: #888;
            font-size: 11px;
            margin-left: 8px;
        }

        .quick-stats {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--text-gray);
            margin-bottom: 10px;
        }
        .active-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-bottom: 8px;
        }
        .filter-tag {
            background: var(--primary-light);
            color: #fff;
            border-radius: 12px;
            padding: 2px 8px;
            font-size: 11px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            transition: opacity 0.15s;
            -webkit-tap-highlight-color: transparent;
        }
        .filter-tag:active {
            opacity: 0.7;
        }
        .filter-tag.clear-all {
            background: var(--danger);
        }

        .indicator-item {
            margin-bottom: 12px;
        }
        .indicator-header {
            font-size: 12px;
            margin-bottom: 4px;
            color: #b71c1c;
        }
        .range-slider {
            position: relative;
            height: 4px;
            background: #f0d0d0;
            border-radius: 2px;
        }
        .range-slider input[type=range] {
            position: absolute;
            width: 100%;
            top: -8px;
            left: 0;
            -webkit-appearance: none;
            height: 20px;
            background: transparent;
            pointer-events: none;
        }
        .range-slider input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 14px;
            height: 14px;
            background: var(--primary);
            border-radius: 50%;
            pointer-events: auto;
            cursor: pointer;
            position: relative;
            z-index: 2;
            transition: transform 0.1s;
            will-change: transform;
        }
        .range-slider input[type=range]::-webkit-slider-thumb:active {
            transform: scale(1.3);
        }
        .slider-track {
            position: absolute;
            height: 100%;
            background: var(--primary);
            border-radius: 2px;
            left: 0;
            right: 0;
            transition: left 0.05s, right 0.05s;
        }

        .time-row {
            display: flex;
            gap: 6px;
            align-items: center;
            flex-wrap: wrap;
            margin-top: 8px;
        }
        .time-row button {
            padding: 4px 8px;
            font-size: 11px;
            border: 1px solid #ccc;
            background: #fff;
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
            -webkit-tap-highlight-color: transparent;
        }
        .time-row button:active {
            transform: scale(0.95);
        }
        .time-row button.active {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
        }

        #chart-container {
            flex: 1;
            position: relative;
            background: #fdf6f6;
            min-width: 0;
            contain: layout style paint;
            will-change: contents;
        }
        #container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        .lock-indicator {
            position: absolute;
            top: 10px;
            left: 10px;
            z-index: 100;
            background: rgba(183, 28, 28, 0.9);
            color: #fff;
            border: none;
            border-radius: 6px;
            padding: 4px 12px;
            font-size: 11px;
            display: none;
            pointer-events: none;
        }
        #back-to-overview {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 100;
            background: rgba(183, 28, 28, 0.85);
            color: #fff;
            border: none;
            border-radius: 6px;
            padding: 6px 14px;
            font-size: 12px;
            cursor: pointer;
            display: none;
            transition: opacity 0.15s, transform 0.15s;
            -webkit-tap-highlight-color: transparent;
        }
        #back-to-overview:active {
            transform: scale(0.95);
            opacity: 0.8;
        }

        #alert-bubble {
            position: fixed;
            bottom: calc(20px + var(--safe-bottom));
            right: 20px;
            width: 300px;
            max-height: 400px;
            background: rgba(50, 5, 5, 0.7);
            color: #f0f0f0;
            border-radius: 14px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            font-size: 13px;
            backdrop-filter: blur(0px);
            -webkit-backdrop-filter: blur(0px);
            border: 1px solid rgba(255, 255, 255, 0.15);
            transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), height 0.25s, opacity 0.25s, border-radius 0.25s;
            will-change: width, height;
            contain: layout style;
        }
        #alert-bubble.collapsed {
            width: 42px;
            height: 42px;
            max-height: 42px;
            border-radius: 21px;
            opacity: 0.6;
        }
        #alert-bubble.collapsed #alert-bubble-header {
            justify-content: center;
            border-bottom: none;
        }
        #alert-bubble.collapsed #alert-bubble-header span {
            display: none;
        }
        #alert-bubble.collapsed #alert-collapse-btn {
            font-size: 20px;
            margin: 0;
        }
        #alert-bubble.collapsed #alert-list {
            display: none;
        }
        #alert-bubble-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.08);
            user-select: none;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        #alert-bubble-header span {
            font-weight: 700;
            font-size: 14px;
            color: #fff;
        }
        #alert-collapse-btn {
            background: none;
            border: none;
            color: #ccc;
            font-size: 18px;
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 4px;
            transition: transform 0.2s;
            -webkit-tap-highlight-color: transparent;
        }
        #alert-list {
            overflow-y: auto;
            flex: 1;
            padding: 6px 0;
            -webkit-overflow-scrolling: touch;
        }
        .alert-item {
            padding: 8px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12.5px;
            transition: background 0.1s;
            -webkit-tap-highlight-color: transparent;
        }
        .alert-item:hover {
            background: rgba(255, 255, 255, 0.15);
        }
        .alert-time {
            color: #aaa;
            font-size: 11px;
            margin-right: 10px;
            white-space: nowrap;
        }
        .alert-name {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-right: 10px;
            font-weight: 500;
        }
        .alert-desc {
            white-space: nowrap;
            font-weight: 700;
            font-size: 12px;
        }
        .alert-up { color: #ff5252; }
        .alert-down { color: #4cafaf; }
        .alert-vol { color: #ffb74d; }
        .alert-amount { color: #81c784; }
        .alert-turnover { color: #ba68c8; }

        #index-bubble {
            position: fixed;
            top: 20px;
            right: 20px;
            width: 260px;
            max-height: 320px;
            background: rgba(50, 5, 5, 0.7);
            color: #f0f0f0;
            border-radius: 14px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            font-size: 13px;
            backdrop-filter: blur(0px);
            -webkit-backdrop-filter: blur(0px);
            border: 1px solid rgba(255, 255, 255, 0.15);
            transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), height 0.25s, opacity 0.25s, border-radius 0.25s;
            will-change: width, height;
            contain: layout style;
        }
        #index-bubble.collapsed {
            width: 42px;
            height: 42px;
            max-height: 42px;
            border-radius: 21px;
            opacity: 0.6;
        }
        #index-bubble.collapsed #index-bubble-header {
            justify-content: center;
            border-bottom: none;
        }
        #index-bubble.collapsed #index-bubble-header span {
            display: none;
        }
        #index-bubble.collapsed #index-collapse-btn {
            font-size: 20px;
            margin: 0;
        }
        #index-bubble.collapsed #index-list {
            display: none;
        }
        #index-bubble-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.08);
            user-select: none;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        #index-bubble-header span {
            font-weight: 700;
            font-size: 14px;
            color: #fff;
        }
        #index-collapse-btn {
            background: none;
            border: none;
            color: #ccc;
            font-size: 18px;
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 4px;
            transition: transform 0.2s;
            -webkit-tap-highlight-color: transparent;
        }
        #index-list {
            overflow-y: auto;
            flex: 1;
            padding: 6px 0;
            -webkit-overflow-scrolling: touch;
        }
        .index-item {
            padding: 8px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12.5px;
        }
        .index-name { font-weight: 600; flex: 1; }
        .index-value { font-weight: 700; }
        .index-change { margin-left: 10px; font-size: 11px; }
        .index-up { color: #ff5252; }
        .index-down { color: #4cafaf; }

        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 10001;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(2px);
            -webkit-backdrop-filter: blur(2px);
        }
        .modal-content {
            background: #fff;
            border-radius: var(--card-radius);
            max-width: 680px;
            width: 90%;
            max-height: 85vh;
            overflow-y: auto;
            padding: 0;
            position: relative;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            -webkit-overflow-scrolling: touch;
        }

        .stock-detail-header {
            position: relative;
            padding: 20px 20px 15px;
            background: linear-gradient(135deg, #fff5f5 0%, #ffebeb 100%);
            border-radius: var(--card-radius) var(--card-radius) 0 0;
            display: flex;
            gap: 15px;
            align-items: center;
        }
        .stock-logo {
            width: 56px;
            height: 56px;
            border-radius: 12px;
            background: #fff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            object-fit: contain;
            padding: 4px;
        }
        .stock-title { flex: 1; }
        .stock-title h3 { margin: 0 0 5px; font-size: 18px; color: #111; }
        .stock-title .stock-code { font-size: 13px; color: #666; margin-bottom: 4px; }
        .stock-title .price-info { font-size: 13px; color: #333; }
        .stock-title .price-info span { margin-right: 15px; }
        .up { color: #ff5252; font-weight: 600; }
        .down { color: #4cafaf; font-weight: 600; }
        .stock-detail-body { padding: 15px 20px 20px; }
        .info-section { margin-bottom: 20px; }
        .info-section h4 {
            font-size: 14px;
            color: var(--primary);
            margin: 0 0 8px;
            padding-left: 10px;
            border-left: 3px solid var(--primary);
        }
        .info-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px 20px;
            font-size: 13px;
            color: #444;
            margin-bottom: 6px;
        }
        .info-label { font-weight: 500; color: #555; }
        .concept-list {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 8px;
        }
        .concept-tag {
            background: #ffebeb;
            color: var(--primary);
            border-radius: 4px;
            padding: 2px 8px;
            font-size: 11px;
            border: 1px solid #f9d6d6;
        }
        .theme-item { margin-bottom: 12px; }
        .theme-item .theme-title { font-weight: 600; color: #d32f2f; font-size: 13px; }
        .theme-item .theme-content { font-size: 12px; color: #555; margin-top: 2px; }
        .detail-link {
            display: inline-block;
            margin-top: 15px;
            padding: 8px 18px;
            background: var(--primary);
            color: #fff;
            border-radius: 6px;
            text-decoration: none;
            font-size: 13px;
            transition: opacity 0.15s;
        }
        .detail-link:hover { opacity: 0.85; }
        .chart-images {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 10px;
        }
        .chart-images img {
            width: 100%;
            height: auto;
            border-radius: 4px;
            border: 1px solid #eee;
            content-visibility: auto;
            contain: layout style paint;
        }

        .rank-tabs {
            display: flex;
            gap: 2px;
            margin-bottom: 8px;
            flex-wrap: wrap;
        }
        .rank-tab {
            padding: 4px 8px;
            font-size: 11px;
            border: 1px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
            background: #fff;
            transition: background 0.15s, color 0.15s;
            -webkit-tap-highlight-color: transparent;
        }
        .rank-tab:active { transform: scale(0.95); }
        .rank-tab.active {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
        }
        .rank-list {
            /*max-height: 200px;*/
            overflow-y: auto;
            font-size: 11px;
            -webkit-overflow-scrolling: touch;
        }
        .rank-item {
            padding: 4px 8px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            border-bottom: 1px solid #f0f0f0;
            transition: background 0.1s;
            -webkit-tap-highlight-color: transparent;
        }
        .rank-item:hover { background: #fef0f0; }
        .rank-code { color: #888; font-size: 10px; margin-left: 4px; }
        .alert-rule-item {
            display: flex;
            align-items: center;
            gap: 4px;
            margin-bottom: 4px;
            font-size: 11px;
        }
        .alert-rule-item input,
        .alert-rule-item select {
            padding: 2px 4px;
            font-size: 11px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        .alert-rule-item button {
            background: var(--danger);
            color: #fff;
            border: none;
            border-radius: 4px;
            padding: 2px 6px;
            cursor: pointer;
            font-size: 10px;
            transition: opacity 0.15s;
            -webkit-tap-highlight-color: transparent;
        }
        .alert-rule-item button:active { opacity: 0.7; }
        .flow-item {
            display: flex;
            justify-content: space-between;
            font-size: 11px;
            padding: 3px 0;
            cursor: pointer;
            transition: background 0.1s;
            -webkit-tap-highlight-color: transparent;
        }
        .flow-item:hover { background: #fef0f0; }
        .flow-item .flow-name { flex: 1; }
        .flow-item .flow-value { font-weight: 600; }

        @media (max-width: 768px) {
            #filter-panel {
                position: fixed;
                bottom: 0;
                left: 0;
                width: 100% !important;
                height: 70vh;
                border-radius: 20px 20px 0 0;
                transform: translateY(100%);
                transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                z-index: 1000;
                border-right: none;
                box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
            }
            #filter-panel:not(.collapsed) {
                transform: translateY(0);
            }
            #filter-panel.collapsed {
                transform: translateY(100%);
                width: 100% !important;
                opacity: 1;
                pointer-events: none;
            }
            .drag-fold-btn {
                bottom: 80px;
                top: auto;
                left: 50%;
                transform: translateX(-50%);
                border-radius: 24px;
            }
            #index-bubble { width: 200px; right: 5px; top: 5px; }
            #alert-bubble { width: 260px; right: 5px; bottom: 10px; }
        }
        .drag-fold-btn {
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 2000;
            background: var(--primary);
            color: #fff;
            border: none;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            cursor: pointer;
            font-size: 18px;
            transition: transform 0.15s, opacity 0.15s;
            will-change: transform;
            -webkit-tap-highlight-color: transparent;
        }
        .drag-fold-btn:active {
            transform: scale(0.9);
            opacity: 0.8;
        }
        .core-links {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }
        .core-link-btn {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 8px 0;
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            color: #fff;
            border-radius: 8px;
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
            transition: opacity 0.15s, transform 0.15s;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
            will-change: transform;
            flex: 0 0 calc(50% - 4px);
        }
        .core-link-btn:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }
        .core-link-btn:active { transform: scale(0.97); }
        .sync-reset-btn {
            background: linear-gradient(135deg, #4cafaf, #2e7d72);
            color: #fff;
            border: none;
            border-radius: 8px;
            padding: 8px 0;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            margin-bottom: 8px;
            font-size: 13px;
            transition: opacity 0.15s, transform 0.15s;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
            will-change: transform;
            -webkit-tap-highlight-color: transparent;
        }
        .sync-reset-btn:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }
        .sync-reset-btn:active { transform: scale(0.97); }

        @keyframes spin { to { transform: rotate(360deg); } }