body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* New Gradient Background for Auth Page */
body.auth-page {
    background: linear-gradient(-45deg, #007bff, #0056b3, #023e8a, #002855);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    height: 100vh;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-align: center;
    backdrop-filter: blur(10px);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

aside {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    overflow-y: auto;
    border-right: 1px solid rgba(102,126,234,0.1);
}

.sidebar-module {
    margin-bottom: 2rem;
}

.sidebar-module h3 {
    color: #667eea;
    border-bottom: none;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: rgba(244, 247, 249, 0.6);
    backdrop-filter: blur(10px);
}

/* New Card styles */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.15);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.25);
}

button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0.9rem 1.2rem;
    margin-top: 0.5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

#exportExcelBtn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

#exportExcelBtn:hover {
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

#clearDataBtn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

#clearDataBtn:hover {
    box-shadow: 0 6px 25px rgba(108, 117, 125, 0.4);
}

/* --- Dataset Manager --- */
#dataset-manager label {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
    font-weight: bold;
}

#dataset-manager select {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

#deleteDatasetBtn {
    background-color: #dc3545; /* Red */
}

#deleteDatasetBtn:hover {
    background-color: #c82333;
}

/* --- User Info --- */
#user-info {
    padding: 15px;
    background: linear-gradient(135deg, rgba(102,126,234,0.15) 0%, rgba(118,75,162,0.15) 100%);
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 1rem;
    border: 1px solid rgba(102,126,234,0.2);
}

#vip-prompt {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
    border-radius: 16px;
    margin-bottom: 1rem;
    border: 2px solid #fbbf24;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
}

.vip-icon {
    font-size: 36px;
    color: #d97706;
    margin-bottom: 12px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

#vip-prompt h4 {
    font-size: 16px;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 15px 0;
}

.vip-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    text-align: left;
}

.vip-benefits li {
    padding: 6px 0;
    color: #78350f;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vip-benefits i {
    color: #16a34a;
    font-size: 14px;
}

.vip-limit {
    font-size: 12px;
    color: #dc2626;
    margin: 10px 0;
    font-weight: 600;
    padding: 8px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 6px;
}

#upgradeBtn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    margin-top: 10px;
}

#upgradeBtn:hover {
    box-shadow: 0 6px 25px rgba(245, 158, 11, 0.5);
    transform: translateY(-2px) scale(1.02);
}

aside button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

#project-analysis-display {
    margin-top: 2rem;
}

.chart-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chart-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
    color: #495057;
}

.category-analysis .chart-container-wrapper {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    width: 100%;
}

.category-analysis .chart-container {
    flex: 1;
    min-width: 0; /* Important for flexbox to shrink contents */
    width: 100%; /* Each container takes full width inside the wrapper */
    min-height: 400px; /* Give a fixed height to avoid collapse */
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.category-analysis h4 {
    text-align: center;
    color: #6c757d;
    font-weight: normal;
}


#scrollToAnalysisBtn, #manageStandardsBtn {
    background-color: #6c757d;
}

#scrollToAnalysisBtn:hover, #manageStandardsBtn:hover {
    background-color: #5a6268;
}

/* --- Table Controls --- */
#table-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-group label {
    font-weight: bold;
    color: #495057;
    margin-right: 0.5rem;
}

.filter-group select, #table-controls button {
    padding: 0.5rem 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #fff;
}

#table-controls button {
    background-color: #6c757d;
    color: white;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease-in-out;
}

#table-controls button:hover {
    background-color: #5a6268;
}

#dataTable {
    margin-top: 1rem;
    width: 100%;
    border-collapse: collapse;
}

#dataTable table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#dataTable th, #dataTable td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

#dataTable th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    position: relative;
}

#dataTable th.sortable-header {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

#dataTable th.sortable-header:hover {
    background-color: #0069d9;
}

#dataTable th.sortable-header::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5em;
    vertical-align: middle;
    opacity: 0.5;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath fill='white' d='M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41zm255-105L177 64c-9.4-9.4-24.6-9.4-33.9 0L24 183c-15.1 15.1-4.4 41 17 41h238c21.4 0 32.1-25.9 17-41z'/%3E%3C/svg%3E");
}

#dataTable th.sort-asc::after {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath fill='white' d='M279 224H41c-21.4 0-32.1-25.9-17-41L143 64c9.4-9.4 24.6-9.4 33.9 0l119 119c15.2 15.1 4.5 41-16.9 41z'/%3E%3C/svg%3E");
}

#dataTable th.sort-desc::after {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath fill='white' d='M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z'/%3E%3C/svg%3E");
}

#dataTable tr:nth-child(even) {
    background-color: #f2f2f2;
}

#dataTable tr:hover {
    background-color: #e9ecef;
}

.score-full {
    background-color: #d4edda; /* Light Green */
    color: #155724;
}

.score-fail {
    background-color: #f8d7da; /* Red */
    color: #721c24;
}

.score-absent {
    background-color: #e9ecef; /* Grey */
    color: #495057;
    font-style: italic;
}

#analysis-display {
    margin-top: 2rem;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* 初始状态和加载动画 */
#initial-state {
    text-align: center;
    color: #6c757d;
    padding-top: 5rem;
}

.hidden {
    display: none;
}

#loading-spinner {
    /* The 'display' property is now handled by the rule below */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem;
    color: #007bff;
}

/* This rule ensures the spinner is only displayed as a flex container when it is NOT hidden. */
#loading-spinner:not(.hidden) {
    display: flex;
}

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #007bff; /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styles for the new summary table */
#class-summary-table-container {
    width: 100%;
    overflow-x: auto; /* For responsiveness on smaller screens */
    margin-top: 20px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    text-align: center;
}

.summary-table th,
.summary-table td {
    border: 1px solid #ddd;
    padding: 10px 12px;
}

.summary-table thead tr {
    background-color: #007bff;
    color: #ffffff;
    text-align: center;
}

.summary-table tbody tr:nth-of-type(even) {
    background-color: #f3f3f3;
}

.summary-table tbody tr:hover {
    background-color: #e9ecef;
}

.summary-table td:first-child {
    font-weight: bold;
    text-align: left;
}

.summary-table .summary-col {
    background-color: #eaf4ff; /* A light blue to distinguish summary columns */
    color: #212529; /* Explicitly set a dark color for text for readability */
}

.summary-table tbody tr:nth-of-type(even) .summary-col {
    background-color: #dcebff; /* A slightly darker blue for even rows */
}

.summary-table .detail-col-header {
    background-color: #f8f9fa; /* Lighter, less prominent header for detail columns */
    color: #495057;
}

/* Styles for the new chart controls */
.chart-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.chart-metric-btn {
    padding: 8px 16px;
    border: 1px solid #007bff;
    background-color: #ffffff;
    color: #007bff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.chart-metric-btn:hover {
    background-color: #e9ecef;
}

.chart-metric-btn.active {
    background-color: #007bff;
    color: #ffffff;
}

#exportStatsBtn {
    background-color: #17a2b8; /* A different, info-like color */
    color: white;
}

#exportStatsBtn:hover {
    background-color: #138496;
}

aside button {
    display: flex; /* Use flexbox for alignment */
    align-items: center;
    justify-content: flex-start; /* Align text to the left */
    gap: 10px; /* Space between icon and text */
    width: 100%;
    padding: 0.8rem 1rem;
    margin-top: 0.5rem;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: all 0.2s ease-in-out;
}

aside button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

aside h3 .fas {
    margin-right: 10px;
    color: #007bff;
}

.vip-label {
    background-color: gold;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 4px;
}

.vip-hidden {
    color:#999;
}

.vip-note {
    font-size: 0.85rem;
    color:#e67e22;
    margin-top:4px;
}

.vip-locked {
    position: relative;
    pointer-events: none;
}
.vip-locked > * {
    filter: blur(5px);
}
.vip-locked::after {
    content: '升级 VIP 解锁统计分析';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* --- Authentication Page Styles --- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f7f9;
}

.auth-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 3rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-form h2 {
    color: #002855;
    margin-bottom: 1.5rem;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box; /* Important for padding */
}

.auth-form button {
    width: 100%;
    padding: 0.9rem;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.auth-form button:hover {
    background-color: #0056b3;
}

.auth-form p {
    color: #6c757d;
}

.auth-form a {
    color: #007bff;
    text-decoration: none;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: none; /* Hidden by default */
}

/* --- Admin Page Styles --- */
.admin-page {
    background-color: #f4f7f9;
}

.admin-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.admin-container h1 {
    text-align: center;
    color: #002855;
    margin-bottom: 2rem;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table th,
.user-table td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    text-align: left;
}

.user-table thead {
    background-color: #e9ecef;
}

.user-table .status-vip {
    color: #28a745;
    font-weight: bold;
}

.user-table .status-active {
    color: #6c757d;
}

.user-table button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

.vip-toggle-btn.is-vip {
    background-color: #ffc107;
}
.vip-toggle-btn.is-active {
    background-color: #28a745;
}

/* VIP提示按钮样式 */
.vip-required {
    position: relative;
    cursor: not-allowed;
}
.vip-required::after {
    content: '\f06a'; /* FontAwesome exclamation-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #e74c3c;
    margin-left: 6px;
}
.vip-required:hover::after {
    animation: blink 1s infinite;
}
@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0; }
}

/* 禁止复制样式 */
.no-copy {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}
/* toast 错误提示 */
.toast-error {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: #fff;
    padding: 14px 28px;
    border-radius: 6px;
    z-index: 9999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    font-size: 1.05rem;
    font-weight: 600;
}

/* ========== 联系微信模态框样式 ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    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);
    }
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: #000;
}

.contact-modal {
    padding: 30px;
}

.contact-modal h2 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 24px;
    text-align: center;
}

.contact-modal h2 i {
    color: #ffd700;
    margin-right: 10px;
}

.contact-info {
    text-align: center;
}

.contact-tip {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.wechat-qrcode-container {
    margin: 30px 0;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 12px;
}

.wechat-qrcode {
    width: 256px;
    height: 256px;
    max-width: 100%;
    border: 8px solid white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 0 auto 20px;
    display: block;
}

.wechat-number {
    font-size: 18px;
    color: #333;
    margin: 15px 0 0 0;
}

.wechat-number strong {
    color: #07c160;
    font-size: 20px;
    font-weight: 600;
}

.contact-steps {
    margin-top: 30px;
    text-align: left;
    background: #f5f7ff;
    padding: 20px;
    border-radius: 8px;
}

.step-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

.steps-list {
    margin: 0;
    padding-left: 20px;
    color: #555;
    line-height: 1.8;
}

.steps-list li {
    margin-bottom: 10px;
}