* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: #f8fafc;
    color: #333;
    line-height: 1.6;
    transition: background-color 0.3s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #eaeaea;
    background: linear-gradient(to right, #ffffff, #f0f7ff, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

h1 {
    color: #1565c0;
    margin-bottom: 8px;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #546e7a;
    font-size: 1rem;
    margin-bottom: 15px;
}

.data-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#data-date {
    font-weight: bold;
    color: #0d47a1;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: rgba(13, 71, 161, 0.08);
    display: inline-block;
}

.refresh-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#last-update {
    color: #546e7a;
    font-size: 0.9rem;
}

#refresh-btn {
    background-color: #1976d2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

#refresh-btn:hover {
    background-color: #1565c0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(21, 101, 192, 0.2);
}

#refresh-btn:active {
    transform: translateY(1px);
}

#refresh-btn::before {
    content: "↻";
    font-size: 14px;
    font-weight: bold;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (min-width: 992px) {
    .dashboard {
        grid-template-columns: 1fr 1fr;
    }
}

.section {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #1565c0;
    font-size: 1.4rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1f5fe;
    position: relative;
}

h2::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: #1976d2;
}

.info-tip {
    font-size: 12px;
    color: #757575;
    font-weight: normal;
    margin-left: 8px;
}

.data-container {
    min-height: 300px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eaeaea;
}

th {
    background-color: #f5f7fa;
    font-weight: 500;
}

.up {
    color: #d81e06;
}

.down {
    color: #1aad19;
}

.loading {
    text-align: center;
    padding: 40px 0;
    color: #78909c;
    font-size: 1rem;
    animation: pulse 1.5s infinite ease-in-out;
}

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

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    border-left: 4px solid #f44336;
}

.error-message::before {
    content: "⚠";
    font-size: 18px;
    margin-right: 10px;
}

.no-data {
    text-align: center;
    padding: 30px 0;
    color: #78909c;
    font-style: italic;
}

.hidden {
    display: none;
}

.stock-item {
    display: grid;
    grid-template-columns: 80px 1fr 80px 100px auto;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    transition: background-color 0.15s ease;
}

.stock-item:hover {
    background-color: #f5f5f5;
}

.stock-item:last-child {
    border-bottom: none;
}

.stock-code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-weight: bold;
    color: #263238;
    letter-spacing: 0.5px;
}

.stock-name {
    font-weight: bold;
    color: #37474f;
}

.stock-price {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    text-align: right;
    font-weight: 500;
}

.stock-change {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-weight: bold;
}

.stock-change.up {
    color: #d32f2f;
    position: relative;
    font-size: 15px;
    background-color: rgba(211, 47, 47, 0.05);
    border-radius: 3px;
    padding: 2px 4px;
}

.stock-speed, .stock-turnover {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    text-align: right;
    white-space: nowrap;
}

.stock-sectors {
    font-size: 12.5px;
    line-height: 1.5;
    color: #455a64;
}

.stock-tags {
    font-size: 12px;
    color: #607d8b;
}

.stock-tags span {
    display: inline-block;
    background-color: #eceff1;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 2px;
}

.limit-time, .target-time {
    display: inline-block;
    font-size: 12px;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: normal;
}

.limit-time {
    color: #d32f2f;
    background-color: rgba(211, 47, 47, 0.1);
}

.target-time {
    color: #ff6f00;
    background-color: rgba(255, 111, 0, 0.1);
}

.limit-up, .target-up {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    font-size: 13px;
}

.limit-up {
    color: #ffffff;
    background-color: #d32f2f;
}

.target-up {
    color: #ffffff;
    background-color: #ff6f00;
}

.row-limit-up {
    border-left: 3px solid #d32f2f;
}

.row-target-up {
    border-left: 3px solid #ff6f00;
}

.target-up {
    animation: pulse-target 2s infinite;
}

@keyframes pulse-target {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.turnover-rate, .change-speed {
    display: inline-block;
    margin-right: 10px;
    font-size: 12px;
    color: #455a64;
    padding: 2px 6px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.sector-item {
    margin-bottom: 15px;
    border: 1px solid #e8eaf6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.sector-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.sector-header {
    background: linear-gradient(to right, #e8f5e9, #f1f8e9);
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.sector-header::after {
    content: "⌄";
    font-size: 18px;
    transition: transform 0.2s;
}

.sector-header.active::after {
    transform: rotate(180deg);
}

.sector-name {
    font-weight: bold;
    color: #2e7d32;
}

.sector-stats {
    color: #558b2f;
    font-size: 0.9rem;
    font-weight: 500;
}

.sector-stocks {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #fafafa;
}

.sector-stocks.show {
    max-height: 1000px;
    padding: 15px;
    border-top: 1px dashed #e0e0e0;
}

.target-stocks-table-container {
    overflow-x: auto;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    background: white;
}

.target-stocks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.target-stocks-table th {
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom, #e3f2fd, #bbdefb);
    color: #0d47a1;
    font-weight: bold;
    padding: 14px 10px;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.target-stocks-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eceff1;
    vertical-align: middle;
}

.row-highlight-strong {
    background-color: #fff8e1;
    border-left: 3px solid #ffc107;
}

.row-highlight-medium {
    background-color: #fffde7;
    border-left: 3px solid #ffeb3b;
}

.row-highlight-light {
    background-color: #fffef5;
    border-left: 3px solid #fff59d;
}

.target-stocks-table tr:hover {
    background-color: rgba(232, 244, 253, 0.6);
}

/* 股票详情区域 */
.stock-details {
    grid-column: span 5;
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* 统计信息栏 */
.stats-bar {
    background: linear-gradient(to right, #e8f5e9, #f3e5f5);
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    color: #455a64;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0f2f1;
}

.stats-bar strong {
    color: #00796b;
    font-size: 16px;
    padding: 0 4px;
}

/* 交替行样式 */
.even-row {
    background-color: rgba(245, 249, 255, 0.4);
}

.odd-row {
    background-color: rgba(255, 255, 255, 0.7);
}

/* 数据变化动画 */
@keyframes highlight {
    0% { background-color: rgba(255, 248, 225, 0.8); }
    100% { background-color: transparent; }
}

.data-update {
    animation: highlight 1.5s ease-out;
}

/* 移动设备优化 */
@media (max-width: 768px) {
    .stock-item {
        grid-template-columns: 1fr 1fr;
    }
    
    .stock-details {
        grid-column: span 2;
    }
    
    .data-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .refresh-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .target-stocks-table th,
    .target-stocks-table td {
        padding: 10px 6px;
        font-size: 12px;
    }
}

/* 打印样式优化 */
@media print {
    body {
        background-color: white;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    header, #refresh-btn, .no-print {
        display: none;
    }
    
    .section {
        box-shadow: none;
        padding: 5px;
        page-break-inside: avoid;
    }
    
    .target-stocks-table-container {
        box-shadow: none;
    }
    
    .target-stocks-table th {
        background: #f0f0f0;
        color: black;
    }
}

/* 可排序表头样式增强 */
.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background-color 0.2s;
}

.sortable:hover {
    background-color: #bbdefb;
}

.sort-icon {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.6;
}

.sort-icon.active {
    opacity: 1;
    color: #0d47a1;
    font-weight: bold;
}

.sort-icon.active-second {
    opacity: 0.8;
    color: #5c6bc0;
    font-weight: bold;
    font-size: 11px;
}

/* 排序方向指示器 */
.sort-asc::after {
    content: "↑";
    position: absolute;
    right: 8px;
    color: #0d47a1;
}

.sort-desc::after {
    content: "↓";
    position: absolute;
    right: 8px;
    color: #0d47a1;
}

/* 涨停时间列样式 */
.stock-limit-time {
    white-space: nowrap;
    color: #e65100;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* 股票信息单元格样式 */
.stock-info-cell {
    vertical-align: top;
    padding: 8px 10px;
}

.stock-main-info {
    display: flex;
    flex-direction: column;
}

.stock-code-row {
    margin-top: 3px;
}

.stock-sub-info {
    margin-top: 6px;
    font-size: 12px;
    color: #546e7a;
    line-height: 1.5;
    border-top: 1px dashed #e0e0e0;
    padding-top: 5px;
}

.stock-sectors-row {
    color: #455a64;
    margin-top: 3px;
}

.stock-code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-weight: bold;
    color: #263238;
    letter-spacing: 0.5px;
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
    font-size: 12px;
}

.stock-name {
    font-weight: bold;
    color: #1565c0;
    font-size: 15px;
}

.stock-tags-row {
    margin-bottom: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.stock-tags-row span {
    display: inline-block;
    background-color: #eceff1;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #455a64;
}

/* 成交额列样式增强 */
.stock-turnover-value {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    text-align: right;
    font-weight: 500;
    white-space: nowrap;
    color: #455a64;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #f5f5f5;
}

/* 过滤器控件样式增强 */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 15px;
}

.filter-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background-color: #e0e0e0;
}

.filter-btn.active {
    background-color: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* 排序提示样式 */
.sort-tooltip {
    background-color: #f5f7fa;
    padding: 5px 10px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 12px;
    color: #455a64;
    border: 1px solid #e0e0e0;
    line-height: 1.5;
    width: 100%;
}

.sort-tooltip small {
    display: block;
    color: #78909c;
    margin-top: 3px;
    font-style: italic;
}

/* 确保表格中所有数值列对齐 */
.target-stocks-table td.stock-price, 
.target-stocks-table td.stock-speed, 
.target-stocks-table td.stock-turnover,
.target-stocks-table td.stock-volume-ratio,
.target-stocks-table td.stock-turnover-value {
    text-align: right;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* 股票详情行样式 */
.stock-detail-row {
    border-top: none !important;
    background-color: rgba(248, 249, 250, 0.5) !important;
}

.stock-detail-row td {
    padding: 4px 10px 8px !important;
    border-bottom: 1px solid #e0e0e0;
}

.stock-details-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 15px;
    font-size: 12px;
    color: #546e7a;
}

.stock-tags-container, .stock-sectors-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.stock-tags-container span {
    background-color: #eceff1;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #455a64;
    margin-right: 2px;
}

.stock-sectors-container {
    color: #2e7d32;
    font-weight: 500;
}

.stock-volume-ratio {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    text-align: right;
    font-weight: 500;
    white-space: nowrap;
    color: #673ab7;
    background-color: rgba(103, 58, 183, 0.05);
    border-radius: 3px;
    padding: 2px 4px;
}

/* 涨停时间简洁显示 */
.limit-time-mini {
    font-size: 11px;
    color: #d32f2f;
    margin-top: 2px;
    font-weight: normal;
}

/* 确保表格中的内容对齐 */
.target-stocks-table td.stock-price, 
.target-stocks-table td.stock-speed, 
.target-stocks-table td.stock-turnover,
.target-stocks-table td.stock-volume-ratio {
    text-align: right;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* 调整表格行高和边距 */
.target-stocks-table tr {
    line-height: 1.3;
}

.target-stocks-table td {
    padding: 8px 10px;
}

/* 调整股票信息单元格样式 */
.stock-info-cell {
    vertical-align: top;
    padding: 8px 10px;
}

.stock-main-info {
    display: flex;
    flex-direction: column;
}

.stock-code-row {
    margin-top: 3px;
}

/* 微调涨停时间列显示 */
.stock-limit-time {
    white-space: nowrap;
    color: #e65100;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    text-align: center;
}

/* 股票名称加重显示 */
.stock-name {
    font-weight: bold;
    color: #1565c0;
    font-size: 15px;
}

/* 量比数值颜色 */
.stock-volume-ratio {
    font-weight: 500;
    color: #673ab7;
}

/* 新增成交额列样式 */
.stock-turnover-value {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    text-align: right;
    font-weight: 500;
    white-space: nowrap;
    color: #455a64;
}

/* 冲刺涨停行样式 */
.row-chasing {
    border-left: 3px solid #ff9800;
}

/* 首板特殊标记 */
.first-board-mark {
    background-color: #8bc34a;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 4px;
    font-weight: bold;
}

/* 优化统计信息栏 */
.stats-bar {
    background: linear-gradient(to right, #e8f5e9, #f3e5f5);
    padding: 10px 15px;
    border-radius: 8px 8px 0 0;
    color: #455a64;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0f2f1;
    flex-wrap: wrap;
    gap: 10px;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .stats-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-controls {
        margin-left: 0;
        width: 100%;
    }
}

/* 统一各数值列样式 */
.stock-price, 
.stock-speed, 
.stock-turnover,
.stock-volume-ratio,
.stock-turnover-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* 调试样式，用于调试时显示边框 */
.debug-border {
    border: 1px solid red !important;
}

/* 确保表格中的数字列右对齐 */
.stock-price, .stock-change, .stock-speed, .stock-turnover, .stock-volume-ratio {
    text-align: right;
    padding-right: 8px;
}

/* 统计栏样式优化 */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: linear-gradient(to right, #f5f5f5, #e5e5e5);
    border-radius: 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .stats-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filter-controls {
        margin-left: 0;
        width: 100%;
    }
} 