:root {
    --primary: #007BFF;
    --primary-dark: #0056b3;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: transform 0.05s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    --success: #4caf50;
    --warning: #ff9800; 
    --danger:  #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(to bottom, #f0f8ff, #e6e6fa);
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
    margin: 0;
}

#sidebar-container {
    background: white;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.main-content {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    padding: 60px 20px 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* TOP BANNER STYLES */
.top-banner {
    width: 100%;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);  
    padding: 30px 40px 0px 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    border-radius: 15px;
}

.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.score-card {
    text-align: center;
    padding: 20px;
    background: transparent;
    border-radius: 15px;
}

.score-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #000;
    margin-bottom: 15px;
}

.score-number {
    font-size: 3em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0;
}

.circular-progress {
    position: relative;
    width: 240px;
    height: 160px;
    margin: -20px auto 0 auto;
}

.goal-text {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.goal-label {
    font-size: 0.9em;
    color: #000;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.goal-label:hover {
    color: var(--primary);
    text-decoration: underline;
}

.goal-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #000;
}

.banner-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;  
    justify-content: flex-start;  
    text-align: center;
    padding-top: 0; 
}

.banner-subtitle-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #000;
    margin: 0 0 10px 0;
    margin-top: -30px;
}

.banner-subtitle {
    font-size: 1.1em;
    color: #333;
    margin: 0;
}

.banner-button {
    font-size: 1.2em;
    padding: 12px 30px;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    margin-top: 15px;
}

.pulse-button {
    animation: pulse 2s infinite;
}

.pulse-button:hover {
    animation: none;
}

.banner-button:hover {
    background: linear-gradient(135deg, var(--primary-dark), #004494);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    text-decoration: none;
    color: white;
}

.content-container {
    width: 100%;
    /* max-width: 1400px; */
    margin: 10px auto 0 auto;
}

/* NEW USER CONTENT - Keep original styling */
.hero-section {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-title {
    font-size: 3.5em;
    font-weight: 700;
    color: #000000;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 25px;
    max-width: 800px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* .stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
} */

.stats-row {
    display: flex;
    justify-content: center;  
    gap: 120px; 
    margin: 15px auto;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9em;
    color: black;
}

.cta-button {
    font-size: 1.8em;
    padding: 15px 80px;
    color: white;
    background: linear-gradient(135deg, #007BFF, #0056b3);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 15px;
}

.cta-button:hover {
    background: linear-gradient(135deg, #0056b3, #004494);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    text-decoration: none;
    color: white;
}

.cta-subtitle {
    color: black;
    font-size: 1em;
}

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

.feature-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

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

.feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    font-size: 18px;
    color: white;
}

.feature-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #000000;
    margin-bottom: 12px;
}

.feature-description {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.feature-button {
    font-size: 1.5em;
    padding: 12px 50px;
    color: white;
    background-color: var(--primary);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    display: inline-block;
    width: 400px;
}

.feature-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    text-decoration: none;
    color: white;
}

.daily-button-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.new-badge {
    position: absolute;
    top: -10px;
    right: 80px;
    background-color: #ff4444;
    color: white;
    font-size: 1em;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 10;
}

/* RETURNING USER CONTENT - Two column layout */
.returning-user-layout {
    display: grid;
    grid-template-columns: 2fr 3fr;
    /* grid-template-columns: 40% 60%; */
    gap: 40px;
    align-items: start;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Session Selection Cards */
.session-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    /* transition: transform 0.3s ease, box-shadow 0.3s ease; */
    text-align: center;
}

.first-session-card {
    /* height: 300px;   */
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.first-session-card .session-button {
    margin: 0 auto;
    display: block;
}

.first-session-card .stat-number {
    font-size: 1.5em;   
    font-weight: 600;  
}

.first-session-card .stat-label {
    font-size: 0.8em;  
    color: #444;  
}

.session-card:hover {
    /* transform: translateY(-5px); */
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.session-card h2 {
    font-size: 1.4em;
    font-weight: 600;
    color: #000000;
    margin-bottom: 15px;
}

.session-card p {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 0.95em;
}


.session-button {
    font-size: 1.2em;
    padding: 12px 30px;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    display: inline-block;
    width: 100%;
    max-width: 300px;
}

.session-button:hover {
    background: linear-gradient(135deg, var(--primary-dark), #004494);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    text-decoration: none;
    color: white;
}

.session-card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.session-card .feature-icon {
    margin: 0;
    width: 40px;
    height: 40px;
    font-size: 16px;
    position: absolute; 
    right: 0; 
}

.session-card h2 {
    font-size: 1.4em;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0;
}

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

.card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

/* Performance Dashboard Styles */
.performance-title {
    font-size: 2.2em;
    font-weight: 700;
    color: #000000;
    margin-bottom: 30px;
    text-align: center;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    /* margin-bottom: 30px; */
    margin-bottom: 0;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    height: 200px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}


.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    margin: 0;
    flex-shrink: 0;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 10px;
}

.card-value {
    /* font-size: 28px; */
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Radar Chart Container */
.radar-container {
    background: white;
    border-radius: 20px;
    padding: 20px;  /* 从 30px 改为 20px */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 350px;   /* 添加这行 */
    max-height: 300px;  /* 添加这行 */
    margin: 0 auto;     /* 添加这行 */
}

.radar-title {
    font-size: 1.4em;
    font-weight: 600;
    color: #000000;
    margin-bottom: 20px;
}

/* Performance Button */
.performance-button {
    font-size: 1.2em;
    padding: 12px 30px;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 400;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
    text-decoration: underline;
    display: inline-block;
    transition: all 0.3s ease;
    border-radius: 0;
    margin-top: 20px;
    width: 100%;
}

.performance-button:hover {
    background: linear-gradient(135deg, #007BFF, #0056b3);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
    border-radius: 30px;
    padding: 15px 30px;
    text-decoration: none;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Loading screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 60px 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.progress-item {
    margin-bottom: 15px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-weight: 500;
    font-size: 0.9rem;
}

.progress-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4caf50;
    width: 0%;
    transition: width 0.5s ease-in-out;
}

.radar-and-correction {
    display: flex;
    gap: 20px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    /* min-height: 300px; */
    height: 490px;
    overflow: hidden;
    max-width: 100%;    
}

.radar-box {
    /* flex: 50%;   */
    flex: 1;
    height: 100%;
    position: relative;
    min-height: 0; 
}

#topicRadar {
    max-width: 390px;
    max-height: 390px;
    width: 100% !important;
}

.correction-box {
    flex: 1;
    /* flex: 50%;   */
}

/* .radar-box, .correction-box {
    flex: 1 1 50%; 
    width: 50%;    
    max-width: 50%; 
    min-width: 0;   
    height: 100%;
    position: relative;
} */

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

.loading-screen p {
    color: var(--gray);
    font-size: 1.1em;
    margin: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: #666;
    width: 100%;
    margin-top: auto;
}

.start-now-button {
    animation: pulse 2s infinite;
}

.start-now-button:hover {
    animation: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    }
}

/* Desktop only - score card left padding */
@media (min-width: 769px) {
    .score-card {
        padding-left: 80px;
    }
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .returning-user-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 1280px) {
    .radar-and-correction {
        flex-direction: column; /* 上下排列 */
        height: auto;
    }

    .radar-box,
    .correction-box {
        width: 100%;
        max-width: 100%;
    }

    #topicRadar {
        width: 100% !important;
        height: auto !important;
        margin: 0 auto; 
        max-height: 350px; /* 限制一下高度，避免太长 */
    }
}

@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
    }

    #sidebar-container {
        z-index: 1000;
    }

    .main-content {
        padding: 20px 15px;
        margin-left: 0;
        z-index: 1;
    }

    .content-container {
        max-width: 100%;
        padding: 0 5px; /* 添加这行 */
        box-sizing: border-box; /* 添加这行 */
    }

    /* Banner mobile styles */
    .top-banner {
        padding: 15px 20px;
    }

    .banner-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .banner-title {
        font-size: 1.3em;
    }

    .banner-subtitle {
        font-size: 0.95em;
    }

    .banner-button {
        font-size: 1.2em;
        padding: 10px 25px;
        width: 100%;
        max-width: 300px;
        margin-bottom: 20px;
    }

    .hero-section {
        padding: 30px 20px;
    }
    
    .hero-title {
        font-size: 2em !important; /* 强制覆盖inline style */
    }

    .hero-subtitle {
        font-size: 1em;
    }

    .stats-row, .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-number {
        font-size: 1.8em;
    }

    .cta-button {
        padding: 12px 35px;
        font-size: 1.2em;
        width: 95%;
        text-align: center;
    }

    .feature-button {
        padding: 12px 25px;
        font-size: 1.2em;
        max-width: 300px;
        width: 90%;
        text-align: center;
    }

    .feature-title {
        font-size: 1.3em;
    }

    .new-badge {
        font-size: 1em;
        padding: 3px 6px;
        top: -8px;
        right: 20px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .performance-title {
        font-size: 1.8em;
    }

    .session-card h2 {
        font-size: 1.0em;
    }

    session-card p {
        font-size: 0.8em; 
    }

    .card-title {
        font-size: 1.0rem;
    }

    .radar-title{
        font-size: 1.0rem;
    }

    .session-button {
        font-size: 1.2em;
        padding: 12px 30px;
    }

    .radar-and-correction {
        flex-direction: column;
        gap: 15px;
        min-height: 600px; 
        height: auto; 
    }

    .radar-box {
        flex: none; 
        width: 100%; 
        min-height: 300px; 
    }

    #topicRadar {
        max-width: 100%;
        max-height: 300px; 
        width: 100% !important;
        height: 400px !important; 
    }

    #newUserContent .hero-section {
        width: 100%;
        box-sizing: border-box;
    }

    /* stats-row 改成竖排，间距缩小 */
    #newUserContent .stats-row {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    /* 按钮缩小宽度和内边距 */
    #newUserContent .cta-button {
        width: 90%;
        max-width: 320px;
        font-size: 1.2em;
        padding: 12px 20px;
    }
}
