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

body {
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
    height: 100vh;
    background: #f9f9f9;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 导航栏样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.header .logo {
    font-size: 20px;
    font-weight: bold;
    color: #1890ff;
    text-decoration: none;
    margin-right: 32px;
}

/* 导航菜单样式 */
.nav-menu {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-item {
    margin-right: 8px;
    border-radius: 4px;
    text-decoration: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s;
}

.nav-item:hover {
    color: #3b82f6;
}

.nav-item.active {
    color: #3b82f6;
    font-weight: 600;
    position: relative;
    background: transparent;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #3b82f6;
    border-radius: 2px;
}

.nav-item.active:hover {
    color: #2563eb;
    background: transparent;
}

.header .user-info .user-area {
    display: flex;
    align-items: center;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-menu:hover {
    background-color: #f3f4f6;
}

.user-menu-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-icon {
    flex-shrink: 0;
    font-size: 16px;
    margin-right: 8px;
}

.user-name,
.user-status {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-right: 8px;
}

.dropdown-arrow {
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.2s;
}

.user-menu:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.register-btn {
    padding: 6px 16px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.register-btn:hover {
    background-color: #2563eb;
}

.login-btn, .logout-btn {
    padding: 6px 16px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.login-btn:hover, .logout-btn:hover {
    background: #40a9ff;
}

.logout-btn {
    background: #ff4d4f;
}

.logout-btn:hover {
    background: #ff7875;
}

.logout-item {
    border-top: 1px solid #f3f4f6;
    color: #ef4444;
}

.logout-item:hover {
    background-color: #fef2f2;
}

/* 下拉菜单样式 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 1001;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

/* 导航下拉菜单样式 */
.nav-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    margin-right: 0;
}

.nav-dropdown-trigger:hover {
    color: #3b82f6;
}

.nav-dropdown-trigger .dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.nav-dropdown-trigger:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1001;
    display: none;
}

.nav-dropdown-menu.show {
    display: block;
}

.nav-dropdown-menu .dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    white-space: nowrap;
}

.nav-dropdown-menu .dropdown-item:hover {
    background-color: #f9fafb;
    color: #1890ff;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    white-space: nowrap;
}

.dropdown-item:hover {
    background-color: #f9fafb;
    color: #1890ff;
}

.dropdown-icon {
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .header-left {
        gap: 20px;
    }

    .nav-menu {
        gap: 16px;
    }

    .logo {
        font-size: 18px;
    }
}

@media (max-width: 640px) {
    .nav-menu {
        display: none;
    }

    .user-menu-wrapper {
        gap: 8px;
    }

    .user-name,
    .user-status {
        display: none;
    }

    .register-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* 主内容容器 */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* 侧边栏样式 */
.sidebar {
    width: 195px;
    background: white;
    border-right: 1px solid #eee;
    flex-shrink: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 侧边栏头部 - 固定位置，与目录栏标题保持一致 */
.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0;
    height: 45px;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

/* 侧边栏内容区域 - 可滚动 */
.sidebar-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-content h3 {
    margin: 16px 0 8px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 4px;
}

.sidebar a {
    text-decoration: none;
    color: #1890ff;
    font-size: 14px;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    background: #e6f7ff;
}

.sidebar a.active {
    background: #e6f7ff;
    border-left-color: #1890ff;
    color: #1890ff;
    font-weight: 500;
}

/* 目录栏样式 */
.toc-panel {
    width: 300px;
    background: white;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* 目录面板隐藏状态 */
.toc-panel.hidden {
    transform: translateX(-100%);
    position: absolute;
    z-index: 10;
}

/* 显示目录按钮样式 */
.show-toc-btn {
    position: absolute;
    top: 0px;
    right: 1px;
    padding: 6px 6px;
    background-color: #d0d0d0;
    background-image: linear-gradient(to bottom right, #e0e0e0, #a0a0a0);
    color: #333;
    border: 1px solid #b0b0b0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 45px;
    min-width: auto;
    width: 25px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 
        2px 2px 5px rgba(0,0,0,0.2) inset,
        -2px -2px 5px rgba(255,255,255,0.7) inset,
        0 1px 3px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
    font-weight: bold;
    transition: all 0.3s ease;
}

.show-toc-btn:hover {
    background-color: #f0e68c;
    background-image: linear-gradient(to bottom right, #f8f0b0, #d4c560);
    border-color: #d4af37;
}

.show-toc-btn.visible {
    display: flex;
}

/* 目录头部样式 - 与原始设计一致 */
.toc-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    height: 45px;
}

.toc-header h3 {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

/* 关闭按钮样式 - 与原始设计一致 */
.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: #666;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* 目录内容区域样式 */
.toc-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* 目录条目样式 */
.toc-item {
    padding: 12px;
    margin-bottom: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.toc-item:hover {
    background: #f0f7ff;
    transform: translateX(1px);
}

.toc-item.active {
    background: #e6f7ff;
    border-left-color: #1890ff;
    color: #1890ff;
}

/* 目录条目标题样式 */
.toc-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-item-title.highlight {
    color: #ff4d4f;
    font-weight: 500;
}

/* 目录条目元信息样式 */
.toc-item-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.2;
}

.toc-item-meta-left {
    flex: 1;
}

.toc-item-meta-right {
    font-size: 11px;
}

/* 元信息标签样式 */
.toc-meta-tag {
    display: inline-block;
    margin-right: 6px;
    padding: 0 4px;
    border-radius: 2px;
    background: #f0f0f0;
    font-size: 11px;
}

.toc-stock-tag {
    background: #e6f3ff;
    color: #0066cc;
}

.toc-concept-tag {
    background: #ffcccc;
    color: #cc3333;
}

/* 概念和情绪打分显示行 */
.toc-item-extra-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 4px;
    color: #666;
}

/* 概念信息样式 */
.toc-item-concept {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

/* 情绪打分样式 */
.toc-item-sentiment {
    font-weight: bold;
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
    position: relative;
}

/* 内容容器样式 */
.content-container {
    padding: 0;
    background: transparent;
}

/* 文件信息样式 */
.file-info {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.file-info h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.file-info .meta {
    font-size: 14px;
    color: #666;
}

/* 通用隐藏类 */
.hidden {
    display: none !important;
}

/* 消息提示样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message.error {
    background: #ff4d4f;
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.position-relative {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-icon {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

.toggle-password:hover .password-icon {
    color: #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 搜索框样式 */
.search-container {
    margin: 16px 0;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}



/* 调研纪要特有样式 */
.jy-section {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.jy-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
}

.section-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.concept-tag {
    padding: 2px 8px;
    background-color: #e6f7ff;
    color: #1890ff;
    border-radius: 4px;
    font-size: 12px;
}

.sentiment-score {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.sentiment-score.positive {
    background-color: #f6ffed;
    color: #52c41a;
}

.sentiment-score.negative {
    background-color: #fff1f0;
    color: #ff4d4f;
}

.sentiment-score.neutral {
    background-color: #f5f5f5;
    color: #8c8c8c;
}

.section-content {
    color: #333;
    line-height: 1.6;
}

.no-toc {
    text-align: center;
    color: #999;
    padding: 20px;
}



/* 媒体查询 */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .toc-panel {
        width: 260px;
    }
    
    .content-container {
        padding: 16px;
    }
}

/* 新增样式：支持更新后的内容结构 */

/* 财经快讯内容项样式 - 与原始设计保持一致 */
.item {
    margin-bottom: 24px;
    padding: 16px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.item h3 {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.item h3.important {
    color: #ff4d4f; /* 红色标题 */
}

/* 财经快讯元信息样式 */
.item .meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

/* 财经快讯内容样式 */
.item p {
    line-height: 1.7;
    font-size: 14px;
    color: #333;
    white-space: pre-wrap;
}

/* 股票标签样式 */
.stock {
    background-color: #e6f3ff;
    color: #0066cc;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

/* 概念标签样式 */
.concept {
    background-color: #ffcccc;
    color: #cc3333;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

/* 高亮文本样式 */
.highlight {
    color: #ff4444;
    font-weight: bold;
}

/* 概念分析数据样式 */
.concepts-analysis, .news-summary {
    margin-top: 16px;
    padding: 16px;
    background-color: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

/* 概念表格样式 - 支持表格布局 */
.concepts-table-container {
    overflow-x: auto;
    margin-top: 10px;
}

.concepts-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.concepts-table th {
    background: #0056b3;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
    border-right: 1px solid #ffffff;
}

.concepts-table th:last-child {
    border-right: none;
}

.concepts-table td {
    padding: 10px 8px;
    border-top: 1px solid #ffffff;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
    font-size: 13px;
    line-height: 1.4;
    vertical-align: top;
}

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

.concepts-table tr:hover {
    background-color: #e9ecef;
}

.concepts-table td.high-score {
    color: #dc3545;
    font-weight: bold;
}

/* 列宽自适应调整 */
.concepts-table th:nth-child(1),
.concepts-table td:nth-child(1) {
    /* 相关概念列 */
    width: 15%;
    min-width: 100px;
}

.concepts-table th:nth-child(2),
.concepts-table td:nth-child(2) {
    /* 逻辑链列 */
    width: 25%;
    min-width: 150px;
}

.concepts-table th:nth-child(3),
.concepts-table td:nth-child(3) {
    /* 驱动因素列 */
    width: 20%;
    min-width: 120px;
}

.concepts-table th:nth-child(4),
.concepts-table td:nth-child(4) {
    /* 量化数列 */
    width: 15%;
    min-width: 100px;
}

.concepts-table th:nth-child(5),
.concepts-table td:nth-child(5) {
    /* 情绪打分列 */
    width: 10%;
    min-width: 80px;
}

.concepts-table th:nth-child(6),
.concepts-table td:nth-child(6) {
    /* 受益A股列 */
    width: 15%;
    min-width: 100px;
}

.concept-section {
    margin-bottom: 12px;
}
.concept-section:last-child {
    margin-bottom: 0;
}
.concept-section h4 {
    font-size: 14px;
    color: #1890ff;
    margin-bottom: 6px;
    font-weight: 600;
}
.concept-content {
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    padding-left: 8px;
    border-left: 2px solid #1890ff;
}
/* 高分高亮样式 */
.high-score {
    color: #ff0000;
    font-weight: bold;
    font-size: 1.1em;
}

/* 摘要样式 */
.item-summary {
    margin-bottom: 24px;
    padding: 16px;
    background: #f0f7ff;
    border-left: 4px solid #1890ff;
    border-radius: 4px;
}

.item-summary h3 {
    font-size: 16px;
    color: #1890ff;
    margin-bottom: 8px;
    font-weight: 500;
}

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

/* 正文内容样式 */
.item-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.item-content p {
    margin-bottom: 16px;
}

.item-content h1,
.item-content h2,
.item-content h3,
.item-content h4,
.item-content h5,
.item-content h6 {
    margin: 24px 0 16px;
    color: #333;
}



.toc-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.toc-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #888;
}

.toc-source {
    color: #1890ff;
}

.toc-time {
    color: #999;
}

/* 数据加载中提示 */
.loading {
    position: relative;
    padding: 40px;
    text-align: center;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 无数据提示增强 */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
    background: #fafafa;
    border-radius: 8px;
}

.card-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background-color: #3b82f6;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 28px;
    font-weight: bold;
}

/* 底部备案信息样式 */
.site-footer {
    padding: 6px 24px;
    text-align: center;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

.site-footer a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: #1890ff;
    text-decoration: underline;
}
