/* CSS Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8fafc;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #1557b0;
    text-decoration: underline;
}

img,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* ===== Header & Navigation ===== */
header {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(26, 115, 232, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header .logo {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

header nav a {
    color: rgba(255,255,255,0.9);
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

header nav a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

header nav a:active {
    transform: scale(0.96);
}

#darkModeToggle {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #fff;
    transition: all 0.3s ease;
}

#darkModeToggle:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
}

/* Mobile Menu */
nav.mobile-menu {
    display: none;
    gap: 2px;
}

nav.mobile-menu a {
    color: rgba(255,255,255,0.9);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.08);
    transition: all 0.3s ease;
}

nav.mobile-menu a:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    text-decoration: none;
}

/* ===== Banner ===== */
.banner {
    background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 50%, #c5d9f8 100%);
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(26,115,232,0.08) 0%, transparent 60%),
                radial-gradient(circle at 70% 80%, rgba(13,71,161,0.06) 0%, transparent 50%);
    animation: bannerGlow 12s ease-in-out infinite alternate;
}

@keyframes bannerGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(2%, 2%) scale(1.05); }
}

.banner .container {
    position: relative;
    z-index: 2;
}

.banner h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: #1a73e8;
    text-shadow: 0 2px 10px rgba(26,115,232,0.15);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.banner p {
    font-size: 1.15rem;
    color: #3c4a5a;
    max-width: 800px;
    margin: 0 auto 30px;
    line-height: 1.8;
    font-weight: 400;
}

.banner svg {
    margin: 20px auto 0;
    filter: drop-shadow(0 8px 20px rgba(26,115,232,0.3));
    transition: transform 0.3s ease;
    cursor: pointer;
}

.banner svg:hover {
    transform: scale(1.05) translateY(-2px);
}

.banner svg rect {
    fill: url(#bannerBtnGrad);
}

/* ===== Sections ===== */
.section {
    padding: 70px 0;
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: #1a73e8;
    text-align: center;
    position: relative;
    letter-spacing: -0.3px;
}

.section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #1a73e8, #0d47a1);
    border-radius: 4px;
    margin: 12px auto 0;
}

.section h3 {
    font-size: 1.35rem;
    margin: 20px 0 12px;
    color: #1e293b;
    font-weight: 600;
}

.section h4 {
    font-size: 1.1rem;
    margin: 16px 0 8px;
    color: #475569;
    font-weight: 500;
}

/* ===== Grid & Cards ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.card {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 28px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 8px 32px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26,115,232,0.03), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(26,115,232,0.12), 0 6px 16px rgba(0,0,0,0.06);
    border-color: rgba(26,115,232,0.2);
}

.card:hover::before {
    opacity: 1;
}

.card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: #1e293b;
    position: relative;
}

.card p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
    position: relative;
}

/* ===== FAQ ===== */
.faq-item {
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-bottom: 16px;
    transition: border-color 0.3s ease;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-weight: 600;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(26,115,232,0.04);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    color: #1e293b;
}

.faq-question::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 300;
    color: #1a73e8;
    transition: transform 0.3s ease;
}

.faq-question:hover {
    background: rgba(26,115,232,0.08);
}

.faq-answer {
    display: none;
    margin-top: 10px;
    padding: 8px 16px 12px;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
    animation: fadeSlideIn 0.3s ease;
}

.faq-answer.open {
    display: block;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== HowTo ===== */
.howto-step {
    margin-bottom: 24px;
    padding: 20px 24px;
    border-left: 4px solid #1a73e8;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
    border-radius: 0 16px 16px 0;
    transition: all 0.3s ease;
}

.howto-step:hover {
    background: rgba(255,255,255,0.9);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.howto-step h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #1a73e8;
    font-size: 1.1rem;
}

.howto-step p {
    color: #475569;
    line-height: 1.7;
}

/* ===== Article List ===== */
.article-list {
    list-style: none;
    display: grid;
    gap: 20px;
}

.article-list li {
    padding: 22px 24px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.article-list li:hover {
    background: rgba(255,255,255,0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.article-list li h3 {
    margin-bottom: 6px;
    font-size: 1.15rem;
    color: #1e293b;
}

.article-list li .meta {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.article-list li p {
    color: #475569;
    font-size: 0.95rem;
    margin-bottom: 10px;
    line-height: 1.6;
}

.article-list li a {
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.article-list li a::after {
    content: '→';
    transition: transform 0.2s ease;
}

.article-list li a:hover::after {
    transform: translateX(4px);
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    padding: 50px 0 40px;
    font-size: 0.9rem;
}

.footer a {
    color: #94a3b8;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #fff;
    text-decoration: none;
}

.footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 36px;
}

.footer h4 {
    color: #f1f5f9;
    margin-bottom: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer p {
    line-height: 1.7;
    margin-bottom: 8px;
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: none;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(26,115,232,0.35);
    transition: all 0.3s ease;
    z-index: 999;
    backdrop-filter: blur(8px);
}

.back-to-top.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(26,115,232,0.45);
}

.back-to-top:active {
    transform: scale(0.95);
}

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

/* ===== Scroll Animation ===== */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Dark Mode ===== */
.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

.dark-mode header {
    background: linear-gradient(135deg, #0d1b3e 0%, #0a0f2a 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.dark-mode .banner {
    background: linear-gradient(135deg, #1a2332 0%, #0f172a 50%, #1a1f2e 100%);
}

.dark-mode .banner h1 {
    color: #60a5fa;
    text-shadow: 0 2px 10px rgba(96,165,250,0.2);
}

.dark-mode .banner p {
    color: #94a3b8;
}

.dark-mode .card {
    background: rgba(30,41,59,0.7);
    backdrop-filter: blur(12px);
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.dark-mode .card:hover {
    border-color: rgba(96,165,250,0.2);
    box-shadow: 0 16px 48px rgba(96,165,250,0.08);
}

.dark-mode .card h3 {
    color: #f1f5f9;
}

.dark-mode .card p,
.dark-mode .faq-answer,
.dark-mode .howto-step p,
.dark-mode .article-list li p {
    color: #94a3b8;
}

.dark-mode .section h2 {
    color: #60a5fa;
}

.dark-mode .section h2::after {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.dark-mode .section h3 {
    color: #e2e8f0;
}

.dark-mode .section h4 {
    color: #94a3b8;
}

.dark-mode .faq-question {
    color: #e2e8f0;
    background: rgba(96,165,250,0.06);
}

.dark-mode .faq-question:hover {
    background: rgba(96,165,250,0.1);
}

.dark-mode .faq-question::after {
    color: #60a5fa;
}

.dark-mode .faq-item {
    border-bottom-color: rgba(255,255,255,0.06);
}

.dark-mode .howto-step {
    background: rgba(30,41,59,0.5);
    border-left-color: #60a5fa;
}

.dark-mode .howto-step:hover {
    background: rgba(30,41,59,0.8);
}

.dark-mode .howto-step h3 {
    color: #60a5fa;
}

.dark-mode .article-list li {
    background: rgba(30,41,59,0.5);
    border-color: rgba(255,255,255,0.04);
}

.dark-mode .article-list li:hover {
    background: rgba(30,41,59,0.8);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.dark-mode .article-list li h3 {
    color: #f1f5f9;
}

.dark-mode .article-list li .meta {
    color: #64748b;
}

.dark-mode .footer {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
}

.dark-mode .footer h4 {
    color: #f1f5f9;
}

.dark-mode .footer a {
    color: #64748b;
}

.dark-mode .footer a:hover {
    color: #94a3b8;
}

.dark-mode .back-to-top {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 8px 24px rgba(59,130,246,0.3);
}

.dark-mode a {
    color: #60a5fa;
}

.dark-mode a:hover {
    color: #93c5fd;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .banner h1 {
        font-size: 2.2rem;
    }
    
    .banner {
        padding: 80px 0 60px;
    }
    
    .section {
        padding: 50px 0;
    }
}

@media (max-width: 768px) {
    header nav {
        display: none;
    }
    
    nav.mobile-menu {
        display: flex;
    }
    
    header .logo {
        font-size: 1.3rem;
    }
    
    .banner h1 {
        font-size: 1.8rem;
    }
    
    .banner p {
        font-size: 1rem;
    }
    
    .banner {
        padding: 60px 0 50px;
    }
    
    .section h2 {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card {
        padding: 22px 18px;
    }
    
    .footer .container {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .faq-question {
        font-size: 0.95rem;
        padding: 10px 14px;
    }
    
    .howto-step {
        padding: 16px 18px;
    }
    
    .article-list li {
        padding: 18px 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .banner h1 {
        font-size: 1.5rem;
    }
    
    .banner p {
        font-size: 0.9rem;
    }
    
    .section h2 {
        font-size: 1.4rem;
    }
    
    .card h3 {
        font-size: 1.1rem;
    }
    
    header .logo {
        font-size: 1.1rem;
    }
    
    nav.mobile-menu a {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}

/* ===== Utility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Smooth gradient definition for banner button */
.banner svg defs {
    display: none;
}

/* Ensure dark mode toggle is visible */
#darkModeToggle {
    white-space: nowrap;
}

/* Print styles */
@media print {
    header,
    .back-to-top,
    nav.mobile-menu {
        display: none !important;
    }
    
    .banner {
        background: #f0f4ff !important;
        padding: 40px 0 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}