/* 行情页面样式 - 专业股票交易风格 */

/* 主要内容区域 */
.main-content {
    padding: 20px 0;
    background: #f5f5f5;
    min-height: calc(100vh - 60px);
    padding-bottom: 60px; /* 为ICP备案留出空间 */
}

/* 市场标签页切换区域 */
.market-tabs-section {
    padding: 20px 0 0 0;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
}

.market-tabs {
    display: flex;
    gap: 0;
    margin-top: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.market-tab {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.market-tab:hover {
    color: var(--color-primary);
    background: rgba(25, 118, 210, 0.05);
}

.market-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* 市场标签页内容 */
.market-tab-content {
    display: none;
}

.market-tab-content.active {
    display: block;
}

/* 市场总览样式 */
.market-overview {
    padding: 20px 0;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
}

.market-overview h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
}

.market-indices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.index-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.index-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.index-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.index-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.index-code {
    font-size: 0.8rem;
    color: var(--color-text-light);
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: "Courier New", monospace;
}

.index-data {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.index-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text-primary);
    font-family: "Courier New", monospace;
}

.index-change {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.change-value,
.change-percent {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: "Courier New", monospace;
}

.index-chart {
    height: 60px;
    background: #f8fafc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    font-size: 0.8rem;
}

/* 内容标签样式 */
.content-tabs {
    padding: 20px 0;
}

.tab-nav {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    background: #ffffff;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
}

.content-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: #f8f9fa;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 3px solid transparent;
}

.content-tab.active {
    background: #ffffff;
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.content-tab:hover:not(.active) {
    background: #ffffff;
    color: var(--color-text-primary);
}

.tab-content {
    background: #ffffff;
    border-radius: 0 0 6px 6px;
    border: 1px solid var(--color-border);
    border-top: none;
}

.tab-panel {
    display: none;
    padding: 20px;
}

.tab-panel.active {
    display: block;
}

/* 排行榜样式 */
.rankings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.ranking-types {
    display: flex;
    gap: 4px;
}

.ranking-type-btn {
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    background: #f8f9fa;
    color: var(--color-text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.ranking-type-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.ranking-type-btn:hover:not(.active) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.market-filter .filter-select {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--color-text-primary);
    font-size: 14px;
}

.market-filter .filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* 成交量异动榜 - 异动说明区域 */
.volume-aberration-hint-wrap {
    flex-basis: 100%;
    width: 100%;
    margin-top: 10px;
    order: 10;
}

.volume-aberration-hint-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 16px;
    padding: 10px 14px;
    background: #f0f7ff;
    border-left: 4px solid var(--color-primary, #1976d2);
    border-radius: 6px;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}

.volume-aberration-hint-title {
    font-weight: 600;
    color: var(--color-primary, #1976d2);
    flex-shrink: 0;
}

.volume-aberration-hint-formula {
    color: #333;
}

.volume-aberration-hint-desc {
    color: #555;
}

.rankings-content {
    border-radius: 6px;
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
}

.rankings-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
}

.rankings-table td {
    text-align: center;
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.rankings-table tbody tr {
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.rankings-table tbody tr:hover {
    background: #fafafa;
}

.rank-number {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    margin: 0 auto;
}

.rank-number.rank-1 {
    background: var(--color-rise);
    color: #ffffff;
}

.rank-number.rank-2 {
    background: #fa8c16;
    color: #ffffff;
}

.rank-number.rank-3 {
    background: var(--color-warning);
    color: #ffffff;
}

.rank-number:not(.rank-1):not(.rank-2):not(.rank-3) {
    background: #f0f0f0;
    color: var(--color-text-secondary);
}

/* 股票信息列 */
.stock-info {
    text-align: left;
}

.stock-info .stock-name {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}

.stock-info .stock-code {
    font-size: 12px;
    color: var(--color-text-light);
    font-family: "Courier New", monospace;
}

/* 价格列 */
.price-column {
    font-family: "Courier New", monospace;
    font-weight: 600;
}

/* 通用按钮样式 */
.btn {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: #40a9ff;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f8f9fa;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* 行业板块工具栏 / 列表（对齐自选股列表形态） */
.sectors-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sectors-toolbar-left {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.sector-count {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.sector-source-hint {
    font-size: 12px;
    color: var(--color-text-light, #999);
}

.sectors-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sectors-toolbar-right #refreshSectorSlopeBtn:disabled,
.sectors-toolbar-right #refreshConceptSlopeBtn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.sector-view-controls {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.sector-view-controls .view-btn {
    background: #ffffff;
    border: none;
    padding: 8px 12px;
    font-size: 16px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sector-view-controls .view-btn.active,
.sector-view-controls .view-btn:hover {
    background: var(--color-primary);
    color: #ffffff;
}

.sectors-list {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: auto;
    max-height: 70vh;
}

.sectors-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.sectors-table th,
.sectors-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    white-space: nowrap;
    font-size: 14px;
    vertical-align: middle;
}

.sectors-table th {
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 1;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.sectors-table th.th-sortable {
    cursor: pointer;
    user-select: none;
}

.sectors-table th.th-sortable:hover {
    color: #2563eb;
}

.sectors-table th.th-sortable.is-sorted {
    color: #1d4ed8;
}

.sectors-table th.th-sortable .sort-indicator {
    font-size: 0.75em;
    opacity: 0.85;
    margin-left: 2px;
}

.sectors-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.sectors-table tbody tr:hover {
    background: #f5f9ff;
}

.sectors-table .stock-info-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sectors-table .stock-info-cell .stock-name {
    font-weight: 600;
    color: var(--color-text-primary);
}

.sectors-table .stock-info-cell .stock-code {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-family: "Courier New", monospace;
}

.sectors-table .btn {
    padding: 4px 10px;
    font-size: 13px;
}

/* 板块网格 */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.sector-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.sector-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.sector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sector-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.sector-change {
    font-weight: 600;
    font-family: "Courier New", monospace;
}

.sector-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #fafafa;
    border-radius: 6px;
}

.sector-stats .stat-item {
    text-align: center;
}

.sector-stats .label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    display: block;
}

.sector-stats .value {
    font-size: 18px;
    font-weight: 700;
    font-family: "Courier New", monospace;
}

.sector-leaders {
    margin-bottom: 1rem;
}

.leader-stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.leader-stock:last-child {
    border-bottom: none;
}

.leader-stock .stock-name {
    font-weight: 600;
    color: var(--color-text-primary);
}

.leader-stock .stock-name.clickable {
    cursor: pointer;
    color: var(--color-primary);
    text-decoration: underline;
    transition: all 0.3s ease;
}

.leader-stock .stock-name.clickable:hover {
    color: var(--color-primary-dark);
    text-decoration: none;
}

.leader-stock .stock-change {
    font-weight: 600;
    font-family: "Courier New", monospace;
}

.board-role-chip {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #0f766e;
    background: #ccfbf1;
    border-radius: 3px;
    vertical-align: middle;
}

.board-source-chip {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 500;
    color: #334155;
    background: #e2e8f0;
    border-radius: 3px;
    vertical-align: middle;
}

.board-source-chip.board-source-em {
    color: #9a3412;
    background: #ffedd5;
}

.sector-detail-btn {
    width: 100%;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sector-detail-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* 热门关注 */
.hot-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.hot-section {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.hot-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.hot-stocks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot-stock-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.hot-stock-item:hover {
    background: #fafafa;
}

.hot-stock-item .rank {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    background: #f0f0f0;
    color: var(--color-text-secondary);
}

.hot-stock-item:nth-child(1) .rank {
    background: var(--color-rise);
    color: #ffffff;
}

.hot-stock-item:nth-child(2) .rank {
    background: #fa8c16;
    color: #ffffff;
}

.hot-stock-item:nth-child(3) .rank {
    background: var(--color-warning);
    color: #ffffff;
}

.hot-indicator {
    color: var(--color-rise);
    font-size: 16px;
    margin-left: auto;
}

.stock-price {
    margin-left: auto;
    text-align: right;
    font-family: "Courier New", monospace;
}

/* 资金流向和情绪指标 */
.capital-flow {
    margin-bottom: 1.5rem;
}

.flow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.flow-item:last-child {
    border-bottom: none;
}

.flow-label {
    font-weight: 500;
    color: var(--color-text-secondary);
}

.flow-value {
    font-weight: 600;
    font-family: "Courier New", monospace;
}

.sentiment-meter {
    text-align: center;
    margin-bottom: 1rem;
}

.meter-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.meter-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-fall), var(--color-warning), var(--color-rise));
    transition: width 0.3s ease;
}

.meter-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.sentiment-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.sentiment-item {
    text-align: center;
}

.sentiment-item .label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.sentiment-item .value {
    font-size: 16px;
    font-weight: 700;
}

/* 市场统计 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stats-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.stats-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.stats-content {
    margin-bottom: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: var(--color-text-secondary);
}

.stat-value {
    font-weight: 600;
    font-family: "Courier New", monospace;
    color: var(--color-text-primary);
}

.distribution-chart {
    height: 120px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.heat-indicators {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.heat-item {
    text-align: center;
    padding: 12px;
    background: #fafafa;
    border-radius: 6px;
}

.heat-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.heat-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.heat-trend {
    font-size: 12px;
    font-weight: 600;
    font-family: "Courier New", monospace;
}

/* 行业板块详情弹窗 */
.sector-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1100;
    justify-content: center;
    align-items: flex-start;
    padding: 8vh 16px 24px;
    box-sizing: border-box;
}

.sector-detail-modal.show {
    display: flex;
}

.sector-detail-content {
    background: #ffffff;
    border-radius: 8px;
    width: 100%;
    max-width: 720px;
    max-height: 84vh;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
}

.sector-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-border);
}

.sector-detail-header h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.sector-detail-sub {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.close-sector-detail {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-light);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}

.close-sector-detail:hover {
    color: var(--color-text-secondary);
    background: #f5f5f5;
    border-radius: 4px;
}

.sector-detail-body {
    padding: 16px 20px 22px;
    overflow-y: auto;
}

.sector-detail-loading,
.sector-detail-error {
    text-align: center;
    color: #888;
    padding: 2rem 0;
}

.sector-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin-bottom: 16px;
}

.sector-detail-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 4px;
    font-size: 13px;
}

.sector-detail-item .label {
    color: var(--color-text-secondary);
}

.sector-detail-item .value {
    font-weight: 600;
    font-family: "Courier New", monospace;
    text-align: right;
}

.sector-detail-section {
    margin-top: 14px;
}

.sector-detail-section h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.sector-fund-flow-host {
    min-height: 48px;
}

.sector-limit-up-host {
    min-height: 48px;
}

.sector-limit-up-summary {
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
    line-height: 1.45;
}

.sector-limit-up-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #475569;
}

.sector-limit-up-controls label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sector-limit-up-mode {
    min-width: 120px;
    padding: 2px 6px;
}

.sector-limit-up-min {
    width: 52px;
    padding: 2px 4px;
}

.sector-limit-up-wave {
    font-size: 13px;
    color: #334155;
    margin-bottom: 8px;
    line-height: 1.5;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.sector-limit-up-wave-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.sector-limit-up-hint {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 4px;
}

.sector-limit-up-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.sector-limit-up-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.sector-limit-up-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sector-limit-up-table th,
.sector-limit-up-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    white-space: nowrap;
}

.sector-limit-up-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    z-index: 1;
}

.sector-limit-up-table td.num,
.sector-limit-up-table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sector-limit-up-table .sector-limit-up-check {
    width: 28px;
    text-align: center;
    padding-left: 8px;
    padding-right: 4px;
}

.sector-limit-up-link {
    color: #1d4ed8;
    text-decoration: none;
}

.sector-limit-up-link:hover {
    text-decoration: underline;
}

.sector-fund-flow-tiers {
    margin: 8px 0;
    font-size: 13px;
}

.sector-fund-flow-tiers summary {
    cursor: pointer;
    color: var(--color-text-secondary, #64748b);
    margin-bottom: 6px;
}

.sector-ff-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    margin-top: 12px;
    padding: 8px 4px 0;
    border-top: 1px solid #e2e8f0;
    overflow-x: auto;
}

.sector-ff-bar-col {
    flex: 1 0 14px;
    max-width: 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.sector-ff-bar-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    min-height: 80px;
}

.sector-ff-bar {
    width: 100%;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
}

.sector-ff-bar.up {
    background: #dc2626;
}

.sector-ff-bar.down {
    background: #16a34a;
}

.sector-ff-bar-label {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    white-space: nowrap;
}

.sector-detail-summary {
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-primary);
    background: #f8fafc;
    border-left: 3px solid var(--color-primary);
    padding: 10px 12px;
    border-radius: 0 4px 4px 0;
}

.sector-trend-summary-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 6px;
}

.sector-trend-summary-title {
    font-weight: 600;
    color: #334155;
}

.sector-trend-summary-body {
    color: #475569;
    word-break: break-word;
}

.sector-weak-chip.mixed {
    color: #6d28d9;
    background: #ede9fe;
}

.sector-slope-trend-wrap {
    margin-top: 14px;
    padding: 12px 12px 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 72%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.sector-slope-trend-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 14px;
    margin-bottom: 10px;
}
.sector-slope-trend-title {
    font-size: 14px;
    font-weight: 650;
    color: #0f172a;
}
.sector-slope-trend-hint {
    font-size: 12px;
    color: #94a3b8;
}
.sector-slope-trend-host {
    min-height: 64px;
}
.sector-slope-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.sector-slope-legend-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.sector-slope-legend-btn .sector-slope-legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--leg, #94a3b8);
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}
.sector-slope-legend-btn.is-on .sector-slope-legend-swatch {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--leg, #2563eb) 28%, transparent);
}
.sector-slope-legend-btn .sector-slope-legend-n {
    font-size: 10px;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.sector-slope-legend-btn.is-on {
    border-color: color-mix(in srgb, var(--leg, #2563eb) 42%, #e2e8f0);
    color: #0f172a;
    background: color-mix(in srgb, var(--leg, #2563eb) 9%, #fff);
    font-weight: 600;
}
.sector-slope-legend-btn:not(.is-on) {
    opacity: 0.55;
}
.sector-slope-legend-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.sector-slope-latest {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px 8px;
    margin-bottom: 10px;
}
.sector-slope-latest-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
}
.sector-slope-latest-lab {
    font-size: 11px;
    font-weight: 600;
}
.sector-slope-latest-val {
    font-size: 13px;
    font-family: ui-monospace, "Courier New", monospace;
    font-weight: 650;
}
.sector-slope-chart-box {
    width: 100%;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #f1f5f9;
    overflow: hidden;
}
.sector-slope-chart-box canvas {
    display: block;
    width: 100%;
    height: 220px;
}
.sector-slope-chart-foot {
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}
@media (max-width: 720px) {
    .sector-slope-latest {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.sector-weak-chip {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
}

.sector-weak-chip.weak {
    color: #b91c1c;
    background: #fee2e2;
}

.sector-weak-chip.ok {
    color: #047857;
    background: #d1fae5;
}

.sector-weak-chip.strong {
    color: #b45309;
    background: #ffedd5;
}

.sector-weak-chip.unknown {
    color: #92400e;
    background: #fef3c7;
}

/* 龙头/中军：复用分析频道板块分析 ba-short-roles / ba-role-pill */
.ba-muted {
    color: #94a3b8;
    font-size: 0.85rem;
}

.ba-short-roles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.85rem;
}

.ba-short-roles-label {
    color: #6b7280;
    flex-shrink: 0;
}

.ba-role-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
}

.ba-role-pill--leader {
    color: #fff;
    background: #f56c6c;
    border: 1px solid #f56c6c;
}

.ba-role-pill--leader:hover {
    color: #fff;
    background: #f78989;
    border-color: #f78989;
    text-decoration: none;
}

.ba-role-pill--mid {
    color: #8a6116;
    background: #fdf6ec;
    border: 1px solid #e6a23c;
}

.ba-role-pill--mid:hover {
    color: #6d4c10;
    background: #faecd8;
    border-color: #cf9236;
    text-decoration: none;
}

.sector-detail-meta {
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

.close-sector-detail svg {
    display: block;
}

.sector-detail-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 10px;
}

.sector-detail-section-head h3 {
    margin: 0;
}

.sector-detail-section-head .sector-detail-actions {
    margin: 0;
}

.sector-slope-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.sector-slope-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sector-slope-table th,
.sector-slope-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    white-space: nowrap;
}

.sector-slope-table thead th {
    color: #64748b;
    font-weight: 600;
    font-size: 12px;
}

.sector-slope-table tbody th {
    font-weight: 500;
}

.sector-slope-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, "Courier New", monospace;
}

.sector-slope-table .sector-weak-chip {
    margin-left: 0;
}

.sector-slope-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.sector-slope-meta-item .k::after {
    content: "：";
}

.sector-slope-meta-item .v {
    color: #334155;
    font-variant-numeric: tabular-nums;
}

.sector-ff-chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
}

.sector-ff-chart-hint {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
}

.sector-ff-chart-head + .sector-ff-chart {
    margin-top: 6px;
}

.sector-limit-up-wave-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
}

.sector-limit-up-wave-main .k {
    font-weight: 600;
}

.sector-limit-up-wave-main .v {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.sector-limit-up-wave-main .r {
    color: #64748b;
}

.sector-limit-up-count {
    margin-left: auto;
    align-self: center;
    font-size: 12px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.sector-limit-up-table .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.sector-detail-foot {
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    color: #64748b;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* 搜索弹窗 */
.search-modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal.show {
    display: flex !important;
    visibility: visible;
    opacity: 1;
}

.search-content {
    background: #ffffff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.search-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 16px;
    margin-right: 12px;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.close-search {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-search:hover {
    background: #f5f5f5;
    color: var(--color-text-secondary);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

/* 颜色类 */
.positive {
    color: var(--color-rise) !important;
}

.negative {
    color: var(--color-fall) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .market-indices {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 0.75rem;
    }
    
    .rankings-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .ranking-types {
        justify-content: center;
    }
    
    .sectors-grid {
        grid-template-columns: 1fr;
    }
    
    .hot-content {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sentiment-meter {
        margin-bottom: 1rem;
    }
    
    .meter-label,
    .meter-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .index-data {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .hot-stock-item {
        padding: 8px 0;
    }
    
    .sentiment-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .rankings-table th,
    .rankings-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .content-tab {
        flex: none;
        min-width: 80px;
    }
} 

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 20px 0 10px 0;
    flex-wrap: wrap;
  }
  .pagination .page-btn {
    min-width: 32px;
    height: 32px;
    margin: 0 2px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
  }
  .pagination .page-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    font-weight: bold;
    cursor: default;
  }
  .pagination .page-btn:disabled {
    background: #f3f4f6;
    color: #bbb;
    border-color: #e5e7eb;
    cursor: not-allowed;
  }
  .pagination .page-btn:hover:not(:disabled):not(.active) {
    background: #f1f5fd;
    color: #2563eb;
    border-color: #2563eb;
  }
  .pagination .page-ellipsis {
    padding: 0 6px;
    color: #999;
    font-size: 16px;
    user-select: none;
  }

  /* 让表格区域在小屏下可横向滚动，且宽度自适应 */
.table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
    box-sizing: border-box;
  }
  
  @media (max-width: 900px) {
    .table {
      min-width: 500px;
      font-size: 13px;
    }
  }
  
  @media (max-width: 600px) {
    .table {
      min-width: 400px;
      font-size: 12px;
    }
    .table thead, .table tbody, .table tr, .table th, .table td {
      white-space: nowrap;
    }
  }
  
  /* 让表格外层容器自适应并可滚动 */
  .rankings-content, .tab-panel, .main-content, .container {
    width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
  }



  /* 让表格区域和分页始终拉伸填满父容器 */
.rankings-content {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    /* 关键：让内容区自适应拉伸 */
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  
  /* 让表格100%宽度，且可横向滚动 */
  .rankings-table, .table {
    width: 100%;
    min-width: 900px; /* 你可以根据实际列数调整 */
    box-sizing: border-box;
    border-collapse: collapse;
    display: table;
  }
  
  /* 让表格外层在小屏下可横向滚动 */
  @media (max-width: 900px) {
    .rankings-content {
      overflow-x: auto;
    }
    .rankings-table, .table {
      min-width: 600px;
      font-size: 13px;
    }
  }
  @media (max-width: 600px) {
    .rankings-table, .table {
      min-width: 400px;
      font-size: 12px;
    }
  }
  
  /* 分页栏自适应居中 */
  .pagination {
    width: 100%;
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
  }

/* 单板重算斜率：flex 放在内层，避免 td 失去 table-cell 导致与行内容垂直不对齐 */
.sector-row-actions {
    vertical-align: middle;
}
.sector-row-actions-inner {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.sector-row-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
}
.sector-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.sector-card-actions .sector-detail-btn,
.sector-card-actions .sector-slope-btn {
    flex: 1;
    min-width: 72px;
}
.sector-slope-btn {
    background: #fff;
    border: 1px solid var(--color-border, #d9d9d9);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text, #333);
}
.sector-slope-btn:hover {
    border-color: var(--color-primary, #1890ff);
    color: var(--color-primary, #1890ff);
}
.sector-slope-btn:disabled,
.sector-row-slope-btn:disabled,
.sector-detail-slope-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}
.sector-detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
}

.sector-detail-actions .sector-detail-rpe-btn {
    border: none;
}

.lhb-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lhb-types {
    display: flex;
    gap: 8px;
}

.lhb-type-btn {
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    background: #f8f9fa;
    color: var(--color-text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.lhb-type-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.lhb-type-btn:hover:not(.active) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.lhb-meta {
    color: #666;
    font-size: 13px;
}

.lhb-hint {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fff8e6;
    border: 1px solid #ffe2a8;
    border-radius: 6px;
    color: #8a6d3b;
    font-size: 13px;
}

.lhb-table-wrap {
    overflow-x: auto;
}

.lhb-subhead {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.lhb-hot-wrap {
    margin-top: 8px;
}

.auction-toolbar {
    flex-wrap: wrap;
    gap: 10px;
}

.auction-benchmark-wrap {
    margin: 12px 0 16px;
}

.auction-benchmark-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.auction-benchmark-card {
    border: 1px solid #e5ebf2;
    border-radius: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    cursor: pointer;
    transition: box-shadow .2s, transform .2s;
}

.auction-benchmark-card:hover {
    box-shadow: 0 6px 18px rgba(31, 42, 55, 0.08);
    transform: translateY(-1px);
}

.auction-benchmark-card .abc-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: #6b7a8c;
}

.auction-benchmark-card .abc-name {
    font-weight: 600;
    color: #1f2a37;
}

.auction-benchmark-card .abc-pct {
    margin-top: 8px;
    font-size: 20px;
    font-weight: 700;
}

.auction-benchmark-card .abc-tags {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7a8c;
}

.auction-empty {
    color: #888;
    font-size: 14px;
    padding: 8px 0;
}
