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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 股票输入区域 */
.stock-input {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.stock-input h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

#stock-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

#stock-code {
    flex: 1;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#stock-code:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    padding: 14px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

button:hover {
    background: #5a6fd8;
}

button:active {
    transform: translateY(1px);
}

/* 股票结果区域 - DeepSeek聊天框样式 */
.stock-result {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    display: none;
    line-height: 1.7;
    font-size: 15px;
    position: relative;
}

.stock-result h3 {
    margin-bottom: 25px;
    color: #333;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.stock-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.info-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.info-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.chart-container {
    margin-top: 30px;
    height: 300px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

/* 详细分析报告 */
.report-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.report-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.report-section h4::before {
    content: "•";
    color: #667eea;
    font-size: 18px;
    margin-right: 8px;
}

.report-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.report-content p {
    margin-bottom: 10px;
    font-size: 14px;
    color: #495057;
}

.report-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.report-content li {
    margin-bottom: 8px;
    font-size: 14px;
    color: #495057;
}

.report-content h5 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

/* 数据来源 */
.data-source {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #999;
    text-align: right;
}

/* 收起/展开按钮 */
.toggle-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.toggle-button {
    padding: 10px 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-button:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* 辅助工具部分 */
.tools-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.tools-section h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
}

.tool-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    justify-content: center;
}

.tool-tab {
    padding: 10px 20px;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    margin-right: 20px;
    transition: all 0.3s;
}

.tool-tab:hover {
    color: #667eea;
}

.tool-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tool-panel {
    display: none;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.tool-panel.active {
    display: block;
}

.tool-panel h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.brief-content, .strategy-content, .validation-content {
    line-height: 1.7;
}

.brief-content h4, .strategy-content h4, .validation-content h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.brief-content ul, .strategy-content ul, .validation-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.brief-content li, .strategy-content li, .validation-content li {
    margin-bottom: 8px;
    color: #495057;
}

.brief-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.brief-content th, .brief-content td {
    border: 1px solid #e9ecef;
    padding: 10px;
    text-align: left;
}

.brief-content th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

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

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #667eea;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #667eea }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    #stock-form {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .stock-info {
        grid-template-columns: 1fr;
    }
    
    .report-content {
        grid-template-columns: 1fr;
    }
    
    .tool-tabs {
        flex-direction: column;
    }
    
    .tool-tab {
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .stock-result {
        padding: 20px;
    }
    
    .report-section {
        padding: 15px;
    }
}