﻿.outer-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    margin: 0;
    background: #000;
}

.main-container {
    display: flex;
    flex-direction: column;
    flex: 0 0 calc(85% - 23px); /* 初始宽度 85%，减去分隔条宽度 */
    min-width: 300px; /* 最小宽度 */
    max-width: calc(100% - 150px - 3px); /* 限制最大宽度 */
    height: 100vh;
}

/* 主图表区域 */
#tv_chart_container {
    height: 75vh;
    min-height: 100px;
    position: relative;
    background: #000;
}

#data-container {
    background: #000;
    color: white;
    border-top: 2px solid #333;
    overflow-y: auto;
    height: 25vh;
    min-height: 5vh;
}

#splitter {
    height: 3px;
    background: #4CAF50;
    cursor: ns-resize;
    width: 100%;
}

#stock-picker {
    flex: 0 0 calc(15% - 3px); /* 初始宽度 15%，减去分隔条宽度 */
    min-width: 50px; /* 最小宽度 */
    max-width: calc(100% - 300px - 3px); /* 限制最大宽度 */
    background: #1a1a1a;
    border-left: 2px solid #333;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

#stock-picker h3 {
    margin: 0 0 0 0;
    font-size: 14px;
    color: #4caf50;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
    text-align: left;
}

#main-splitter {
    width: 3px;
    background: #4CAF50;
    cursor: ew-resize;
    flex-shrink: 0;
    height: 100%; /* 充满高度 */
    z-index: 10; /* 确保可交互 */
}

.picker-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.indicator-select {
    padding: 5px;
    background: #2d2d2d;
    color: #fff;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    font-size: 12px;
    width: 100%;
}

.compact-select {
    padding: 5px;
    background: #2d2d2d;
    color: #fff;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    font-size: 12px;
    width: 100px; /* 缩小宽度 */
}

.strategy-select {
    padding: 5px;
    background: #2d2d2d;
    color: #fff;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    font-size: 12px;
    width: 120px; /* 缩小宽度 */
}

.date-row {
    justify-content: space-between;
}

.date-row label {
    color: #fff;
    font-size: 12px;
    margin-right: 5px;
    width: 30px;
    min-width: 30px;
}

#end-date {
    padding: 5px;
    background: #2d2d2d;
    color: #fff;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    font-size: 12px;
    flex-grow: 1;
    width: 100px;
}

#select-stocks-btn {
    background: #4CAF50;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-left: 10px;
}

.stock-table-container {
    flex-grow: 1;
    overflow-y: auto; /* 表格独立滚动 */
}

#stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#stock-table th, #stock-table td {
    padding: 6px;
    text-align: center;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}

#stock-table th {
    background: #2d2d2d;
    position: sticky;
    top: 0;
    border-bottom: 2px solid #4CAF50;
}

#stock-table th:nth-child(1), #stock-table td:nth-child(1) {
    width: 33%; /* 股票名称列 */
}

#stock-table th:nth-child(2), #stock-table td:nth-child(2) {
    width: 33%; /* 股票代码列 */
}

#stock-table th:nth-child(3), #stock-table td:nth-child(3) {
    width: 33%; /* 股票代码列 */
}

#stock-table a {
    color: #ffff00;
    text-decoration: none;
    cursor: pointer;
}

#stock-table a:hover {
    text-decoration: underline;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 12px;
    color: #fff;
    position: sticky;
    bottom: 0;
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.pagination-controls button {
    padding: 3px 3px;
    background: #4CAF50;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 25px;
}

#page-info {
    margin: 0 10px; /* 为文字添加额外的左右外边距 */
}

.pagination-controls button:disabled {
    background: #555;
    cursor: not-allowed;
}

.data-layout {
    display: flex;
    height: 100%;
    gap: 0;
    padding: 10px;
}

.data-left {
    flex: 0 0 calc(60% - 23px); /* flex-grow: 0, flex-shrink: 0, flex-basis: 60% */
    min-width: 200px; /* Minimum width */
    max-width: calc(100% - 200px - 3px); /* Prevent overflow with splitter */
    background: #1a1a1a;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Independent scrolling */
}

.data-right {
    flex: 0 0 calc(40% - 10px); /* flex-grow: 0, flex-shrink: 0, flex-basis: 40% */
    min-width:200px; /* Minimum width */
    max-width: calc(100% - 200px - 3px); /* Prevent overflow with splitter */
    background: #1a1a1a;
    border-radius: 6px;
    padding: 10px;
    overflow-y: auto; /* Independent scrolling */
}

#vertical-splitter {
    width: 3px;
    background: #4CAF50;
    cursor: ew-resize;
    flex-shrink: 0;
}

.table-container {
    overflow-y: auto;
}

/* 调整行高以显示更多数据 */
#trades-table tr {
    height: 30px; /* 原35px */
}

/* 表格美化 */
#trades-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
}

#trades-table th,
#trades-table td {
    padding: 6px 10px;
    text-align: center;
    border-right: 1px solid #333;
    border-bottom: 1px solid #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

#trades-table th {
    background: #2d2d2d;
    color: #fff;
    font-weight: 500;
    position: sticky;
    top: 0;
    border-bottom: 2px solid #4caf50;
}

#trades-table tr:nth-child(even) {
    background: #242424;
}

#trades-table tr:hover {
    background: #2f2f2f;
}

#trades-table td {
    color: #e0e0e0;
}

#trades-table th:nth-child(2),
#trades-table td:nth-child(2),
#trades-table th:nth-child(3),
#trades-table td:nth-child(3) {
    width: 90px; /* 日期列固定宽度 */
    min-width: 90px;
}

#trades-table th:nth-child(1),
#trades-table td:nth-child(1) {
    width: 30px;
} /* 序号列 */

.chart-container {
    background: #1a1a1a;
    border-radius: 4px;
    padding: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .data-layout {
        flex-direction: column;
    }

    .data-left,
    .data-right {
        flex: none;
        width: 100% !important;
        min-width: 100% !important;
    }

    #trades-table {
        font-size: 11px;
    }

    #trades-table th,
    #trades-table td {
        padding: 6px 8px;
    }
}

.data-section .header-container {
    display: flex;
    justify-content: space-between; /* 左右对齐 */
    align-items: center; /* 垂直居中 */
}

.data-section .stats-text {
    font-size: 14px;
    color: #fff;
    text-align: right;
    max-width: 75%; /* 限制宽度，避免挤压标题 */
}

/* 文字美化 */
.data-section h3 {
    margin: 0 0 0 0;
    font-size: 14px;
    color: #4caf50;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
    text-align: left;
}

#scan-progress {
    color: #fff;
    font-size: 12px;
}

#progress-text {
    display: block;
    margin-bottom: 5px;
}

.backtest-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 12px;
}

.filter-checkbox input {
    margin-right: 5px;
    accent-color: #4CAF50; /* Checkbox color */
}

.data-left .header-container {
    margin-bottom: 10px;
}
