/* ==========================================================================
   暗域工坊NXCN - Learning Management System Custom Styles
   Author: Eovence
   Description: Custom CSS for the 暗域工坊NXCN
   Version: 1.0.0
   ========================================================================== */

/* ==========================================================================
   CSS TABLE OF CONTENTS

   1.  CSS Custom Properties (Variables)
   2.  Base Styles & Typography
   3.  Component Typography
   4.  Lazy Loading
   5.  Gradients & Backgrounds
   6.  Animations & Keyframes
   7.  Card & Component Styles
   8.  Button Styles
   9.  Navigation & Navbar
   10. Mega Menu System
   11. Slider & Carousel Components
   12. Rating & Interactive Elements
   13. Accessibility & Focus Management
   14. Custom Scrollbar
   15. Responsive Typography Utilities
   16. Layout & Spacing Utilities
   17. Print Styles
   18. Main Swiper
   19. Hero Slider System
   20. Responsive Design & Media Queries
   21. Performance & Accessibility Optimizations

   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties (Variables)
   ========================================================================== */
:root {
    /* Typography */
    --font-primary: 'Alibaba PuHui Ti 3.0', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans CJK SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: var(--font-primary);

    /* Colors */
    --color-primary: #667eea;
    --color-primary-dark: #764ba2;
    --color-secondary: #f093fb;
    --color-secondary-dark: #f5576c;
    --color-success: #4facfe;
    --color-success-dark: #00f2fe;
    --color-warning: #e8b848;

    /* NXCN Logo Animation */
    --logo-border-right: 4px;
    --logo-text-stroke: rgba(255,255,255,0.6);
    --logo-animation-color: #4facfe;
    --logo-font-size: 20px;

    /* Neutral Colors */
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --spacing-4xl: 6rem;

    /* Shadows - Fluent Design inspired depth system */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.05), 0 8px 16px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.08);
    --shadow-2xl: 0 16px 32px rgba(0, 0, 0, 0.08), 0 32px 64px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.06);

    /* Transitions - Fluent Design inspired */
    --transition-fast: 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --ease-fluent: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-fluent-in: cubic-bezier(0.32, 0, 0.67, 0);
    --ease-fluent-out: cubic-bezier(0.33, 1, 0.68, 1);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Z-Index Scale */
    --z-dropdown: 50;
    --z-modal: 60;
    --z-tooltip: 70;
    --z-toast: 80;

    /* Swiper Theme */
    --swiper-theme-color: #58e8fd;
}

/* ==========================================================================
   2. Base Styles & Typography
   ========================================================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Scale */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
}

a, button, select {
    cursor: pointer;
}

/* Typography Utilities */
.text-primary {
    font-family: var(--font-primary);
}

.text-heading {
    font-family: var(--font-heading);
}

.text-optimized {
    line-height: 1.7;
}

/* ==========================================================================
   3. Component Typography
   ========================================================================== */
.brand-text,
.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

button,
.btn {
    font-family: var(--font-primary);
    font-weight: 500;
    letter-spacing: 0.01em;
}

nav a,
.nav-link {
    font-family: var(--font-primary);
    font-weight: 500;
    letter-spacing: 0.01em;
}

p,
li,
td,
th {
    font-family: var(--font-primary);
    line-height: 1.7;
}

.card-title,
.section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.hero-subtitle {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
}

input,
textarea,
select,
label {
    font-family: var(--font-primary);
    font-weight: 400;
}

.price,
.stat-number {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.testimonial-text {
    font-family: var(--font-primary);
    font-style: italic;
    font-weight: 400;
    line-height: 1.7;
}

.testimonial-author {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.01em;
}

footer {
    font-family: var(--font-primary);
    font-weight: 400;
}

/* ==========================================================================
   4. Lazy Loading
   ========================================================================== */
img:not([src]):not([srcset]) {
    visibility: hidden;
}

.lazyload {
    opacity: 0;
    transition: opacity 0.5s;
}

.lazyload.loaded {
    opacity: 1;
}

.lazyload-container .skeleton-shimmer {
    background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .lazyload-container .skeleton-shimmer {
    background: linear-gradient(90deg, #374151 0%, #4b5563 50%, #374151 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.lazyload-container.loaded .skeleton,
.lazyload-container.loaded > .skeleton-shimmer {
    display: none;
}

/* ==========================================================================
   5. Gradients & Backgrounds
   ========================================================================== */
.gradient-primary,
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.gradient-secondary,
.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
}

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

/* ==========================================================================
   6. Animations & Keyframes
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Animation Utilities */
.animate-fade-in {
    animation: fadeIn 0.6s var(--ease-fluent-out);
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s var(--ease-fluent-out);
}

.animate-slide-down {
    animation: slideDown 0.3s var(--ease-fluent-out);
}

/* Reveal animations - triggered on scroll */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-fluent-out), transform 0.7s var(--ease-fluent-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ==========================================================================
   7. Card & Component Styles
   ========================================================================== */
.card-shadow {
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card-shadow:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* ==========================================================================
   8. Button Styles
   ========================================================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    transition: all var(--transition-normal);
    color: #fff;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    transition: all var(--transition-normal);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(240, 147, 251, 0.25);
    filter: brightness(1.05);
}

.btn-secondary:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

/* ==========================================================================
   9. Navigation & Navbar
   ========================================================================== */
.navbar-blur {
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    background-color: rgba(255, 255, 255, 0.85) !important;
    transition: background-color var(--transition-normal), backdrop-filter var(--transition-normal);
}

.dark .navbar-blur {
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    background-color: rgba(17, 24, 39, 0.85) !important;
}

/* ==========================================================================
   10. Mega Menu System
   ========================================================================== */
.mega-menu {
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.mega-menu.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mega-menu-trigger {
    position: relative;
    margin-bottom: -1px;
}

.mega-menu-content {
    position: relative;
    z-index: var(--z-dropdown);
    margin-top: -1px;
    pointer-events: auto;
}

.mega-menu-content [x-show] {
    transition: all var(--transition-normal) ease-in-out;
}

/* ==========================================================================
   11. Slider & Carousel Components
   ========================================================================== */
.slider-container {
    position: relative;
    overflow: hidden;
}

.slider-track {
    transition: transform var(--transition-slow);
}

/* ==========================================================================
   12. Rating & Interactive Elements
   ========================================================================== */
.star-rating {
    color: var(--color-warning);
}

/* ==========================================================================
   13. Accessibility & Focus Management
   ========================================================================== */
.focus-visible:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   14. Custom Scrollbar
   ========================================================================== */
/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 8px;   /* vertical thickness */
  height: 8px;  /* horizontal thickness */
}

/* Orientation-specific to be explicit */
::-webkit-scrollbar:vertical { width: 8px; }
::-webkit-scrollbar:horizontal { height: 8px; }

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

::-webkit-scrollbar-thumb:active {
  background: var(--color-gray-500);
}

/* Corner where both bars meet (useful on desktops) */
::-webkit-scrollbar-corner {
  background: var(--color-gray-100);
}

/* ==========================================================================
   15. Responsive Typography Utilities
   ========================================================================== */
.text-responsive {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.text-responsive-lg {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.text-responsive-xl {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

/* ==========================================================================
   16. Layout & Spacing Utilities
   ========================================================================== */
.section-padding {
    padding-top: var(--spacing-3xl);
    padding-bottom: var(--spacing-3xl);
}

@media (min-width: 768px) {
    .section-padding {
        padding-top: var(--spacing-4xl);
        padding-bottom: var(--spacing-4xl);
    }
}

/* ==========================================================================
   17. Print Styles
   ========================================================================== */
@media print {
    .no-print {
        display: none !important;
    }
}

/* ==========================================================================
   18. Main Swiper
   ========================================================================== */

/* Main Swiper Container */
.main-swiper {
    padding-bottom: 50px; /* Space for pagination */
    padding-left: 0;
    padding-right: 0;
}

/* Swiper Navigation */
.main-swiper .swiper-slide {
    display: flex;
    height: auto;
}

.main-swiper .swiper-button-next,
.main-swiper .swiper-button-prev {
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    color: var(--color-gray-800);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    margin-top: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Dark mode support */
.dark .main-swiper .swiper-button-next,
.dark .main-swiper .swiper-button-prev {
    background-color: rgba(31, 41, 55, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.main-swiper .swiper-button-prev {
    left: 16px;
}

.main-swiper .swiper-button-next {
    right: 16px;
}

/* Hide arrows on mobile to prevent overlap/clutter */
@media (max-width: 767px) {
    .main-swiper .swiper-button-next,
    .main-swiper .swiper-button-prev {
        display: none;
    }
}

.main-swiper .swiper-button-next:hover,
.main-swiper .swiper-button-prev:hover {
    background-color: var(--color-primary);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    border-color: transparent;
}

.main-swiper .swiper-button-next::after,
.main-swiper .swiper-button-prev::after {
    font-size: 18px;
    font-weight: bold;
}

/* Swiper Pagination */
.main-swiper .swiper-pagination {
    bottom: 0 !important;
}

.main-swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: var(--color-gray-300);
    opacity: 1;
    transition: all 0.3s ease;
    border-radius: 10px;
}

.dark .main-swiper .swiper-pagination-bullet {
    background: var(--color-gray-600);
}

.main-swiper .swiper-pagination-bullet-active {
    width: 32px;
    background: var(--color-primary-dark);
    box-shadow: 0 2px 4px rgba(118, 75, 162, 0.4);
}

/* ==========================================================================
   19. Hero Slider System
   ========================================================================== */
.hero-swiper {
    position: relative;
    overflow: hidden;
}

.hero-swiper .swiper-slide {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.hero-swiper .swiper-slide-active {
    opacity: 1;
}

.hero-swiper .swiper-slide-prev,
.hero-swiper .swiper-slide-next {
    opacity: 0.3;
}

/* Swiper Navigation */
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.hero-swiper .swiper-button-next:hover,
.hero-swiper .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.hero-swiper .swiper-button-next::after,
.hero-swiper .swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
}

/* Swiper Pagination */
.hero-swiper .swiper-pagination {
    bottom: 30px;
}

.hero-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all var(--transition-normal);
}

.hero-swiper .swiper-pagination-bullet-active {
    background: var(--color-white);
    transform: scale(1.2);
}

/* Progress Bar */
.hero-swiper .swiper-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.hero-swiper .swiper-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    width: 0%;
    transition: width 5s linear;
}

/* Floating Action Buttons */
.hero-swiper .swiper-pause,
.hero-swiper .swiper-play {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
}

.hero-swiper .swiper-pause:hover,
.hero-swiper .swiper-play:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Enhanced Slide Content Animations */
.hero-swiper .swiper-slide-active .animate-fade-in-up {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-swiper .swiper-slide-active .animate-fade-in-up:nth-child(2) {
    animation-delay: 0.5s;
}

.hero-swiper .swiper-slide-active .animate-fade-in-up:nth-child(3) {
    animation-delay: 0.7s;
}

/* ==========================================================================
   20. Responsive Design & Media Queries
   ========================================================================== */
@media (max-width: 768px) {
    .hero-swiper .swiper-button-next,
    .hero-swiper .swiper-button-prev {
        width: 40px;
        height: 40px;
    }

    .hero-swiper .swiper-button-next::after,
    .hero-swiper .swiper-button-prev::after {
        font-size: 16px;
    }

    .hero-swiper .swiper-pagination {
        bottom: 20px;
    }

    .hero-swiper .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.5;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 1.25rem;
        line-height: 1.6;
    }
}

@media (min-width: 1025px) {
    .hero-title {
        font-size: 3rem;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 1.375rem;
        line-height: 1.6;
    }
}

/* ==========================================================================
   21. Performance & Accessibility Optimizations
   ========================================================================== */
.font-display {
    font-display: swap;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        font-weight: 500;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        font-weight: 700;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
    NXCN Logo Animation (Imported from NXCN Project)
    ========================================================================== */
.nxcn-logo-button {
    margin: 0;
    height: auto;
    background: transparent;
    padding: 0;
    border: none;
    cursor: pointer;
    --border-right: var(--logo-border-right);
    --text-stroke-color: var(--logo-text-stroke);
    --animation-color: var(--logo-animation-color);
    --fs-size: var(--logo-font-size);
    letter-spacing: 2px;
    text-decoration: none;
    font-family: "Alibaba PuHui Ti 3.0", "PingFang SC", "Microsoft YaHei", sans-serif;
    position: relative;
    text-transform: uppercase;
    color: #041233;
    -webkit-text-stroke: 1px var(--text-stroke-color);
    /* 修复：部分浏览器因 <button> 嵌套在 <a> 内而拦截 pointer-events */
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
}

.nxcn-logo-button .actual-text,
.nxcn-logo-button .hover-text {
    position: relative;
    display: inline-block;
    font-size: var(--fs-size);
    font-weight: 700;
}

.nxcn-logo-button .hover-text {
    position: absolute;
    box-sizing: border-box;
    content: attr(data-text);
    color: var(--animation-color);
    width: 0%;
    inset: 0;
    border-right: var(--border-right) solid var(--animation-color);
    overflow: hidden;
    transition: 0.5s;
    -webkit-text-stroke: 1px var(--animation-color);
}

.nxcn-logo-button:hover .hover-text {
    width: 100%;
    filter: drop-shadow(0 0 23px var(--animation-color));
}

/* 暗色模式 - 导航栏 Logo 文字可见性修复 */
.dark .nxcn-logo-button {
    color: #ffffff;
    -webkit-text-stroke: 1px rgba(255,255,255,0.62);
}
.dark .nxcn-logo-button .actual-text {
    color: #ffffff;
    -webkit-text-stroke: 1px rgba(255,255,255,0.62);
    text-shadow: 0 0 16px rgba(255,255,255,0.18);
}

/* 页脚 Logo：与导航栏动效一致，颜色跟随浅色/深色主题 */
footer .nxcn-logo-button,
footer .footer-logo-button {
    color: #041233;
    -webkit-text-stroke: 1px rgba(4,18,51,0.42);
    text-shadow: none;
}

footer .footer-logo-button .actual-text {
    color: #041233;
}

.dark footer .nxcn-logo-button,
.dark footer .footer-logo-button {
    color: white;
    -webkit-text-stroke: 1px rgba(255,255,255,0.6);
    text-shadow: 0 0 16px rgba(255,255,255,0.18);
}

.dark footer .footer-logo-button .actual-text {
    color: white;
}

footer .footer-logo-button .hover-text {
    color: var(--logo-animation-color);
    -webkit-text-stroke: 1px var(--logo-animation-color);
}

/* ====== Preloader Logo Progress ====== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    background: #020617;
    opacity: 1;
    visibility: visible;
    transition: opacity .35s ease, visibility .35s ease;
}
.preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.preloader.hidden {
    display: none;
}
.logo-progress-loader {
    display: grid;
    place-items: center;
}
.preloader .nxcn-logo-button {
    --logo-font-size: 20.7px;
    cursor: default;
    pointer-events: none;
}

.preloader .nxcn-logo-button,
.preloader .nxcn-logo-button .actual-text {
    color: white;
    -webkit-text-stroke: 1px rgba(255,255,255,.62);
    text-shadow: 0 0 16px rgba(255,255,255,.2);
}

.preloader .nxcn-logo-button .hover-text {
    transition: none;
    -webkit-text-stroke: 1px var(--animation-color);
    animation: logo-progress-sweep 3s cubic-bezier(.25, .1, .25, 1) infinite;
    filter: drop-shadow(0 0 18px var(--animation-color));
}

@media (max-width: 1279px) {
    .preloader .nxcn-logo-button {
        --logo-font-size: 16.1px;
    }
}
@keyframes logo-progress-sweep {
    0% { width: 0%; }
    80% { width: 100%; }
    100% { width: 100%; }
}

/* 导航栏主题切换按钮缩小约 15% */
.theme-toggle {
    padding: 0.425rem !important;
}

.theme-toggle svg {
    width: 1.0625rem !important;
    height: 1.0625rem !important;
}

/* 网站背景氛围动画：底色上一层、内容下一层，不改变原背景色和主题切换 */
body {
    position: relative;
    isolation: isolate;
}



/* 主页 Live2D 人物脚下影子隐藏 */
.live2d-character-shadow {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}

/* Logo 响应式字体大小 */
.nxcn-logo-button {
    --logo-font-size: 18px;
    font-size: var(--logo-font-size);
}

@media (max-width: 1279px) {
    .nxcn-logo-button {
        --logo-font-size: 16px;
    }
    
    header .nxcn-logo-button {
        --logo-font-size: 14px;
    }
}

@media (max-width: 767px) {
    .nxcn-logo-button {
        --logo-font-size: 16px;
    }
    
    footer .nxcn-logo-button {
        --logo-font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nxcn-logo-button {
        --logo-font-size: 14px;
    }
    font-size: 14px;
    
    footer .nxcn-logo-button {
        --logo-font-size: 12px;
        font-size: 12px;
    }
}

/* 主页导航栏加长并靠右 */
@media (min-width: 1024px) {
    .navbar-menu {
        margin-left: auto;
        padding-right: 2rem;
    }
    [data-x-show="mobileMenuOpen"] {
        display: none !important;
    }
}

/* ==========================================================================
   21. 响应式布局补丁（app.css 中缺失的类）
   ========================================================================== */

/* --- Grid 响应式列 --- */
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
}

/* --- 暗色模式 --- */
.dark .dark\:bg-gray-800 { --tw-bg-opacity: 1; background-color: rgb(31 41 55 / var(--tw-bg-opacity)); }
.dark .dark\:bg-gray-900\/95 { background-color: rgba(17, 24, 39, 0.95); }
.dark .dark\:divide-gray-700 { --tw-divide-opacity: 1; border-color: rgb(55 65 81 / var(--tw-divide-opacity)); }
.dark .dark\:divide-gray-700 > :not([hidden]) ~ :not([hidden]) { --tw-divide-opacity: 1; border-color: rgb(55 65 81 / var(--tw-divide-opacity)); }
.dark .dark\:from-blue-900\/20 { --tw-gradient-from: rgba(30, 58, 138, 0.2) var(--tw-gradient-from-position); }
.dark .dark\:to-indigo-900\/20 { --tw-gradient-to: rgba(49, 46, 129, 0.2) var(--tw-gradient-to-position); }
.dark .dark\:to-gray-900\/95 { --tw-gradient-to: rgba(17, 24, 39, 0.95) var(--tw-gradient-to-position); }
.dark .dark\:hover\:bg-blue-800\/50:hover { background-color: rgba(30, 64, 175, 0.5); }
.dark .dark\:hover\:bg-gray-700:hover { --tw-bg-opacity: 1; background-color: rgb(55 65 81 / var(--tw-bg-opacity)); }

/* --- 背景不透明度 --- */
.bg-white\/90 { background-color: rgba(255, 255, 255, 0.9); }
.backdrop-blur-md { --tw-backdrop-blur: blur(12px); backdrop-filter: var(--tw-backdrop-blur); }

/* --- 间距 --- */
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }

/* --- 文字 --- */
.text-md { font-size: 1rem; line-height: 1.5rem; }

/* --- 任意值 --- */
.max-h-\[400px\] { max-height: 400px; }
.max-h-\[calc\(100vh-10rem\)\] { max-height: calc(100vh - 10rem); }
.z-\[60\] { z-index: 60; }
.z-\[9999\] { z-index: 9999; }
.z-\[99999\] { z-index: 99999; }
.bg-\[var\(--color-primary-dark\)\] { background-color: var(--color-primary-dark); }
.focus\:ring-\[var\(--color-primary-dark\)\]:focus { --tw-ring-color: var(--color-primary-dark); }
.hover\:text-\[var\(--color-primary\)\]:hover { color: var(--color-primary); }

/* ============================================================

/* ============================================================
   GLOBAL THEME UNIFY - ALL PAGES
   深色：深蓝统一  |  浅色：白色统一
   ============================================================ */

/* --- 深色模式 --- */
html.dark body,
body.dark {
    background-color: #0f0f12 !important;
    color: #e2e8f0 !important;
}

/* 页面主要区块背景 */
html.dark main,
html.dark > body > section,
html.dark > body > div > section,
html.dark .page-section,
html.dark .content-section,
html.dark .section,
body.dark main,
body.dark > body > section,
body.dark > body > div > section,
body.dark .page-section,
body.dark .content-section,
body.dark .section {
    background-color: #0f0f12 !important;
}

/* 底部导航 */
html.dark footer,
body.dark footer {
    background-color: #0f0f12 !important;
    border-top: 1px solid rgba(92, 225, 230, 0.1) !important;
}

/* 卡片、白色背景容器 */
html.dark .bg-white,
html.dark .bg-gray-50,
html.dark .bg-gray-100,
html.dark .bg-gray-200,
html.dark .dark\:bg-gray-800,
html.dark .dark\:bg-gray-900,
html.dark .dark\:bg-gray-950,
html.dark .card,
html.dark [class*="card-"],
html.dark .panel,
body.dark .bg-white,
body.dark .bg-gray-50,
body.dark .bg-gray-100,
body.dark .bg-gray-200,
body.dark .dark\:bg-gray-800,
body.dark .dark\:bg-gray-900,
body.dark .dark\:bg-gray-950,
body.dark .card,
body.dark [class*="card-"],
body.dark .panel {
    background-color: #18181d !important;
}

/* 边框 */
html.dark .border,
html.dark .border-2,
html.dark .border-t,
html.dark .border-b,
html.dark .border-l,
html.dark .border-r,
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300,
html.dark .border-gray-600,
html.dark .border-gray-700,
html.dark .border-gray-800,
html.dark .divide-x > *,
html.dark .divide-y > *,
body.dark .border,
body.dark .border-2,
body.dark .border-t,
body.dark .border-b,
body.dark .border-l,
body.dark .border-r,
body.dark .border-gray-100,
body.dark .border-gray-200,
body.dark .border-gray-300,
body.dark .border-gray-600,
body.dark .border-gray-700,
body.dark .border-gray-800,
body.dark .divide-x > *,
body.dark .divide-y > * {
    border-color: rgba(92, 225, 230, 0.1) !important;
}

/* 文字颜色 */
html.dark .text-gray-900,
html.dark .text-gray-800,
html.dark .text-gray-700,
body.dark .text-gray-900,
body.dark .text-gray-800,
body.dark .text-gray-700 {
    color: #f1f5f9 !important;
}

html.dark .text-gray-600,
html.dark .text-gray-500,
body.dark .text-gray-600,
body.dark .text-gray-500 {
    color: #94a3b8 !important;
}

html.dark .text-gray-400,
html.dark .text-gray-300,
body.dark .text-gray-400,
body.dark .text-gray-300 {
    color: #cbd5e1 !important;
}

/* 输入框 */
html.dark input,
html.dark textarea,
html.dark select,
body.dark input,
body.dark textarea,
body.dark select {
    background-color: #18181d !important;
    border-color: rgba(92, 225, 230, 0.15) !important;
    color: #e2e8f0 !important;
}

/* --- 浅色模式 --- */
html:not(.dark) body,
body:not(.dark) {
    background-color: #ffffff !important;
    color: #0c4a6e !important;
}

/* 页面主要区块背景 */
html:not(.dark) main,
html:not(.dark) > body > section,
html:not(.dark) > body > div > section,
html:not(.dark) .page-section,
html:not(.dark) .content-section,
html:not(.dark) .section,
body:not(.dark) main,
body:not(.dark) > body > section,
body:not(.dark) > body > div > section,
body:not(.dark) .page-section,
body:not(.dark) .content-section,
body:not(.dark) .section {
    background-color: #ffffff !important;
}

/* 底部导航 */
html:not(.dark) footer,
body:not(.dark) footer {
    background-color: #ffffff !important;
    border-top: 1px solid rgba(14, 165, 233, 0.12) !important;
}

/* 卡片、白色背景容器 */
html:not(.dark) .bg-white,
html:not(.dark) .bg-gray-50,
html:not(.dark) .bg-gray-100,
html:not(.dark) .bg-gray-200,
html:not(.dark) .card,
html:not(.dark) [class*="card-"],
html:not(.dark) .panel,
body:not(.dark) .bg-white,
body:not(.dark) .bg-gray-50,
body:not(.dark) .bg-gray-100,
body:not(.dark) .bg-gray-200,
body:not(.dark) .card,
body:not(.dark) [class*="card-"],
body:not(.dark) .panel {
    background-color: #ffffff !important;
}

/* 边框 */
html:not(.dark) .border,
html:not(.dark) .border-2,
html:not(.dark) .border-t,
html:not(.dark) .border-b,
html:not(.dark) .border-l,
html:not(.dark) .border-r,
html:not(.dark) .border-gray-100,
html:not(.dark) .border-gray-200,
html:not(.dark) .border-gray-300,
html:not(.dark) .divide-x > *,
html:not(.dark) .divide-y > *,
body:not(.dark) .border,
body:not(.dark) .border-2,
body:not(.dark) .border-t,
body:not(.dark) .border-b,
body:not(.dark) .border-l,
body:not(.dark) .border-r,
body:not(.dark) .border-gray-100,
body:not(.dark) .border-gray-200,
body:not(.dark) .border-gray-300,
body:not(.dark) .divide-x > *,
body:not(.dark) .divide-y > * {
    border-color: rgba(14, 165, 233, 0.12) !important;
}

/* 文字颜色 */
html:not(.dark) .text-gray-900,
html:not(.dark) .text-gray-800,
html:not(.dark) .text-gray-700,
body:not(.dark) .text-gray-900,
body:not(.dark) .text-gray-800,
body:not(.dark) .text-gray-700 {
    color: #0c4a6e !important;
}

html:not(.dark) .text-gray-600,
html:not(.dark) .text-gray-500,
body:not(.dark) .text-gray-600,
body:not(.dark) .text-gray-500 {
    color: rgba(12, 74, 110, 0.7) !important;
}

html:not(.dark) .text-gray-400,
html:not(.dark) .text-gray-300,
body:not(.dark) .text-gray-400,
body:not(.dark) .text-gray-300 {
    color: rgba(12, 74, 110, 0.5) !important;
}

/* --- 导航栏滚动收起 --- */
header.nav-hidden {
    transform: translateY(-100%) !important;
}

header {
    transition: transform 0.3s ease, background-color 0.3s ease, backdrop-filter 0.3s ease !important;
    will-change: transform;
}

/* --- 导航栏深色模式背景 --- */
html.dark header.navbar-blur,
body.dark header.navbar-blur {
    background-color: rgba(10, 22, 40, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* --- 导航栏浅色模式背景 --- */
html:not(.dark) header.navbar-blur,
body:not(.dark) header.navbar-blur {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* --- 移动端菜单按钮确保可见 --- */
.mobile-menu-toggle {
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

html:not(.dark) .mobile-menu-toggle,
body:not(.dark) .mobile-menu-toggle {
    color: #0c4a6e !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(14, 165, 233, 0.2) !important;
}

header.navbar-blur .mobile-menu-toggle {
    color: #e2e8f0 !important;
    background: rgba(30, 30, 35, 0.6) !important;
    border: 1px solid rgba(92, 225, 230, 0.2) !important;
}

html:not(.dark) header.navbar-blur .mobile-menu-toggle,
body:not(.dark) header.navbar-blur .mobile-menu-toggle {
    color: #0c4a6e !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(14, 165, 233, 0.2) !important;
}

@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

