/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

/* 容器 */
.container {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0;
    margin: 0;
}

/* Header 部分 */
.header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.header h1 {
    color: #333;
    font-size: 24px;
    margin: 0;
    text-align: center;
}

.home-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s ease;
}

.home-icon:hover {
    background-color: #28a745;
    border-color: #28a745;
    transform: translateY(-50%) scale(1.1);
}

/* Content 部分 */
.content {
    display: grid;
    grid-template-columns: calc(25% - 1.67px) calc(41% - 2.5px) calc(34% - 1.67px);
    gap: 5px;
    padding: 5px 5px 5px;
    height: calc(100vh - 80px);
}

/* 左侧选股指令 */
.left-column {
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

.left-column h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.instruction-card {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.instruction-card:hover {
    background-color: #e9ecef;
    border-left-color: #1976d2;
    transform: translateX(2px);
}

.instruction-card.selected {
    background-color: #e3f2fd;
    border-left-color: #1976d2;
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.2);
}

.instruction-card h3 {
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
    transition: color 0.3s ease;
}

.instruction-card:hover h3,
.instruction-card.selected h3 {
    color: #1976d2;
}

.instruction-card ul {
    list-style-type: disc;
    margin-left: 15px;
}

.instruction-card li {
    margin-bottom: 3px;
    color: #666;
    font-size: 12px;
}

.sub-list {
    list-style-type: none;
    margin-left: 5px;
    margin-top: 5px;
}

.sub-list li {
    padding: 2px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.sub-list li:last-child {
    border-bottom: none;
}

.sub-link {
    color: #1976d2;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
}

.sub-link:hover {
    color: #0d47a1;
    text-decoration: underline;
}

/* 中间列 - 选股操作指令 */
.middle-column {
    display: flex;
    flex-direction: column;
    padding: 10px;
    height: 100%;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.middle-column h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 10px 10px;
    margin: -10px -10px 15px -10px;
    border-bottom: 2px solid #e0e0e0;
    z-index: 10;
}

/* 右侧列 - 股票列表 */
.right-column {
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100%;
    background-color: #fff;
    border-radius: 8px;
    overflow-y: auto;
    box-sizing: border-box;
}

.right-column h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 10px 0;
    margin: -10px 0 15px 0;
    border-bottom: 2px solid #1976d2;
    z-index: 10;
}

.stock-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stock-list p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #1976d2;
    transition: all 0.3s ease;
}

.stock-item:hover {
    background-color: #e3f2fd;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
}

.stock-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-code {
    font-size: 14px;
    color: #1976d2;
    font-weight: bold;
}

.stock-name {
    font-size: 13px;
    color: #666;
}

.stock-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    background-color: #4caf50;
    color: white;
}

.operation-instruction {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* 红色文本样式 */
.text-red {
    color: #d32f2f;
    font-weight: bold;
}

/* 阶段标题红底白字样式 */
.stage-title {
    background-color: #d32f2f;
    color: white;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 8px;
}

/* 阶段查看按钮样式 */
.stage-lookup-btn {
    color: #4caf50;
    cursor: pointer;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-left: 8px;
    border: 2px solid #4caf50;
    background-color: transparent;
}

.stage-lookup-btn:hover {
    background-color: #4caf50;
    color: white;
}

/* 阶段更新按钮样式 */
.stage-update-btn {
    color: #1976d2;
    cursor: pointer;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-left: 4px;
    border: 2px solid #1976d2;
    background-color: transparent;
}

.stage-update-btn:hover {
    background-color: #1976d2;
    color: white;
}

/* 中证 1000 链接样式 */
.zz1000-link {
    color: #1976d2;
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
}

.zz1000-link:hover {
    color: #0d47a1;
}

/* 阶段一筛选结果区域 */
.stage1-result-area {
    margin-top: 10px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: none;
}

.stage1-result-area.active {
    display: block;
}

.stage1-progress {
    color: #666;
    font-size: 12px;
    margin-bottom: 10px;
    padding: 8px;
    background-color: #e3f2fd;
    border-radius: 4px;
}

.stage1-stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.stage1-stock-table th {
    background-color: #1976d2;
    color: white;
    padding: 8px 4px;
    text-align: left;
    font-weight: normal;
}

.stage1-stock-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #ddd;
}

.stage1-stock-table tr:hover {
    background-color: #f0f0f0;
}

.stage1-stock-table .code {
    color: #1976d2;
    font-weight: bold;
}

.stage1-stock-table .name {
    color: #333;
}

.stage1-stock-table .price {
    color: #333;
    text-align: right;
}

.stage1-stock-table .change-up {
    color: #d32f2f;
    text-align: right;
}

.stage1-stock-table .change-down {
    color: #388e3c;
    text-align: right;
}

.stage1-stock-table .market-cap {
    text-align: right;
    color: #666;
}

.stage1-loading {
    text-align: center;
    padding: 20px;
    color: #1976d2;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    z-index: 10;
}

/* 分页进度显示 */
.stage1-progress-container {
    padding: 15px;
    max-height: 600px;
    overflow-y: auto;
}

.page-progress {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
}

.page-header {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.passed-stocks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stock-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: #4CAF50;
    color: white;
    border-radius: 15px;
    font-size: 12px;
    white-space: nowrap;
}

.page-info {
    padding: 8px;
    color: #666;
    font-size: 14px;
}

.page-loading {
    padding: 12px;
    text-align: center;
    color: #2196F3;
    font-size: 14px;
}

.page-error {
    padding: 12px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 4px;
    margin: 10px 0;
}

.continue-btn,
.finish-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    margin: 15px 0;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.continue-btn:hover,
.finish-btn:hover {
    background-color: #1976D2;
}

.finish-btn {
    background-color: #4CAF50;
}

.finish-btn:hover {
    background-color: #45a049;
}

.modal-close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px 30px 30px;
}

/* 理由内容样式 */
.reason-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #1976d2;
}

.reason-section {
    margin-bottom: 20px;
}

.reason-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 10px;
}

.reason-section-content {
    padding-left: 20px;
}

.reason-section-content p {
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.reason-summary {
    margin-top: 25px;
    padding: 15px;
    background-color: #e3f2fd;
    border-radius: 6px;
    border-left: 4px solid #1976d2;
}

.reason-summary-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.reason-summary-content p {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

