/* Tokyo Night CTF Platform - CSS */
/* Color Palette */
:root {
    /* Tokyo Night Colors */
    --bg-primary: #1a1b26;
    --bg-secondary: #16161e;
    --bg-tertiary: #24283b;
    --bg-float: #1f2335;
    --bg-popup: #3b4261;

    /* Text Colors */
    --text-primary: #c0caf5;
    --text-secondary: #a9b1d6;
    --text-muted: #565f89;
    --text-dark: #414868;

    /* Accent Colors */
    --accent-blue: #7aa2f7;
    --accent-purple: #bb9af7;
    --accent-cyan: #7dcfff;
    --accent-pink: #f7768e;
    --accent-green: #9ece6a;
    --accent-orange: #e0af68;
    --accent-red: #f7768e;

    /* Neon Effects */
    --neon-blue: #7aa2f7;
    --neon-pink: #ff007f;
    --neon-cyan: #00ffff;
    --neon-green: #39ff14;

    /* Borders */
    --border-primary: #414868;
    --border-secondary: #565f89;

    /* Shadows */
    --shadow-glow: 0 0 20px rgba(122, 162, 247, 0.3);
    --shadow-neon: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;

    /* Fonts */
    --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Animations */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Cyber Grid Background */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(122, 162, 247, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(122, 162, 247, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: grid-pulse 4s ease-in-out infinite;
}

@keyframes grid-pulse {

    0%,
    100% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Container */.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}/* Navigation */
.navbar {
    background: rgba(26, 27, 38, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-primary);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition-normal);
}

.nav-container {
    max-width: none;
    margin: 0;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    width: 100%;
}

.nav-brand {
    flex: 0 0 auto;
}

.nav-brand .brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
    transition: var(--transition-fast);
}

.nav-brand .brand-link:hover {
    color: var(--accent-blue);
}

.neon-icon {
    color: var(--accent-blue);
    margin-right: 0.5rem;
    font-size: 1.8rem;
    filter: drop-shadow(0 0 5px var(--accent-blue));
}

.brand-text .neon-accent {
    color: var(--accent-pink);
    text-shadow: 0 0 10px var(--accent-pink);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 0 0 auto;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-blue);
    background: rgba(122, 162, 247, 0.1);
    box-shadow: 0 0 15px rgba(122, 162, 247, 0.2);
}

.nav-link.register-btn {
    background: linear-gradient(45deg, var(--accent-pink), var(--accent-purple));
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.nav-link.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(247, 118, 142, 0.4);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-score {
    background: linear-gradient(45deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-family: var(--font-mono);
}

.user-dropdown {
    position: relative;
}

.user-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.user-btn:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(122, 162, 247, 0.2);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-float);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-top: 0.5rem;
    min-width: 150px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
}

.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-red);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    z-index: 1001;
}

.nav-toggle .bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition-fast);
}

/* Main Content */
.main-content {
    margin-top: 70px;
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Flash Messages */
.flash-container {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 1001;
    max-width: 400px;
}

.flash-message {
    background: var(--bg-float);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slide-in-right 0.3s ease;
    backdrop-filter: blur(10px);
}

.flash-success {
    border-color: var(--accent-green);
    background: rgba(158, 206, 106, 0.1);
}

.flash-error {
    border-color: var(--accent-red);
    background: rgba(247, 118, 142, 0.1);
}

.flash-info {
    border-color: var(--accent-blue);
    background: rgba(122, 162, 247, 0.1);
}

.flash-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 1rem;
    transition: var(--transition-fast);
}

.flash-close:hover {
    color: var(--accent-red);
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Cards */
.card {
    background: var(--bg-float);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
    transform: scaleX(0);
    transition: var(--transition-normal);
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-blue);
}

.card-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(122, 162, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 162, 247, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, var(--accent-green), var(--accent-cyan));
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(158, 206, 106, 0.3);
}

.btn-danger {
    background: linear-gradient(45deg, var(--accent-red), var(--accent-pink));
    color: white;
    box-shadow: 0 4px 15px rgba(247, 118, 142, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-blue);
    color: var(--accent-blue);
}

.btn-outline:hover {
    background: var(--accent-blue);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: var(--font-mono);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-float);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.table td {
    color: var(--text-secondary);
}

.table tr:hover {
    background: rgba(122, 162, 247, 0.05);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-easy {
    background: rgba(158, 206, 106, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.badge-medium {
    background: rgba(224, 175, 104, 0.2);
    color: var(--accent-orange);
    border: 1px solid var(--accent-orange);
}

.badge-hard {
    background: rgba(247, 118, 142, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.badge-solved {
    background: rgba(125, 207, 255, 0.2);
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-float);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.stat-icon.icon-users {
    color: var(--accent-blue);
}

.stat-icon.icon-challenges {
    color: var(--accent-purple);
}

.stat-icon.icon-submissions {
    color: var(--accent-green);
}

.stat-icon.icon-correct {
    color: var(--accent-cyan);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Challenge Grid */
.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.challenge-card {
    background: var(--bg-float);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-blue);
    transform: scaleX(0);
    transition: var(--transition-normal);
}

.challenge-card:hover::before {
    transform: scaleX(1);
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-blue);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.challenge-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.challenge-points {
    background: linear-gradient(45deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 1.1rem;
}

.challenge-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.challenge-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
}

.footer-right {
    display: flex;
    gap: 2rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-blue);
}

/* Animations */
@keyframes neon-pulse {

    0%,
    100% {
        text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor;
    }

    50% {
        text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, 0 0 8px currentColor;
    }
}

.neon-text {
    animation: neon-pulse 2s ease-in-out infinite;
}

/* Challenge Motto Styles */
.challenge-motto {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(122, 162, 247, 0.1), rgba(187, 154, 247, 0.1));
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.challenge-motto::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(122, 162, 247, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.motto-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 1;
}

.neon-glow {
    text-shadow: 0 0 5px var(--accent-cyan), 0 0 10px var(--accent-cyan), 0 0 15px var(--accent-cyan);
    animation: glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    from {
        text-shadow: 0 0 5px var(--accent-cyan), 0 0 10px var(--accent-cyan), 0 0 15px var(--accent-cyan);
    }
    to {
        text-shadow: 0 0 10px var(--accent-cyan), 0 0 20px var(--accent-cyan), 0 0 30px var(--accent-cyan);
    }
}

.accent-text {
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.motto-decoration {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-green);
    position: relative;
    z-index: 1;
}

.cyber-bracket {
    color: var(--accent-orange);
    font-weight: bold;
    text-shadow: 0 0 5px currentColor;
}

.typing-effect {
    display: inline-block;
    border-right: 2px solid var(--accent-green);
    animation: typing 4s steps(20) infinite, blink 1s infinite;
    white-space: nowrap;
    overflow: hidden;
    max-width: 20ch;
}

@keyframes typing {
    0%, 90%, 100% {
        width: 0;
    }
    30%, 60% {
        width: 20ch;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Enhanced Subtitle Section Styles */
.enhanced-subtitle-section {
    background: linear-gradient(135deg, rgba(122, 162, 247, 0.08), rgba(187, 154, 247, 0.08), rgba(125, 207, 255, 0.08));
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(122, 162, 247, 0.1);
}

.enhanced-subtitle-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple), var(--accent-cyan), var(--accent-pink));
    background-size: 400% 400%;
    animation: gradient-border 8s ease infinite;
    border-radius: 20px;
    z-index: -1;
    padding: 2px;
}

.enhanced-subtitle-section::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: var(--bg-primary);
    border-radius: 18px;
    z-index: -1;
}

@keyframes gradient-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.main-title-in-subtitle {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.main-title-in-subtitle .neon-text {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-cyan), 0 0 20px var(--accent-cyan), 0 0 30px var(--accent-cyan);
    animation: neon-pulse 2s ease-in-out infinite;
}

.main-title-in-subtitle .accent-text {
    background: linear-gradient(45deg, var(--accent-purple), var(--accent-pink));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    margin-left: 0.5rem;
}

.page-subtitle.enhanced {
    font-size: 1.4rem;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.cyber-line {
    height: 2px;
    width: 80px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    animation: line-glow 2s ease-in-out infinite alternate;
}

@keyframes line-glow {
    from {
        box-shadow: 0 0 5px var(--accent-cyan);
    }
    to {
        box-shadow: 0 0 15px var(--accent-cyan), 0 0 25px var(--accent-cyan);
    }
}

.cyber-icon {
    font-size: 1.5rem;
    color: var(--accent-orange);
    text-shadow: 0 0 10px currentColor;
    animation: icon-pulse 1.5s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-title-in-subtitle {
        font-size: 2rem;
    }
    
    .page-subtitle.enhanced {
        font-size: 1.1rem;
    }
    
    .enhanced-subtitle-section {
        padding: 1.5rem;
    }
    
    .cyber-line {
        width: 50px;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-secondary);
        width: 100%;
        text-align: center;
        transition: var(--transition-normal);
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        border-top: 1px solid var(--border-primary);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

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

    .challenge-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .flash-container {
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }

    .container {
        padding: 0 0.5rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Selection */
::selection {
    background: rgba(122, 162, 247, 0.3);
    color: var(--text-primary);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(122, 162, 247, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s ease-in-out infinite;
}

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

/* AI Response Markdown Styles */
.ai-response {
    font-family: var(--font-sans);
    line-height: 1.8;
    color: var(--text-primary);
    padding: 1.5rem;
    background: var(--bg-float);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    margin: 1rem 0;
}

.ai-response h1,
.ai-response h2,
.ai-response h3,
.ai-response h4,
.ai-response h5,
.ai-response h6 {
    color: var(--accent-blue);
    margin: 2.5rem 0 1.5rem 0 !important;
    font-weight: 600;
    line-height: 1.4;
    display: block;
}

.ai-response h1:first-child,
.ai-response h2:first-child,
.ai-response h3:first-child,
.ai-response h4:first-child,
.ai-response h5:first-child,
.ai-response h6:first-child {
    margin-top: 0 !important;
}

.ai-response h1 {
    font-size: 1.6rem;
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: 0.8rem;
    margin-bottom: 1.5rem;
}

.ai-response h2 {
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
}

.ai-response h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.ai-response p {
    margin: 1.8rem 0 !important;
    color: var(--text-primary);
    line-height: 2.0;
    display: block;
}

.ai-response p:first-child {
    margin-top: 0 !important;
}

.ai-response p:last-child {
    margin-bottom: 0 !important;
}

.ai-response code {
    background: var(--bg-tertiary);
    color: var(--accent-cyan);
    padding: 0.4rem 0.8rem !important;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border: 1px solid var(--border-primary);
    margin: 0 0.3rem !important;
    display: inline-block;
}

.ai-response pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 2rem !important;
    margin: 2.5rem 0 !important;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    line-height: 1.6;
}

.ai-response pre:before {
    content: "代码";
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    background: var(--accent-blue);
    color: var(--bg-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.8;
}

.ai-response pre code {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
    display: block;
    white-space: pre;
    word-wrap: break-word;
}

/* 代码语法高亮 */
.ai-response pre code .keyword {
    color: var(--accent-purple);
    font-weight: 600;
}

.ai-response pre code .string {
    color: var(--accent-green);
}

.ai-response pre code .comment {
    color: var(--text-muted);
    font-style: italic;
}

.ai-response pre code .number {
    color: var(--accent-orange);
}

.ai-response pre code .function {
    color: var(--accent-cyan);
}

.ai-response blockquote {
    border-left: 4px solid var(--accent-purple);
    background: var(--bg-float);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 10px 10px 0;
    color: var(--text-secondary);
    font-style: italic;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ai-response ul,
.ai-response ol {
    margin: 1.5rem 0;
    padding-left: 2.5rem;
}

.ai-response li {
    margin: 0.8rem 0;
    color: var(--text-primary);
    line-height: 1.7;
}

.ai-response li p {
    margin: 0.5rem 0;
}

.ai-response strong {
    color: var(--accent-orange);
    font-weight: 600;
}

.ai-response em {
    color: var(--accent-pink);
    font-style: italic;
}

.ai-response a {
    color: var(--accent-cyan);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition-fast);
    padding: 0.1rem 0.2rem;
    border-radius: 4px;
}

.ai-response a:hover {
    border-bottom-color: var(--accent-cyan);
    text-shadow: 0 0 8px var(--accent-cyan);
    background: rgba(125, 207, 255, 0.1);
}

.ai-response table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--bg-float);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-response th,
.ai-response td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.ai-response th {
    background: var(--bg-tertiary);
    color: var(--accent-blue);
    font-weight: 600;
}

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

.ai-response hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
    margin: 3rem 0;
}

/* 特殊样式：数字编号 */
.ai-response ol {
    counter-reset: item;
    list-style: none;
}

.ai-response ol > li {
    display: block;
    margin-bottom: 2rem !important;
    position: relative;
    padding-left: 3rem;
    line-height: 1.8;
}

.ai-response ol > li:before {
    content: counter(item);
    counter-increment: item;
    font-weight: bold;
    color: var(--bg-primary);
    background: var(--accent-blue);
    padding: 0.4rem 0.8rem;
    border-radius: 50%;
    font-size: 0.9rem;
    min-width: 2rem;
    height: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    top: 0;
    box-shadow: 0 2px 8px rgba(122, 162, 247, 0.3);
}

/* 无序列表样式 */
.ai-response ul {
    list-style: none;
}

.ai-response ul > li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.5rem !important;
    line-height: 1.8;
}

.ai-response ul > li:before {
    content: "▶";
    color: var(--accent-cyan);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.8rem;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}

.ai-response ul > li:hover:before {
    transform: rotate(90deg);
}

/* 嵌套列表 */
.ai-response ul ul,
.ai-response ol ol,
.ai-response ul ol,
.ai-response ol ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.ai-response ul ul > li:before {
    content: "◆";
    color: var(--accent-purple);
}

/* 段落间距优化 */
.ai-response p + p {
    margin-top: 1.5rem;
}

.ai-response p + h1,
.ai-response p + h2,
.ai-response p + h3,
.ai-response p + h4,
.ai-response p + h5,
.ai-response p + h6 {
    margin-top: 2.5rem;
}

.ai-response h1 + p,
.ai-response h2 + p,
.ai-response h3 + p,
.ai-response h4 + p,
.ai-response h5 + p,
.ai-response h6 + p {
    margin-top: 1rem;
}