/* 风险管理页面样式 */
/* 文件功能：风险管理页面的CSS样式定义 */
/* 创建日期：2025-01-01 */
/* 作者：AI炒股学习网开发团队 */

/* 页面头部样式 */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') repeat;
    opacity: 0.3;
}

.page-header .header-content {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: 40px;
}

.page-header .header-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-header .header-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 风险统计样式 */
.risk-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 2;
}

.stat-item {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
    color: #fff;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* 风险评估工具样式 */
.risk-assessment {
    padding: 80px 0;
    background: #f8f9fa;
}

.risk-assessment h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: #2c3e50;
    position: relative;
}

.risk-assessment h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.assessment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.assessment-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.assessment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
}

.card-badge {
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-content p {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* 表单样式 */
.assessment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.form-group select,
.form-group input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 投资组合输入样式 */
.portfolio-input {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
}

.portfolio-list {
    min-height: 100px;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 20px;
    background: #f8f9fa;
}

.portfolio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.portfolio-item:last-child {
    margin-bottom: 0;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* 市场指标样式 */
.market-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.indicator-name {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.indicator-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.indicator-value[data-risk="low"] {
    color: #28a745;
}

.indicator-value[data-risk="medium"] {
    color: #ffc107;
}

.indicator-value[data-risk="high"] {
    color: #dc3545;
}

/* 风险警报样式 */
.risk-alerts {
    margin-top: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid;
    margin-bottom: 10px;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert strong {
    font-weight: 700;
}

/* 风险控制策略样式 */
.risk-strategies {
    padding: 80px 0;
    background: white;
}

.risk-strategies h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: #2c3e50;
    position: relative;
}

.risk-strategies h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.strategy-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    text-align: center;
}

.strategy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.strategy-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.strategy-card h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.strategy-card p {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.strategy-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    text-align: left;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-item .label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.detail-item .value {
    font-weight: 700;
    color: #667eea;
    font-size: 0.9rem;
}

/* 风险管理工具样式 */
.risk-tools {
    padding: 80px 0;
    background: #f8f9fa;
}

.risk-tools h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: #2c3e50;
    position: relative;
}

.risk-tools h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.tool-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tool-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
}

.tool-badge {
    background: linear-gradient(90deg, #28a745, #20c997);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tool-content p {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* VaR计算器样式 */
.var-calculator {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-row label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.input-row input,
.input-row select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.var-result {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    margin-top: 10px;
}

.var-result.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

/* 相关性分析样式 */
.correlation-tool {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stock-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stock-inputs input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
}

.correlation-result {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.correlation-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.correlation-value.high {
    color: #dc3545;
}

.correlation-value.medium {
    color: #ffc107;
}

.correlation-value.low {
    color: #28a745;
}

/* 压力测试样式 */
.stress-test {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scenario-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.scenario-btn {
    padding: 12px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.scenario-btn:hover,
.scenario-btn.active {
    background: #667eea;
    color: white;
}

.stress-result {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 100px;
}

/* 风险预算样式 */
.risk-budget {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.budget-slider {
    display: flex;
    align-items: center;
    gap: 15px;
}

.budget-slider label {
    font-weight: 600;
    color: #495057;
    min-width: 100px;
}

.budget-slider input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.budget-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.budget-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.asset-allocation {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 150px;
}

.allocation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

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

.allocation-name {
    font-weight: 600;
    color: #495057;
}

.allocation-percentage {
    font-weight: 700;
    color: #667eea;
}

/* 风险教育样式 */
.risk-education {
    padding: 80px 0;
    background: white;
}

.risk-education h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: #2c3e50;
    position: relative;
}

.risk-education h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.education-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    text-align: center;
}

.education-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.education-card h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.education-card p {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.knowledge-list,
.case-list,
.guide-list {
    text-align: left;
    margin-bottom: 25px;
    padding-left: 0;
    list-style: none;
}

.knowledge-list li,
.case-list li,
.guide-list li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #495057;
    line-height: 1.5;
}

.knowledge-list li::before,
.case-list li::before,
.guide-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: 700;
}

/* 评估结果样式 */
.assessment-results {
    padding: 80px 0;
    background: #f8f9fa;
}

.assessment-results h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: #2c3e50;
}

.results-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.risk-profile,
.recommendations {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.profile-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
}

.risk-level {
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.risk-level.conservative {
    background: #d4edda;
    color: #155724;
}

.risk-level.moderate {
    background: #fff3cd;
    color: #856404;
}

.risk-level.aggressive {
    background: #f8d7da;
    color: #721c24;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.detail-label {
    font-weight: 600;
    color: #495057;
}

.detail-value {
    font-weight: 700;
    color: #667eea;
}

.recommendations h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 25px;
}

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommendation-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.recommendation-title {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.recommendation-desc {
    color: #6c757d;
    line-height: 1.5;
}

/* 按钮样式 */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header {
        padding: 60px 0 40px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .header-content p {
        font-size: 1rem;
    }
    
    .risk-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .assessment-grid,
    .strategies-grid,
    .tools-grid,
    .education-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .results-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stock-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .scenario-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .budget-slider {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .budget-slider label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .assessment-card,
    .strategy-card,
    .tool-card,
    .education-card {
        padding: 20px;
    }
    
    .risk-stats {
        grid-template-columns: 1fr;
    }
    
    .scenario-buttons {
        grid-template-columns: 1fr;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .risk-assessment h2,
    .risk-strategies h2,
    .risk-tools h2,
    .risk-education h2 {
        font-size: 2rem;
    }
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 高亮样式 */
.highlight {
    background: linear-gradient(90deg, #fff3cd, #ffeaa7);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.notification-warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.notification-error {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

.notification-info {
    background: linear-gradient(90deg, #17a2b8, #6f42c1);
}