/* static/css/style.css */

/* === Header === */
header {
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px;
    background: linear-gradient(90deg, #E3F2FD 0%, #BBDEFB 50%, #90CAF9 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Ensure logo text is readable */
.logo {
    font-family: "KaiTi", "SimSun", serif;
    color: #0D2A4A;
    font-size: 1.1em;
    font-weight: 600;
}

/* LiShu font for the second part of the slogan */
.lishu-text {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2em;
    font-weight: 400;
}

/* Disabled Register Button */
button.register:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Login Button (if different style needed) */
button.login { /* Reuse or define */ }
button.logout {
    background-color: #6c757d;
    color: white;
}
button.logout:hover { background-color: #5a6268; }

/* === Admin Panel === */
.admin-panel { padding: 10px 15px; margin-bottom: 10px; }
.admin-panel h3 { font-size: 1.2em; margin-bottom: 10px; }
.admin-controls { gap: 15px; }
.admin-control-group { padding: 10px; }
.admin-control-group p { margin-bottom: 8px; font-size: 0.95em; }
.admin-control-group .refresh-button { padding: 4px 8px; font-size: 0.8em; }
.admin-control-group .data-timestamp { font-size: 0.75em; margin-top: 4px; }

/* Login Modal Styles */
#login-modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); z-index: 1000; opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
#login-modal {
    display: none; position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95); background-color: #fff;
    padding: 25px 30px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001; width: 90%; max-width: 400px; opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
#login-modal-overlay.modal-active,
#login-modal.modal-active { display: block; opacity: 1; }
#login-modal.modal-active { transform: translate(-50%, -50%) scale(1); }

#login-modal-close {
    position: absolute; top: 10px; right: 15px; background: none; border: none;
    font-size: 1.8em; line-height: 1; color: #888; cursor: pointer; padding: 0;
}
#login-modal h3 {
    margin-top: 0; margin-bottom: 20px; color: #333; text-align: center;
    font-size: 1.3em; border-bottom: 1px solid #eee; padding-bottom: 10px;
}
#login-form label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; text-align: left;}
#login-form input[type="text"],
#login-form input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
#login-form button[type="submit"] {
    width: 100%;
    padding: 10px 15px;
    font-size: 1em;
}
#login-error {
    color: #dc3545;
    margin-top: 10px;
    text-align: center;
    font-size: 0.9em;
    min-height: 1.2em;
}

.auth-buttons button { padding: 5px 10px; font-size: 0.85em; }
.auth-buttons .register { background-color: #4a90e2; color: white; }
.auth-buttons .register:hover { background-color: #3a7bc8; }
.auth-buttons .login { background-color: #50e3c2; color: white; }
.auth-buttons .login:hover { background-color: #40c0a0; }

.refresh-button {
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
    background-color: #ffc107;
    color: #333;
    border: 1px solid #dda600;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}
.refresh-button:hover {
    background-color: #e0a800;
}
.refresh-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    border-color: #bbb;
}

/* === Gauges Section === */
.gauges {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 3px;
    margin-bottom: 0;
    text-align: center;
}
.gauge {
    flex: 1;
    min-width: 150px;
    max-width: 180px;
    margin: 0;
    margin-bottom: 0;
}

.chart-container {
    position: relative;
    height: 65px;
    width: 130px;
    margin: 0 auto 2px auto;
}
.chart-container canvas {
    display: block; width: 100%; height: 100%;
    position: relative;
    z-index: 2;
}

.meter-scale {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 3;
}
.meter-scale .tick {
    position: absolute; bottom: 0; left: 50%; width: 1px; height: 4px;
    background-color: #ccc; transform-origin: bottom center; margin-left: -0.5px; z-index: 4;
}
.meter-scale .label {
    position: absolute; font-size: 0.65em; color: #666; transform: translateX(-50%); z-index: 4;
}

.gauge-pointer {
    position: absolute;
    top: 25%;
    bottom: 50%;
    left: 50%;
    width: 2px;
    height: 50px;
    background-color: #1c1c1c;
    transform-origin: 50% 100%;
    transform: translateX(-1px);
    transition: transform 0.3s ease-in-out;
    z-index: 5;
}

.meter-scale .tick.tick-0,
.meter-scale .tick.tick-25,
.meter-scale .tick.tick-50,
.meter-scale .tick.tick-75,
.meter-scale .tick.tick-100 {
    height: 8px;
    background-color: #888;
}

.meter-scale .tick.tick-0   { transform: translateX(-0.5px) rotate(-85deg); }
.meter-scale .tick.tick-10  { transform: translateX(-0.5px) rotate(-68deg); }
.meter-scale .tick.tick-20  { transform: translateX(-0.5px) rotate(-51deg); }
.meter-scale .tick.tick-25  { transform: translateX(-0.5px) rotate(-42.5deg); }
.meter-scale .tick.tick-30  { transform: translateX(-0.5px) rotate(-34deg); }
.meter-scale .tick.tick-40  { transform: translateX(-0.5px) rotate(-17deg); }
.meter-scale .tick.tick-50  { transform: translateX(-0.5px) rotate(0deg); }
.meter-scale .tick.tick-60  { transform: translateX(-0.5px) rotate(17deg); }
.meter-scale .tick.tick-70  { transform: translateX(-0.5px) rotate(34deg); }
.meter-scale .tick.tick-75  { transform: translateX(-0.5px) rotate(42.5deg); }
.meter-scale .tick.tick-80  { transform: translateX(-0.5px) rotate(51deg); }
.meter-scale .tick.tick-90  { transform: translateX(-0.5px) rotate(68deg); }
.meter-scale .tick.tick-100 { transform: translateX(-0.5px) rotate(85deg); }

.meter-scale .label.label-0   { bottom: 2px; left: 10%; transform: translateX(-50%) rotate(5deg); }
.meter-scale .label.label-25  { bottom: 20px; left: 12%; transform: translateX(-50%) rotate(45deg); }
.meter-scale .label.label-50  { bottom: 52px; left: 50%; }
.meter-scale .label.label-75  { bottom: 20px; left: 88%; transform: translateX(-50%) rotate(-45deg); }
.meter-scale .label.label-100 { bottom: 2px; left: 90%; transform: translateX(-50%) rotate(-5deg); }

.gauge p {
    margin-top: 0px;
    font-size: 0.85em;
    font-weight: bold;
    line-height: 1;
}
.gauge-label { margin-right: 3px; }
.gauge-value { font-size: 1em; }

:root {
    --gauge-color-cold: #0d6efd;
    --gauge-color-cool: #198754;
    --gauge-color-warm: #FF7F50;
    --gauge-color-hot: #dc3545;
    --gauge-color-bg: #e9ecef;
    --gauge-color-border: #dee2e6;
}

/* === Section Titles === */
.section-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 10px;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-title a { font-size: 0.8em; color: #666; text-decoration: none; font-weight: normal; }
.section-title a:hover { text-decoration: underline; }

.section-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-controls a {
    font-size: 0.8em;
    color: #666;
    text-decoration: none;
    font-weight: normal;
}
.section-controls a:hover {
    text-decoration: underline;
}

/* === Calendar Section === */
.calendar-section {
    margin-top: 2px;
    border-top: 2px solid #0056b3;
    margin-bottom: 2px;
}
.section-title {
    font-size: 1.1em;
    margin-bottom: 4px;
    padding-bottom: 4px;
}
.calendar {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 130px;
    margin-bottom: 1px;
}
.calendar-day {
    flex: 1;
    flex-basis: 0;
    min-width: 200px;
    border: 1px solid #ddd;
    padding: 5px 12px;
    border-radius: 5px;
    background-color: #fdfdfd;
    font-size: 0.85em;
    min-height: 100px;
    max-height: 138px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-top: 0;
    margin-bottom: 5px;
}
.calendar-day::-webkit-scrollbar {
    width: 6px;
}
.calendar-day::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}
.calendar-day h4 { font-size: 0.95em; margin-top: 1px; margin-bottom: 8px; }
.calendar-day ul { list-style: none; padding-left: 0; margin: 0; margin-top: auto; flex-grow: 1; }
.calendar-day li { font-size: 0.9em; margin-bottom: 4px; }
.calendar-day li .tag { padding: 2px 5px; font-size: 0.8em; margin-right: 4px; }
.calendar-day.placeholder { justify-content: center; align-items: center; color: #999; background-color: #fafafa; }

/* === Tab Structure === */
.tab-container { margin-bottom: 5px; border-bottom: none; }

/* Moved from index.html: Tab Buttons */
.tab-buttons { 
    display: flex; 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}
.tab-button {
    padding: 6px 12px; 
    margin-right: 5px; 
    margin-bottom: 0;
    border: 1px solid #ccc; 
    border-bottom: none; 
    border-radius: 5px 5px 0 0;
    cursor: pointer; 
    background-color: #f8f9fa; 
    color: #495057;
    font-size: 0.9em;
}
.tab-button.active {
    background-color: #fff; 
    border-color: #ccc; 
    border-bottom-color: #fff;
    color: #0d6efd; 
    font-weight: bold;
}

/* Moved from index.html: Learn More Button */
.learn-more-btn {
    margin-left: 8px;
    padding: 2px 6px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    color: #333;
}

.tab-content { 
    display: none;  
    margin-bottom: 0; 
    padding: 1px 0px; 
    border-top: 0;
    width: 100%; 
    box-sizing: border-box;
}
.tab-content.active {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

/* LOF Learn More Button and Submenu */
#lof-learn-more {
    margin-left: 1px;
    padding: 2px 6px;
    background-color: #4a90e2;
    border: 1px solid #3a7bc8;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    color: white;
    display: inline-block;
    white-space: nowrap;
    width: 80px;
    text-align: center;
    box-sizing: border-box;
}
#lof-learn-more:hover {
    background-color: #3a7bc8;
}
#lof-submenu {
    display: none;
    position: absolute;
    width: 85px;
    min-width: 85px;
    right: 0;
    left: 0;
    top: 100%;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 1px 0;
    margin-top: 1px;
}
#lof-submenu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
#lof-submenu a {
    padding: 6px 15px;
    color: #333;
    text-decoration: none;
    font-size: 0.8em;
    transition: background-color 0.2s;
    display: block;
    align-items: center;
    text-align: center;
    font-weight: bold;
}
#lof-submenu a:hover {
    background-color: #f0f7ff;
    color: #0056b3;
}
#lof-submenu a:not(:last-child) {
    border-bottom: 1px solid #eee;
}

.all-tab-header { display: flex; margin-bottom: 10px; align-items: center; }
.all-description { text-align: center; font-size: 1em; font-weight: normal; color: #FF0033; flex-grow: 1; }

.data-timestamp {
    font-size: 0.8em;
    border-radius: 10px;
    display: inline-block;
    padding: 3px 8px;
    margin-right: 8px;
    background-color: #4a90e2;
    color: white;
    min-width: 40px;
    text-align: left;
    vertical-align: middle;
}

/* === ETF/REITs Sections within Tabs === */
.etf-section,
.qdii-section,
.lof-section,
.reits-section,
.cb-section,
.st-section {
    display: flex;
    flex-wrap: nowrap;
    border-top: 2px solid #0056b3;
    gap: 10px;
    margin-bottom: 5px;
    width: 100%;
    justify-content: center;
    overflow-x: hidden;
}

.etf-table-container {
    flex-basis: 32%;
    flex-grow: 0;
    flex-shrink: 0;
    min-width: 250px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    margin-right: 10px;
    max-height: 1500px; /* Limit table height for scrolling */
    overflow-y: auto;
}

.other-table-container {
    flex-basis: 49%;
    flex-grow: 0;
    flex-shrink: 0;
    min-width: 250px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    margin-right: 10px;
    max-height: 1500px; /* Limit table height for scrolling */
    overflow-y: auto;
}

.etf-table-container h4, .other-table-container h4 {
    text-align: center;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 1em;
    color: #333333;
    border-radius: 10px;
}

.etf-table,
.reits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    table-layout: auto;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 10px;
}

.etf-table th,
.lof-table th,
.qdii-table th,
.reits-table th,
.etf-table td,
.reits-table td {
    border-bottom: 1px solid #eee;
    border-left: 1px solid #eee;
    padding: 8px 8px; /* Increased padding for larger row height */
    text-align: center;
    vertical-align: middle;
}
.etf-table th:first-child,
.lof-table th:first-child,
.qdii-table th:first-child,
.reits-table th:first-child,
.etf-table td:first-child,
.reits-table td:first-child {
    border-left: none;
}

.etf-table thead,
.reits-table thead {
    background-color: #4a90e2;
    color: white;
    font-weight: 600;
    border-color: #4a90e2;
    border-bottom-width: 2px;
    position: sticky; /* Make header sticky */
    top: 0; /* Pin to top of container */
    z-index: 10; /* Ensure header stays above table body */
}

.etf-table thead th,
.reits-table thead th {
    background-color: #4a90e2;
    color: white;
    font-weight: 600;
    border-color: #4a90e2;
    border-bottom-width: 2px;
    position: relative; /* Ensure sortable arrows render correctly */
}

.etf-table tbody tr:nth-child(even),
.reits-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}
.etf-table tbody tr:hover,
.reits-table tbody tr:hover {
    background-color: #e9ecef;
}

/* Style for merged Code/Name column */
.etf-table td.code-name,
.reits-table td.code-name {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.etf-table td.code-name .code,
.reits-table td.code-name .code {
    font-weight: bold;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.etf-table td.code-name .name,
.reits-table td.code-name .name {
    font-size: 0.9em;
    color: #333;
}

/* 为可点击的转债代码/名称添加样式 */
.clickable-bond {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clickable-bond:hover {
    background-color: #e3f2fd !important;
    border-radius: 4px;
}

.clickable-bond .code,
.clickable-bond .name {
    color: #0066cc;
}

.clickable-bond:hover .code,
.clickable-bond:hover .name {
    text-decoration: underline;
}

.etf-table td:nth-child(3),
.reits-table td:nth-child(3) {
    text-align: right;
}
.etf-table td:nth-child(4),
.reits-table td:nth-child(5),
.reits-table td:nth-child(4),
.reits-table td:nth-child(5) {
    text-align: right;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}

.etf-table .positive,
.reits-table .positive { color: #dc3545; }
.etf-table .negative,
.reits-table .negative { color: #198754; }

.etf-table tbody td[colspan="4"],
.reits-table tbody td[colspan="4"],
.etf-table tbody td[colspan="5"],
.reits-table tbody td[colspan="5"],
.etf-table tbody td[colspan="7"],
.reits-table tbody td[colspan="7"] {
    height: 80px;
    text-align: center;
    color: #999;
    font-style: italic;
    background-color: #fff !important;
}

/* Moved from index.html: Table Sorting Styles */
th.sortable { 
    cursor: pointer; 
    position: relative; 
    padding-right: 20px; 
}
th.sortable:hover { 
    background-color: #3a7bc8;
}
th.sortable::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    opacity: 0.3;
}
th.sort-asc::after {
    border-bottom: 5px solid #fff;
    opacity: 1;
}
th.sort-desc::after {
    border-top: 5px solid #fff;
    opacity: 1;
}

/* === Swiper.js Styles for Non-ETF Tabs === */
.swiper-container {
    width: 100%;
    overflow: hidden;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    touch-action: pan-y; /* Allow vertical scrolling */
}

.swiper-slide .other-table-container {
    width: 100%;
    box-sizing: border-box;
}

.swiper-pagination {
    position: relative;
    margin-top: 10px;
}

.swiper-pagination-bullet {
    background: #666;
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background: #0056b3;
    opacity: 1;
}

/* === Footer === */
footer {
    border-top: 1px solid #dee2e6;
    padding: 8px 0 4px 0;
    margin-top: 15px;
    font-size: 0.8em;
    color: #6c757d;
}

/* === Modal Styles === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    width: 80%;
    max-width: 650px;
    max-height: 80vh;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.modal-overlay.modal-active,
.modal.modal-active {
    display: flex;
    opacity: 1;
}
.modal.modal-active {
    transform: translate(-50%, -50%) scale(1);
}
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8em;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0;
}
.modal-close-btn:hover {
    color: #333;
}
.modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 1.3em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    flex-shrink: 0;
}
.modal-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 15px;
}
.modal-content ul {
    list-style: none;
    padding-left: 5px;
    margin: 0;
}
.modal-content .modal-calendar-day { margin-bottom: 15px; padding-bottom: 10px; }
.modal-content .modal-calendar-day:last-child {
    margin-bottom: 0;
    border-bottom: none;
}
.modal-content h5 { font-size: 1em; margin-bottom: 8px; }
.modal-content li {
    margin-bottom: 8px;
    font-size: 0.95em;
    line-height: 1.5;
    color: #444;
}
.modal-content .tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-right: 8px;
    color: #fff;
    min-width: 40px;
    text-align: center;
    vertical-align: middle;
}
body.modal-open {
    overflow: hidden;
}

/* Tag Styles */
.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-right: 8px;
    background-color: #adb5bd;
    color: #333;
    min-width: 40px;
    text-align: center;
    vertical-align: middle;
}
.tag-cn, .tag[tag="cn"], .tag[tag="china"], .tag[tag="中国"] {
    background-color: #dc3545;
    color: #fff;
}
.tag-us, .tag[tag="us"], .tag[tag="usa"], .tag[tag="美国"] {
    background-color: #0d6efd;
    color: #fff;
}
.tag-eu, .tag[tag="eu"], .tag[tag="eur"], .tag[tag="欧元区"] {
    background-color: #ffc107;
    color: #333;
}
.tag-jp, .tag[tag="jp"], .tag[tag="jpn"], .tag[tag="日本"] {
    background-color: #6f42c1;
    color: #fff;
}
.tag-gb, .tag[tag="gb"], .tag[tag="gbp"], .tag[tag="英国"] {
    background-color: #198754;
    color: #fff;
}
.tag-hk, .tag[tag="hk"], .tag[tag="hongkong"], .tag[tag="中国香港"] {
    background-color: #e83e8c;
    color: #fff;
}
.tag-fr, .tag[tag="fr"], .tag[tag="france"], .tag[tag="法国"] {
    background-color: #6610f2;
    color: #fff;
}
.tag-de, .tag[tag="de"], .tag[tag="germany"], .tag[tag="德国"] {
    background-color: #343a40;
    color: #fff;
}
.tag-global, .tag[tag="global"], .tag[tag="全球"] {
    background-color: #adb5bd;
    color: #333;
}

/* Importance Level Styles */
.importance-high {
    color: #d63384;
    font-weight: bold;
}
.importance-medium {
    color: #e57373;
}
.importance-low {
    color: #6c757d;
    font-weight: normal;
}

/* === Media Queries === */
@media (max-width: 768px) {
    /* Non-ETF sections use Swiper.js */
    .etf-section,
    .qdii-section,
    .lof-section,
    .reits-section,
    .cb-section,
    .st-section {
        display: block !important;
        width: 100% !important;
        overflow: hidden !important;
        padding-bottom: 10px !important;
        margin: 0 !important;
    }
    .etf-table-container {
        flex-basis: 33% !important;
        min-width: 100% !important;
        //max-height: 260px !important; /* Smaller height on mobile */
        overflow-y: auto !important;
        position: relative; /* Ensure sticky header works within container */
    }
    .other-table-container {
		flex-basis: 49% !important;
        //width: 100% !important;
        min-width: 100% !important;
        //padding: 0 10px !important;
        //box-sizing: border-box !important;
        //margin-right: 0 !important;
        //max-height: 260px !important; /* Smaller height on mobile */
        overflow-y: auto !important;
        position: relative; /* Ensure sticky header works within container */
    }
    .reits-table,
    .etf-table {
        width: 100% !important;
        min-width: 100% !important;
        table-layout: auto !important;
    }
    .reits-table th,
    .etf-table th,
    .reits-table td,
    .etf-table td {
        font-size: 0.8em !important;
        padding: 6px 4px !important;
    }
    .reits-table thead {
        position: sticky; /* Ensure sticky header on mobile */
        top: 0;
        z-index: 10;
    }
    .tab-content.active {
        display: block !important;
        width: 100% !important;
        overflow: visible !important; /* Allow scrolling */
    }
    .swiper-slide {
        touch-action: pan-y !important; /* Ensure vertical scrolling */
    }
}

/* Desktop: Revert non-ETF tabs to flexbox layout */
@media (min-width: 769px) {
    .etf-swiper .swiper-slide {
        // width: auto !important;
        width: 100%; /* 在小屏幕上每个 slide 占满整个容器 */
    }
    .etf-section,
    .qdii-section,
    .lof-section,
    .reits-section,
    .cb-section,
    .st-section {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }
    .etf-table-container {
        flex-basis: 32% !important;
        min-width: 250px !important;
    }
    .other-table-container {
        flex-basis: 49% !important;
        min-width: 250px !important;
    }
    .swiper-container,
    .swiper-wrapper,
    .swiper-slide {
        display: contents !important;
    }
    .swiper-pagination {
        display: none !important;
    }
}