:root {
    /* 核心色板 */
    --text-on-color: #ffffff;
    --text-on-color-muted: rgba(255, 255, 255, 0.85);

    /* 渐变色定义 (参考 grade-dashboard-modern.css) */
    --gradient-green: linear-gradient(135deg, #2ecc71 0%, #58d68d 100%);
    --gradient-orange: linear-gradient(135deg, #f39c12 0%, #f7c65f 100%);
    --gradient-red: linear-gradient(135deg, #e74c3c 0%, #ff8a65 100%);
    --gradient-blue: linear-gradient(135deg, #3498db 0%, #5dade2 100%);

    --radius-card: 16px;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.analysis-container {
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.analysis-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

/* 2x2 网格布局 - 更紧凑 */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, minmax(220px, auto));
    /* 减小最小高度 */
    gap: 20px;
}

@media (max-width: 900px) {
    .analysis-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
}

/* --- 卡片通用样式 --- */
.minimal-card {
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-md);
    padding: 20px;
    /* 减小内边距 */
    display: flex;
    flex-direction: column;
    color: #fff;
    /* 默认白字 */
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.minimal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 背景颜色变体 */
.card-color-green {
    background: var(--gradient-green);
}

.card-color-orange {
    background: var(--gradient-orange);
}

.card-color-red {
    background: var(--gradient-red);
}

.card-color-blue {
    background: var(--gradient-blue);
}

/* 卡片标题区域 */
.card-header-row {
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 500;
}

/* 装饰性背景图标 */
.card-bg-icon {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 1;
}

/* 卡片内容区域 */
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* --- Card 1: 优势学科 (Refined) --- */
.advantage-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.advantage-item {
    display: grid;
    grid-template-columns: 60px 1fr 50px;
    align-items: center;
    gap: 12px;
}

.adv-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.adv-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.adv-bar {
    height: 100%;
    background: #fff;
    /* 进度条白色 */
    border-radius: 3px;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.adv-value {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    text-align: right;
}

/* --- Card 2 & 3: 趋势图 (Refined) --- */
.trend-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trend-info {
    display: flex;
    flex-direction: column;
    width: 30%;
}

.trend-subject {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}

.trend-tag {
    font-size: 0.7rem;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.trend-chart {
    flex: 1;
    height: 40px;
    margin: 0 12px;
    display: flex;
    align-items: center;
}

/* Chart strokes will be set to white via JS or inline SVG props */

.trend-stat {
    text-align: right;
    min-width: 50px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
}

/* --- Card 4: 差距分析 (Refined) --- */
.gap-chart-container {
    height: 80px;
    /* 减小高度 */
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 6px;
}

.gap-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px 3px 0 0;
    position: relative;
    transition: height 0.3s;
}

.gap-bar.highlight {
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.gap-summary {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #fff;
    border-left: 3px solid #fff;
    backdrop-filter: blur(4px);
}

/* --- New Refactored Card Styles (Clean White Design) --- */

.card-style-clean {
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    color: #333;
    /* Reset text color to dark */
    position: relative;
    overflow: hidden;
    height: 100%;
}

.card-style-clean:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-header-simple {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card-title-text {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.02em;
}

.card-title-bold {
    font-weight: 700;
    color: #333;
}

/* Icons */
.card-icon-blue {
    color: #3498db;
    font-size: 1rem;
}

.card-icon-orange {
    color: #f39c12;
    font-size: 1rem;
}

.card-icon-purple {
    color: #9b59b6;
    font-size: 1rem;
}

/* Body Layout */
.card-body-simple {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* justify-content: space-between; */
}

.card-subtitle-text {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 2px;
}

.card-main-score {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 8px;
    font-family: 'Outfit', -apple-system, sans-serif;
    /* Use modern font if available */
    color: #2c3e50;
}

.card-sub-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.subject-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

/* Badges */
.card-badges {
    display: flex;
    gap: 6px;
}

.badge-green {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green-outline {
    border: 1px solid #a5d6a7;
    color: #2e7d32;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-orange {
    background: #fff3e0;
    color: #ef6c00;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-orange-outline {
    border: 1px solid #ffcc80;
    color: #ef6c00;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Gap Chart Custom */
.gap-comparison-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 30px;
    height: 100px;
    margin-bottom: 10px;
}

.gap-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.gap-score {
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

.gap-bar-visual {
    width: 24px;
    border-radius: 4px;
}

.bar-blue {
    background: #3498db;
}

.bar-purple {
    background: #9b59b6;
}

.gap-label {
    font-size: 0.8rem;
    color: #888;
}

.gap-footer-info {
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* Summary Text */
.summary-paragraph {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
    text-align: justify;
    padding: 4px 0;
}