/* 青智网络 - 所有页面共享样式 */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    color: #374151;
    line-height: 1.7;
    background: white;
}

* { scroll-behavior: smooth; }

/* ========== Navigation ========== */
.nav-link {
    color: #475569;
    transition: all 0.15s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: #2563eb;
    background-color: #eff6ff;
}

.nav-link.active {
    color: #2563eb;
    background-color: #eff6ff;
}

.nav-link.active:hover {
    color: #2563eb;
    background-color: #dbeafe;
}

.nav-logo {
    color: #1e293b;
    transition: color 0.15s ease;
}

.nav-scrolled {
    background: #2563eb !important;
}

.nav-scrolled .nav-logo {
    color: white !important;
}

.nav-scrolled .nav-link {
    color: rgba(255,255,255,0.9) !important;
    background-color: transparent !important;
}

.nav-scrolled .nav-link:hover {
    color: white !important;
    background-color: rgba(255,255,255,0.15) !important;
}

.nav-scrolled .nav-link.active {
    color: white !important;
    background-color: rgba(255,255,255,0.25) !important;
    border-radius: 0.5rem;
}

.nav-scrolled #mobileMenuBtn {
    color: white !important;
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.nav-dropdown-panel {
    transform: translateY(-8px);
    transition: transform 0.25s ease;
    border-left: 1px solid rgba(229, 231, 235, 0.8);
    border-right: 1px solid rgba(229, 231, 235, 0.8);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.nav-dropdown-blue {
    border-top: 3px solid #3b82f6;
}

.nav-dropdown-blue .nav-dropdown-item:hover {
    background-color: #eff6ff;
    color: #2563eb;
}

.nav-dropdown-purple {
    border-top: 3px solid #9333ea;
}

.nav-dropdown-purple .nav-dropdown-item:hover {
    background-color: #faf5ff;
    color: #9333ea;
}

.nav-dropdown-orange {
    border-top: 3px solid #f97316;
}

.nav-dropdown-orange .nav-dropdown-item:hover {
    background-color: #fff7ed;
    color: #ea580c;
}

.nav-dropdown-green {
    border-top: 3px solid #22c55e;
}

.nav-dropdown-green .nav-dropdown-item:hover {
    background-color: #f0fdf4;
    color: #22c55e;
}

.group:hover .nav-dropdown,
.group:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.group:hover .nav-dropdown-panel,
.group:focus-within .nav-dropdown-panel {
    transform: translateY(0);
}

.nav-dropdown-item {
    position: relative;
    transition: color 0.15s;
    text-decoration: none;
}

.nav-dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-dropdown-blue .nav-dropdown-item::before {
    background: #3b82f6;
}

.nav-dropdown-purple .nav-dropdown-item::before {
    background: #9333ea;
}

.nav-dropdown-orange .nav-dropdown-item::before {
    background: #f97316;
}

.nav-dropdown-green .nav-dropdown-item::before {
    background: #22c55e;
}

.nav-dropdown-item:hover::before {
    transform: scaleX(1);
}

.nav-dropdown-item:hover {
    color: inherit;
}

.nav-scrolled .nav-dropdown-panel {
    border-left-color: rgba(255,255,255,0.2) !important;
    border-right-color: rgba(255,255,255,0.2) !important;
    border-bottom-color: rgba(255,255,255,0.2) !important;
    background: white !important;
}

.nav-scrolled .nav-dropdown-blue {
    border-top-color: #3b82f6 !important;
}

.nav-scrolled .nav-dropdown-purple {
    border-top-color: #9333ea !important;
}

.nav-scrolled .nav-dropdown-orange {
    border-top-color: #f97316 !important;
}

.nav-scrolled .nav-dropdown-green {
    border-top-color: #22c55e !important;
}

.nav-scrolled .nav-dropdown-item {
    color: #374151;
}

.nav-scrolled .nav-dropdown-blue .nav-dropdown-item:hover {
    background-color: #eff6ff;
    color: #2563eb;
}

.nav-scrolled .nav-dropdown-purple .nav-dropdown-item:hover {
    background-color: #faf5ff;
    color: #9333ea;
}

.nav-scrolled .nav-dropdown-orange .nav-dropdown-item:hover {
    background-color: #fff7ed;
    color: #ea580c;
}

.nav-scrolled .nav-dropdown-green .nav-dropdown-item:hover {
    background-color: #f0fdf4;
    color: #22c55e;
}

/* ========== Keyframes & Animations ========== */
@keyframes grid-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(40px); }
}

@keyframes grid-scroll-v {
    0% { transform: translateY(0); }
    100% { transform: translateY(40px); }
}

@keyframes breathe-line {
    0%, 100% { opacity: 0.3; transform: scaleX(0.8); }
    50% { opacity: 0.8; transform: scaleX(1); }
}

@keyframes move-dot {
    0%, 100% { left: 5%; opacity: 0; }
    50% { left: 95%; opacity: 1; }
}

@keyframes move-dot-reverse {
    0%, 100% { right: 5%; opacity: 0; }
    50% { right: 95%; opacity: 1; }
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.1); }
    50% { transform: translate(-10px, 10px) scale(0.9); }
    75% { transform: translate(15px, 15px) scale(1.05); }
}

@keyframes beam-rise {
    0% { transform: translateY(100%); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-400px); opacity: 0; }
}

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

@keyframes node-expand {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(2); opacity: 0; }
}

@keyframes rise {
    0% { transform: translateY(0) scaleY(0.5); opacity: 0; }
    10% { opacity: 0.7; }
    80% { opacity: 0.3; }
    100% { transform: translateY(-400px) scaleY(1); opacity: 0; }
}

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

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

@keyframes float-slow {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes float-medium {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes float-fast {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

/* ========== Common Animation Classes ========== */
.grid-line-h {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: grid-scroll 12s linear infinite;
}

.grid-line-v {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: grid-scroll-v 15s linear infinite;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    animation: float-orb 8s ease-in-out infinite;
    will-change: transform, opacity;
}

.net-node {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    animation: node-pulse 4s ease-in-out infinite;
    will-change: transform, opacity;
}

.net-node::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    animation: node-expand 4s ease-out infinite;
}

.rise-particle {
    position: absolute;
    bottom: 0;
    width: 2px;
    height: 15px;
    border-radius: 2px;
    animation: rise 6s linear infinite;
    will-change: transform, opacity;
}

.data-beam {
    position: absolute;
    width: 3px;
    height: 60px;
    background: linear-gradient(to top, transparent, rgba(147, 197, 253, 0.8), transparent);
    animation: beam-rise 3s linear infinite;
    opacity: 0;
    will-change: transform, opacity;
}

.connection-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
    animation: breathe-line 4s ease-in-out infinite;
    will-change: transform, opacity;
}

.connection-line::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(99, 102, 241, 0.6);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    animation: move-dot 4s ease-in-out infinite;
}

.connection-line::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(99, 102, 241, 0.6);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    animation: move-dot-reverse 4s ease-in-out infinite;
}

.hero-bg-blue .data-beam {
    background: linear-gradient(to top, transparent, rgba(125, 211, 252, 0.75), transparent);
}

.hero-bg-blue .connection-line {
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.42), transparent);
}

.hero-bg-blue .connection-line::before,
.hero-bg-blue .connection-line::after {
    background: rgba(125, 211, 252, 0.68);
}

.hero-bg-purple .data-beam {
    background: linear-gradient(to top, transparent, rgba(232, 121, 249, 0.72), transparent);
}

.hero-bg-purple .connection-line {
    background: linear-gradient(90deg, transparent, rgba(216, 180, 254, 0.42), transparent);
}

.hero-bg-purple .connection-line::before,
.hero-bg-purple .connection-line::after {
    background: rgba(244, 114, 182, 0.66);
}

.hero-bg-green .data-beam {
    background: linear-gradient(to top, transparent, rgba(45, 212, 191, 0.72), transparent);
}

.hero-bg-green .connection-line {
    background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.42), transparent);
}

.hero-bg-green .connection-line::before,
.hero-bg-green .connection-line::after {
    background: rgba(34, 197, 94, 0.68);
}

.hero-bg-orange .data-beam {
    background: linear-gradient(to top, transparent, rgba(251, 191, 36, 0.72), transparent);
}

.hero-bg-orange .connection-line {
    background: linear-gradient(90deg, transparent, rgba(251, 146, 60, 0.42), transparent);
}

.hero-bg-orange .connection-line::before,
.hero-bg-orange .connection-line::after {
    background: rgba(253, 186, 116, 0.68);
}

.hero-bg-teal .data-beam {
    background: linear-gradient(to top, transparent, rgba(94, 234, 212, 0.72), transparent);
}

.hero-bg-teal .connection-line {
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.42), transparent);
}

.hero-bg-teal .connection-line::before,
.hero-bg-teal .connection-line::after {
    background: rgba(20, 184, 166, 0.68);
}

.grid-line-h,
.grid-line-v,
.glow-orb,
.net-node,
.rise-particle,
.data-beam,
.connection-line,
.hero-orb {
    pointer-events: none;
}

.counter {
    transition: all 0.3s ease;
}

.counter.in-view {
    animation: count-up 2s ease-out forwards;
}

/* ========== Swiper Styles ========== */
.swiper {
    width: 100%;
    height: 520px;
}

.swiper-slide {
    display: flex;
}

.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #CBD5E1;
    opacity: 1;
    border-radius: 4px;
}

.swiper-pagination-bullet-active {
    background: #3B82F6;
    width: 24px;
}

.swiper-button-next,
.swiper-button-prev {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.swiper:hover .swiper-button-next,
.swiper:hover .swiper-button-prev,
.swiper:focus-within .swiper-button-next,
.swiper:focus-within .swiper-button-prev {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.swiper-button-prev {
    left: 24px;
}

.swiper-button-next {
    right: 24px;
}

.swiper-slide:not(.swiper-slide-active) .net-node,
.swiper-slide:not(.swiper-slide-active) .connection-line,
.swiper-slide:not(.swiper-slide-active) .rise-particle,
.swiper-slide:not(.swiper-slide-active) .float-medium,
.swiper-slide:not(.swiper-slide-active) .hero-gradient::after {
    animation-play-state: paused;
}

/* ========== Hero Styles ========== */
.hero-gradient {
    position: relative;
    overflow: hidden;
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

.home-hero-slide .net-node,
.home-hero-slide .connection-line,
.home-hero-slide .rise-particle {
    pointer-events: none;
}

.home-hero-kicker,
.home-hero-title,
.home-hero-text,
.home-hero-actions,
.home-hero-visual {
    will-change: transform, opacity;
}

.swiper-slide .home-hero-kicker,
.swiper-slide .home-hero-title,
.swiper-slide .home-hero-text,
.swiper-slide .home-hero-actions,
.swiper-slide .home-hero-visual {
    opacity: 0;
    transform: translateY(16px);
}

.swiper-slide-active .home-hero-kicker,
.swiper-slide-active .home-hero-title,
.swiper-slide-active .home-hero-text,
.swiper-slide-active .home-hero-actions,
.swiper-slide-active .home-hero-visual {
    animation: home-hero-fade-up 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.swiper-slide-active .home-hero-title {
    animation-delay: 0.08s;
}

.swiper-slide-active .home-hero-text {
    animation-delay: 0.16s;
}

.swiper-slide-active .home-hero-actions {
    animation-delay: 0.24s;
}

.swiper-slide-active .home-hero-visual {
    animation-delay: 0.14s;
}

.home-hero-visual .float-medium {
    animation: home-hero-float 5.5s ease-in-out infinite;
}

.home-hero-cta svg {
    transition: transform 0.22s ease;
}

.home-hero-cta:hover svg,
.home-hero-cta:focus-visible svg {
    transform: translateX(4px);
}

@keyframes home-hero-fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes home-hero-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(2deg); }
}

.float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

.float-medium {
    animation: float-medium 4s ease-in-out infinite;
}

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

/* ========== Card & Component Styles ========== */
.card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, currentColor 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

.group:hover.card-glow::before {
    opacity: 1;
}

.cta-glow {
    position: relative;
    overflow: hidden;
}

.cta-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.cta-glow:hover::before {
    opacity: 1;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* ========== Page Hero Background (for subpages) ========== */
.hero-bg {
    background: linear-gradient(135deg, #1e40af 0%, #4f46e5 50%, #7c3aed 100%);
    position: relative;
    overflow: hidden;
}

.hero-bg-blue {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #4f46e5 100%);
}

.hero-bg-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%);
}

.hero-bg-green {
    background: linear-gradient(135deg, #166534 0%, #22c55e 50%, #15803d 100%);
}

.hero-bg-orange {
    background: linear-gradient(135deg, #c2410c 0%, #f97316 50%, #ea580c 100%);
}

.hero-bg-teal {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 50%, #0d9488 100%);
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-bg > .max-w-7xl > [class*="md:grid-cols-5"] > [class*="md:col-span-3"] {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 5.75rem !important;
    padding-bottom: 3rem !important;
}

.hero-bg > .max-w-7xl > [class*="py-12"]:not([class*="md:grid-cols-5"]) {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 5.75rem !important;
    padding-bottom: 3rem !important;
}

.hero-bg > .max-w-7xl > [class*="min-h-[420px]"] {
    align-items: flex-start !important;
    padding-top: 5.25rem;
    padding-bottom: 3rem;
}

.hero-bg span[class*="bg-white/20"][class*="backdrop-blur-sm"] {
    align-self: flex-start;
    width: auto;
    max-width: max-content;
    margin-bottom: 1.5rem !important;
}

.hero-bg h1 + p {
    margin-top: 0;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
}

.subpage-hero-visual {
    width: min(100%, 22rem);
}

.subpage-hero-card {
    width: 100%;
    min-height: 22rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subpage-hero-card .subpage-hero-image {
    width: min(100%, 20rem);
    height: auto;
    max-height: 20rem;
    flex: 0 0 auto;
    pointer-events: none;
    will-change: transform;
}

@media (max-width: 768px) {
    .home-hero-swiper,
    .home-hero-slide {
        height: auto;
        min-height: 460px;
    }

    .home-hero-inner {
        min-height: 460px;
        height: auto !important;
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .home-hero-copy {
        width: 100% !important;
        padding-right: 0 !important;
    }

    .home-hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .home-hero-text {
        max-width: none;
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .home-hero-actions {
        flex-wrap: wrap;
    }

    .home-hero-visual {
        display: none !important;
    }

    .home-hero-slide .net-node,
    .home-hero-slide .connection-line {
        opacity: 0.55;
    }

    .home-hero-slide .rise-particle {
        height: 10px;
        opacity: 0.5;
        animation-duration: 8s;
    }

    .connection-line::after {
        display: none;
    }

    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }

    .subpage-hero-visual {
        width: min(100%, 18rem);
    }

    .subpage-hero-card {
        min-height: 18rem;
        padding: 1.25rem;
    }

    .subpage-hero-card .subpage-hero-image {
        width: min(100%, 16rem);
        max-height: 16rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-gradient,
    .grid-line-h,
    .grid-line-v,
    .glow-orb,
    .net-node,
    .net-node::after,
    .rise-particle,
    .data-beam,
    .connection-line,
    .connection-line::before,
    .connection-line::after,
    .float-slow,
    .float-medium,
    .float-fast,
    .home-hero-kicker,
    .home-hero-title,
    .home-hero-text,
    .home-hero-actions,
    .home-hero-visual {
        animation: none !important;
        transition: none !important;
    }

    .home-hero-kicker,
    .home-hero-title,
    .home-hero-text,
    .home-hero-actions,
    .home-hero-visual {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ========== Additional Utility Classes ========== */
.case-card {
    transition: all 0.3s ease;
}

.case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.3);
}

.case-card:hover .case-image {
    transform: scale(1.05);
}

.case-image {
    transition: transform 0.3s ease;
}

.contact-card {
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.2);
}

.value-card {
    transition: all 0.3s ease;
}

.value-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.2);
}

.value-card:hover .value-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.3);
}

.value-icon {
    transition: all 0.3s ease;
}

.team-card {
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.25);
}

.feature-card {
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.15);
}

.result-card {
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-primary {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.1), 0 4px 12px rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15), 0 12px 24px rgba(37, 99, 235, 0.2);
}

/* Timeline */
.history-panel {
    position: relative;
}

.history-range-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1.25rem;
    align-items: center;
    max-width: 58rem;
    margin: 0 auto 2.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.25rem;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(248, 250, 252, 0.95));
    box-shadow: 0 20px 50px -36px rgba(15, 23, 42, 0.35);
}

.history-range-card span {
    grid-row: span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 8.5rem;
    min-height: 4rem;
    border-radius: 1rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 12px 26px -16px rgba(37, 99, 235, 0.65);
}

.history-range-card strong {
    color: #0f172a;
    font-size: 1.125rem;
}

.history-range-card p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.8;
}

.history-horizontal {
    max-width: 72rem;
    margin: 0 auto;
}

.history-rail-wrap {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1.75rem;
}

.history-nav {
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 999px;
    color: #2563eb;
    background: #fff;
    box-shadow: 0 14px 28px -22px rgba(15, 23, 42, 0.4);
    transition: transform 0.25s ease, color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.history-nav:hover,
.history-nav:focus-visible {
    color: #fff;
    background: #2563eb;
    box-shadow: 0 16px 34px -20px rgba(37, 99, 235, 0.65);
    transform: translateY(-1px);
}

.history-nav:disabled {
    cursor: not-allowed;
    color: #cbd5e1;
    background: #f8fafc;
    box-shadow: none;
    transform: none;
}

.history-year-track {
    position: relative;
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding: 1.05rem 0.15rem 1.15rem;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 99, 235, 0.35) transparent;
}

.history-year-track::-webkit-scrollbar {
    height: 6px;
}

.history-year-track::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.32);
}

.history-year-track::before {
    content: '';
    position: absolute;
    top: 2.08rem;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: linear-gradient(to right, rgba(37, 99, 235, 0.18), rgba(124, 58, 237, 0.45), rgba(16, 185, 129, 0.25));
}

.history-year-tab {
    --history-accent: #2563eb;
    position: relative;
    z-index: 1;
    flex: 0 0 8.4rem;
    min-height: 6.6rem;
    padding: 3.1rem 0.9rem 0.85rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    text-align: left;
    color: #64748b;
    background: rgba(255, 255, 255, 0.96);
    scroll-snap-align: center;
    box-shadow: 0 14px 36px -32px rgba(15, 23, 42, 0.42);
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease, color 0.28s ease, background 0.28s ease;
}

.history-year-tab::before {
    content: '';
    position: absolute;
    top: 0.78rem;
    left: 50%;
    width: 1.35rem;
    height: 1.35rem;
    border: 4px solid #fff;
    border-radius: 999px;
    background: var(--history-accent);
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
    transform: translateX(-50%);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--history-accent) 14%, transparent);
}

.history-year-tab span {
    display: block;
    color: var(--history-accent);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0;
}

.history-year-tab small {
    display: block;
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
}

.history-year-tab:hover,
.history-year-tab:focus-visible,
.history-year-tab.is-active {
    color: #0f172a;
    border-color: rgba(99, 102, 241, 0.35);
    border-color: color-mix(in srgb, var(--history-accent) 42%, #e2e8f0);
    background: #fff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), color-mix(in srgb, var(--history-accent) 8%, #fff));
    box-shadow: 0 22px 48px -28px rgba(15, 23, 42, 0.48);
    transform: translateY(-3px);
}

.history-year-tab.is-active::before {
    box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.14), 0 12px 24px -12px var(--history-accent);
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--history-accent) 18%, transparent), 0 12px 24px -12px var(--history-accent);
}

.history-detail-stage {
    min-height: 16.5rem;
}

.history-detail-card {
    --history-accent: #2563eb;
    display: none;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.4rem;
    align-items: flex-start;
    padding: 1.75rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1.5rem;
    background: #fff;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--history-accent) 7%, #fff));
    box-shadow: 0 22px 58px -40px rgba(15, 23, 42, 0.45);
}

.history-detail-card.is-active {
    display: grid;
    animation: historyFadeUp 0.28s ease both;
}

.history-detail-icon {
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    background: var(--history-accent);
    box-shadow: 0 18px 34px -18px var(--history-accent);
}

.history-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.history-detail-meta span {
    color: var(--history-accent);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0;
}

.history-detail-meta small {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 800;
}

.history-detail-card h3 {
    margin-bottom: 0.75rem;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
}

.history-detail-card p {
    max-width: 46rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.85;
}

.history-card {
    padding: 1.4rem;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 1.15rem;
    background: #fff;
}

.history-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.history-year {
    color: var(--history-accent);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.history-step {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
}

.history-card h3 {
    margin-bottom: 0.65rem;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
}

.history-card p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.75;
}

.history-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.history-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    color: var(--history-accent);
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(37, 99, 235, 0.08);
    background: color-mix(in srgb, var(--history-accent) 10%, #fff);
}

.history-noscript {
    display: grid;
    gap: 1rem;
    max-width: 58rem;
    margin: 1.5rem auto 0;
}

.history-accent-blue { --history-accent: #2563eb; }
.history-accent-indigo { --history-accent: #4f46e5; }
.history-accent-purple { --history-accent: #7c3aed; }
.history-accent-sky { --history-accent: #0284c7; }
.history-accent-amber { --history-accent: #d97706; }
.history-accent-emerald { --history-accent: #059669; }
.history-accent-cyan { --history-accent: #0891b2; }
.history-accent-violet { --history-accent: #8b5cf6; }

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

@media (max-width: 767px) {
    .history-range-card {
        grid-template-columns: 1fr;
        padding: 1.25rem;
        margin-bottom: 2rem;
    }

    .history-range-card span {
        grid-row: auto;
        width: 100%;
        min-height: 3.5rem;
    }

    .history-rail-wrap {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .history-nav {
        display: none;
    }

    .history-year-track {
        margin: 0 -1rem;
        padding-inline: 1rem;
    }

    .history-year-tab {
        flex-basis: 7.4rem;
        min-height: 6.2rem;
        padding: 2.95rem 0.75rem 0.8rem;
    }

    .history-detail-stage {
        min-height: 20rem;
    }

    .history-detail-card.is-active {
        display: block;
    }

    .history-detail-card {
        padding: 1.25rem;
    }

    .history-detail-icon {
        width: 3.5rem;
        height: 3.5rem;
        margin-bottom: 1rem;
        border-radius: 1rem;
    }

    .history-detail-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.15rem;
    }

    .history-detail-card h3 {
        font-size: 1.2rem;
    }
}

/* Form Styles */
input:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Article Detail */
.article-body h2 {
    scroll-margin-top: 6rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
    color: #0f172a;
}

.article-body h3 {
    scroll-margin-top: 6rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body table,
.article-body pre {
    margin-bottom: 1rem;
}

.article-body p {
    color: #334155;
}

.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body strong {
    font-weight: 700;
    color: #0f172a;
}

.article-body a {
    color: #ea580c;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(234, 88, 12, 0.25);
    text-underline-offset: 4px;
}

.article-body a:hover {
    color: #c2410c;
    text-decoration-color: rgba(194, 65, 12, 0.55);
}

.article-body pre {
    overflow-x: auto;
    border-radius: 0.75rem;
    background: #0f172a;
    padding: 1rem;
    color: #e2e8f0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
}

.article-body th,
.article-body td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    text-align: left;
}

.article-body th {
    background: #f8fafc;
    color: #0f172a;
}

.article-toc-link {
    display: block;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: #475569;
    font-size: 0.875rem;
    line-height: 1.5rem;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.article-toc-link:hover {
    color: #ea580c;
    background: rgba(255, 255, 255, 0.75);
    transform: translateX(2px);
}

.article-toc-link-sub {
    padding-left: 1.5rem;
    color: #64748b;
}

/* Template Showcase */
.template-demo-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.template-demo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px -18px rgba(15, 23, 42, 0.28);
    border-color: rgba(192, 132, 252, 0.35);
}

.template-demo-frame {
    height: 360px;
    overflow: hidden;
    position: relative;
}

.template-demo-frame::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 72px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.92) 100%);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.template-demo-card:hover .template-demo-frame::after,
.template-demo-card:focus-within .template-demo-frame::after {
    opacity: 0;
}

.template-demo-image {
    --scroll-distance: 0px;
    --scroll-duration: 6s;
    transform: translateY(0);
    transition: transform var(--scroll-duration) linear;
    will-change: transform;
}

.template-demo-card:hover .template-demo-image,
.template-demo-card:focus-within .template-demo-image {
    transform: translateY(calc(-1 * var(--scroll-distance)));
}

@media (max-width: 1024px) {
    .template-demo-frame {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .template-demo-frame {
        height: 280px;
    }

    .template-demo-card:hover {
        transform: none;
    }
}
