:root {
    --card-bg: #FFFFFF;
    --page-bg: #F5F5F7; /* Light gray, similar to Apple's site */
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --border-radius: 20px;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    --gradient-start: #007AFF; /* Apple Blue */
    --gradient-end: #00C6FF;   /* Lighter Blue/Cyan */
    --icon-color: var(--gradient-start);
    --gradient-secondary-start: #6A11CB; /* Purple for section titles or accents */
    --gradient-secondary-end: #2575FC;   /* Blue for section titles or accents */
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--page-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    min-height: 100vh;
    line-height: 1.6;
}

.bento-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Adjust based on desired column count */
    grid-auto-rows: minmax(150px, auto); /* Min height for rows, auto grows */
    gap: 20px;
    width: 100%;
    max-width: 1200px; /* Max width of the grid */
}

.bento-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden; /* Important for rounded corners with internal elements */
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

/* Card specific sizing */
.card-main-title {
    grid-column: span 2;
    grid-row: span 1;
}

.card-parameters {
    grid-column: span 1;
    grid-row: span 1;
}

.card-standardization {
    grid-column: span 1;
    grid-row: span 1;
}
.card-evaluation-metrics {
    grid-column: span 2;
    grid-row: span 1;
}

.card-results-table {
    grid-column: span 3;
    grid-row: span 2;
}

.card-section-title {
    grid-column: span 3;
    grid-row: span 1;
    text-align: center;
    padding: 15px 25px;
    background-color: var(--page-bg);
    box-shadow: none;
    border-bottom: 2px solid;
    border-image-slice: 1;
    border-image-source: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
}
.card-section-title h2 {
    margin: 0;
    font-size: 1.6em;
}
.card-section-title .fas { /* Icon in section title */
    margin-right: 10px;
    /* Gradient for icon in section title if desired, though simple color is fine too */
    /* background-image: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; */
}

.card-improvement-calc {
    grid-column: span 1;
    grid-row: span 1;
}
.card-improvement-weights {
    grid-column: span 2;
    grid-row: span 1;
}
.card-analysis-steps {
    grid-column: span 3;
    grid-row: span 1;
}
.card-benefits {
    grid-column: span 3;
    grid-row: span 1;
}
.card-footer-info {
    grid-column: span 3;
    grid-row: span 1;
    background-color: var(--page-bg);
    box-shadow: none;
    text-align: center;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

/* Typography & Content Styling */
.card-header {
    margin-bottom: 20px;
}

h1.gradient-text {
    font-size: 2.8em; /* Large title */
    font-weight: 700;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.card-title {
    font-size: 1.4em; /* Medium title for cards */
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.icon-header {
    color: var(--icon-color);
    margin-right: 10px;
    font-size: 0.9em;
}

.subtitle, .description {
    font-size: 0.95em;
    color: var(--text-secondary);
    margin-top: 0;
}

.gradient-text {
    background-image: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700; /* Make gradient numbers pop */
}

.top-performer {
    display: flex;
    align-items: center;
    margin-top: auto; /* Pushes to bottom if card has extra space */
    padding-top: 15px;
}

.top-performer .icon {
    font-size: 2.5em;
    margin-right: 15px;
}

.top-performer .label {
    display: block;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.top-performer .value {
    font-size: 1.6em; /* Adjusted for apprentice list */
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
}
.top-performer .apprentices-list {
    display: block;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.top-performer .score {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-left: 0; /* Align if value is block */
}

.param-item {
    margin-bottom: 15px;
}
.param-item .label {
    display: block;
    font-size: 0.9em;
    color: var(--text-secondary);
}
.param-item .value {
    font-size: 1.8em; /* Large bold numbers */
    font-weight: 700;
}

.formula-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
    background-color: var(--page-bg);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    text-align: center;
    color: var(--text-primary);
}
/* For the Z-score formula presentation */
.formula-display frac {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    position: relative;
    padding: 0 5px;
}
.formula-display frac::before { /* Numerator */
    content: "(个人成绩 - μ)"; /* Default, update if using data-attributes */
    display: block;
    line-height: 1.2;
}
.formula-display frac::after { /* Denominator */
    content: "σ"; /* Default, update if using data-attributes */
    display: block;
    line-height: 1.2;
    border-top: 1.5px solid var(--text-primary); /* The fraction line */
    padding-top: 2px;
    margin-top: 2px;
}
.formula-display sub, .formula-highlight sub, .metric-item .detail sub, .apprentices-list sub {
    font-size: 0.7em;
    vertical-align: sub;
    margin: 0 1px; /* Small spacing around subscript */
}


.metric-item {
    margin-bottom: 15px;
}
.metric-item .label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1em;
}
.metric-item .detail {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 3px;
    margin-bottom: 0;
}
.capsule-tag {
    display: inline-block;
    background-color: var(--page-bg);
    color: var(--gradient-start);
    font-size: 0.75em;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}
.formula-highlight {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
    background-color: var(--page-bg);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Table Styling */
.table-container {
    width: 100%;
    overflow-x: auto; /* For responsiveness on small screens */
    flex-grow: 1; /* Allows table to take available space */
    max-height: 400px; /* Example max height for scroll */
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

th, td {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid var(--page-bg);
}

th {
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8em;
    background-color: #FCFCFD; /* Slightly off-white for header */
    position: sticky; /* Make table header sticky */
    top: 0; /* Stick to top of .table-container */
    z-index: 1;
}
tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #F9F9FB;
}

td:nth-child(1), th:nth-child(1) { text-align: center; width: 5%;} /* Rank */
td:nth-child(2), th:nth-child(2) { width: 25%; font-weight: 500;} /* Mentor name */
td:nth-child(3), th:nth-child(3),
td:nth-child(4), th:nth-child(4) { text-align: right; width: 20%;}
td:nth-child(5), th:nth-child(5) { text-align: right; width: 20%; font-weight: 700;} /* Score */

/* Analysis steps list */
.analysis-list {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
}
.analysis-list li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--page-bg);
    font-size: 0.95em;
    color: var(--text-primary);
}
.analysis-list li:last-child {
    border-bottom: none;
}
.analysis-list li strong {
    color: var(--gradient-start);
    font-weight: 500;
}
.capsule-tag-analysis {
    display: inline-block;
    background-image: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    color: white;
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Benefits list */
.benefits-list {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
    flex-grow: 1; /* Helps push content if card is taller */
    display: flex;
    flex-direction: column;
    justify-content: space-around; /* Distribute items evenly if card has extra space */
}
.benefits-list li {
    padding: 10px 0;
    font-size: 0.95em;
    display: flex;
    align-items: flex-start;
}
.benefits-list li .fas {
    color: var(--gradient-start);
    margin-right: 12px;
    margin-top: 4px; /* Align icon nicely with text */
    font-size: 1.1em;
    width: 20px; /* Fixed width for icon container */
    text-align: center;
}
.benefits-list li strong {
    font-weight: 500;
    color: var(--text-primary);
}

/* Footer info styling */
.report-author {
    font-size: 0.9em;
    color: var(--text-primary);
    margin: 0 0 5px 0;
    font-weight: 500;
}
.report-date {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin: 0;
}


/* Responsive Design Adjustments */
@media (max-width: 900px) {
    .bento-grid-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for medium screens */
    }
    /* Ensure these span correctly on 2-column layout */
    .card-main-title,
    .card-results-table,
    .card-section-title,
    .card-analysis-steps,
    .card-benefits,
    .card-footer-info,
    .card-evaluation-metrics { /* This one was changed to span 2 for alignment */
        grid-column: span 2 !important;
    }
    .card-standardization,
    .card-parameters,
    .card-improvement-calc,
    .card-improvement-weights { /* These might need specific spanning if not pairing well */
        grid-column: span 1 !important; /* Default for single column items */
    }
    /* If improvement-calc and improvement-weights were meant to be side-by-side on 2-col */
    .card-improvement-calc {
         /* grid-column: span 1 !important; */
    }
    .card-improvement-weights {
        /* grid-column: span 1 !important; */ /* If it should be next to calc on 2-col */
        /* If it should be full width after calc on 2-col: */
        /* grid-column: span 2 !important;  */
    }
     /* For 900px, if card-improvement-calc and card-improvement-weights are to be side-by-side: */
    .card-improvement-calc { grid-column: span 1 !important; }
    .card-improvement-weights { grid-column: span 1 !important; }

}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .bento-grid-container {
        grid-template-columns: 1fr; /* Single column for small screens */
        gap: 15px;
    }
    /* All cards take full width on small screens */
    .bento-card {
        grid-column: span 1 !important;
    }
    h1.gradient-text {
        font-size: 2.2em;
    }
    .card-title {
        font-size: 1.2em;
    }
    .param-item .value, .top-performer .value {
        font-size: 1.5em;
    }
    .table-container {
        max-height: 300px; /* Adjust scroll height for mobile */
    }
    th, td {
        padding: 8px 10px;
        font-size: 0.85em;
    }
    .card-section-title h2 {
        font-size: 1.3em;
    }
}