/* ============================================
   7xMetal Base Styles — 所有页面共享
   适用：PC 和移动端通用组件样式
   不包含任何 @media 查询（设备差异在 base-mobile.css）
   ============================================ */

/* ========================================
   CSS变量系统 - 所有主题
   ======================================== */

/* 亮色主题 */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --watermark-color: rgba(0, 0, 0, 0.12);
    --accent-primary: #0066cc;
    --accent-secondary: #0052a3;
    --accent-tertiary: #003d7a;
    --accent-light: #e6f2ff;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0284c7;
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --spacing-xs: 0.125rem;
    --spacing-sm: 0.25rem;
    --spacing-md: 0.375rem;
    --spacing-lg: 0.5rem;
    --spacing-xl: 0.75rem;
    --spacing-2xl: 1rem;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    --text-xs: 0.65rem;
    --text-sm: 0.75rem;
    --text-base: 0.85rem;
    --text-lg: 0.95rem;
    --text-xl: 1.05rem;
    --text-2xl: 1.25rem;
    --text-3xl: 1.5rem;
    --text-4xl: 1.75rem;
    --accent-color: #0066cc;

    /* 移动端变量 */
    --mobile-header-height: 36px;
    --mobile-control-height: 36px;
    --mobile-padding: 8px;
    --mobile-margin: 8px;
    --mobile-gap: 6px;
    --mobile-font-xs: 10px;
    --mobile-font-sm: 12px;
    --mobile-font-base: 14px;
    --mobile-font-lg: 16px;
    --mobile-font-xl: 18px;
    --mobile-space-xs: 2px;
    --mobile-space-sm: 4px;
    --mobile-space-md: 6px;
    --mobile-space-lg: 8px;
    --mobile-space-xl: 12px;
}

/* 暗色主题 */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    --border-color: #2a2a2a;
    --border-light: #1a1a1a;
    --watermark-color: rgba(255, 255, 255, 0.08);
    --accent-primary: #00d4ff;
    --accent-secondary: #00b8e6;
    --accent-tertiary: #0099cc;
    --accent-light: #1a2a3a;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --accent-color: #3b82f6;
}

/* 纯黑色主题 */
[data-theme="black"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    --border-color: #2a2a2a;
    --border-light: #1a1a1a;
    --watermark-color: rgba(255, 255, 255, 0.08);
    --accent-primary: #00d4ff;
    --accent-secondary: #00b8e6;
    --accent-tertiary: #0099cc;
    --accent-light: #1a2a3a;
    --success: #00ff88;
    --danger: #ff4d4d;
    --warning: #ffaa00;
    --info: #00ccff;
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.8);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.9);
    --accent-color: #3b82f6;
}

/* holding-page 专用配色变量 */
.holding-page {
    --long-primary: #0056b3;
    --long-secondary: #003d82;
    --long-light: rgba(0, 86, 179, 0.12);
    --long-bg: linear-gradient(135deg, rgba(0, 86, 179, 0.06) 0%, rgba(0, 61, 130, 0.02) 100%);
    --short-primary: #003366;
    --short-secondary: #002244;
    --short-light: rgba(0, 51, 102, 0.12);
    --short-bg: linear-gradient(135deg, rgba(0, 51, 102, 0.06) 0%, rgba(0, 34, 68, 0.02) 100%);
    --netlong-primary: #0d9488;
    --netlong-secondary: #0f766e;
    --netlong-light: rgba(13, 148, 136, 0.12);
    --netlong-bg: linear-gradient(135deg, rgba(13, 148, 136, 0.06) 0%, rgba(15, 118, 110, 0.02) 100%);
    --netshort-primary: #cc6600;
    --netshort-secondary: #a35200;
    --netshort-light: rgba(204, 102, 0, 0.12);
    --netshort-bg: linear-gradient(135deg, rgba(204, 102, 0, 0.06) 0%, rgba(163, 82, 0, 0.02) 100%);
    --volume-primary: #334155;
    --volume-secondary: #1e293b;
    --volume-light: rgba(51, 65, 85, 0.12);
    --volume-bg: linear-gradient(135deg, rgba(51, 65, 85, 0.06) 0%, rgba(30, 41, 59, 0.02) 100%);
    --increase-primary: #b91c1c;
    --increase-light: rgba(185, 28, 28, 0.12);
    --decrease-primary: #15803d;
    --decrease-light: rgba(21, 128, 61, 0.12);
}

/* holding-page 全高度布局（LME首页、持仓页共用） */
html.holding-page, body.holding-page {
    height: 100%;
    margin: 0;
    overflow: hidden;
}
body.holding-page .app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}
body.holding-page .app-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
body.holding-page .app-footer {
    flex: 0 0 auto;
}

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

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   主容器系统
   ======================================== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-shrink: 0;
}

.header-center {
    flex-shrink: 0;
}

.app-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 0 1 auto;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-start;
    padding: 4px 2px;
}
.header-right > * {
    flex: 0 0 auto;
}

/* 导航链接单独滚动，避免撑开 header 并裁切用户下拉菜单 */
.nav-scroll {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-scroll::-webkit-scrollbar {
    display: none;
}
.nav-scroll > * {
    flex: 0 0 auto;
}

.nav-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: var(--accent-light);
    color: var(--accent-secondary);
}

/* 品牌按钮 */
.back-btn {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    box-shadow: 0 1px 3px rgba(30, 136, 229, 0.3);
    transition: all 0.2s ease;
}
.back-btn:hover {
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
    box-shadow: 0 2px 6px rgba(30, 136, 229, 0.45);
    color: #fff;
    text-decoration: none;
}

.brand-tagline {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 4px;
}

.app-main {
    flex: 1;
    max-width: 1920px;
    margin: 0 auto;
    padding: var(--spacing-md);
    width: 100%;
}

/* 底部栏 */
.app-footer {
    text-align: center;
    padding: 10px 16px 12px;
    font-size: 10px;
    color: #444;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    line-height: 1.7;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.app-footer a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}
.app-footer a:hover {
    color: #999;
}

/* ========================================
   控制面板系统
   ======================================== */
.control-panel {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel-header {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
}

.panel-title {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.panel-body {
    padding: var(--spacing-xs) var(--spacing-sm);
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.divider {
    width: 1px;
    height: 16px;
    background-color: var(--border-color);
    margin: 0 4px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    max-width: 100%;
}

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

.control-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0;
    white-space: nowrap;
}

.control-input {
    padding: 1px 3px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--text-xs);
    font-family: var(--font-family);
    transition: all 0.2s ease;
    min-height: 16px;
    line-height: 1.2;
    width: fit-content;
    max-width: 150px;
}
.control-input:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-tertiary);
}
.control-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-light);
    background-color: var(--bg-primary);
}

select.control-input {
    cursor: pointer;
    padding-right: 16px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 10 10'%3E%3Cpath fill='%23475569' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    width: fit-content;
    max-width: 180px;
}
select.control-input:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 10 10'%3E%3Cpath fill='%230066cc' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
}

input[type="date"].control-input {
    cursor: pointer;
    width: fit-content;
    min-width: 100px;
    max-width: 110px;
    font-size: 0.6rem;
}
input[type="date"].control-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}
input[type="date"].control-input:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* 日期输入框包装器 */
.date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.date-nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.date-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 10px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}
.date-nav-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
.date-nav-btn:active {
    transform: scale(0.95);
}
.date-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.date-nav-btn:disabled:hover {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* ========================================
   复选框组
   ======================================== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 2px;
}

.checkbox-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    align-items: center;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}
.checkbox-item:hover {
    background-color: var(--bg-tertiary);
}
.checkbox-item:active {
    transform: scale(0.98);
}

.checkbox-input {
    width: 10px;
    height: 10px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    margin: 0;
    transition: transform 0.1s ease;
}
.checkbox-input:hover {
    transform: scale(1.1);
}

.checkbox-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    line-height: 1.3;
    transition: color 0.2s ease;
}
.checkbox-item:hover .checkbox-label {
    color: var(--text-primary);
}

/* ========================================
   图表区域系统
   ======================================== */
.chart-panel {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.chart-container {
    position: relative;
    height: 625px;
    padding: var(--spacing-md);
}
.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ========================================
   状态栏系统
   ======================================== */
.status-bar {
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xs) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.status-items {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
}
.status-indicator.loading {
    background-color: var(--warning);
    animation: pulse 1.5s ease-in-out infinite;
}
.status-indicator.error {
    background-color: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   按钮系统
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--accent-secondary);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--accent-light);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* common.css 中的按钮样式 */
.holding-page .btn-primary,
.btn-primary {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.2);
    white-space: nowrap;
}
.holding-page .btn-primary:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
.holding-page .btn-primary:active,
.btn-primary:active {
    transform: translateY(0);
}

/* ========================================
   语言和主题切换
   ======================================== */
.language-toggle, .theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}
.language-toggle:hover, .theme-toggle:hover {
    background-color: var(--accent-light);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 2px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 130px;
    z-index: 1000;
    overflow: hidden;
}

.language-option {
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}
.language-option:hover {
    background-color: var(--accent-light);
    color: var(--accent-primary);
}

.flag {
    font-size: 1rem;
    line-height: 1;
    display: inline-block;
}

/* ========================================
   数据表格样式
   ======================================== */
.data-table-container {
    margin-top: var(--spacing-md);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: var(--spacing-xs) var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.data-table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.data-table td {
    color: var(--text-secondary);
    font-size: var(--text-xs);
}
.data-table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

/* ========================================
   加载和遮罩
   ======================================== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 88px;
    font-weight: bold;
    color: var(--watermark-color);
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   标签页导航
   ======================================== */
.tab-content {
    display: none !important;
}
.tab-content.active {
    display: block !important;
}

.tabs-nav {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) 0;
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}
.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.tab-navigation {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-secondary, #f8fafc);
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    margin-bottom: 0;
}
.tab-navigation .tab-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}
.tab-navigation .tab-btn:hover {
    color: var(--text-primary, #1e293b);
    background: rgba(59, 130, 246, 0.08);
}
.tab-navigation .tab-btn.active {
    color: #3b82f6;
    background: white;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}
.tab-navigation .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3b82f6;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   全屏模式
   ======================================== */
body.fullscreen-mode {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}
body.fullscreen-mode .app-main {
    padding: 0;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}
body.fullscreen-mode .control-panel {
    display: none;
}
body.fullscreen-mode .status-bar {
    display: none;
}
body.fullscreen-mode .chart-panel {
    flex: 1;
    border-radius: 0;
    box-shadow: none;
    height: 100%;
}
body.fullscreen-mode .chart-container {
    height: 100%;
    padding: 20px;
}
body.fullscreen-mode .data-table-container {
    display: none !important;
}
body.fullscreen-mode .exit-fullscreen-btn {
    display: block !important;
}

.exit-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 20px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1000;
    display: none;
    transition: all 0.3s ease;
}
.exit-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}
body[data-theme="dark"] .exit-fullscreen-btn {
    background: rgba(255, 255, 255, 0.3);
}
body[data-theme="dark"] .exit-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========================================
   用户菜单（PC & Mobile 通用）
   ======================================== */
.user-menu-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.user-icon-btn:hover,
.user-icon-btn.active {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.user-avatar {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 9999;
    overflow: hidden;
}
.user-dropdown-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.user-dropdown-email {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    flex-shrink: 0;
}
.user-badge.premium {
    background: #f59e0b20;
    color: #f59e0b;
    border: 1px solid #f59e0b40;
}
.user-dropdown-item {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.1s;
    cursor: pointer;
}
.user-dropdown-item:hover {
    background: var(--accent-light);
    color: var(--accent-color);
}
.user-dropdown-logout {
    color: #ef4444 !important;
}
.user-dropdown-logout:hover {
    background: #ef444410 !important;
    color: #ef4444 !important;
}
.user-dropdown-divider {
    margin: 0;
    border: none;
    border-top: 1px solid var(--border-color);
}
.user-login-link {
    font-size: 12px !important;
    padding: 4px 10px !important;
    border-radius: 4px;
    background: var(--accent-color);
    color: #fff !important;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.15s;
}
.user-login-link:hover {
    opacity: 0.85;
    color: #fff !important;
}

/* ========================================
   工具类
   ======================================== */
.text-positive { color: var(--success); }
.text-negative { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 600; }
.positive { color: var(--success); font-weight: 600; }
.negative { color: var(--danger); font-weight: 600; }

/* ========================================
   暗色模式适配（共享组件）
   ======================================== */
[data-theme="dark"] .holding-page .analysis-section {
    box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .holding-page .section-header {
    border-bottom-color: var(--border-color);
}

/* 席位名称可点击提示 */
.holding-page .chart-wrapper canvas {
    cursor: pointer;
}

/* SEO: 视觉隐藏但对搜索引擎和屏幕阅读器可见的 h1 */
.seo-h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== 中等屏幕（平板 / iPad）：导航保持单行，压缩字号并隐藏副标题 ===== */
@media (max-width: 1500px) and (min-width: 769px) {
    .brand-tagline {
        display: none !important;
    }
    .header-content {
        gap: 8px;
    }
    .header-right {
        gap: 4px;
    }
    .nav-scroll {
        gap: 4px;
    }
    .nav-link {
        font-size: 12px !important;
        padding: 4px 7px !important;
    }
    .theme-toggle {
        padding: 4px 8px;
    }
}

@media (max-width: 1280px) and (min-width: 769px) {
    .header-content {
        padding: 0 12px;
    }
    .header-right {
        gap: 3px;
    }
    .nav-scroll {
        gap: 3px;
    }
    .nav-link {
        font-size: 11px !important;
        padding: 3px 6px !important;
    }
}

@media (max-width: 1100px) and (min-width: 769px) {
    .header-content {
        padding: 0 10px;
    }
    .header-right {
        gap: 2px;
    }
    .nav-scroll {
        gap: 2px;
    }
    .nav-link {
        padding: 3px 5px !important;
    }
    .theme-toggle .theme-label {
        display: none !important;
    }
}

@media (max-width: 900px) and (min-width: 769px) {
    .nav-link {
        font-size: 10.5px !important;
        padding: 3px 5px !important;
    }
}

/* 更窄的平板：导航可横向滑动，右侧渐隐提示还有内容 */
@media (max-width: 1000px) and (min-width: 769px) {
    .nav-scroll {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent);
    }
}
