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

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
    padding: 15px 0;
}

/* 主容器布局 - 使用flex布局 */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    position: relative;
    gap: 5px;
}

/* 主表格容器 - 留出侧边栏空间 */
.table-container {
    width: calc(100% - 200px);
    overflow-x: auto;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 确保表格宽度填充满容器 */
.table-container table {
    width: 100%;
    border-collapse: collapse;
}

/* 左侧表格表头样式 */
.table-container th {
    background-color: #4285F4;
    color: white;
    font-weight: bold;
    padding: 10px 8px;
    text-align: center;
}

/* 右侧题材统计表样式 */
.sidebar {
    position: sticky;
    top: 20px;
    width: 190px;
    max-height: calc(100vh - 40px);
    display: block;
    opacity: 1;
}

/* 调整列宽 */
th:nth-child(1), td:nth-child(1) {
    width: 100px;
    white-space: nowrap;
    text-align: center;
    overflow: visible;
    text-overflow: ellipsis;
}

th:nth-child(2), td:nth-child(2) {
    width: 100px;
    text-align: center;
    padding: 0;
    white-space: nowrap;
}

th:nth-child(3), td:nth-child(3) {
    width: 70px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th:nth-child(4), td:nth-child(4) {
    width: 70px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 分时图容器样式 */
.time-chart {
    width: 100px;
    height: 50px;
    margin: 0 auto;
    display: block;
}

/* 确保分时图列的单元格有足够的高度 */
td:nth-child(2) {
    height: 50px;
    padding: 0;
}

th:nth-child(7), td:nth-child(7) {
    width: 80px;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

th:nth-child(8), td:nth-child(8) {
    width: 800px;
    white-space: normal;
    word-wrap: break-word;
}

th:nth-child(9), td:nth-child(9) {
    width: 50px;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
}

th:nth-child(10), td:nth-child(10) {
    width: 40px;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 确保表格单元格内容格式正确 */
th:not(:nth-child(8)):not(:nth-child(9)), 
td:not(:nth-child(8)):not(:nth-child(9)) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 隐藏代码列和市场列 */
th:nth-child(5), td:nth-child(5),
th:nth-child(6), td:nth-child(6) {
    display: none;
}

/* 排序表头样式 */
th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
}

th.sortable::after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

th.sortable.sorted::after {
    color: white;
    transform: translateY(-50%) rotate(180deg);
}

/* 3开头股票代码显示为橙色 */
.orange-code {
    color: #FF7F00;
}

.stock-name-link.blue-text {
    color: #1E90FF !important;
}

.stock-name-link.orange-text {
    color: #FF7F00 !important;
}

/* 表格内联样式优化 */
.stock-name-link {
    text-decoration: none;
    color: #2c3e50;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

.no-data {
    text-align: center;
    padding: 80px;
    color: #777;
    font-size: 12px;
}

.date-info {
    background-color: #e8f4f8;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: bold;
}

/* 几天几板样式 */
.days-boards-tag {
    color: rgb(255, 255, 255);
    background: rgb(255, 90, 81);
    border-radius: 4px;
    font-size: 12px;
    padding: 0px 8px;
    display: inline-block;
}

/* 表格内联样式优化 */
.stock-name-link {
    text-decoration: none;
    color: #2c3e50;
}

.filter-input {
    margin: 0 auto;
    display: block;
    padding: 5px;
    border: none;
    border-radius: 5px;
    text-align: center;
}

.search-input {
    padding: 5px;
    font-size: 12px;
    width: 100%;
    text-align: center;
}

.search-wrapper {
    display: flex;
    width: 100%;
    margin-top: 5px;
}

/* 详情页分时图样式 */
.min-chart-full .time-chart {
    width: 100%;
    height: 500px;
}

/* 题材统计表格 */
.plate-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* 右侧题材统计表表头样式 */
.plate-stats-table th {
    padding: 6px 8px;
    text-align: center;
    background-color: #d03939;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 500;
    color: #faf7f7;

    font-size: 14px;
    height: 24px;
}

/* 表格数据行 */
.plate-stats-table tr:not(:last-child) td {
    padding: 6px 8px;
    border-bottom: 1px solid #f5f5f5;
    line-height: 1;
    height: 28px;
}

/* 表格最后一行 */
.plate-stats-table tr:last-child td {
    padding: 6px 8px;
    line-height: 1;
    height: 28px;
}

/* 题材名称列 */
.plate-name {
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

/* 数量列 */
.plate-count {
    font-weight: 600;
    color: #333;
    text-align: right;
    width: 30px;
}

/* 无数据提示 */
.plate-stats-table .no-data {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* 题材搜索容器样式 */
.plate-search-container {
    display: flex;
    gap: 8px;
    padding: 10px;
    align-items: center;
    justify-content: center;
 
    border-top: 1px solid #e0e0e0;
}

/* 搜索输入框样式 */
.plate-search-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 120px;
    transition: all 0.3s ease;
    outline: none;
}

.plate-search-input:focus {
    outline: none;
    border-color: #d03939;
    box-shadow: 0 0 0 2px rgba(208, 57, 57, 0.1);
}

/* 搜索按钮样式 */
.plate-search-button {
    padding: 6px 12px;
    background-color: #d03939;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.plate-search-button:hover {
    background-color: #b52a2a;
}

.plate-search-button:active {
    transform: translateY(1px);
}

/* 滚动条美化 */
.stats-content::-webkit-scrollbar {
    width: 6px;
}

.stats-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.stats-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.stats-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 - 1200px以下屏幕 */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
        gap: 12px;
    }
    
    .table-container {
        width: 100%;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        margin-top: 0;
        height: auto;
        max-height: 400px;
    }
}

/* 响应式设计 - 768px以下屏幕 */
@media (max-width: 768px) {
    .header-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    h1 {
        font-size: 2em;
    }
}

/* 搜索建议样式 */
.search-wrapper {
    position: relative;
    display: block;
    width: 100%;
    height: 30px;
}

.search-input {
    width: 100%;
    height: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}

/* 将搜索建议下拉框放在表格外部 */
#searchSuggestions {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 3px 3px;
    background-color: white;
    z-index: 9999;
    display: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    /* 确保下拉框不被其他元素裁剪 */
    clip-path: none;
    /* 确保下拉框能够覆盖在表格内容上方 */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.search-suggestion-item {
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* 涨跌颜色样式 */
.price-up {
    color: #ff4d4f;
}

.price-down {
    color: #52c41a;
}