/* 移动端样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* 头部 */
.header {
    text-align: center;
    color: white;
    padding: 20px 0;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 搜索区域 */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#stockSymbol {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

#stockSymbol:focus {
    border-color: #667eea;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.style-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.style-selector label {
    font-size: 14px;
    color: #666;
}

.style-selector select {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #333;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #555;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* 评分卡片 */
.score-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.score-card h2 {
    color: white;
    margin-bottom: 20px;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.score-circle {
    font-size: 48px;
    font-weight: bold;
}

.score-circle small {
    font-size: 24px;
    opacity: 0.8;
}

.score-info {
    text-align: left;
}

.rating {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.confidence {
    font-size: 14px;
    opacity: 0.9;
}

.reasoning {
    margin-top: 15px;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.6;
}

/* AI分析（简化版，显示在综合评分卡片中） */
.ai-analysis-simple {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.ai-analysis-label {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-analysis-label i {
    font-size: 16px;
}

.ai-analysis-text {
    font-size: 15px;
    line-height: 1.8;
    opacity: 0.95;
    text-align: left;
    padding: 0;
}

/* AI分析卡片 */
.ai-analysis-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-left: 4px solid #667eea;
}

.ai-analysis-card h3 {
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-analysis-card h3 i {
    font-size: 20px;
}

.ai-analysis-content {
    margin-top: 15px;
    line-height: 1.8;
    color: #333;
}

.ai-analysis-heading {
    font-weight: bold;
    font-size: 16px;
    color: #667eea;
    margin-top: 15px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.ai-analysis-heading:first-child {
    margin-top: 0;
}

.ai-analysis-paragraph {
    font-size: 14px;
    margin-bottom: 12px;
    text-align: justify;
    color: #555;
}

/* 维度得分 */
.dimension-scores {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.dimension-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.dimension-name {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dimension-name i {
    font-size: 16px;
    color: #667eea;
    width: 20px;
    text-align: center;
}

.dimension-value {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
}

.dimension-weight {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 指标列表 */
.indicators {
    display: grid;
    gap: 15px;
}

.indicator-group {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.indicator-group-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.indicator-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.indicator-item:last-child {
    border-bottom: none;
}

.indicator-label {
    color: #666;
    font-size: 14px;
}

.indicator-value {
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

/* 列表样式 */
.strength-list,
.risk-list,
.opportunity-list {
    list-style: none;
}

.strength-list li,
.opportunity-list li {
    padding: 12px;
    margin-bottom: 8px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.risk-list li {
    padding: 12px;
    margin-bottom: 8px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

/* 查看详情按钮 */
.btn-view-detail {
    margin-top: 12px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.btn-view-detail:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-view-detail:active {
    transform: scale(0.98);
}

.btn-view-detail i {
    font-size: 14px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* 详细报告内容 */
.detail-report-content {
    line-height: 1.8;
    color: #333;
    font-size: 15px;
}

.detail-report-content h3,
.detail-report-content h4 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: bold;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.detail-report-content h3:first-child,
.detail-report-content h4:first-child {
    margin-top: 0;
}

.detail-report-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.detail-report-content ul,
.detail-report-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.detail-report-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.detail-report-content strong {
    color: #667eea;
    font-weight: bold;
}

/* 段落分隔 */
.detail-report-content > p + p {
    margin-top: 15px;
}

/* 响应式 */
@media (max-width: 480px) {
    .score-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .dimension-scores {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .detail-report-content {
        font-size: 14px;
    }
}
