/* ============================================================
   admin.css — 响应式后台样式
   桌面端：100vh 固定，内部滚动
   移动端：页面整体滚动，内容自然撑开，左侧参数区自适应，图表高度增加
   ============================================================ */

/* ============================================================
   1. 全局重置 & 基础
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden; /* 桌面端固定高度，禁止整体滚动 */
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: #f4f7fc;
    color: #1e293b;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ============================================================
   2. 导航栏
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
    background: rgba(3, 45, 101, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0 2rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.nav-links {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: space-evenly;
    list-style: none;
    flex-wrap: wrap;
    gap: 2px;
}

.nav-links li a {
    text-decoration: none;
    color: #f0f4ff;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    border-bottom: 2px solid transparent;
    transition: border-color 0.25s, color 0.25s, background 0.2s;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
    display: inline-block;
}

.nav-links li a:hover {
    color: #ffd966;
    border-bottom-color: #ffd966;
    background: rgba(255, 255, 255, 0.08);
}

.nav-links li a.active-link {
    color: #ffd966;
    border-bottom-color: #ffd966;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: #f0f4ff;
    border-radius: 4px;
    transition: all 0.25s ease;
}

/* ============================================================
   3. 主内容 — 桌面固定高度
   ============================================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f4f7fc;
    overflow: hidden; /* 禁止整体滚动 */
}

/* ============================================================
   4. 页面容器
   ============================================================ */
.page-content {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: transparent;
    overflow: hidden;
}

.page-content.active {
    display: flex;
}

/* ============================================================
   5. 控制栏
   ============================================================ */
.control-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 1px solid #e9edf4;
    flex-shrink: 0;
}

.control-bar .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s, transform 0.1s;
    background-color: #eef2f6;
    color: #1e293b;
    white-space: nowrap;
}
.control-bar .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-start { background-color: #22c55e; color: #fff; }
.btn-start:hover:not(:disabled) { background-color: #16a34a; }
.btn-pause { background-color: #f59e0b; color: #fff; }
.btn-pause:hover:not(:disabled) { background-color: #d97706; }
.btn-stop { background-color: #ef4444; color: #fff; }
.btn-stop:hover:not(:disabled) { background-color: #dc2626; }
.btn-reset { background-color: #3b82f6; color: #fff; }
.btn-reset:hover:not(:disabled) { background-color: #2563eb; }

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    font-size: 0.85rem;
    color: #475569;
    flex-wrap: wrap;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #94a3b8;
    transition: background-color 0.3s;
    flex-shrink: 0;
}
.dot.stopped { background-color: #ef4444; }
.dot.running { background-color: #22c55e; }
.dot.paused  { background-color: #f59e0b; }

.week-info {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
    background: #f1f5f9;
    padding: 0.15rem 1rem;
    border-radius: 20px;
    white-space: nowrap;
}
.last-action {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.section-divider {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 0;
    flex-shrink: 0;
}

/* ============================================================
   6. 双栏布局 — 桌面固定高度，内部滚动
   ============================================================ */
.two-col-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    background: transparent;
    gap: 0;
    overflow: hidden;
}

.col-left {
    flex: 0 0 40%;
    background: #ffffff;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e9edf4;
    overflow: hidden;
    min-height: 0;
}

.col-right {
    flex: 1;
    background: #ffffff;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* 右侧上下图表 */
.col-right .right-top,
.col-right .right-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}
.col-right .right-top { padding-bottom: 8px; }
.col-right .right-bottom { padding-top: 8px; }
.col-right .section-divider { margin: 0; flex-shrink: 0; }

.right-top canvas,
.right-bottom canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    min-height: 80px;
}

/* ============================================================
   7. 左侧标签 & 内容
   ============================================================ */
.left-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #e9edf4;
    margin-bottom: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.left-tabs .tab-btn {
    background: none;
    border: none;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    position: relative;
}
.left-tabs .tab-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.left-tabs .tab-btn.active {
    color: #032d65;
    background: #e9edf4;
    font-weight: 600;
}
.left-tabs .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #032d65;
}

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

/* ============================================================
   8. 参数设置 (tabParams) — 内部滚动
   ============================================================ */
#tabParams {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-right: 2px;
}
#tabParams .param-row,
#tabParams .param-grid,
#tabParams .param-actions,
#tabParams .clear-events-row {
    flex-shrink: 0;
}
#tabParams .event-list-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 4px;
    border-top: 1px solid #e9edf4;
    padding-top: 6px;
    min-height: 60px;
}
#tabParams .event-list-wrap .event-list-header {
    flex-shrink: 0;
}
#tabParams .event-list-wrap .item-list {
    flex: 1;
    overflow-y: auto;
    background: #f8fafc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
}

.param-row.row-week {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.param-row.row-week label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}
.param-row.row-week input[type="number"] {
    width: 80px;
    padding: 4px 6px;
    border: 1px solid #d1d9e6;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #fff;
    transition: border-color 0.2s;
}
.param-row.row-week input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.param-row.row-week input:disabled {
    background: #f1f5f9;
    opacity: 0.7;
}

.param-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 6px 10px;
    margin-bottom: 6px;
    flex-shrink: 0;
}
.param-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.param-item label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.3px;
}
.param-item input[type="number"],
.param-item select {
    width: 100%;
    padding: 4px 5px;
    border: 1px solid #d1d9e6;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #fff;
    transition: border-color 0.2s;
}
.param-item input:focus,
.param-item select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.param-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 6px;
    flex-shrink: 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #eef2f6;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.action-btn:hover { background: #d1d9e6; }
.action-btn.primary { background: #3b82f6; color: #fff; }
.action-btn.primary:hover { background: #2563eb; }
.action-btn.secondary { background: #f1f5f9; color: #475569; }
.action-btn.secondary:hover { background: #e2e8f0; }
.action-btn.danger { background: #fee2e2; color: #b91c1c; }
.action-btn.danger:hover { background: #fecaca; }
.action-btn.small { padding: 2px 8px; font-size: 0.7rem; }

.clear-events-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    padding: 6px 0;
    border-top: 1px solid #e9edf4;
    margin-top: 2px;
    flex-shrink: 0;
}
.clear-events-row .clear-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
}
.clear-events-row input[type="number"] {
    width: 60px;
    padding: 3px 4px;
    border: 1px solid #d1d9e6;
    border-radius: 4px;
    font-size: 0.75rem;
}
.clear-events-row .clear-to {
    font-size: 0.75rem;
    color: #94a3b8;
}

.event-list-wrap .event-list-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 4px;
}
.event-list-wrap .event-list-header i { margin-right: 4px; }
.event-count {
    background: #e9edf4;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 0.7rem;
}
.item-list .empty-tip {
    color: #94a3b8;
    text-align: center;
    padding: 6px 0;
}
.item-list .event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    border-bottom: 1px dashed #e9edf4;
    flex-wrap: wrap;
    gap: 4px;
}
.item-list .event-item:last-child { border-bottom: none; }
.item-list .event-item .event-week {
    font-weight: 600;
    color: #1e293b;
}
.item-list .event-item .event-desc {
    color: #475569;
    flex: 1;
    min-width: 60px;
}

/* ============================================================
   9. 参数配置表
   ============================================================ */
#tabTable {
    padding: 0;
    flex-direction: column;
    overflow: hidden;
}
#tabTable .table-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 4px;
    flex-shrink: 0;
}
#tabTable .table-header i { margin-right: 4px; }
#tabTable .table-count {
    background: #e9edf4;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 0.7rem;
}
#tabTable .table-wrap {
    flex: 1;
    overflow: auto;
    border: 1px solid #e9edf4;
    border-radius: 4px;
    min-height: 0;
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: #fff;
}
.param-table thead {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 2;
}
.param-table th {
    padding: 5px 4px;
    text-align: center;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #d1d9e6;
    white-space: nowrap;
}
.param-table td {
    padding: 4px 4px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}
.param-table tbody tr:hover { background: #f8fafc; }
.param-table tbody tr.active-row { background: #dbeafe; }

/* ============================================================
   10. 延迟控制
   ============================================================ */
#tabDelay {
    padding: 0 2px 0 0;
    overflow-y: auto;
    flex-direction: column;
    gap: 8px;
}
.status-card {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    background: #f8fafc;
    border-radius: 6px;
    padding: 8px 12px;
    border: 1px solid #e9edf4;
    flex-shrink: 0;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
}
.status-label { font-weight: 500; color: #475569; }
.status-value { font-weight: 600; color: #1e293b; }

.control-section { flex-shrink: 0; }
.control-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.control-section h3 i { color: #3b82f6; }

.param-section {
    background: #fafcff;
    border: 1px solid #e9edf4;
    border-radius: 4px;
    padding: 8px 10px;
}

.control-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100px;
    margin-top: 4px;
}
.list-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 4px 0 6px;
    flex-shrink: 0;
}
.search-box {
    position: relative;
    flex: 0 0 140px;
}
.search-box input {
    width: 100%;
    padding: 3px 24px 3px 6px;
    border: 1px solid #d1d9e6;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #fff;
}
.search-box i {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.7rem;
    pointer-events: none;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #475569;
}
.filter-group select {
    padding: 2px 4px;
    border: 1px solid #d1d9e6;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #fff;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 6px;
    flex-shrink: 0;
}
.pagination-btn {
    background: #eef2f6;
    border: none;
    border-radius: 4px;
    padding: 2px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #1e293b;
    transition: background 0.2s;
}
.pagination-btn:hover:not(:disabled) { background: #d1d9e6; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 0.75rem; color: #475569; }

#controlTable .param-table { font-size: 0.7rem; }
#controlTable .param-table td,
#controlTable .param-table th { padding: 3px 4px; }
#controlTable .param-table td:last-child { white-space: nowrap; }

/* ============================================================
   11. 图表设置
   ============================================================ */
#tabChart {
    padding: 0 2px 0 0;
    overflow-y: auto;
    flex-direction: column;
}
.chart-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.chart-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.chart-section h3 i { color: #3b82f6; }

.chart-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.chart-controls .param-item { margin-bottom: 0; }
.chart-controls .param-item label { font-size: 0.7rem; }
.chart-controls .param-item select,
.chart-controls .param-item input {
    font-size: 0.75rem;
    padding: 3px 4px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 2px 0;
}
.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    color: #475569;
    cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #3b82f6;
    cursor: pointer;
}
.chart-controls hr {
    margin: 8px 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}
#update-chart {
    font-size: 0.8rem;
    padding: 6px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-start;
}
#update-chart:hover { background: #2563eb; }

/* ============================================================
   12. 滚动条
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   13. 用户管理
   ============================================================ */
.sub-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #e9edf4;
    padding: 0 16px;
    margin: 6px 0 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.sub-tab-btn {
    background: none;
    border: none;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    position: relative;
}
.sub-tab-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.sub-tab-btn.active {
    color: #032d65;
    background: #e9edf4;
    font-weight: 600;
}
.sub-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #032d65;
}
.sub-tab-btn .badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    border-radius: 12px;
    padding: 0 6px;
    margin-left: 4px;
    min-width: 18px;
    text-align: center;
    font-weight: 600;
}

.sub-tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.sub-tab-content.active { display: flex; }

.users-control-bar {
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 1px solid #e9edf4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    flex-shrink: 0;
}
.users-control-bar .search-box { flex: 0 0 180px; }

.user-table td,
.user-table th { padding: 4px 6px; font-size: 0.75rem; }
.user-table .status-badge {
    display: inline-block;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 500;
}
.status-active { background: #dcfce7; color: #16a34a; }
.status-inactive { background: #fef9c3; color: #ca8a04; }
.status-suspended { background: #fee2e2; color: #dc2626; }

.upgrade-table td,
.upgrade-table th { padding: 4px 6px; font-size: 0.75rem; }
.upgrade-table .reason-text {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.btn-refresh {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #2563eb; }

.user-pagination,
.upgrade-pagination,
.reg-pagination {
    flex-shrink: 0;
    padding: 6px 16px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    border-top: 1px solid #e9edf4;
}

/* 报名管理 */
.reg-count {
    font-size: 0.8rem;
    color: #475569;
    margin-left: auto;
}
.reg-count strong { font-weight: 600; color: #1e293b; }
.registration-table td,
.registration-table th { padding: 4px 6px; font-size: 0.75rem; }

.table-wrap {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

/* ============================================================
   14. 竞赛管理
   ============================================================ */
.contests-control-bar {
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 1px solid #e9edf4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    flex-shrink: 0;
}
.contests-control-bar .search-box { flex: 0 0 180px; }
.contest-count {
    font-size: 0.8rem;
    color: #475569;
    margin-left: auto;
}
.contest-count strong { color: #1e293b; }

.contest-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #ffffff;
    min-height: 0;
}
.contest-left {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e9edf4;
    overflow: hidden;
    padding: 8px 0;
}
.contest-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    overflow: hidden;
    background: #fafcff;
}

.contest-table-wrap {
    flex: 1;
    overflow: auto;
    padding: 0 12px 8px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.ranking-table thead {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 2;
}
.ranking-table th {
    padding: 6px 8px;
    text-align: center;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #d1d9e6;
}
.ranking-table td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}
.ranking-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}
.ranking-table tbody tr:hover { background: #f1f5f9; }
.ranking-table tbody tr.active-row {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
}

.profit-positive { color: #16a34a; font-weight: 600; }
.profit-negative { color: #dc2626; font-weight: 600; }

.user-summary {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid #e9edf4;
    flex-shrink: 0;
}
.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.summary-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}
.summary-rank {
    font-size: 0.8rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 12px;
    border-radius: 20px;
}
.summary-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px 12px;
}
.stat-item {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 0.6rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

/* 详情选项卡 */
.user-detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e9edf4;
    flex-shrink: 0;
    margin: 6px 0 8px;
    flex-wrap: wrap;
}
.detail-tab {
    padding: 6px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.detail-tab:hover {
    color: #1e293b;
    background: #f1f5f9;
}
.detail-tab.active {
    color: #032d65;
    border-bottom-color: #032d65;
    font-weight: 600;
}

.detail-content-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}
.detail-pane {
    display: none;
    height: 100%;
    flex-direction: column;
}
.detail-pane.active { display: flex; }

.user-chart-wrap {
    flex: 1;
    display: flex;
    gap: 16px;
    min-height: 0;
}
.chart-container {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9edf4;
    padding: 10px;
    min-height: 150px;
}
.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}
.chart-tip {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 4px;
}

.user-holdings {
    flex: 1;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9edf4;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 80px;
}
.holdings-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e9edf4;
    padding-bottom: 6px;
    flex-shrink: 0;
}
.holdings-list {
    flex: 1;
    overflow-y: auto;
    padding-top: 6px;
    font-size: 0.75rem;
}
.holding-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed #f1f5f9;
    flex-wrap: wrap;
    gap: 4px;
}
.holding-item:last-child { border-bottom: none; }
.holding-code { font-weight: 600; color: #1e293b; }
.holding-detail {
    display: flex;
    gap: 12px;
    color: #475569;
    flex-wrap: wrap;
}
.holding-detail .text-green { color: #16a34a; }
.holding-detail .text-red { color: #dc2626; }

#detail-trades .table-wrap,
#detail-loans .table-wrap {
    flex: 1;
    overflow: auto;
}
#detail-trades .param-table,
#detail-loans .param-table { font-size: 0.75rem; }
#detail-trades .param-table th,
#detail-loans .param-table th {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 2;
}
.trade-buy { color: #16a34a; font-weight: 600; }
.trade-sell { color: #dc2626; font-weight: 600; }

#fundListContainer {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}
.fund-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 4px;
}
.fund-item:last-child { border-bottom: none; }
.fund-name { font-weight: 600; color: #1e293b; }
.fund-detail {
    display: flex;
    gap: 16px;
    color: #475569;
    flex-wrap: wrap;
}
.fund-detail .text-green { color: #16a34a; }
.fund-detail .text-red { color: #dc2626; }

#detail-trades .pagination {
    flex-shrink: 0;
    padding: 6px 0 0;
}

/* ============================================================
   15. 新闻管理
   ============================================================ */
.news-control-bar {
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 1px solid #e9edf4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    flex-shrink: 0;
}
.news-control-bar .btn-add-news {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 0.35rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.news-control-bar .btn-add-news:hover { background: #2563eb; }
.news-control-bar .search-box { flex: 0 0 180px; }
.news-count {
    font-size: 0.8rem;
    color: #475569;
    margin-left: auto;
}
.news-count strong { font-weight: 600; color: #1e293b; }

.news-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #ffffff;
    min-height: 0;
}
.news-left {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e9edf4;
    overflow: hidden;
    padding: 6px 0;
}
.news-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    overflow-y: auto;
    background: #fafcff;
}

.news-table-wrap {
    flex: 1;
    overflow: auto;
    padding: 0 16px 8px;
    background: #ffffff;
}
.news-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: #fff;
}
.news-table thead {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 2;
}
.news-table th {
    padding: 6px 8px;
    text-align: center;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #d1d9e6;
    white-space: nowrap;
}
.news-table td {
    padding: 5px 8px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}
.news-table tbody tr:hover { background: #f8fafc; }
.news-table tbody tr td:first-child {
    font-weight: 500;
    color: #64748b;
}
.news-table tbody tr.active-row { background: #dbeafe; }

.news-pagination {
    flex-shrink: 0;
    padding: 8px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    border-top: 1px solid #e9edf4;
}

.news-detail-card {
    flex: 1;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9edf4;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 150px;
}
.detail-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}
.detail-placeholder i { margin-bottom: 12px; }
.detail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.detail-header {
    border-bottom: 1px solid #e9edf4;
    padding-bottom: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.detail-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.75rem;
    color: #64748b;
}
.detail-meta span { display: inline-flex; align-items: center; gap: 4px; }
.detail-meta .detail-top {
    background: #fef3c7;
    color: #d97706;
    padding: 0 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.65rem;
}
.detail-meta .detail-top.hidden { display: none; }
.detail-summary {
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.detail-body {
    flex: 1;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #1e293b;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 4px 0;
}
.detail-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e9edf4;
    flex-shrink: 0;
    margin-top: 8px;
    flex-wrap: wrap;
}
.detail-actions .action-btn { padding: 4px 14px; font-size: 0.75rem; }

/* ============================================================
   16. 日志管理
   ============================================================ */
.logs-control-bar {
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 1px solid #e9edf4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    flex-shrink: 0;
}
.logs-control-bar .search-box { flex: 0 0 180px; }
.logs-control-bar .filter-group select,
.logs-control-bar .filter-group input {
    padding: 3px 6px;
    border: 1px solid #d1d9e6;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #fff;
}
.log-count {
    font-size: 0.8rem;
    color: #475569;
    margin-left: auto;
}
.log-count strong { color: #1e293b; }

.log-table-wrap {
    flex: 1;
    overflow: auto;
    padding: 0 16px 8px;
    background: #ffffff;
}
.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: #fff;
}
.log-table thead {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 2;
}
.log-table th {
    padding: 6px 8px;
    text-align: center;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #d1d9e6;
    white-space: nowrap;
}
.log-table td {
    padding: 5px 8px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}
.log-table tbody tr:hover { background: #f8fafc; }

.log-pagination {
    flex-shrink: 0;
    padding: 8px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    border-top: 1px solid #e9edf4;
}

/* ============================================================
   17. 模态框
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalFadeIn 0.25s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e9edf4;
    flex-shrink: 0;
}
.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-header h3 i { color: #3b82f6; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0 4px;
}
.modal-close:hover { color: #ef4444; }

.modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

#newsForm .form-group,
#userEditForm .form-group,
#fundAdjustForm .form-group {
    margin-bottom: 12px;
}
#newsForm .form-group label,
#userEditForm .form-group label,
#fundAdjustForm .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 2px;
}
#newsForm .form-group input,
#newsForm .form-group textarea,
#newsForm .form-group select,
#userEditForm .form-group input,
#userEditForm .form-group select,
#fundAdjustForm .form-group input,
#fundAdjustForm .form-group select,
#fundAdjustForm .form-group textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d9e6;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
#newsForm .form-group input:focus,
#newsForm .form-group textarea:focus,
#newsForm .form-group select:focus,
#userEditForm .form-group input:focus,
#userEditForm .form-group select:focus,
#fundAdjustForm .form-group input:focus,
#fundAdjustForm .form-group select:focus,
#fundAdjustForm .form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
#newsForm .form-group textarea,
#fundAdjustForm .form-group textarea {
    resize: vertical;
    min-height: 50px;
}
#newsForm .form-row {
    display: flex;
    gap: 16px;
}
#newsForm .form-row .form-group { flex: 1; }
#newsForm .form-actions,
#userEditForm .form-actions,
#fundAdjustForm .form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #e9edf4;
    margin-top: 8px;
    flex-wrap: wrap;
}
#newsForm .form-actions .action-btn,
#userEditForm .form-actions .action-btn,
#fundAdjustForm .form-actions .action-btn {
    padding: 6px 18px;
    font-size: 0.85rem;
}
#newsForm .form-actions .action-btn.primary,
#userEditForm .form-actions .action-btn.primary,
#fundAdjustForm .form-actions .action-btn.primary {
    background: #3b82f6;
    color: #fff;
}
#newsForm .form-actions .action-btn.primary:hover,
#userEditForm .form-actions .action-btn.primary:hover,
#fundAdjustForm .form-actions .action-btn.primary:hover {
    background: #2563eb;
}
#newsForm .form-actions .action-btn.secondary,
#userEditForm .form-actions .action-btn.secondary,
#fundAdjustForm .form-actions .action-btn.secondary {
    background: #eef2f6;
    color: #1e293b;
}
#newsForm .form-actions .action-btn.secondary:hover,
#userEditForm .form-actions .action-btn.secondary:hover,
#fundAdjustForm .form-actions .action-btn.secondary:hover {
    background: #d1d9e6;
}

#newsForm .form-row .form-group:last-child label {
    font-weight: 400;
    cursor: pointer;
}
#newsForm .form-row .form-group:last-child input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
    margin-right: 4px;
}

/* ============================================================
   18. 响应式 — 移动端适配
   ============================================================ */

/* 平板及以下 — 允许整体滚动，图表增高 */
@media (max-width: 1024px) {
    /* 重置 html/body 允许滚动 */
    html, body {
        height: auto;
        overflow: auto;
    }
    .main-content {
        overflow: visible;  /* 让内容自然撑开 */
        height: auto;
        min-height: 100vh;
    }
    .page-content {
        overflow: visible;
        min-height: 100vh;
    }

    /* 双栏改为上下排列 */
    .two-col-layout {
        flex-direction: column;
        overflow: visible;
        height: auto;
    }

    /* 左侧：自适应高度，内部保留滚动，max-height 增大到500px */
    .col-left {
        flex: 0 0 auto;
        height: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e9edf4;
        padding: 10px 12px;
        overflow: visible;
    }
    .col-left .tab-content-wrapper {
        overflow-y: auto;
        max-height: 500px; /* 事件列表滚动区域增高 */
    }
    #tabParams {
        overflow-y: auto;
    }

    /* 右侧：占据剩余空间，两个图表高度一致 */
    .col-right {
        flex: 1 1 auto;
        min-height: 60vh;
        padding: 10px 12px;
        overflow: visible;
    }
    .col-right .right-top,
    .col-right .right-bottom {
        padding: 4px 0;          /* 统一内边距，消除差异 */
        flex: 1 1 auto;
        min-height: 200px;       /* 相同最小高度 */
    }
    .col-right .right-top canvas,
    .col-right .right-bottom canvas {
        min-height: 180px;
    }

    /* 参数网格 */
    .param-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    /* 竞赛 */
    .contest-layout {
        flex-direction: column;
        overflow: visible;
        height: auto;
    }
    .contest-left {
        flex: 0 0 auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e9edf4;
        padding: 8px 0;
        overflow: visible;
    }
    .contest-left .contest-table-wrap {
        max-height: 350px;
        overflow: auto;
    }
    .contest-right {
        flex: 1 1 auto;
        min-height: 60vh;
        padding: 10px 12px;
        overflow: visible;
    }
    .user-chart-wrap {
        flex-direction: column;
    }
    .chart-container {
        flex: 0 0 200px;
        min-height: 180px;
    }
    .summary-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    /* 新闻 */
    .news-layout {
        flex-direction: column;
        overflow: visible;
        height: auto;
    }
    .news-left {
        flex: 0 0 auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e9edf4;
        padding: 6px 0;
        overflow: visible;
    }
    .news-left .news-table-wrap {
        max-height: 350px;
        overflow: auto;
    }
    .news-right {
        flex: 1 1 auto;
        min-height: 300px;
        padding: 10px 12px;
        overflow: visible;
    }
    .news-detail-card {
        min-height: 200px;
    }

    /* 用户管理 */
    .users-control-bar .search-box,
    .contests-control-bar .search-box,
    .news-control-bar .search-box {
        flex: 1 1 120px;
    }
    .users-control-bar,
    .contests-control-bar,
    .news-control-bar,
    .logs-control-bar {
        gap: 0.4rem 0.6rem;
        padding: 8px 12px;
    }
    .news-count,
    .contest-count,
    .log-count {
        width: 100%;
        margin-left: 0;
        text-align: right;
    }

    /* 表格水平滚动 */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 模态框 */
    .modal-content {
        max-width: 95%;
        margin: 10px;
    }
    #newsForm .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* 隐藏部分表格列 */
    .user-table th:nth-child(7),
    .user-table td:nth-child(7),
    .user-table th:nth-child(8),
    .user-table td:nth-child(8) {
        display: none;
    }
    .upgrade-table th:nth-child(6),
    .upgrade-table td:nth-child(6),
    .upgrade-table th:nth-child(7),
    .upgrade-table td:nth-child(7) {
        display: none;
    }
    .registration-table th:nth-child(5),
    .registration-table td:nth-child(5),
    .registration-table th:nth-child(6),
    .registration-table td:nth-child(6) {
        display: none;
    }
    .news-table th:first-child,
    .news-table td:first-child {
        display: none;
    }
    .news-table th:nth-child(4),
    .news-table td:nth-child(4),
    .news-table th:nth-child(5),
    .news-table td:nth-child(5) {
        display: none;
    }
    .ranking-table th:nth-child(4),
    .ranking-table td:nth-child(4),
    .ranking-table th:nth-child(5),
    .ranking-table td:nth-child(5) {
        display: none;
    }
}

/* 手机横屏 & 小平板 */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
        min-height: 44px;
    }
    .menu-toggle {
        display: flex;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(3, 45, 101, 0.98);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 0.5rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }
    .nav-links.show { display: flex; }
    .nav-links li a {
        padding: 0.5rem 1.2rem;
        border-bottom: none;
        border-radius: 0;
        text-align: center;
        width: 100%;
        font-size: 0.9rem;
    }
    .nav-links li a.active-link {
        background: rgba(255, 255, 255, 0.15);
        border-bottom: none;
    }

    .control-bar {
        gap: 0.4rem 0.6rem;
        padding: 8px 12px;
    }
    .control-bar .btn {
        padding: 0.25rem 0.7rem;
        font-size: 0.75rem;
    }
    .status-badge {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
    .week-info {
        font-size: 0.75rem;
        padding: 0.1rem 0.8rem;
    }
    .last-action {
        font-size: 0.65rem;
        max-width: 120px;
    }

    .col-left {
        padding: 8px 10px;
    }
    .col-left .tab-content-wrapper {
        max-height: 450px; /* 增高 */
    }
    .col-right {
        min-height: 70vh;
        padding: 8px 10px;
    }
    .col-right .right-top,
    .col-right .right-bottom {
        padding: 4px 0;          /* 统一内边距 */
        flex: 1 1 auto;
        min-height: 220px;       /* 相同最小高度 */
    }
    .col-right .right-top canvas,
    .col-right .right-bottom canvas {
        min-height: 200px;
    }

    .param-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4px 8px;
    }
    .left-tabs .tab-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .sub-tab-btn {
        padding: 4px 8px;
        font-size: 0.65rem;
    }
    .detail-tab {
        padding: 4px 6px;
        font-size: 0.65rem;
    }

    .summary-stats {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .summary-name {
        font-size: 0.95rem;
    }
    .stat-value {
        font-size: 0.8rem;
    }

    .chart-container {
        flex: 0 0 160px;
        min-height: 140px;
    }
    .user-holdings {
        min-height: 80px;
    }

    .modal-content {
        max-width: 100%;
        margin: 8px;
        max-height: 95vh;
    }
    .modal-header {
        padding: 12px 16px;
    }
    .modal-header h3 {
        font-size: 0.9rem;
    }
    .modal-body {
        padding: 12px 16px 16px;
    }
    #newsForm .form-group,
    #userEditForm .form-group,
    #fundAdjustForm .form-group {
        margin-bottom: 8px;
    }

    .search-box {
        flex: 1 1 80px !important;
        min-width: 60px;
    }
    .search-box input {
        font-size: 0.7rem;
        padding: 2px 20px 2px 4px;
    }
    .filter-group {
        font-size: 0.65rem;
    }
    .filter-group select {
        font-size: 0.65rem;
        padding: 1px 4px;
    }
    .btn-refresh {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .pagination .pagination-btn {
        padding: 1px 6px;
        font-size: 0.65rem;
    }
    .page-info {
        font-size: 0.65rem;
    }

    .param-table,
    .ranking-table,
    .news-table,
    .log-table {
        font-size: 0.65rem;
    }
    .param-table th,
    .param-table td,
    .ranking-table th,
    .ranking-table td,
    .news-table th,
    .news-table td,
    .log-table th,
    .log-table td {
        padding: 3px 4px;
    }
}

/* 手机竖屏 */
@media (max-width: 480px) {
    .navbar {
        padding: 0 0.6rem;
        min-height: 40px;
    }
    .nav-links li a {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .control-bar {
        padding: 6px 8px;
        gap: 0.3rem 0.4rem;
    }
    .control-bar .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    .week-info {
        font-size: 0.7rem;
        padding: 0.1rem 0.6rem;
    }
    .last-action {
        font-size: 0.6rem;
        max-width: 80px;
    }

    .col-left {
        padding: 6px 8px;
    }
    .col-left .tab-content-wrapper {
        max-height: 400px; /* 增高 */
    }
    .col-right {
        min-height: 80vh;
        padding: 6px 8px;
    }
    .col-right .right-top,
    .col-right .right-bottom {
        padding: 4px 0;          /* 统一内边距 */
        flex: 1 1 auto;
        min-height: 180px;       /* 相同最小高度 */
    }
    .col-right .right-top canvas,
    .col-right .right-bottom canvas {
        min-height: 160px;
    }

    .param-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3px 6px;
    }
    .param-item label {
        font-size: 0.6rem;
    }
    .param-item input[type="number"] {
        font-size: 0.7rem;
        padding: 3px 4px;
    }
    .left-tabs .tab-btn {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .sub-tab-btn {
        padding: 4px 6px;
        font-size: 0.6rem;
    }
    .detail-tab {
        padding: 4px 6px;
        font-size: 0.6rem;
    }

    .summary-stats {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    .summary-name {
        font-size: 0.9rem;
    }
    .stat-value {
        font-size: 0.75rem;
    }

    .chart-container {
        flex: 0 0 120px;
        min-height: 100px;
        padding: 6px;
    }
    .holding-detail {
        gap: 4px 8px;
        font-size: 0.7rem;
    }
    .fund-detail {
        gap: 4px 8px;
        font-size: 0.7rem;
    }

    .modal-content {
        max-width: 100%;
        margin: 4px;
        max-height: 95vh;
        border-radius: 8px;
    }
    .modal-header {
        padding: 10px 14px;
    }
    .modal-header h3 {
        font-size: 0.85rem;
    }
    .modal-body {
        padding: 10px 14px 14px;
    }
    #newsForm .form-group,
    #userEditForm .form-group,
    #fundAdjustForm .form-group {
        margin-bottom: 6px;
    }
}