/* ===============================================
   星研安研学平台 - 自定义样式
   =============================================== */

/* CSS Variables */
:root {
    --primary: #1E3A5F;
    --secondary: #FDB813;
    --accent: #4CAF50;
    --info: #0091D5;
    --gradient-hero: linear-gradient(135deg, #1E3A5F 0%, #0091D5 50%, #4CAF50 100%);
    --gradient-gold: linear-gradient(135deg, #FFCD00 0%, #FDB813 100%);
    --gradient-green: linear-gradient(135deg, #4CAF50 0%, #00B0E8 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

/* ===============================================
   Navigation Styles
   =============================================== */

/* Safe area for notched devices (iOS / Android) */
.nav-safe {
    top: max(1rem, env(safe-area-inset-top, 1rem));
    left: max(1rem, env(safe-area-inset-left, 1rem));
    right: max(1rem, env(safe-area-inset-right, 1rem));
}

.nav-safe.nav-scrolled {
    top: max(0.5rem, env(safe-area-inset-top, 0.5rem));
}

@media (max-width: 767px) {
    .nav-safe {
        left: max(0.75rem, env(safe-area-inset-left, 0.75rem));
        right: max(0.75rem, env(safe-area-inset-right, 0.75rem));
    }
    
    .mobile-menu-dropdown {
        max-height: 70vh;
    }
}

/* Fallback when backdrop-filter not supported */
.nav-inner {
    background-color: rgba(255, 255, 255, 0.95);
}
@supports (backdrop-filter: blur(12px)) {
    .nav-inner {
        background-color: rgba(255, 255, 255, 0.8);
    }
}

/* Bottom safe area for CTA section */
.contact-safe {
    padding-bottom: max(5rem, calc(5rem + env(safe-area-inset-bottom, 0px)));
}

.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    color: #475569;
    font-size: 1.125rem;   /* 导航链接字号，可改为 1.25rem 更大 */
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 0;
    color: #475569;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    padding-left: 1rem;
    cursor: pointer;
}

.mobile-nav-link:hover {
    color: var(--primary);
    border-left-color: var(--secondary);
    padding-left: 1.5rem;
}

/* ===============================================
   Button Styles
   =============================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: var(--gradient-gold);
    color: var(--primary);
    font-weight: 600;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(253, 184, 19, 0.3);
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 184, 19, 0.4);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-green);
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: white;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    border: 2px solid transparent; /* 与 btn-white 边框一致，保证两按钮视觉尺寸相同 */
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.btn-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: transparent;
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    text-decoration: none;
    border: 2px solid white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-white:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-3px);
}

/* ===============================================
   Hero Section Animations
   =============================================== */

.stars-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
    animation: twinkle 3s infinite;
}

.star-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 2.5s;
}

.star-2 {
    top: 40%;
    left: 20%;
    animation-delay: 0.5s;
    animation-duration: 3s;
}

.star-3 {
    top: 60%;
    left: 80%;
    animation-delay: 1s;
    animation-duration: 2.8s;
}

.star-4 {
    top: 30%;
    left: 70%;
    animation-delay: 1.5s;
    animation-duration: 3.2s;
}

.star-5 {
    top: 80%;
    left: 30%;
    animation-delay: 2s;
    animation-duration: 2.6s;
}

.star-6 {
    top: 50%;
    left: 50%;
    animation-delay: 2.5s;
    animation-duration: 3.5s;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* ===============================================
   Feature Cards
   =============================================== */

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

@supports (backdrop-filter: blur(10px)) {
    .feature-card {
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px);
    }
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(30, 58, 95, 0.15);
    border-color: rgba(253, 184, 19, 0.5);
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feature-card:hover .icon-wrapper {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ===============================================
   Course Cards
   =============================================== */

.course-card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.course-image {
    width: 100%;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.course-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 1;
}

.course-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover .course-img {
    transform: scale(1.05);
}

.course-content {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.course-content a.btn-secondary {
    margin-top: auto;
}

.badge {
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 0.375rem 0.875rem;
    background: var(--gradient-gold);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===============================================
   Stats Section
   =============================================== */

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFCD00, #FDB813, #FFE082);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Poppins', sans-serif;
}

.gradient-text-light {
    background: linear-gradient(135deg, #FFFFFF, #FFCD00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===============================================
   Team Section
   =============================================== */

.team-member {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 1.5rem;
    transition: all 0.3s ease;
}

.team-member:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.ring-gradient {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--gradient-gold);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.team-member:hover .ring-gradient {
    opacity: 1;
}

/* ===============================================
   Testimonials
   =============================================== */

.testimonial-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

@supports (backdrop-filter: blur(10px)) {
    .testimonial-card {
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px);
    }
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.stars {
    display: flex;
    gap: 0.25rem;
}

.star-icon {
    width: 20px;
    height: 20px;
    fill: #FDB813;
    stroke: #FDB813;
}

.quote {
    font-style: italic;
    position: relative;
}

.quote::before {
    content: '"';
    font-size: 3rem;
    color: var(--info);
    opacity: 0.3;
    position: absolute;
    top: -1rem;
    left: -0.5rem;
    font-family: Georgia, serif;
}

.author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===============================================
   FAQ (常见问题) Styles
   =============================================== */

.faq-item summary::-webkit-details-marker,
.faq-item summary::marker {
    display: none;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-item .faq-answer {
    background: white;
    border-radius: 0 0 0.75rem 0.75rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-top: none;
    margin-top: -1px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.faq-item[open] .faq-question {
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom: none;
}

/* ===============================================
   Footer Styles
   =============================================== */

.footer-link {
    color: #94A3B8;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.875rem;
}

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

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.social-link:hover {
    background: var(--gradient-gold);
    transform: translateY(-3px);
}

/* ===============================================
   Animations
   =============================================== */

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

.animation-delay-600 {
    animation-delay: 0.6s;
}

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

/* Intersection Observer Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===============================================
   Responsive Design
   =============================================== */

/* Mobile (375px - 767px) */
@media (max-width: 767px) {
    .stat-number {
        font-size: 2.5rem;
    }
    
    h1 {
        font-size: 2.5rem !important;
        letter-spacing: 0.02em;
    }
    
    #home h1 {
        font-size: 2.75rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    /* Touch targets ≥ 44px (Apple / Material guideline) */
    .btn-primary,
    .btn-ghost,
    .btn-cta,
    .btn-white {
        min-height: 44px;
        width: 100%;
        justify-content: center;
    }
    
    .btn-secondary {
        min-height: 44px;
    }
    
    #mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Tighter section spacing on mobile */
    section:not(#home):not(#contact) {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    section .text-center.mb-16 {
        margin-bottom: 2.5rem;
    }
    
    #faq .mb-12 {
        margin-bottom: 2rem;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .stat-number {
        font-size: 3rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    /* Parallax effect for larger screens */
    .hero-parallax {
        transform: translateY(var(--scroll-offset, 0));
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===============================================
   Utility Classes
   =============================================== */

.cursor-pointer {
    cursor: pointer;
}

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

/* Light mode specific overrides */
@media (prefers-color-scheme: light) {
    .feature-card {
        background: rgba(255, 255, 255, 0.9);
    }
    
    .testimonial-card {
        background: rgba(255, 255, 255, 0.9);
    }
}
