/**
 * 黑龙江题库系统 - 全局现代化UI设计系统 v2.0
 * 设计理念：教育SaaS的精致感、清晰的信息层级、流畅的交互
 * 配色：Indigo主色 + Slate中性色 + 功能色
 */

/* ==================== CSS Variables ==================== */
:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #EEF2FF;
    --primary-hover: #4338CA;
    
    --success: #10B981;
    --success-light: #ECFDF5;
    --success-dark: #059669;
    
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --danger-dark: #DC2626;
    
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --warning-dark: #D97706;
    
    --info: #3B82F6;
    --info-light: #EFF6FF;
    --info-dark: #2563EB;
    
    --bg: #F8FAFC;
    --bg-elevated: #F1F5F9;
    --card: #FFFFFF;
    --text: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    
    --header-height: 64px;
    --sidebar-width: 260px;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin-top: 0;
    letter-spacing: -0.02em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 12px;
}

p:last-child { margin-bottom: 0; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

ul, ol {
    padding-left: 20px;
    margin: 8px 0;
}

li {
    margin: 4px 0;
    color: var(--text-secondary);
}

/* ==================== Layout ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ==================== Header (Hero Style) ==================== */
header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
    color: #ffffff;
    padding: 48px 20px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 40%);
    pointer-events: none;
}

header h1 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
    position: relative;
}

header p {
    color: rgba(255,255,255,0.7);
    margin: 0;
    font-size: 1rem;
    position: relative;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ==================== Navigation ==================== */
nav {
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    min-height: 52px;
}

nav a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    padding: 14px 16px;
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    margin: 2px;
}

nav a:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    transform: translateX(-50%);
    border-radius: 2px;
}

nav a:hover::after {
    width: 40%;
}

.user-info {
    color: #fbbf24 !important;
    font-weight: 600;
}

.user-info:hover {
    color: #fbbf24 !important;
}

/* ==================== Footer ==================== */
footer {
    background: #0f172a;
    color: rgba(255,255,255,0.45);
    text-align: center;
    padding: 32px 20px;
    margin-top: 48px;
    font-size: 0.82rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

footer p {
    color: rgba(255,255,255,0.45);
    margin: 4px 0;
}

/* ==================== Cards & Content ==================== */
.content,
.card,
.login-box,
.register-box,
.stats,
.header[class],
.question-card,
.toolbar,
.settings-panel,
.cart-item,
.paper-box {
    background-color: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.content {
    padding: 32px;
    margin-top: 24px;
}

.content:hover {
    box-shadow: var(--shadow-lg);
}

.card {
    padding: 28px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-light);
    color: var(--text);
}

/* Admin / internal header */
.header {
    padding: 24px 28px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header h1 {
    font-size: 1.35rem;
    color: var(--text);
    margin: 0;
}

/* ==================== Dashboard ==================== */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* ==================== Stats ==================== */
.stats {
    padding: 28px;
}

.stats h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 24px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    opacity: 0;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
}

/* ==================== Login & Register ==================== */
.login-box,
.register-box {
    max-width: 420px;
    margin: 48px auto;
    padding: 40px 36px;
}

.login-box h1,
.register-box h1 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 1.5rem;
    color: var(--text);
}

.links {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.links p {
    margin: 8px 0;
    font-size: 0.88rem;
}

.security-note {
    text-align: center;
    margin-top: 20px;
    padding: 12px 16px;
    background: var(--warning-light);
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    color: var(--warning-dark);
    font-size: 0.82rem;
    font-weight: 500;
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.88rem;
}

.form-group label .required {
    color: var(--danger);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea,
.fill-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card);
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus,
.fill-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 400;
    font-size: 0.88rem;
    transition: var(--transition);
    user-select: none;
}

.checkbox-group label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* Range slider */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.45);
}

/* ==================== Buttons ==================== */
.btn,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    line-height: 1.5;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn:active,
button:active,
input[type="submit"]:active {
    transform: translateY(0);
}

.btn-primary,
button[type="submit"],
input[type="submit"] {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
}

.btn-primary:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-hover) 100%);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: #ffffff;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-dark) 0%, #047857 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: #ffffff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark) 0%, #b91c1c 100%);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #ffffff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    color: #ffffff;
}

.btn-warning:hover {
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-auto {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: #ffffff;
}

.btn-auto:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

.btn-disabled,
button:disabled,
.btn:disabled {
    background: #cbd5e1 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ==================== Tables ==================== */
table,
.paper-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
}

th {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    font-size: 0.88rem;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f8fafc;
}

/* ==================== Messages & Alerts ==================== */
.message,
.alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.message.success {
    background: var(--success-light);
    color: #065f46;
    border-color: #a7f3d0;
}

.message.error {
    background: var(--danger-light);
    color: #991b1b;
    border-color: #fecaca;
}

.message.warning,
.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-color: #fde68a;
}

.message.info,
.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border-color: #bfdbfe;
}

.login-tip {
    background: var(--warning-light);
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    text-align: center;
    font-weight: 500;
}

.login-tip a {
    color: #92400e;
    text-decoration: underline;
    font-weight: 600;
}

/* ==================== Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.badge-type {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge-subject {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-difficulty {
    background: #fef3c7;
    color: #92400e;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.auto-badge {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: #ffffff;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: 8px;
}

/* ==================== Question List ==================== */
.question-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.question-item {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.question-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.question-id {
    font-weight: 600;
    color: var(--text);
    font-size: 0.92rem;
}

.question-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.question-content {
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 12px;
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    list-style: none;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    background: var(--card);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    text-decoration: none;
}

.pagination .current,
.pagination span.current {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ==================== Quick Links (Home) ==================== */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.quick-link {
    display: block;
    padding: 32px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-slow);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.quick-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
    pointer-events: none;
}

.quick-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    color: #ffffff;
    text-decoration: none;
}

.quick-link h3 {
    color: #ffffff;
    margin: 0 0 10px;
    font-size: 1.15rem;
    position: relative;
}

.quick-link p {
    color: rgba(255,255,255,0.85);
    margin: 0;
    font-size: 0.88rem;
    position: relative;
}

.quick-link.auto-paper {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
}

.quick-link.auto-paper:hover {
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.3);
}

/* Feature blocks */
.feature {
    margin: 20px 0;
    padding: 24px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-elevated) 100%);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.feature:hover {
    background: #e2e8f0;
    transform: translateX(4px);
}

.feature h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--text);
}

.feature p,
.feature li {
    color: var(--text-secondary);
    margin: 6px 0;
}

/* ==================== Page Title ==================== */
.page-title {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.3rem;
}

/* ==================== Cart ==================== */
.cart-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cart-item {
    padding: 20px 24px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.cart-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.cart-count {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 6px;
    display: inline-block;
}

/* ==================== Exam / Paper Preview ==================== */
.question-card {
    padding: 32px;
    margin-bottom: 24px;
}

.options-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.option-item {
    padding: 14px 18px;
    margin-bottom: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
}

.option-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.option-item.selected {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    margin: 0;
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.progress-info {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

.timer {
    font-size: 1rem;
    color: var(--danger);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.question-type {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-score {
    color: var(--success);
    font-weight: 700;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.question-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 16px;
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.question-nav a,
.question-nav button {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    padding: 0 8px;
}

.question-nav a:hover,
.question-nav button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.question-nav a.active,
.question-nav button.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ==================== Toolbar (Preview) ==================== */
.toolbar {
    padding: 18px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
}

.toolbar-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-panel {
    padding: 24px;
    margin-bottom: 24px;
    display: none;
}

.settings-panel.show {
    display: block;
}

.settings-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.settings-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Paper rendering */
.paper {
    background: var(--card);
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.paper-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.paper-header h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.paper-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.paper-question {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.paper-question:last-child {
    border-bottom: none;
}

.paper .footer {
    display: none;
}

/* ==================== Utility Classes ==================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.float-right { float: right; }
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty h3 {
    margin: 0 0 16px;
    color: var(--text);
    font-size: 1.2rem;
}

.empty p {
    margin: 0 0 10px;
}

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

.filter-bar {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.filter-bar label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.88rem;
}

/* Difficulty colors */
.difficulty-easy { color: var(--success); }
.difficulty-medium { color: var(--warning); }
.difficulty-hard { color: var(--danger); }

/* ==================== Animations ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.content,
.card,
.stat-item,
.question-item,
.quick-link,
.feature,
.login-box,
.register-box,
.cart-item,
.question-card {
    animation: fadeInUp 0.5s ease backwards;
}

.content:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }

/* ==================== Mobile Menu ==================== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
}

.mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
}

/* ==================== Print Overrides ==================== */
@media print {
    nav,
    footer,
    .btn:not(.paper .btn),
    button:not(.paper button),
    .back-link,
    .paper-actions,
    .toolbar,
    .settings-panel,
    .mobile-menu-toggle,
    .question-nav {
        display: none !important;
    }
    
    body {
        background: #fff !important;
    }
    
    .content,
    .card,
    .paper {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        padding: 24px !important;
    }
    
    .paper {
        padding: 32px !important;
    }
    
    .question-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    :root {
        --radius-lg: 12px;
    }
    
    .container {
        padding: 16px 12px;
    }
    
    .content {
        padding: 20px;
        margin-top: 16px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-item {
        padding: 16px 12px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .quick-links {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .quick-link {
        padding: 24px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .login-box,
    .register-box {
        margin: 24px auto;
        padding: 28px 20px;
    }
    
    nav {
        flex-direction: column;
        padding: 8px;
        min-height: auto;
        max-height: 52px;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }
    
    nav.open {
        max-height: 500px;
    }
    
    nav a {
        padding: 10px 12px;
        font-size: 0.85rem;
        width: 100%;
        text-align: left;
        border-radius: var(--radius-sm);
    }
    
    nav a::after {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    header {
        padding: 40px 16px 32px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .question-item {
        padding: 16px;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cart-item {
        padding: 16px;
        flex-direction: column;
    }
    
    .page-title {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-buttons {
        justify-content: center;
    }
    
    .paper {
        padding: 24px;
    }
    
    .question-card {
        padding: 20px;
    }
    
    .nav-buttons {
        flex-direction: column;
    }
    
    .nav-buttons .btn {
        width: 100%;
    }
    
    .question-nav {
        justify-content: center;
    }
    
    .option-item {
        padding: 12px 14px;
    }
    
    th, td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar select,
    .filter-bar .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    h1 { font-size: 1.35rem; }
    h2 { font-size: 1.15rem; }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .paper-actions {
        flex-direction: column;
    }
    
    .paper-actions .btn {
        width: 100%;
    }
}
