/* ===== CSS Variables ===== */
:root {
    --bg: #0a0e1a;
    --bg2: #131a2c;
    --bg3: #1a2238;
    --surface: rgba(20, 27, 45, 0.7);
    --surface-hover: rgba(26, 34, 56, 0.9);
    --ink: #e8edf5;
    --muted: #7a86a0;
    --muted2: #5a6580;
    --rule: rgba(255, 255, 255, 0.08);
    --accent: #00d4ff;
    --accent2: #ff6b35;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --accent2-glow: rgba(255, 107, 53, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== Background Decoration ===== */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: var(--accent);
    top: -200px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: var(--accent2);
    bottom: -150px;
    left: -100px;
    animation: float 10s ease-in-out infinite reverse;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

/* ===== Header ===== */
.app-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--rule);
    backdrop-filter: blur(12px);
    background: rgba(10, 14, 26, 0.6);
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.logo-icon {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--bg);
    letter-spacing: -0.5px;
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-text p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 2px;
}

.header-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    font-size: 0.72rem;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: var(--accent);
    font-weight: 500;
}

/* ===== Main ===== */
.app-main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.section {
    animation: fadeIn 0.4s ease;
}

.section.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.3px;
}

/* ===== Mode Selector ===== */
.mode-selector {
    margin-bottom: 2rem;
}

.mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mode-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 2px solid var(--rule);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.mode-card:hover {
    background: var(--surface-hover);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.mode-card.active {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.08);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.mode-icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.mode-card.active .mode-icon-wrapper {
    color: var(--accent);
    background: rgba(0, 212, 255, 0.15);
}

.mode-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.mode-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.mode-card p {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ===== Upload Zone ===== */
.upload-zone {
    border: 2px dashed var(--rule);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--surface);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragging {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.05);
}

.upload-zone.dragging {
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent);
    transition: all 0.25s ease;
}

.upload-zone:hover .upload-icon {
    transform: scale(1.1);
    background: rgba(0, 212, 255, 0.15);
}

.upload-icon svg {
    width: 32px;
    height: 32px;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: var(--muted);
    margin-bottom: 1rem;
}

.upload-link {
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
}

.upload-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted2);
    flex-wrap: wrap;
}

.upload-hint .dot {
    color: var(--muted2);
}

/* ===== Video Preview ===== */
.preview-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.preview-main {
    min-width: 0;
}

.video-wrapper {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.video-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.preview-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--rule);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.info-label {
    font-size: 0.85rem;
    color: var(--muted);
    flex-shrink: 0;
}

.info-value {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.preview-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-tips {
    font-size: 0.78rem;
    color: var(--muted2);
    text-align: center;
    padding: 0.75rem;
    background: rgba(0, 212, 255, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 212, 255, 0.1);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0099cc);
    color: var(--bg);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-large {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: rgba(0, 212, 255, 0.3);
}

.btn-small {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
}

.btn-ghost.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 212, 255, 0.08);
}

/* ===== Processing Section ===== */
.processing-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.processing-content {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.processing-visual {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.processing-ring {
    position: absolute;
    inset: 0;
    border: 3px solid var(--rule);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.processing-pulse {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.15;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(0.8); opacity: 0.1; }
    50% { transform: scale(1.1); opacity: 0.25; }
}

.processing-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.processing-status {
    color: var(--muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    min-height: 1.5em;
}

.progress-container {
    margin-bottom: 2rem;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--bg3);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 100px;
    transition: width 0.3s ease;
    box-shadow: 0 0 12px var(--accent-glow);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--muted);
}

.processing-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 1;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted2);
    transition: all 0.3s ease;
}

.step-item.active .step-dot {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse-dot 1s ease-in-out infinite;
}

.step-item.completed .step-dot {
    background: var(--success);
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.step-text {
    font-size: 0.82rem;
    font-weight: 500;
}

/* ===== Results Section ===== */
.results-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-left,
.results-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.2px;
}

.card-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 100px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    font-weight: 600;
}

/* ===== Score Card ===== */
.score-display {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.score-ring-container {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: var(--rule);
    stroke-width: 10;
}

.score-ring-fg {
    fill: none;
    stroke: var(--accent);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s ease;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

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

.score-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-unit {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
    margin-top: 4px;
}

.score-grade {
    flex: 1;
}

.grade-label {
    font-size: 0.8rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.25rem;
}

.grade-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.breakdown-label {
    font-size: 0.82rem;
    width: 90px;
    flex-shrink: 0;
    color: var(--muted);
}

.breakdown-bar {
    flex: 1;
    height: 6px;
    background: var(--bg3);
    border-radius: 100px;
    overflow: hidden;
}

.breakdown-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 1s ease;
}

.breakdown-score {
    font-size: 0.82rem;
    font-weight: 600;
    width: 35px;
    text-align: right;
    flex-shrink: 0;
}

/* ===== Metrics ===== */
.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--rule);
    gap: 1rem;
}

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

.metric-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.metric-desc {
    font-size: 0.72rem;
    color: var(--muted);
}

.metric-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.metric-number {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--mono);
}

.metric-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.metric-status.good { background: var(--success); }
.metric-status.warning { background: var(--warning); }
.metric-status.bad { background: var(--danger); }

/* ===== Video Result ===== */
.video-result-card .video-wrapper {
    border-radius: var(--radius-sm);
}

.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.video-play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.play-icon svg {
    width: 28px;
    height: 28px;
}

.video-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ===== Issues ===== */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.issue-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--rule);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.issue-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.issue-item.critical {
    border-left: 3px solid var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.issue-item.warning {
    border-left: 3px solid var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.issue-item.good {
    border-left: 3px solid var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.issue-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.issue-item.critical .issue-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.issue-item.warning .issue-icon {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.issue-item.good .issue-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.issue-content {
    flex: 1;
}

.issue-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.issue-desc {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ===== Suggestions ===== */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.suggestion-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--rule);
    background: rgba(0, 212, 255, 0.03);
}

.suggestion-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #0099cc);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.suggestion-content {
    flex: 1;
}

.suggestion-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.suggestion-desc {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ===== Timeline ===== */
.timeline-card {
    margin-top: 0;
}

.timeline-container {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--rule) transparent;
}

.timeline-container::-webkit-scrollbar {
    height: 6px;
}

.timeline-container::-webkit-scrollbar-track {
    background: transparent;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: var(--rule);
    border-radius: 100px;
}

.frame-card {
    flex-shrink: 0;
    width: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--rule);
    background: var(--bg3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.frame-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.frame-card.active {
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.frame-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
    overflow: hidden;
}

.frame-image canvas,
.frame-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.frame-info {
    padding: 0.5rem 0.75rem;
}

.frame-time {
    font-size: 0.75rem;
    color: var(--muted);
    font-family: var(--mono);
}

.frame-label {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 2px;
}

/* ===== Footer ===== */
.app-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--rule);
    background: rgba(10, 14, 26, 0.6);
    backdrop-filter: blur(10px);
}

.footer-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.footer-desc {
    font-size: 0.78rem;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
}

.footer-support {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.support-qrcode {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--rule);
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.support-qrcode img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.support-text {
    font-size: 0.8rem;
    color: var(--muted);
    max-width: 320px;
    line-height: 1.6;
}

.footer-contact {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.contact-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.contact-desc {
    font-size: 0.78rem;
    color: var(--muted);
}

.contact-email {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.contact-email:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-icp {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-icp a {
    font-size: 0.75rem;
    color: var(--muted2);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-icp a:hover {
    color: var(--accent);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg2);
    border: 1px solid var(--rule);
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast.success { border-color: rgba(16, 185, 129, 0.3); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }
.toast.warning { border-color: rgba(245, 158, 11, 0.3); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.removing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to { transform: translateX(100%); opacity: 0; }
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 14, 26, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    backdrop-filter: blur(8px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--rule);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: var(--muted);
    font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .preview-layout,
    .results-layout {
        grid-template-columns: 1fr;
    }

    .results-left {
        order: 2;
    }

    .results-right {
        order: 1;
    }

    .score-display {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .app-main {
        padding: 1rem;
    }

    .mode-cards {
        grid-template-columns: 1fr;
    }

    .app-header {
        padding: 1rem;
    }

    .header-badges {
        display: none;
    }

    .header-text h1 {
        font-size: 1.25rem;
    }

    .processing-steps {
        gap: 1rem;
    }

    .score-number {
        font-size: 2.5rem;
    }

    .grade-value {
        font-size: 2rem;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }
}
