/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.page {
    min-height: 100vh;
}

/* 登录页面样式 */
#loginPage {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#loginPage .card {
    border: none;
    border-radius: 15px;
}
.mb-2 {
    margin-bottom: 0rem!important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container-fluid {
        padding: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

/* 排行榜样式优化 */
.rankings-list {
    max-height: 400px;
    overflow-y: auto;
}

.ranking-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 15px;
    background: white;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* 股票卡片样式优化 */
.stock-card {
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.stock-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    border-color: #007bff;
}

.stock-card .card-body {
    padding: 12px !important; /* 减少内边距 */
}

.stock-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.stock-card .text-muted {
    font-size: 0.85rem;
}

.stock-card .badge {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
}

.stock-code {
    font-weight: bold;
    color: #495057;
}

.stock-name {
    color: #6c757d;
    font-size: 0.9rem;
}

.score {
    font-weight: bold;
    font-size: 1.1rem;
}

.score.bullish {
    color: #dc3545;
}

.score.bearish {
    color: #28a745;
}

/* 投资组合样式 */
.portfolio-list {
    /* max-height: 400px; */
    /* overflow-y: auto; */
}

.portfolio-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 15px;
    background: white;
}

/* 分析报告样式 */
.report-section {
    margin-bottom: 30px;
}

.report-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.metric-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;  /* 统一控制所有方向的间隔 */
}

.metric-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
    text-align: center;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #495057;
}

.metric-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 3px;
}

/* 按钮样式 */
.btn-ai-analysis {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    color: white;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.btn-ai-analysis:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 移动端优化 */
@media (max-width: 576px) {
    .ranking-item, .portfolio-item {
        padding: 10px;
    }
    
    .btn-ai-analysis {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    .metric-card {
        padding: 5px;
    }
    
    .metric-value {
        font-size: 1.2rem;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .ranking-item, .portfolio-item {
        background-color: #2d2d2d;
        border-color: #404040;
    }
}

/* 股票基础信息面板样式 */
.stock-info-left {
    padding: 20px;
    border-right: 1px solid #e9ecef;
}

.stock-info-right {
    padding: 20px;
    text-align: center;
}

.info-row {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.5;
}

.stock-name {
    font-weight: bold;
    color: #495057;
    font-size: 18px;
}

.stock-code {
    color: #6c757d;
    font-size: 16px;
}

.industry-name {
    color: #495057;
    font-weight: 500;
}

.industry-code {
    color: #6c757d;
}

.separator {
    margin: 0 5px;
    color: #6c757d;
}

.ratio-item {
    margin-right: 10px;
}

.ratio-label {
    color: #6c757d;
    font-size: 14px;
}

.ratio-value {
    color: #495057;
    font-weight: bold;
}

.price-row {
    margin-bottom: 10px;
}

.price-value {
    font-size: 28px;
    font-weight: bold;
    color: #28a745;
}

.date-row {
    color: #6c757d;
    font-size: 14px;
}

/* 基本面数据面板样式 */
.fundamental-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin-top: 20px;
}

.fundamental-title {
    margin-bottom: 15px;
    color: #495057;
    font-weight: bold;
}

.fundamental-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.fundamental-item {
    text-align: center;
    flex: 1;
}

.fundamental-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.fundamental-value {
    font-size: 18px;
    font-weight: bold;
    color: #495057;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stock-info-left {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    
    .fundamental-row {
        flex-direction: column;
        gap: 2px;
    }
    
    .fundamental-item {
        width: 100%;
    }
    
    .ratio-item {
        display: block;
        margin-bottom: 10px;
    }
}

.report-content {
    font-size: 14px;
    line-height: 1.6;
}

.report-content h1,
.report-content h2,
.report-content h3,
.report-content h4,
.report-content h5,
.report-content h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.report-content p {
    margin-bottom: 1em;
}

.report-content ul,
.report-content ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.report-content code {
    padding: 0.2em 0.4em;
    background-color: rgba(27,31,35,0.05);
    border-radius: 3px;
}

.report-content pre {
    padding: 1em;
    overflow: auto;
    background-color: #f6f8fa;
    border-radius: 3px;
}

.report-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.report-content th,
.report-content td {
    padding: 0.5em;
    border: 1px solid #dfe2e5;
}

.report-content blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin-bottom: 1em;
}
/* 基础样式优化 */
.navbar-nav {
    flex-wrap: nowrap !important; /* 禁止换行 */
}

/* 手机端适配（≤575px） */
@media (max-width: 575px) {
    /* 容器内边距调整 */
    .navbar > .container-fluid {
        padding: 0.5rem !important;
    }
    
    /* 品牌名称缩小 */
    .navbar-brand {
        font-size: 0.95rem !important;
        padding: 0.25rem 0 !important;
    }
    
    /* 欢迎语样式 */
    .navbar-text {
        font-size: 0.85rem !important;
        margin-right: 0 !important; /* 移除右侧间距 */
    }
    
    /* 按钮样式优化 */
    .navbar-nav .btn-sm {
        min-width: 36px;
        padding: 0.2rem 0.3rem !important;
        font-size: 0.85rem !important;
    }
    
    /* 按钮组确保并排 */
    .d-flex.gap-1 {
        gap: 0.25rem !important;
    }
    
    /* 用户区域整体右对齐 */
    .navbar-nav.ms-auto {
        align-items: flex-end !important;
    }
}

/* 平板及以上设备（≥576px） */
@media (min-width: 576px) {
    /* 恢复水平排列 */
    .navbar-nav.ms-auto {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.75rem !important;
    }
    
    /* 欢迎语右侧间距 */
    .navbar-text {
        margin-right: 0.5rem !important;
    }
}

/* 免责声明样式补充 */
.disclaimer {
    margin-top: 0.8rem;
    line-height: 1.2;
}

/* 确保在小屏幕上不会过大 */
@media (max-width: 575px) {
    .disclaimer {
        font-size: 1.15rem !important; /* 手机端适当缩小 */
    }
}
 
/* 登录方式切换按钮样式 */
.btn-group .btn-check:checked + .btn-outline-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

/* 验证码输入框样式 */
.input-group .btn {
    white-space: nowrap;
}

/* 内测码提示样式 */
.form-text {
    font-size: 0.875em;
}

/* 成功提示动画 */
.alert-success {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ... existing code ... */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}
/* 会员升级相关样式 */
.membership-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    box-sizing: border-box;
}
.membership-modal .modal-content {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
}

.membership-modal .modal-header {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.membership-modal .modal-body {
    flex: 1;
    padding: 20px;
    background: white;
    overflow-y: auto;
}

.membership-plans {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.membership-plan {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    /* 新增：使用 flex 布局 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.membership-plan:hover {
    border-color: #4285f4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.15);
}

.membership-plan.recommended {
    border-color: #4285f4;
    position: relative;
}

.membership-plan.recommended::before {
    content: '推荐';
    position: absolute;
    top: -10px;
    right: 20px;
    background: #4285f4;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.plan-header h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #333;
}

.plan-price {
    margin: 12px 0;
}
.price {
    font-size: 24px;
    font-weight: bold;
    color: #4285f4;
}
.base-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    position: relative;
}
.plan-price .price {
    font-size: 32px;
    font-weight: bold;
    color: #4285f4;
}

.plan-price .period {
    font-size: 14px;
    color: #666;
}

.discount-info {
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 8px 0;
}

.plan-description {
    color: #666;
    margin: 16px 0;
    font-size: 14px;
}

.plan-features {
    text-align: left;
    margin: 20px 0;
}

.feature-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

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

.feature-name {
    font-size: 14px;
    color: #333;
}
.feature-name.sub-feature {
    color: #999;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.2;
}
.feature-limit {
    font-size: 12px;
    color: #4285f4;
}

.feature-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
}

.tag-free {
    background: #d4edda;
    color: #155724;
}

.tag-upgrade {
    background: #cce5ff;
    color: #004085;
}

.tag-pro {
    background: #e2e3e5;
    color: #383d41;
}

.plan-button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    /* 新增：确保按钮在底部 */
    margin-top: auto;
}
/* 支付弹窗样式 */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1050;
    overflow-y: auto;
    box-sizing: border-box;
}

.payment-modal[style*="block"] {
    display: flex !important;
}

.payment-modal .modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: paymentModalFadeIn 0.3s ease-out;
    position: relative;
    margin: auto;
}

.payment-info {
    background: #e3f2fd;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.payment-info p {
    margin: 4px 0;
    color: #1565c0;
}

.payment-methods h4 {
    margin: 0 0 16px 0;
    color: #333;
}
.payment-method {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    margin: 8px 0;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

/* 未选中状态的悬停效果 */
.payment-method:hover {
    border-color: #4285f4;
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.15);
}

/* 选中状态 */
.payment-method.active,
.payment-method.selected {
    border-color: #4285f4;
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}


.payment-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-option {
    flex: 1;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.payment-option:hover:not(:disabled) {
    border-color: #4285f4;
}

.payment-option.active {
    border-color: #4285f4;
    background: #e3f2fd;
}

.payment-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.payment-section {
    margin-top: 20px;
}

.redeem-input-box {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* 二维码弹窗样式 */
.qrcode-modal {
    max-width: 400px;
    text-align: center;
}

.qrcode-info {
    /* max-width: 400px; */
    text-align: center;
}

.qrcode-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    text-align: center;
}
/* 修改价格样式 - 蓝色显示且字体更大 */
.qrcode-info p {
    font-size: 28px;
    font-weight: bold;
    color: #4285f4;
    margin-bottom: 20px;
    text-align: center;
}

.qrcode-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.qrcode-container img {
    max-width: 200px;
    height: auto;
}

/* 修改提示文字样式 - 居中显示 */
.qrcode-tip {
    color: #666;
    margin: 16px 0;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .membership-plans {
        flex-direction: column;
        align-items: center;
    }
    
    .membership-plan {
        max-width: 100%;
    }
    
    .payment-options {
        flex-direction: column;
    }
}

/* K线图表样式 */
#klineChart {
    position: relative;
    width: 100%;
    min-height: 400px;
}

#klineCanvas {
    width: 100% !important;
    height: 400px !important;
}

.btn-group .btn-check:checked + .btn {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #klineChart {
        min-height: 300px;
    }
    
    #klineCanvas {
        height: 300px !important;
    }
    
    .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}
.ai-tips-wrap {
    margin-left: 10px;
    line-height: 1.2;
}
.ai-tips {
    font-size: 14px;
    color: #666666;
}

/* 支付倒计时样式 */
.payment-timer {
    text-align: center;
    margin: 10px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.payment-timer p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

#timerDisplay {
    font-weight: bold;
    color: #dc3545;
    font-size: 16px;
}

/* 超时提示样式 */
.timeout-message {
    text-align: center;
    margin-top: 15px;
}

.timeout-message p {
    margin-bottom: 10px;
    font-weight: bold;
}

#refreshPayment {
    padding: 8px 20px;
    font-size: 14px;
}
.timeout-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.timeout-buttons .btn {
    flex: 1;
    max-width: 120px;
}

#checkPaymentStatus {
    background-color: #28a745;
    border-color: #28a745;
}

#checkPaymentStatus:hover {
    background-color: #218838;
    border-color: #1e7e34;
}