/* ============================================================
   同花顺财经首页样式 (模仿 10jqka.com.cn 视觉风格)
   品牌色: #FF2436(红) / 正文: #252525 / 次级文字: #25252599
   ============================================================ */

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

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f5f6f8;
    color: #252525;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: #ff2436;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ============ 顶部导航 ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.site-header .header-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-logo img {
    height: 26px;
    width: auto;
}

/* 左侧组:Logo + 导航 + 搜索 + 问财, 模块间距统一(源站同款分组) */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

/* 主导航:内部菜单项间距紧凑(小于模块间距), 统一基准字号/常规字重 */
.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-nav a {
    font-size: 14px;
    color: rgba(37, 37, 37, 0.84);
    padding: 4px 0;
    transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a.active {
    color: #ff2436;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-search {
    position: relative;
}

.header-search input {
    width: 240px;
    height: 36px;
    padding: 0 12px 0 36px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.04);
    font-size: 14px;
    outline: none;
    transition: border 0.2s, background 0.2s;
}

.header-search input:focus {
    background: #fff;
    border: 1px solid #3366ff;
}

.header-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border: 1px solid #ff2436;
    border-radius: 6px;
    background: transparent;
    color: #ff2436;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-btn:hover {
    background: #ff2436;
    color: #fff;
}

/* 下载客户端:灰色细边框(与源站一致) */
.header-btn.ghost {
    border-color: #999;
    color: #323232;
}

.header-btn.ghost:hover {
    background: transparent;
    color: #ff2436;
    border-color: #ff2436;
}

/* 问财:小头像图标 + 文字, hover 变红(与源站一致) */
.header-wencai {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: rgba(37, 37, 37, 0.84);
    padding: 6px 2px;
    white-space: nowrap;
    transition: color 0.2s;
}

.header-wencai img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.header-wencai:hover {
    color: #ff2436;
}

/* 返回旧版:纯文字按钮, hover 变红(与源站一致) */
.header-text-btn {
    font-size: 14px;
    color: rgba(37, 37, 37, 0.84);
    padding: 6px 2px;
    white-space: nowrap;
    transition: color 0.2s;
}

.header-text-btn:hover {
    color: #ff2436;
}

/* 登录:红色实心主按钮(红底白字) */
.header-btn.solid {
    background: #ff2436;
    color: #fff;
}

.header-btn.solid:hover {
    background: #d81e2e;
    color: #fff;
}

/* ============ 页面主体 ============ */
.page-main {
    max-width: 1400px;
    margin: 16px auto 0;
    padding: 0 24px 24px;
    display: grid;
    /* 与源站一致:主内容区 78% | 快讯侧边栏 22% */
    grid-template-columns: 78fr 22fr;
    gap: 16px;
    align-items: start;
}

/* 左侧主内容区:指数条 + K线大图 + 快捷导航 + 资讯, 纵向堆叠 */
.main-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============ 新闻模块(左栏) ============ */
.news-module {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.theme-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    /* 隐藏滚动条:与源站一致,用滚轮横向滚动 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.theme-tabs::-webkit-scrollbar {
    display: none;
}

.theme-tabs a {
    position: relative;
    font-size: 15px;
    color: rgba(37, 37, 37, 0.84);
    white-space: nowrap;
    padding-bottom: 2px;
    transition: color 0.2s;
}

.theme-tabs a.active,
.theme-tabs a:hover {
    color: #252525;
    font-weight: 600;
}

.theme-tabs a.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: #fd4332;
}

/* 新闻列表 */
.news-list {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.news-item {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid rgba(37, 37, 37, 0.06);
    transition: opacity 0.2s;
}

.news-item:hover {
    opacity: 0.85;
}

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

/* 带图新闻(图文左右布局) */
.news-item.with-pic {
    display: flex;
    gap: 16px;
}

/* 第一条重点资讯:红色序号 + 加粗标题 + 摘要 */
.news-item.special {
    display: flex;
    gap: 14px;
}

.news-item.special .news-rank {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 3px;
    border-radius: 4px;
    background: #ff2436;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.news-item .news-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.news-item .news-pic {
    width: 140px;
    height: 96px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-item .news-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-title {
    font-size: 15px;
    font-weight: 400;
    line-height: 24px;
    color: rgba(37, 37, 37, 0.84);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 第一条重点资讯标题:加粗放大(与源站一致) */
.news-item.special .news-title {
    font-size: 18px;
    font-weight: 700;
    color: #252525;
}

.news-summary {
    font-size: 13px;
    line-height: 22px;
    color: rgba(37, 37, 37, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(37, 37, 37, 0.4);
    margin-top: 6px;
}

.news-meta .news-tag {
    color: #ff2436;
}

/* ============ 7x24 快讯(右栏) ============ */
.flash-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px 18px;
    /* 跟随屏幕(页面下滚时面板固定在视口右侧),最高高度限制,内部 flex 布局 */
    position: sticky;
    top: 84px;
    max-height: 680px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 面板标题 + 分类标签组:始终固定在面板顶部,不随列表滚动 */
.flash-panel-title,
.flash-tabs {
    flex-shrink: 0;
}

.flash-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.flash-panel-title .flash-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #ff9500, #ff9500);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
}

/* 快讯分类标签组:横向排列,点击高亮(列表不变) */
.flash-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0 12px;
    border-bottom: 1px solid rgba(37, 37, 37, 0.05);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.flash-tabs::-webkit-scrollbar {
    display: none;
}

.flash-tabs button {
    position: relative;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: rgba(37, 37, 37, 0.6);
    cursor: pointer;
    padding: 4px 0;
    white-space: nowrap;
    transition: color 0.2s;
}

.flash-tabs button:hover {
    color: #252525;
}

.flash-tabs button.active {
    color: #ff2436;
    font-weight: 600;
}

.flash-tabs button.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -3px;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: #ff2436;
}

/* 快讯分类列表:默认隐藏,激活 tab 显示对应分类;
   激活列表占满剩余高度并内部滚动(滚动条隐藏),标题/tab 固定不动 */
.flash-list {
    display: none;
}

.flash-list.active {
    display: block;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.flash-list.active::-webkit-scrollbar {
    display: none;
}

.flash-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    position: relative;
}

.flash-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 30px;
    bottom: 0;
    width: 1px;
    border-left: 1px dashed rgba(37, 37, 37, 0.1);
}

.flash-item .flash-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(37, 37, 37, 0.4);
    margin-top: 6px;
    flex-shrink: 0;
}

.flash-item .flash-dot.hot {
    background: #ff2436;
}

.flash-item .flash-content {
    flex: 1;
    min-width: 0;
}

.flash-item .flash-time {
    font-size: 13px;
    color: rgba(37, 37, 37, 0.6);
    margin-bottom: 2px;
}

.flash-item .flash-time.hot {
    color: #ff2436;
}

.flash-item h3 {
    font-size: 15px;
    font-weight: 400;
    line-height: 24px;
    cursor: pointer;
    color: rgba(37, 37, 37, 0.84);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flash-item h3:hover {
    text-decoration: underline;
}

.flash-item p {
    font-size: 12px;
    line-height: 20px;
    color: rgba(37, 37, 37, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
}

/* ============ 页脚 ============ */
.site-footer {
    background: linear-gradient(to bottom, #fff, #f5f5f5);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 36px 24px 28px;
    margin-top: 8px;
}

.site-footer .footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 20px;
}

.footer-links a {
    font-size: 14px;
    color: rgba(37, 37, 37, 0.6);
}

.footer-links a:hover {
    color: #ff2436;
}

.footer-copyright {
    font-size: 13px;
    color: rgba(37, 37, 37, 0.4);
    line-height: 22px;
}

/* ============ 功能快捷入口条 ============ */
.tools-bar {
    display: flex;
    align-items: stretch;
    gap: 28px;
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    padding: 14px 24px;
    /* 隐藏滚动条:与源站一致,用滚轮横向滚动 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tools-bar::-webkit-scrollbar {
    display: none;
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 64px;
    flex-shrink: 0;
}

.tool-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.tool-item:hover img {
    opacity: 1;
}

.tool-item span {
    font-size: 13px;
    color: rgba(37, 37, 37, 0.84);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ============ 大盘指数模块(层级:Tab导航栏 → 简易行情行 → 图表+右侧面板) ============ */
.market-panel {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

/* 第一层:横向指数Tab导航栏(激活浅底高亮, 滚轮横向滚动, 无滚动条) */
.index-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.index-strip::-webkit-scrollbar {
    display: none;
}

/* 指数Tab:上名称 + 下涨跌幅, 激活浅灰底高亮(与源站一致) */
.index-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-width: 128px;
    padding: 4px 16px;
    border: none;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.index-chip:hover,
.index-chip.active {
    background: rgba(0, 0, 0, 0.04);
}

.index-chip .idx-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    color: #323232;
}

.index-chip .idx-pct {
    align-self: flex-start;
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
    color: #f23030;
}

/* 红涨绿跌 */
.index-chip[data-pct^="-"] .idx-pct {
    color: #099b48;
}

/* 更多滚动按钮:点击向右滚动查看更多指数 */
.index-more {
    align-self: center;
    margin-left: auto;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: background 0.15s;
}

.index-more:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* 图表卡片:第二层行情行 + 第三层图表区 */
.chart-card {
    padding: 0 16px 16px;
}

/* 第二层:简易行情单行(小号常规平铺, 禁止放大居中, 与源站一致) */
.quote-line {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 2px 0 10px;
}

.quote-line .ql-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    line-height: 1.3333em;
    color: rgba(0, 0, 0, 0.84);
}

.quote-line .ql-val {
    font-weight: 500;
    font-size: 11px;
    line-height: 1.3333em;
    color: #f23030;
}

.quote-line .ql-val.down {
    color: #099b48;
}

/* 成交额等非涨跌数值用常规深色 */
.quote-line .ql-val.plain {
    color: rgba(0, 0, 0, 0.84);
}

/* 第三层:分时图(flex:1) + 右侧成交面板(固定宽), 同一水平线左右并排 */
.market-charts {
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.chart-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 300px;
}

.chart-box {
    position: absolute;
    inset: 0;
}

/* 昨日收盘水平虚线 */
.pre-close-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-image: linear-gradient(to right, #9c9c9c 0, #9c9c9c 1px, transparent 1px, transparent 3px);
    background-size: 3px 1px;
    background-repeat: repeat-x;
    pointer-events: none;
    z-index: 4;
    display: none;
}

/* 曲线右侧红色价格悬浮标签 */
.chart-float-tag {
    position: absolute;
    right: 0;
    transform: translateY(-50%);
    background-color: #f23030;
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 5;
    display: none;
}

/* 右:成交统计卡片(对齐源站 flex flex-col justify-between bg-white rounded-lg p-3 gap-1 flex-none self-stretch) */
.chart-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.turnover-card {
    width: 168px;
    flex: 1;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
}

/* 上半部分:今日实时/预测全天两个灰底小卡(上下拼成一块) */
.tc-group {
    display: flex;
    flex-direction: column;
    width: 144px;
}

.tc-block {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px 4px 0 0;
    padding: 10px 10px 6px 16px;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

.tc-block-bottom {
    border-radius: 0 0 4px 4px;
    padding: 10px 10px 8px 16px;
    gap: 4px;
    position: relative;
}

/* 两卡之间的细分隔线 */
.tc-block-bottom::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 16px;
    width: 112px;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.08);
}

.tc-label {
    font-size: 12px;
    line-height: 16px;
    color: rgba(0, 0, 0, 0.84);
}

.tc-value {
    font-weight: 700;
    font-size: 16px;
    line-height: 22px;
    color: rgba(0, 0, 0, 0.84);
}

/* 较上一日:标签灰 + 数值红(增)/绿(减) */
.tc-diff {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    flex-wrap: nowrap;
    padding-top: 4px;
}

.tc-diff-label {
    font-size: 12px;
    line-height: 16px;
    color: rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
}

.tc-diff-num {
    font-weight: 700;
    font-size: 12px;
    line-height: 16px;
    color: #ff2436;
}

.tc-diff-num.down {
    color: #13b566;
}

/* 下半部分:5日/60日均额 */
.tc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    line-height: 16px;
    color: rgba(0, 0, 0, 0.84);
}

.tc-row b {
    font-weight: 500;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.84);
}

/* AI 问财按钮:头像 + 问题文字轮播(点击跳问财) */
.tc-ai {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.tc-ai img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.tc-ai-carousel {
    overflow: hidden;
    height: 20px;
}

.tc-ai-track {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    line-height: 20px;
    color: rgba(0, 0, 0, 0.84);
    animation: tc-roll 7.5s linear infinite;
}

/* 4 行循环(3 个问题 + 重复首行), 每行 20px */
@keyframes tc-roll {
    0%, 20% { transform: translateY(0); }
    33%, 53% { transform: translateY(-20px); }
    66%, 86% { transform: translateY(-40px); }
    100% { transform: translateY(-60px); }
}

/* ============ 空数据占位 ============ */
.empty-tip {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
    .page-main {
        grid-template-columns: 1fr;
    }

    .flash-panel {
        position: static;
        max-height: none;
    }

    .header-nav {
        display: none;
    }

    .market-charts {
        flex-direction: column;
    }
}
