/* Student role theme overrides */
body[data-user-role="student"] {
    background: var(--surface-base);
    color: var(--text-main);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(5, 150, 105, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

body[data-user-role="student"] main>.container {
    padding-inline-start: 0;
    padding-inline-end: 0;
}

body[data-user-role="student"] main>.container.mt-4 {
    margin-top: 32px !important;
}

/* Homework center */
body[data-user-role="student"] .date-section {
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

body[data-user-role="student"] .date-section+.date-section {
    margin-top: 24px;
}

body[data-user-role="student"] .date-section h4 {
    border-bottom: none !important;
    margin-bottom: 16px !important;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

body[data-user-role="student"] .date-section h4 .badge {
    background: var(--gradient-primary);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
    border: none;
}

body[data-user-role="student"] #homeworkListContainer .list-group {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-soft);
}

body[data-user-role="student"] #homeworkListContainer .list-group-item {
    padding: 18px 20px;
    border: none;
    border-bottom: 1px solid rgba(74, 144, 226, 0.06);
    background: transparent;
    transition: background-color 0.2s ease;
}

body[data-user-role="student"] #homeworkListContainer .list-group-item:hover {
    background: rgba(255, 255, 255, 0.5);
}

body[data-user-role="student"] #homeworkListContainer .list-group-item:last-child {
    border-bottom: none;
}

body[data-user-role="student"] .homework-item-container {
    align-items: flex-start;
}

body[data-user-role="student"] .homework-item-left {
    gap: 16px;
}

body[data-user-role="student"] .homework-content {
    font-size: 15px;
    color: var(--text-main);
    font-weight: 500;
}

body[data-user-role="student"] .homework-item-left .form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 3px;
    border-radius: 6px;
    border: 2px solid var(--border-soft);
    accent-color: var(--brand-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

body[data-user-role="student"] .homework-item-left .form-check-input:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

body[data-user-role="student"] .homework-content small {
    color: var(--text-secondary) !important;
}

body[data-user-role="student"] .homework-item-right .btn,
body[data-user-role="student"] #subjectFilterButtons .btn {
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-weight: 500;
    box-shadow: none;
    transition: all 0.2s ease;
}

body[data-user-role="student"] #subjectFilterButtons .btn {
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-secondary);
}

body[data-user-role="student"] #subjectFilterButtons .btn.active,
body[data-user-role="student"] #subjectFilterButtons .btn:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
}

body[data-user-role="student"] .homework-filters {
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 32px;
}

body[data-user-role="student"] .homework-filter-label {
    color: var(--text-secondary) !important;
    margin-bottom: 0;
    font-weight: 500;
}

body[data-user-role="student"] .homework-filters .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    box-shadow: none;
    background-color: rgba(255, 255, 255, 0.8);
}

body[data-user-role="student"] .homework-filters .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

body[data-user-role="student"] .homework-item-right .btn-outline-primary {
    background: transparent;
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

body[data-user-role="student"] .homework-item-right .btn-outline-primary:hover {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

body[data-user-role="student"] .homework-item-right .btn-outline-secondary {
    border-color: var(--border-soft);
    color: var(--text-secondary);
}

body[data-user-role="student"] .homework-item-right .btn-outline-secondary:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
}

body[data-user-role="student"] .navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

body[data-user-role="student"] .navbar .container {
    max-width: 1200px;
}

body[data-user-role="student"] .app-nav-item {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    box-shadow: none;
    transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

body[data-user-role="student"] .app-nav-item:hover,
body[data-user-role="student"] .app-nav-item.active {
    background: var(--brand-primary-soft);
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary-soft);
    box-shadow: none;
}

body[data-user-role="student"] .app-nav-item:hover i,
body[data-user-role="student"] .app-nav-item.active i {
    color: var(--brand-primary) !important;
}

body[data-user-role="student"] .app-nav-item:hover span,
body[data-user-role="student"] .app-nav-item.active span {
    color: var(--brand-primary) !important;
}

body[data-user-role="student"] .mobile-menu-backdrop {
    background: rgba(47, 59, 82, 0.45);
}

/* Shared surface & card helpers */
body[data-user-role="student"] .student-surface {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(74, 144, 226, 0.06);
    padding: 32px;
}

body[data-user-role="student"] .student-card,
body[data-user-role="student"] .student-surface .card,
body[data-user-role="student"] .student-surface .list-group-item {
    background: var(--surface-card);
    border-radius: var(--radius-md);
    border: 1px solid rgba(74, 144, 226, 0.08);
    box-shadow: var(--shadow-soft);
}

body[data-user-role="student"] .card {
    background: var(--surface-card);
    border-radius: var(--radius-md);
    border: 1px solid rgba(74, 144, 226, 0.08);
    box-shadow: var(--shadow-soft);
}

body[data-user-role="student"] .card-header {
    background: rgba(74, 144, 226, 0.08);
    border-bottom: 1px solid rgba(74, 144, 226, 0.1);
    color: var(--text-main);
    font-weight: 600;
}

body[data-user-role="student"] .card-body {
    color: var(--text-main);
}

body[data-user-role="student"] .student-card:hover {
    box-shadow: 0 14px 28px rgba(74, 144, 226, 0.12);
}

body[data-user-role="student"] .student-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body[data-user-role="student"] .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

body[data-user-role="student"] .section-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

body[data-user-role="student"] .section-title h2 i {
    margin-inline-end: 8px;
    color: var(--brand-primary);
}

body[data-user-role="student"] .student-section-title span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Grid modules */
body[data-user-role="student"] .student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

body[data-user-role="student"] .student-app-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--surface-card);
    border: 1px solid rgba(41, 63, 136, 0.08);
    box-shadow: var(--shadow-soft);
    color: var(--text-main);
    text-decoration: none;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Legacy grid classes */
body[data-user-role="student"] .app-grid,
body[data-user-role="student"] .ai-companion-grid,
body[data-user-role="student"] .subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    padding: 0;
}

@media (max-width: 767px) {

    body[data-user-role="student"] .app-grid,
    body[data-user-role="student"] .ai-companion-grid,
    body[data-user-role="student"] .subjects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

body[data-user-role="student"] .app-icon,
body[data-user-role="student"] .app-module-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--surface-card);
    border: 1px solid rgba(74, 144, 226, 0.08);
    box-shadow: var(--shadow-soft);
    color: var(--text-main);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    overflow: hidden;
}

body[data-user-role="student"] .app-icon:hover,
body[data-user-role="student"] .app-module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(74, 144, 226, 0.14);
}

body[data-user-role="student"] .app-icon .icon-wrapper,
body[data-user-role="student"] .module-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary);
    box-shadow: none;
    margin-bottom: 12px;
}

body[data-user-role="student"] .app-icon h5,
body[data-user-role="student"] .app-module-card h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

body[data-user-role="student"] .app-icon p,
body[data-user-role="student"] .app-module-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

body[data-user-role="student"] .student-app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(74, 144, 226, 0.14);
}

body[data-user-role="student"] .student-app-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

body[data-user-role="student"] .student-app-card h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

body[data-user-role="student"] .student-app-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Quick action cards */
body[data-user-role="student"] .student-quick-card {
    cursor: pointer;
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border-soft);
    box-shadow: none;
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

body[data-user-role="student"] .student-quick-card-icon {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    box-shadow: none;
}

body[data-user-role="student"] .student-quick-card:hover {
    border-color: rgba(74, 144, 226, 0.25);
    background: #fff;
}

/* Variants use icon color only; card stays white */
body[data-user-role="student"] .student-quick-card--homework .student-quick-card-icon {
    color: #24a26a;
    background: rgba(36, 162, 106, 0.12);
}

body[data-user-role="student"] .student-quick-card--correction .student-quick-card-icon {
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
}

body[data-user-role="student"] .student-quick-card--notes .student-quick-card-icon {
    color: #d94847;
    background: rgba(217, 72, 71, 0.12);
}

body[data-user-role="student"] .student-quick-card--study .student-quick-card-icon {
    color: #17a2b8;
    background: rgba(23, 162, 184, 0.12);
}

body[data-user-role="student"] .student-quick-card--review .student-quick-card-icon {
    color: #2ed573;
    background: rgba(46, 213, 115, 0.12);
}

/* Card details */
body[data-user-role="student"] .student-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

body[data-user-role="student"] .student-status-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

body[data-user-role="student"] .status-upcoming {
    background: #ffe8d4;
    color: #b45309;
}

body[data-user-role="student"] .status-progress {
    background: #e8f5ff;
    color: #1d4ed8;
}

body[data-user-role="student"] .status-complete {
    background: #e6f6ee;
    color: #1b8a5a;
}

/* Table adjustments */
body[data-user-role="student"] table {
    color: var(--text-main);
}

body[data-user-role="student"] .table thead th {
    background: var(--surface-subtle);
    color: var(--text-main);
    border-bottom: 1px solid var(--border-soft);
}

body[data-user-role="student"] .table tbody tr {
    transition: background-color var(--transition-base);
}

body[data-user-role="student"] .table tbody tr:hover {
    background: var(--brand-primary-soft);
}

body[data-user-role="student"] .table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    background: var(--surface-card);
}

body[data-user-role="student"] .container .row.mb-3 {
    background: var(--surface-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(41, 63, 136, 0.08);
    margin-bottom: 24px !important;
    gap: 12px;
}

body[data-user-role="student"] .container .row.mb-3 .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: #fff;
    color: var(--text-main);
}

body[data-user-role="student"] .container .row.mb-3 .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.15);
}

/* Filter panel */
body[data-user-role="student"] .student-filter-bar {
    background: var(--surface-subtle);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: none;
}

body[data-user-role="student"] .filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--surface-card);
    border-radius: var(--radius-md);
    border: 1px solid rgba(41, 63, 136, 0.08);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

body[data-user-role="student"] .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 220px;
}

body[data-user-role="student"] .filter-group label {
    font-weight: 600;
    color: var(--text-secondary);
}

body[data-user-role="student"] .filter-bar .search-box,
body[data-user-role="student"] .filter-bar .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: #fff;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

body[data-user-role="student"] .filter-bar .search-box:focus,
body[data-user-role="student"] .filter-bar .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.15);
}

body[data-user-role="student"] .student-filter-bar .form-select,
body[data-user-role="student"] .student-filter-bar .search-box,
body[data-user-role="student"] .student-form-control {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: #fff;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

body[data-user-role="student"] .student-filter-bar .form-select:focus,
body[data-user-role="student"] .student-filter-bar .search-box:focus,
body[data-user-role="student"] .student-form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.15);
}

body[data-user-role="student"] .student-analytics-card {
    background: var(--surface-card);
    border: 1px solid rgba(41, 63, 136, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

/* Homework list */
body[data-user-role="student"] .homework-item-container {
    align-items: center;
}

body[data-user-role="student"] .homework-item-left {
    gap: 16px;
}

body[data-user-role="student"] .homework-subject-indicator {
    width: 8px;
    border-radius: 12px;
    background: var(--brand-primary);
    flex-shrink: 0;
}

body[data-user-role="student"] .homework-deadline {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Notes */
body[data-user-role="student"] .note-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    box-shadow: none;
    border-radius: 8px;
}

body[data-user-role="student"] .note-header {
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
}

body[data-user-role="student"] .note-header .timestamp {
    color: var(--text-secondary);
}

body[data-user-role="student"] .note-body {
    padding: 24px;
    background: #fff;
    color: var(--text-main);
}

body[data-user-role="student"] .note-body pre {
    background: var(--surface-subtle);
    border-radius: var(--radius-sm);
    padding: 16px;
}

body[data-user-role="student"] .note-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

body[data-user-role="student"] .note-actions .btn {
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-weight: 500;
    box-shadow: none;
}

body[data-user-role="student"] .note-actions .btn-info {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

body[data-user-role="student"] .note-actions .btn-info:hover {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
}

body[data-user-role="student"] .note-actions .btn-primary {
    background: var(--brand-secondary);
    border-color: var(--brand-secondary);
}

body[data-user-role="student"] .note-actions .btn-primary:hover {
    background: #249564;
    border-color: #249564;
}

body[data-user-role="student"] .note-actions .btn-danger {
    background: var(--brand-danger);
    border-color: var(--brand-danger);
}

body[data-user-role="student"] .note-actions .btn-danger:hover {
    background: #d94e4b;
    border-color: #d94e4b;
}

body[data-user-role="student"] .deep-learning-section {
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: #fff;
    padding: 20px;
    margin-top: 24px;
}

body[data-user-role="student"] .deep-learning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--brand-primary-soft);
}

body[data-user-role="student"] .deep-learning-title {
    font-weight: 600;
    color: var(--brand-primary);
    margin-inline-start: 8px;
}

body[data-user-role="student"] .deep-learning-content-wrapper {
    background: #fff;
    border-radius: 8px;
    margin-top: 16px;
    padding: 16px;
    border: 1px dashed var(--border-soft);
}

body[data-user-role="student"] .deep-learning-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 12px 0;
}

body[data-user-role="student"] .deep-ai-study-btn {
    margin-top: 16px;
    width: 100%;
    border: 1px solid rgba(45, 108, 223, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff;
    color: var(--brand-primary);
    font-weight: 600;
    box-shadow: none;
}

body[data-user-role="student"] .deep-ai-study-btn:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

body[data-user-role="student"] .deep-ai-study-btn .btn-line1 {
    font-size: 15px;
}

body[data-user-role="student"] .deep-ai-study-btn .btn-line2 {
    font-size: 12px;
    opacity: 0.85;
}

body[data-user-role="student"] .score-badge[data-score="excellent"] {
    background: rgba(47, 178, 121, 0.12);
    color: #1b8a5a;
}

body[data-user-role="student"] .score-badge[data-score="good"] {
    background: rgba(45, 108, 223, 0.12);
    color: var(--brand-primary);
}

body[data-user-role="student"] .score-badge[data-score="average"] {
    background: rgba(255, 179, 71, 0.15);
    color: #b4690e;
}

/* Module: Preps (预习), Reviews (复习), Exams (成绩) */
body[data-user-role="student"] .prep-item,
body[data-user-role="student"] .review-item,
body[data-user-role="student"] .review-card,
body[data-user-role="student"] .exam-item,
body[data-user-role="student"] .exercise-item {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

body[data-user-role="student"] .prep-item:hover,
body[data-user-role="student"] .review-item:hover,
body[data-user-role="student"] .exam-item:hover,
body[data-user-role="student"] .exercise-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(74, 144, 226, 0.14);
    border-color: var(--brand-primary);
    background: rgba(255, 255, 255, 0.9);
}

body[data-user-role="student"] .stat-item {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 4px 10px !important;
    font-weight: 500;
}

/* Action Buttons Override */
body[data-user-role="student"] .action-btn {
    border-radius: 999px;
    padding: 6px 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

body[data-user-role="student"] a.action-btn:hover {
    text-decoration: none !important;
}

body[data-user-role="student"] .action-btn-primary {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    border: 1px solid transparent;
}

body[data-user-role="student"] .action-btn-primary:hover {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

body[data-user-role="student"] .action-btn-danger {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid transparent;
}

body[data-user-role="student"] .action-btn-danger:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* Filter Toolbar Unification */
body[data-user-role="student"] .filter-toolbar .form-select,
body[data-user-role="student"] .filter-toolbar .form-control,
body[data-user-role="student"] .filter-toolbar .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: none;
    backdrop-filter: blur(4px);
}

body[data-user-role="student"] .filter-toolbar .form-select:focus,
body[data-user-role="student"] .filter-toolbar .form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: #fff;
}

/* Page Titles */
body[data-user-role="student"] h2.text-center {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body[data-user-role="student"] h2.text-center i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Exercise Types & Chips */
body[data-user-role="student"] .type-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.02);
    line-height: 1.3;
}

body[data-user-role="student"] .type-essay {
    color: #5c7cfa;
    border-color: rgba(92, 124, 250, 0.4);
    background: rgba(92, 124, 250, 0.08);
}

body[data-user-role="student"] .type-calculation {
    color: var(--brand-primary);
    border-color: rgba(45, 108, 223, 0.35);
    background: rgba(45, 108, 223, 0.1);
}

body[data-user-role="student"] .type-reading {
    color: #0ca678;
    border-color: rgba(12, 166, 120, 0.35);
    background: rgba(12, 166, 120, 0.08);
}

body[data-user-role="student"] .type-dictation {
    color: #e67700;
    border-color: rgba(230, 119, 0, 0.4);
    background: rgba(230, 119, 0, 0.08);
}

body[data-user-role="student"] .type-comprehensive {
    color: #495057;
    border-color: rgba(73, 80, 87, 0.35);
    background: rgba(73, 80, 87, 0.08);
}

body[data-user-role="student"] .type-system {
    color: #0b7285;
    border-color: rgba(11, 114, 133, 0.35);
    background: rgba(11, 114, 133, 0.08);
}

body[data-user-role="student"] .type-other {
    color: #6c757d;
    border-color: rgba(108, 117, 125, 0.35);
    background: rgba(108, 117, 125, 0.08);
}

body[data-user-role="student"] .meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: #f8fafc;
    font-size: 0.75rem;
    color: #4b5563;
    font-weight: 500;
    line-height: 1.3;
}

body[data-user-role="student"] .status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid transparent;
}

body[data-user-role="student"] .status-success {
    color: #0f5132;
    background: rgba(25, 135, 84, 0.15);
    border-color: rgba(25, 135, 84, 0.35);
}

body[data-user-role="student"] .status-warning {
    color: #8a6d3b;
    background: rgba(255, 193, 7, 0.18);
    border-color: rgba(255, 193, 7, 0.4);
}

body[data-user-role="student"] .status-info {
    color: #0c5460;
    background: rgba(23, 162, 184, 0.16);
    border-color: rgba(23, 162, 184, 0.4);
}

body[data-user-role="student"] .status-danger {
    color: #842029;
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.35);
}

body[data-user-role="student"] .status-secondary {
    color: #495057;
    background: rgba(73, 80, 87, 0.12);
    border-color: rgba(73, 80, 87, 0.35);
}



body[data-user-role="student"] .score-badge[data-score="poor"] {
    background: rgba(242, 95, 92, 0.15);
    color: #c0392b;
}

body[data-user-role="student"] .stat-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    box-shadow: none;
    border-radius: 8px;
}

body[data-user-role="student"] .stat-icon {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    box-shadow: none;
}

/* Subjects grid */
body[data-user-role="student"] .subject-card {
    background: var(--surface-card);
    border: 1px solid rgba(41, 63, 136, 0.08);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

body[data-user-role="student"] .subject-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(41, 63, 136, 0.14);
}

body[data-user-role="student"] .subject-icon-wrapper {
    background: var(--brand-primary);
    box-shadow: none;
}

/* Profile */
body[data-user-role="student"] .profile-container {
    background: transparent;
    box-shadow: none;
    max-width: 1200px;
}

body[data-user-role="student"] .profile-sidebar {
    background: #ffffff;
    color: var(--text-main);
    border-inline-end: 1px solid var(--border-soft);
}

body[data-user-role="student"] .profile-sidebar::before {
    display: none;
}

body[data-user-role="student"] .profile-avatar {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    border-color: rgba(45, 108, 223, 0.2);
}

body[data-user-role="student"] .nav-link {
    color: var(--text-secondary);
    border-inline-start: 3px solid transparent;
}

body[data-user-role="student"] .nav-link.active,
body[data-user-role="student"] .nav-link:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
}

body[data-user-role="student"] .profile-content {
    background: transparent;
}

body[data-user-role="student"] .info-card {
    background: var(--surface-card);
    border: 1px solid rgba(41, 63, 136, 0.08);
    box-shadow: var(--shadow-soft);
}

@media (max-width: 767px) {
    body[data-user-role="student"] .student-surface {
        padding: 20px;
    }

    body[data-user-role="student"] .student-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    body[data-user-role="student"] .student-app-card {
        padding: 16px;
    }
}

/* --- Unified Form Elements (Glassmorphism) --- */
body[data-user-role="student"] .form-control,
body[data-user-role="student"] .form-select,
body[data-user-role="student"] .search-box {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

body[data-user-role="student"] .form-control:focus,
body[data-user-role="student"] .form-select:focus,
body[data-user-role="student"] .search-box:focus {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    border-color: var(--brand-primary);
    outline: none;
}

/* --- Mistake Book (Note Cards) --- */
body[data-user-role="student"] .note-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

body[data-user-role="student"] .note-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--brand-primary-soft);
}

body[data-user-role="student"] .note-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    padding: 1rem;
}

body[data-user-role="student"] .note-header:hover {
    background: rgba(255, 255, 255, 0.4) !important;
}

body[data-user-role="student"] .note-actions-wrapper {
    background: rgba(248, 250, 252, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.03);
}

/* --- Gradebook (Exam & Targets) --- */
body[data-user-role="student"] .target-card,
body[data-user-role="student"] .exam-list-card,
body[data-user-role="student"] .stats-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

body[data-user-role="student"] .exam-list-card .card-header,
body[data-user-role="student"] .target-card .card-header {
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    padding: 1.25rem;
}

body[data-user-role="student"] .target-item,
body[data-user-role="student"] .exam-item {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

body[data-user-role="student"] .target-item:hover,
body[data-user-role="student"] .exam-item:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: var(--brand-primary-soft);
}

/* Progress Bars */
body[data-user-role="student"] .progress,
body[data-user-role="student"] .target-progress {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    overflow: hidden;
    height: 10px;
}

body[data-user-role="student"] .progress-bar,
body[data-user-role="student"] .target-progress-bar {
    background: linear-gradient(90deg, var(--brand-primary) 0%, #34d399 100%);
    border-radius: 999px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

/* Primary Buttons with Gradient */
body[data-user-role="student"] .add-exam-btn,
body[data-user-role="student"] .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #047857 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.4);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
}

body[data-user-role="student"] .add-target-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 999px;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4) !important;
}

body[data-user-role="student"] .add-target-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 24px -4px rgba(99, 102, 241, 0.5) !important;
}

body[data-user-role="student"] a.add-exam-btn:hover,
body[data-user-role="student"] a.btn-primary:hover {
    text-decoration: none !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 24px -4px rgba(16, 185, 129, 0.5);
    filter: brightness(1.1);
}

body[data-user-role="student"] a.add-target-btn:hover {
    box-shadow: 0 12px 24px -4px rgba(99, 102, 241, 0.5) !important;
}

/* Secondary/Outline Buttons */
body[data-user-role="student"] .btn-outline-primary,
body[data-user-role="student"] .action-btn.secondary {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-soft);
    color: var(--text-secondary);
    text-decoration: none !important;
}

body[data-user-role="student"] a.btn-outline-primary:hover,
body[data-user-role="student"] a.action-btn.secondary:hover {
    text-decoration: none !important;
    background: #fff;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Stats Values */
body[data-user-role="student"] .stats-value,
body[data-user-role="student"] .target-score {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #059669 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Homework Buttons Override */
body[data-user-role="student"] .homework-item-right .btn-outline-info {
    color: #0ea5e9;
    border-color: rgba(14, 165, 233, 0.5);
    background: transparent;
}

body[data-user-role="student"] .homework-item-right .btn-outline-info:hover {
    background: #0ea5e9;
    color: #fff;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

body[data-user-role="student"] .homework-item-right .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-soft);
    background: transparent;
}

body[data-user-role="student"] .homework-item-right .btn-outline-secondary:hover {
    background: var(--surface-subtle);
    color: var(--text-main);
    border-color: var(--text-secondary);
}

/* Subject Filter Chips */
body[data-user-role="student"] .wx-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 8px;
    margin-bottom: 8px;
}

body[data-user-role="student"] .wx-chip:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body[data-user-role="student"] .wx-chip.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

body[data-user-role="student"] .wx-chip .subject-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background-color: currentColor;
}

body[data-user-role="student"] .wx-chip.active .subject-dot {
    background-color: #fff;
}

body[data-user-role="student"] .wx-chip .wx-subtle {
    margin-left: 4px;
    opacity: 0.7;
    font-size: 0.75em;
}

/* Exam Item Layout */
body[data-user-role="student"] .exam-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

body[data-user-role="student"] .exam-info {
    flex: 1;
}

body[data-user-role="student"] .exam-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

body[data-user-role="student"] .exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

body[data-user-role="student"] .exam-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

body[data-user-role="student"] .exam-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

body[data-user-role="student"] .exam-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Target Item Layout */
body[data-user-role="student"] .target-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body[data-user-role="student"] .target-name {
    font-weight: 600;
    color: var(--text-main);
    min-width: 100px;
}

body[data-user-role="student"] .target-details {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

body[data-user-role="student"] .target-type {
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

body[data-user-role="student"] .target-scope {
    font-size: 0.9rem;
    color: var(--text-main);
}

body[data-user-role="student"] .target-score {
    font-weight: 700;
    color: var(--brand-primary);
}

body[data-user-role="student"] .target-progress {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

body[data-user-role="student"] .target-progress-bar {
    height: 100%;
    background: var(--brand-primary);
    border-radius: 3px;
}

body[data-user-role="student"] .target-status {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Responsive adjustments for Exam/Target */
@media (max-width: 768px) {

    body[data-user-role="student"] .exam-content,
    body[data-user-role="student"] .target-item {
        flex-direction: column;
        align-items: flex-start;
    }

    body[data-user-role="student"] .exam-actions,
    body[data-user-role="student"] .target-details {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    body[data-user-role="student"] .target-progress {
        min-width: 100px;
    }
}

/* Exam Scores in List */
body[data-user-role="student"] .score-pill {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

body[data-user-role="student"] .score-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-color: var(--brand-primary-soft);
}

body[data-user-role="student"] .subject-label {
    color: var(--text-secondary);
    margin-right: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

body[data-user-role="student"] .score-num {
    color: var(--brand-primary);
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
}

body[data-user-role="student"] .total-score-pill {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

body[data-user-role="student"] .total-score-pill .subject-label,
body[data-user-role="student"] .total-score-pill .score-num {
    color: #fff;
}

body[data-user-role="student"] .total-score-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.4);
}

/* Subject Colors for Score Pills (Matching wechat.css palette) */
body[data-user-role="student"] .score-pill.subject-chinese .score-num {
    color: #E74C3C;
}

body[data-user-role="student"] .score-pill.subject-chinese {
    border-color: rgba(231, 76, 60, 0.2);
    background: rgba(231, 76, 60, 0.05);
}

body[data-user-role="student"] .score-pill.subject-math .score-num {
    color: #4A90E2;
}

body[data-user-role="student"] .score-pill.subject-math {
    border-color: rgba(74, 144, 226, 0.2);
    background: rgba(74, 144, 226, 0.05);
}

body[data-user-role="student"] .score-pill.subject-english .score-num {
    color: #07C160;
}

body[data-user-role="student"] .score-pill.subject-english {
    border-color: rgba(7, 193, 96, 0.2);
    background: rgba(7, 193, 96, 0.05);
}

body[data-user-role="student"] .score-pill.subject-physics .score-num {
    color: #546E7A;
}

body[data-user-role="student"] .score-pill.subject-physics {
    border-color: rgba(84, 110, 122, 0.2);
    background: rgba(84, 110, 122, 0.05);
}

body[data-user-role="student"] .score-pill.subject-chemistry .score-num {
    color: #FF9F43;
}

body[data-user-role="student"] .score-pill.subject-chemistry {
    border-color: rgba(255, 159, 67, 0.2);
    background: rgba(255, 159, 67, 0.05);
}

body[data-user-role="student"] .score-pill.subject-biology .score-num {
    color: #16A085;
}

body[data-user-role="student"] .score-pill.subject-biology {
    border-color: rgba(22, 160, 133, 0.2);
    background: rgba(22, 160, 133, 0.05);
}

body[data-user-role="student"] .score-pill.subject-history .score-num {
    color: #8D6E63;
}

body[data-user-role="student"] .score-pill.subject-history {
    border-color: rgba(141, 110, 99, 0.2);
    background: rgba(141, 110, 99, 0.05);
}

body[data-user-role="student"] .score-pill.subject-geography .score-num {
    color: #00B2A9;
}

body[data-user-role="student"] .score-pill.subject-geography {
    border-color: rgba(0, 178, 169, 0.2);
    background: rgba(0, 178, 169, 0.05);
}

body[data-user-role="student"] .score-pill.subject-politics .score-num {
    color: #F39C12;
}

body[data-user-role="student"] .score-pill.subject-politics {
    border-color: rgba(243, 156, 18, 0.2);
    background: rgba(243, 156, 18, 0.05);
}

/* Target Name Subject Colors */
body[data-user-role="student"] .target-name.subject-chinese {
    color: #E74C3C;
    font-weight: 700;
}

body[data-user-role="student"] .target-name.subject-math {
    color: #4A90E2;
    font-weight: 700;
}

body[data-user-role="student"] .target-name.subject-english {
    color: #07C160;
    font-weight: 700;
}

body[data-user-role="student"] .target-name.subject-physics {
    color: #546E7A;
    font-weight: 700;
}

body[data-user-role="student"] .target-name.subject-chemistry {
    color: #FF9F43;
    font-weight: 700;
}

body[data-user-role="student"] .target-name.subject-biology {
    color: #16A085;
    font-weight: 700;
}

body[data-user-role="student"] .target-name.subject-history {
    color: #8D6E63;
    font-weight: 700;
}

body[data-user-role="student"] .target-name.subject-geography {
    color: #00B2A9;
    font-weight: 700;
}

body[data-user-role="student"] .target-name.subject-politics {
    color: #F39C12;
    font-weight: 700;
}