:root {
    --bg-dark: #0f1117;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.12);
    --coral: #ff6b6b;
    --violet: #7c5cff;
    --text-primary: #f5f5f7;
    --text-muted: #a0a0ab;
}

body.light-theme {
    --bg-dark: #f4f4f8;
    --glass-bg: rgba(20, 20, 30, 0.05);
    --glass-border: rgba(20, 20, 30, 0.12);
    --text-primary: #16161d;
    --text-muted: #5c5c68;
}

body.light-theme .glass-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4)), var(--glass-bg);
}

body.light-theme .bottom-nav,
body.light-theme .drawer,
body.light-theme .chat-input-bar {
    background: rgba(244, 244, 248, 0.85);
}

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

html, body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.orb-1 { width: 300px; height: 300px; background: var(--coral); top: -50px; left: -50px; }
.orb-2 { width: 350px; height: 350px; background: var(--violet); bottom: -80px; right: -50px; }
.orb-3 { width: 250px; height: 250px; background: #4dd4ac; top: 40%; left: 60%; }

.app-shell {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 12px;
    min-height: 100vh;
}

.glass-card {
    background: linear-gradient(145deg, rgba(20, 20, 28, 0.55), rgba(20, 20, 28, 0.35)), var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 20px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-top: 4px;
    gap: 8px;
}

.logo {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-mark {
    color: var(--coral);
}

.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.greeting {
    margin-bottom: 28px;
}

.greeting h1 {
    font-size: 26px;
    margin-bottom: 6px;
}

.subtext {
    color: var(--text-muted);
    font-size: 15px;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.action-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 20px 16px;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.15s ease, background 0.15s ease;
}

.action-card:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.1);
}

.action-icon {
    font-size: 28px;
}

.action-label {
    font-weight: 600;
    font-size: 15px;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    margin-top: 4px;
}

.back-btn {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 22px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 20px;
    border: 2px dashed var(--glass-border);
    cursor: pointer;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.upload-text {
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 13px;
}

.flash-label {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flash-text {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.flash-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.ghost-btn {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    padding: 14px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.ghost-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.flip-container {
    perspective: 1200px;
    min-height: 220px;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 220px;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.flip-container.flipped .flip-inner {
    transform: rotateY(180deg);
}

.flip-front, .flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.flip-back {
    transform: rotateY(180deg);
}

.quiz-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.quiz-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.quiz-option:active {
    transform: scale(0.98);
}

.quiz-option.selected {
    background: rgba(124, 92, 255, 0.25);
    border-color: var(--violet);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.search-icon {
    font-size: 16px;
    opacity: 0.7;
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    flex: 1;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.paper-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.paper-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    cursor: pointer;
}

.paper-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.paper-meta {
    color: var(--text-muted);
    font-size: 13px;
}

.paper-arrow {
    font-size: 24px;
    color: var(--text-muted);
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--glass-border);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 10px;
    border-radius: 10px;
    font-size: 15px;
    transition: background 0.15s ease;
}

.drawer-link:active {
    background: rgba(255, 255, 255, 0.08);
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 99;
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 28px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 20px 14px;
}

.stat-icon {
    font-size: 26px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.stat-label {
    color: var(--text-muted);
    font-size: 12px;
}

.section-title {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.exam-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    margin-bottom: 12px;
}

.exam-score {
    font-size: 18px;
    font-weight: 700;
    color: #4dd4ac;
}

.exam-score-mid {
    color: #ffcc66;
}

.chat-window {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 150px;
}

.chat-bubble {
    max-width: 80%;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.5;
}

.bubble-ai {
    align-self: stretch;
    max-width: 100%;
    background: rgba(124, 92, 255, 0.18);
    border: 1px solid rgba(124, 92, 255, 0.3);
    border-radius: 16px;
}

.bubble-user {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-bottom-right-radius: 4px;
}

.chat-input-bar {
    position: fixed;
    bottom: 78px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 448px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 18px;
    z-index: 60;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background: var(--violet);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.exam-setup {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.setup-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 12px;
}

.setup-label:first-child {
    margin-top: 0;
}

.setup-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.setup-input::placeholder {
    color: var(--text-muted);
}

.time-options {
    display: flex;
    gap: 10px;
}

.time-chip {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px 8px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.time-chip.selected {
    background: rgba(124, 92, 255, 0.25);
    border-color: var(--violet);
}

.start-exam-btn {
    width: 100%;
    background: var(--coral);
    border: none;
    color: white;
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.start-exam-btn:active {
    transform: scale(0.98);
}

.custom-chip {
    background: rgba(255, 107, 107, 0.12);
    border-color: rgba(255, 107, 107, 0.3);
}

.custom-input {
    margin-top: 8px;
}

.exam-top-bar {
    flex-wrap: wrap;
    gap: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    margin-top: 4px;
}

.exam-progress {
    font-size: 13px;
    color: var(--text-muted);
}

.exam-timer {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--coral);
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--coral), var(--violet));
    border-radius: 6px;
    transition: width 0.3s ease;
}

.exam-question-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.answer-textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px;
    color: var(--text-primary);
    font-size: 14.5px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    margin-top: 8px;
}

.answer-textarea::placeholder {
    color: var(--text-muted);
}

.answer-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 4px 0;
}

.answer-divider::before,
.answer-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.answer-divider span {
    padding: 0 10px;
}

.photo-answer-btn {
    background: rgba(124, 92, 255, 0.15);
    border: 1px dashed rgba(124, 92, 255, 0.4);
    color: var(--text-primary);
    padding: 14px;
    border-radius: 14px;
    font-size: 14.5px;
    cursor: pointer;
}

.photo-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 14px;
}

.photo-placeholder {
    font-size: 14px;
    color: var(--text-primary);
}

.retake-btn {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
}

.exam-nav {
    display: flex;
    gap: 12px;
}

.score-summary {
    text-align: center;
    padding: 28px 20px;
    margin-bottom: 24px;
}

.big-score {
    font-size: 48px;
    font-weight: 800;
    color: #4dd4ac;
    margin: 8px 0 4px;
}

.big-score-pct {
    font-size: 24px;
    font-weight: 600;
}

.score-subtext {
    color: var(--text-muted);
    font-size: 13.5px;
}

.question-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.qr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qr-title {
    font-weight: 700;
    font-size: 14px;
}

.qr-score {
    font-weight: 700;
    font-size: 14px;
}

.qr-good { color: #4dd4ac; }
.qr-mid { color: #ffcc66; }
.qr-low { color: #ff6b6b; }

.qr-question {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.qr-feedback {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.splash-screen {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.splash-screen.fade-out {
    opacity: 0;
}

.splash-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 14, 0.95) 20%, rgba(10, 10, 14, 0.5) 60%, rgba(10, 10, 14, 0.2));
}

.splash-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    text-align: center;
}

.splash-logo {
    font-size: 32px;
    color: var(--coral);
    margin-bottom: 12px;
}

.splash-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.splash-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.splash-btn {
    display: block;
    background: var(--coral);
    color: white;
    text-decoration: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--glass-border);
    padding: 10px 0 14px;
    z-index: 50;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    flex: 1;
    transition: color 0.15s ease;
}

.nav-icon {
    font-size: 20px;
}

.nav-item.active {
    color: var(--coral);
}

.app-shell {
    padding-bottom: 90px;
}



.empty-state {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 20px;
    gap: 6px;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.empty-title {
    font-weight: 700;
    font-size: 16px;
}

.empty-subtext {
    color: var(--text-muted);
    font-size: 13.5px;
}

.export-bar {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.export-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 6px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
}

.export-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 20, 28, 0.95);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 13.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 200;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.export-card {
    display: none;
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 400px;
    flex-direction: column;
    gap: 12px;
    padding: 32px 24px;
    background: #14141c;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.export-q-label, .export-a-label {
    color: #a0a0ab;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.export-q-text {
    font-size: 18px;
    font-weight: 700;
    color: #f5f5f7;
    line-height: 1.4;
}

.export-a-text {
    font-size: 18px;
    font-weight: 700;
    color: #4dd4ac;
    line-height: 1.4;
}

.export-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.export-option {
    font-size: 15px;
    color: #a0a0ab;
    padding: 4px 0;
}

.export-option-correct {
    color: #4dd4ac;
    font-weight: 700;
}

.theme-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px;
    margin-top: 8px;
    font-size: 15px;
    color: var(--text-primary);
    border-top: 1px solid var(--glass-border);
}

.theme-toggle {
    width: 46px;
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    padding: 0;
}

.theme-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--coral);
    border-radius: 50%;
    transition: transform 0.25s ease;
}

body.light-theme .theme-toggle-knob {
    transform: translateX(20px);
}

.paper-detail-card {
    margin-bottom: 16px;
}

.paper-detail-title {
    font-size: 20px;
    font-weight: 700;
    margin: 6px 0 4px;
}

.pdf-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 20px;
    margin-bottom: 16px;
}

.pdf-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.paper-actions {
    display: flex;
    gap: 12px;
}

.paper-item {
    text-decoration: none;
    color: var(--text-primary);
}

.flash-progress {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.upload-result {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-result-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.upload-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.upload-file-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    flex-shrink: 0;
}

.upload-file-info {
    flex: 1;
    min-width: 0;
}

.upload-file-name {
    font-weight: 600;
    font-size: 14.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-file-size {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: 2px;
}

.attach-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.attach-preview {
    display: none;
    gap: 8px;
    overflow-x: auto;
    position: fixed;
    bottom: 138px;
    left: 16px;
    right: 16px;
    max-width: 448px;
    margin: 0 auto;
    z-index: 60;
    padding-bottom: 4px;
}

.attach-thumb-wrap {
    position: relative;
    flex-shrink: 0;
}

.attach-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.attach-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--coral);
    color: white;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    margin-bottom: 16px;
}

.result-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.result-ring-good {
    background: rgba(77, 212, 172, 0.15);
    border: 2px solid #4dd4ac;
}

.result-ring-bad {
    background: rgba(255, 107, 107, 0.15);
    border: 2px solid #ff6b6b;
}

.result-check {
    font-size: 30px;
    font-weight: 800;
}

.result-ring-good .result-check {
    color: #4dd4ac;
}

.result-ring-bad .result-check {
    color: #ff6b6b;
}

.result-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.result-banner-good .result-title {
    color: #4dd4ac;
}

.result-banner-bad .result-title {
    color: #ff6b6b;
}

.result-subtext {
    color: var(--text-muted);
    font-size: 14px;
}

.explanation-card {
    margin-bottom: 16px;
}

.explanation-answer {
    font-size: 22px;
    font-weight: 800;
    color: #4dd4ac;
    margin: 6px 0 12px;
}

.explanation-text {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-top: 10px;
}

.about-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    margin-bottom: 16px;
}

.about-avatar {
    font-size: 48px;
    margin-bottom: 10px;
}

.about-name {
    font-size: 19px;
    font-weight: 700;
}

.about-role {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-top: 2px;
}

.about-story, .about-contact {
    margin-bottom: 16px;
}

.about-text {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-top: 8px;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    margin-top: 8px;
    padding: 10px 0;
}

.contact-icon {
    font-size: 18px;
}

.about-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: 20px;
}

.lang-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.lang-toggle-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}

.about-avatar-img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-border);
    margin-bottom: 10px;
}

.about-avatar-img {
    cursor: pointer;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox.open {
    display: flex;
}

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    object-fit: contain;
}

.name-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 400;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.name-modal-overlay.open {
    display: flex;
}

.name-modal {
    width: 100%;
    max-width: 340px;
    text-align: center;
}

.name-modal-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 6px;
}

.name-modal-subtext {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 16px !important;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.bubble-ai h2 {
    font-size: 17px;
    margin: 10px 0 6px;
}

.bubble-ai h3 {
    font-size: 15px;
    margin: 8px 0 4px;
}

.bubble-ai ul, .bubble-ai ol {
    margin: 6px 0 6px 18px;
}

.bubble-ai li {
    margin-bottom: 4px;
}

.bubble-ai strong {
    color: #d4c8ff;
}

.bubble-ai p {
    margin-bottom: 8px;
}

.bubble-ai p:last-child {
    margin-bottom: 0;
}

.qr-correction {
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-top: 4px;
}

.result-score-good { color: #4dd4ac; }
.result-score-mid { color: #ffcc66; }
.result-score-low { color: #ff6b6b; }

.bubble-ai table {
    display: block;
    max-width: 100%;
    width: max-content;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
    overflow-x: auto;
    white-space: nowrap;
}

.bubble-ai th, .bubble-ai td {
    border: 1px solid var(--glass-border);
    padding: 8px 10px;
    text-align: left;
}

.bubble-ai th {
    background: rgba(124, 92, 255, 0.15);
    font-weight: 700;
    color: var(--text-primary);
}

.bubble-ai tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

.bubble-ai code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
}

.bubble-ai pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 8px 0;
}

.bubble-ai pre code {
    background: none;
    padding: 0;
}

.bubble-ai hr {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 12px 0;
}

.bubble-ai .katex {
    font-size: 1.05em;
}

.bubble-ai .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 0;
}

.mermaid-wrapper {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 12px;
    margin: 10px 0;
    overflow-x: auto;
    display: flex;
    justify-content: center;
}

.mermaid-wrapper svg {
    max-width: 100%;
    height: auto;
}

.ai-label-card {
    background: rgba(255, 204, 102, 0.1);
    border-color: rgba(255, 204, 102, 0.3);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.ai-label-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.paper-header-card {
    text-align: center;
    padding: 24px 20px;
    margin-bottom: 20px;
}

.paper-subject {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.paper-header-meta {
    color: var(--text-muted);
    font-size: 13.5px;
}

.paper-question-item {
    margin-bottom: 12px;
}

.paper-marks {
    color: var(--violet);
    font-size: 13px;
    font-weight: 700;
}

.generate-paper-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 20px;
    border-color: rgba(124, 92, 255, 0.35);
}

.generate-cta-icon {
    font-size: 26px;
    flex-shrink: 0;
}

.generate-cta-title {
    font-weight: 700;
    font-size: 15px;
}

.generate-cta-subtitle {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: 2px;
}

.alert-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.alert-modal-overlay.open {
    display: flex;
}

.alert-modal {
    width: 100%;
    max-width: 340px;
    text-align: center;
}

.alert-modal-message {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 16px;
    color: var(--text-primary);
}
