/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Hiragino Sans GB", "WenQuanYi Micro Hei", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 导航栏容器固定宽度 */
.navbar .container {
    width: 1200px;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

a:hover {
    color: #1890ff;
}

ul {
    list-style: none;
}

/* 导航条样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    width: 100%;
}

.logo {
    margin-right: auto; /* 将Logo推到最左边 */
}

nav ul {
    margin-left: auto; /* 将导航菜单推到最右边 */
    display: flex;
    gap: 12px; /* 减小间距，从20px改为12px */
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1890ff;
    margin-right: 15px;
}

/* 基础slogan样式 */
.logo .slogan {
    font-size: 14px;
    font-weight: 500;
    padding-left: 15px;
    margin-right: 10px;
    opacity: 0.9;
    transition: all 0.3s ease;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* 第一条slogan样式 */
.logo .slogan-1 {
    color: #f5222d; /* 红色 */
    border-left-color: #ffccc7;
    padding-right: 15px; /* 在右侧添加空白间隙 */
    margin-right: 5px; /* 增加右侧外边距 */
}

/* 第二条slogan样式 - 巴菲特铁律 */
.logo .slogan-2 {
    color: #1890ff; /* 蓝色 */
    border-left-color: #91d5ff;
}

/* 悬停效果 */
.logo:hover .slogan {
    opacity: 1;
}

.logo:hover .slogan-1 {
    color: #cf1322; /* 深红色 */
}

.logo:hover .slogan-2 {
    color: #096dd9; /* 深蓝色 */
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 10px; /* 减小左边距，从20px改为10px */
}

nav ul li a {
    padding: 10px 10px; /* 减小内边距，从10px 15px改为10px 10px */
    font-weight: 500;
    position: relative;
}

nav ul li a.active {
    color: #1890ff;
}

nav ul li a {
    position: relative;
    overflow: hidden;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #1890ff;
    transition: width 0.3s ease, left 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
    left: 0;
}

/* 主要内容区域样式 */
.main-content {
    padding: 0;
    height: calc(100vh - 70px - 200px - 20px); /* 减去导航条、页脚和额外边距的高度 */
    overflow: hidden;
    width: 100%;
}

.content-wrapper {
    display: flex;
    gap: 0;
    height: 100%;
    width: 100%; /* 确保宽度铺满 */
    max-width: 100%; /* 确保不会被其他样式限制 */
}

/* 左侧列表样式 */
.sidebar {
    flex: 0 0 300px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.stock-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stock-card {
    position: relative;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #eee;
}

.stock-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #1890ff;
}

.stock-card.active {
    border-color: #1890ff;
    background-color: #f0f9ff;
}

.stock-card .stock-code {
    color: #666;
    font-size: 12px;
    margin-bottom: 4px;
}

.stock-card .stock-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.stock-card .stock-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
}

.stock-card .buy-price {
    color: #1890ff;
    font-weight: 500;
}

.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: #ff4d4f;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stock-card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: #ff7875;
    transform: scale(1.1);
}

.up {
    color: #ec0000;
}

.down {
    color: #00da3c;
}

/* 右侧K线图区域样式 */
.chart-container {
    flex: 1;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    height: calc(100vh - 290px); /* 总高度 - 导航栏 - 页脚 - 额外边距 */
    overflow: hidden;
    border-radius: 0;
    position: relative;
    margin: 0;
}

.input-section {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
    overflow: visible;
    padding: 8px 0;
}

.input-item {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.input-item label {
    margin-right: 5px;
    white-space: nowrap;
}

.input-item input {
    display: inline-block;
    vertical-align: middle;
}

/* 精确控制输入框宽度 */
#stock-code { width: 90px }
#stock-name { width: 120px }
#buy-date { width: 120px }
#buy-price { width: 90px }

.input-item {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.input-item label {
    font-size: 12px;
    white-space: nowrap;
    min-width: max-content;
}

/* 为第一个标签（股票代码）添加左侧空白 */
.input-item .first-label {
    padding-left: 15px;
}

.input-item input {
    padding: 6px 8px;
    font-size: 13px;
    box-sizing: border-box;
    height: 32px;
}

/* 股票代码 */
#stock-code {
    width: 70px;
}

/* 股票名称 */ 
#stock-name {
    width: 80px;
}

/* 买入日期 */
#buy-date {
    width: 165px; /* 110px * 1.5 */
}

/* 买入价格 */
#buy-price {
    width: 120px; /* 80px * 1.5 */
}

.btn-query {
    padding: 6px 12px;
    height: 32px;
    flex-shrink: 0;
}

.input-group label {
    font-size: 12px;
    margin-bottom: 3px;
    white-space: nowrap;
}

.input-group input {
    padding: 6px 8px;
    font-size: 13px;
    box-sizing: border-box;
}

.btn-query {
    padding: 6px 12px;
    height: fit-content;
}

.info-row {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
}

.info-item {
    display: inline-flex;
    flex-direction: column;
    min-width: 80px;
}

.status-row {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    min-width: 100px;
}

.input-group label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.input-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.input-group input:read-only {
    background-color: #f5f5f5;
    color: #666;
}

.btn-query {
    padding: 8px 20px;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-query:hover {
    background-color: #40a9ff;
}

#k-chart {
    width:100%;
    height: calc(100% - 120px); /* 进一步减少高度为原来的70% */
    
    position: absolute;
    
}

.stock-info {
    padding-top: 15px;
    border-top: 1px solid #eee;
    margin-bottom: 0;
    width: calc(100% - 320px); /* 减去侧边栏宽度 */
    overflow: hidden;
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    padding: 10px 0;
    position: fixed;
    bottom: 220px; /* 页脚高度 + 额外间距 */
    left: 300px; /* 恢复原位置 */
    background: white;
    z-index: 10;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

.info-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.info-item {
    flex: 0 0 auto;
    min-width: 120px;
    white-space: nowrap;
    padding-left: 10px; /* 增加左边距 */
}

.info-item .label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 3px;
}

.info-item .value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.info-item .value.up {
    color: #ec0000;
}

.info-item .value.down {
    color: #00da3c;
}

/* 页脚样式 */
footer {
    background-color: #24292e;
    color: #fff;
    padding: 15px 0;
    height: 200px;
    width: 100%;
}

.footer-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px 0;
    width: 100%;
}

.footer-section {
    flex: 1 1 auto;
    min-width: 150px;
    margin-bottom: 20px;
    padding: 0 20px;
    white-space: nowrap;
}

.footer-section.qrcode {
    flex: 0 0 auto;
    text-align: center;
    min-width: 120px;
}

.footer-section p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: #1890ff;
}

.footer-section p {
    color: #aaa;
    margin-bottom: 10px;
}

.footer-section.links ul li {
    margin-bottom: 8px;
}

.footer-section.links ul li a {
    color: #aaa;
}

.footer-section.links ul li a:hover {
    color: #1890ff;
}

.social-links {
    margin-top: 15px;
}

.social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    background-color: #333;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: #1890ff;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-bottom p {
    color: #aaa;
}

.footer-links a {
    color: #aaa;
    margin-left: 15px;
}

.footer-links a:hover {
    color: #1890ff;
}

/* 修复K线图容器样式 - 确保只有一个定义 */

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}

.modal-body {
    padding: 10px;
    line-height: 1.6;
}

/* 心路历程模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}

.markdown-body {
    padding: 20px;
}

/* 模态框内容通用样式 - 实现样式复用 */
.markdown-body ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}

.markdown-body li {
    margin-bottom: 8px;
    position: relative;
}

.markdown-body a {
    color: #1890ff;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-block;
    padding: 3px 0;
}

.markdown-body a:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* 特定模态框的额外样式（如果需要） */
#learning-content, #journey-content, #faq-content, #quant-content {
    /* 这里可以添加特定模态框的独特样式 */
}

/* 遮罩层样式 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* 对话框样式 */
.dialog {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: popup 0.5s ease-out;
}

@keyframes popup {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.dialog h2 {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.tips {
    background: #f9f9f9;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
}

.tips ul {
    list-style-type: none;
    padding-left: 15px;
}

.tips li {
    padding: 10px 0;
    font-size: 1.1rem;
    position: relative;
    padding-left: 30px;
}

.tips li:before {
    content: "•";
    color: #3498db;
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: 5px;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-dialog {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-confirm {
    background: #2ecc71;
    color: white;
}

.btn-confirm:hover {
    background: #27ae60;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.hidden {
    display: none;
}

/* 错误提示模态框样式 */
.error-modal .modal-content {
    max-width: 450px;
    text-align: center;
    padding: 30px;
}

.error-title {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#error-message {
    font-size: 1.1rem;
    margin-bottom: 25px;
    padding: 15px;
    background: #fff5f5;
    border-left: 4px solid #e74c3c;
    text-align: left;
    border-radius: 0 8px 8px 0;
}

.modal-footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-confirm-error {
    background: #3498db;
    color: white;
    padding: 10px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-confirm-error:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}



/* 响应式设计 */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        flex: none;
        width: 100%;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        margin: 5px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-controls {
        margin-top: 10px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-section {
        padding-right: 0;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        margin-top: 10px;
    }
    
    .footer-links a {
        margin: 0 8px;
    }
}

/* 股票信息标签颜色样式 */
.stock-info .info-item.orange-color .label,
.stock-info .info-item.orange-color .value {
    color: #ff8c00 !important; /* 橙色 - 吊灯止损 */
    font-weight: bold;
}

.stock-info .info-item.green-color .label,
.stock-info .info-item.green-color .value {
    color: #00aa00 !important; /* 绿色 - 止损 */
    font-weight: bold;
}

.stock-info .info-item.red-color .label,
.stock-info .info-item.red-color .value {
    color: #ff0000 !important; /* 红色 - 动态止盈 */
    font-weight: bold;
}