@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-base: #0f172a;
    --bg-surface: rgba(30, 41, 59, 0.7);
    --bg-surface-hover: rgba(30, 41, 59, 0.9);
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --secondary: #ec4899;
    --accent: #14b8a6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ICP备案悬浮组件 */
.icp-footer {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.icp-footer a {
    color: rgba(226, 232, 240, 0.82);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.icp-footer a:hover {
    color: #ffffff;
}

@media (max-width: 768px) {
    .icp-footer {
        bottom: 12px;
        max-width: calc(100vw - 24px);
        padding: 7px 14px;
    }

    .icp-footer a {
        font-size: 11px;
    }
}


/* Glassmorphism Containers */
.container, .login-container {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 2.5rem;
    max-width: 800px;
    width: 90%;
    margin: 2rem auto;
    animation: fadeUp 0.6s ease-out;
}

.login-container {
    max-width: 480px;
}

/* Headers */
h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

header h1, .brand-header h2 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.brand-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Top Header Bar */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Inputs & Forms */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type="text"], input[type="password"], input[type="file"], textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: var(--transition);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

/* 修复浏览器自动填充导致背景变白 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(20, 20, 40, 0.95) inset !important;
    box-shadow: 0 0 0 1000px rgba(20, 20, 40, 0.95) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    caret-color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.1) !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* Buttons */
button {
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn, .confirm-btn, .upload-btn, .reports-btn, .btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.login-btn:hover, .confirm-btn:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
}

.logout-btn {
    padding: 0.6rem 1.2rem;
    background: rgba(236, 72, 153, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.logout-btn:hover {
    background: var(--secondary);
    color: white;
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    cursor: pointer;
    background: rgba(99, 102, 241, 0.05);
    transition: var(--transition);
    text-align: center;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Role Tabs */
.role-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
}

.role-tab {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 6px;
}

.role-tab.active {
    background: var(--bg-surface);
    color: var(--text-main);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Grid & Cards */
.history-grid, .exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.history-item, .exam-card {
    background: rgba(255, 255, 255, 0.03);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover, .exam-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Utilities */
.hidden { display: none !important; }
.error-message {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(220, 38, 38, 0.2);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.register-btn, .back-to-login-btn {
    background: transparent;
    color: var(--primary-hover);
    border: none;
    margin-top: 1rem;
}
.register-btn:hover, .back-to-login-btn:hover {
    color: white;
    text-decoration: underline;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

.file-actions { display: flex; gap: 0.5rem; }
.remove-btn {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
}
.remove-btn:hover { background: rgba(239, 68, 68, 0.4); color: white; }

.confirm-btn {
    width: auto;
    padding: 0.5rem 1rem;
    background: var(--accent);
}
.confirm-btn:hover {
    background: var(--accent);
    filter: brightness(0.9);
}

.history-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
::placeholder { color: var(--text-muted); opacity: 0.7; }

/* Custom Scrollbar for Glassmorphism */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

/* Additional Color Variables */
:root {
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --success-hover: #059669;
}
