/* =========================================
   Design Variables & Global Reset
   ========================================= */
:root {
    --brand-color: #25D366;
    --brand-dark: #128C7E;
    --brand-light: #DCF8C6;
    --bg-primary: #F7F8FA;
    --bg-secondary: #FFFFFF;
    --text-heading: #111111;
    --text-body: #4A5568;
    --text-muted: #718096;
    --border-color: #E2E8F0;
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
    --radius-sm: 6px;
    --radius-md: 12px;
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --spacing-section: clamp(3rem, 8vw, 8rem);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-body);
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    overflow-wrap: break-word;
}

img, svg {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, a:focus-visible {
    color: var(--brand-dark);
    outline-offset: 2px;
    outline: 2px solid var(--brand-color);
    border-radius: 2px;
}

ul, ol {
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* =========================================
   Typography & Layout Utilities
   ========================================= */
.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 clamp(0.75rem, 5vw, 1.5rem);
}

section {
    padding: var(--spacing-section) 0;
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    color: var(--text-heading);
    font-weight: 700;
    text-wrap: balance;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 720px;
    text-wrap: balance;
}

.text-center {
    text-align: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* 窄屏防溢出适配：弹性子项收缩 & 表格独立滚动 */
.grid-layout, .grid-layout > *, .card, .spec-table { min-width: 0; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.grid-layout {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .grid-layout.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-layout.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-layout.split {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

/* =========================================
   Header & Navigation
   ========================================= */
.site-header {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-heading);
}

.brand-logo img {
    height: 36px;
    width: auto;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-body);
}

.nav-link[aria-current="page"],
.nav-link:hover {
    color: var(--brand-dark);
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--brand-color);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-primary:hover, .btn-primary:focus-visible {
    background-color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
    color: #FFFFFF;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-heading);
}

.btn-outline:hover, .btn-outline:focus-visible {
    border-color: var(--brand-color);
    color: var(--brand-dark);
}

/* =========================================
   SVG Animations
   ========================================= */
@keyframes drawLine {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes floatNode {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.svg-draw {
    path {
        pathLength: 1;
        stroke-dasharray: 1;
        stroke-dashoffset: 0;
        animation: drawLine 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
    }
    
    circle.float {
        animation: floatNode 3s ease-in-out infinite;
        transform-box: fill-box;
        transform-origin: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .svg-draw path,
    .svg-draw circle.float {
        animation: none !important;
    }
}

/* =========================================
   Feature Cards & Tables
   ========================================= */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    border: 1px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
    border-color: var(--border-color);
    transform: translateY(-4px);
}

.card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--brand-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--brand-dark);
}

.card h3 {
    font-size: 1.25rem;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
}

table.spec-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

table.spec-table th,
table.spec-table td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table.spec-table th {
    background-color: #F1F5F9;
    font-weight: 600;
    color: var(--text-heading);
}

table.spec-table tr:last-child td {
    border-bottom: none;
}

/* =========================================
   Downloads & Install
   ========================================= */
.download-section {
    background-color: var(--text-heading);
    color: #FFFFFF;
}

.download-section .section-title {
    color: #FFFFFF;
}

.install-steps {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.install-steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 1.5rem;
}

.install-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.25rem;
    height: 2.25rem;
    background-color: var(--brand-color);
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

/* =========================================
   FAQ (Details / Summary)
   ========================================= */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

details.faq-item {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

details.faq-item[open] {
    border-color: var(--brand-color);
}

summary.faq-question {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-heading);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary.faq-question::-webkit-details-marker {
    display: none;
}

summary.faq-question::after {
    content: "";
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-left: 1rem;
}

details.faq-item[open] summary.faq-question::after {
    transform: rotate(-135deg);
    border-color: var(--brand-color);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--text-body);
    font-size: 1rem;
    line-height: 1.8;
}

/* =========================================
   News & Footer
   ========================================= */
.news-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.related-links {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.related-links li a {
    display: block;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.related-links li a:hover {
    border-color: var(--brand-color);
    color: var(--brand-dark);
}

.related-links li a strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-heading);
}

.site-footer {
    background-color: #F1F5F9;
    padding: 4rem 0 2rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--text-heading);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    text-align: center;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .nav-list {
        display: none; /* Simplification for static site, focus on single page flow */
    }
    .mobile-nav-toggle {
        display: block;
    }
    .header-inner {
        justify-content: center;
    }
    .grid-layout.split {
        grid-template-columns: 1fr;
    }
    .grid-layout.split > div:first-child {
        order: -1;
    }
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}
