/* =========================================
   全局变量与设计系统 (Design Tokens)
   ========================================= */
:root {
    /* 色彩系统：单色灰度 + WhatsApp 品牌绿 */
    --color-bg: #ffffff;
    --color-surface: #f9fafb;
    --color-border: #e5e7eb;
    --color-text-primary: #111827;
    --color-text-secondary: #4b5563;
    --color-text-tertiary: #6b7280;
    
    --color-brand: #25D366;
    --color-brand-hover: #1da851;
    --color-brand-dark: #075e54;
    
    /* 排版系统：宽松行距，圆体亲和感 */
    --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
    --text-base-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --leading-normal: 1.75;
    
    /* 间距与布局 */
    --spacing-container: clamp(1.5rem, 5vw, 5rem);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* 阴影与动效 */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --transition-standard: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   基础重置与排版 (Base Reset & Typography)
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base-size);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 链接与按钮基础 */
a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-standard);
}

ul, ol {
    list-style: none;
}

/* 焦点可见性 (无障碍) */
:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 4px;
    border-radius: 2px;
}

/* =========================================
   通用布局组件 (Layout Components)
   ========================================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-container);
    padding-right: var(--spacing-container);
}

.section {
    padding-top: clamp(4rem, 8vw, 6rem);
    padding-bottom: clamp(4rem, 8vw, 6rem);
}

.section-alt {
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-wrap: balance;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    max-width: 720px;
    margin-bottom: 3rem;
    text-wrap: balance;
}

.grid-bento {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* 卡片样式 */
.card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    transition: var(--transition-standard);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: #d1d5db;
}

.card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ecfdf5;
    color: var(--color-brand-dark);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 1.8rem;
    border-radius: 999px;
    cursor: pointer;
    border: none;
    transition: var(--transition-standard);
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-brand);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--color-brand-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 1.5px solid var(--color-border);
    color: var(--color-text-primary);
}

.btn-secondary:hover {
    border-color: var(--color-text-tertiary);
    background-color: var(--color-surface);
}

/* =========================================
   页头与页脚 (Header & Footer)
   ========================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text-primary);
}

.brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.nav-link:hover, .nav-link[aria-current="page"] {
    color: var(--color-text-primary);
}

.nav-link[aria-current="page"] {
    color: var(--color-brand-dark);
}

@media (max-width: 768px) {
    .nav-desktop { display: none; }
}

.site-footer {
    background-color: var(--color-text-primary);
    color: #d1d5db;
    padding: 3rem 0;
    margin-top: 2rem;
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-col h4 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-col ul li {
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: var(--color-brand);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #374151;
    text-align: center;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* =========================================
   下载区块与表格 (Download & Tables)
   ========================================= */
.download-box {
    background: linear-gradient(to bottom right, #f0fdf4, #ffffff);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.install-steps {
    counter-reset: step-counter;
    text-align: left;
    max-width: 600px;
    margin: 2rem auto;
}

.install-step {
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 1.5rem;
}

.install-step::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.25rem;
    height: 2.25rem;
    background-color: var(--color-brand);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background-color: var(--color-surface);
    font-weight: 600;
    font-size: 0.95rem;
}

td {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

/* =========================================
   FAQ 组件 (Details/Summary)
   ========================================= */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 800px;
}

details {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition-standard);
}

details[open] {
    border-color: #c7d2fe;
    background-color: #f8fafc;
}

summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.05rem;
}

summary::-webkit-details-marker { display: none; }

summary::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text-tertiary);
    transition: transform 0.2s ease;
}

details[open] summary::after {
    transform: rotate(45deg);
}

details > p {
    margin-top: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* =========================================
   新闻卡片 (News Cards)
   ========================================= */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition-standard);
}

.news-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.news-date {
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.news-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.news-card p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.link-btn {
    margin-top: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-brand-dark);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.link-btn:hover {
    gap: 0.5rem;
}

/* =========================================
   相关阅读 (Related Links)
   ========================================= */
.related-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.related-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.related-item:hover {
    background-color: var(--color-surface);
}

.related-item strong {
    font-size: 0.95rem;
    color: var(--color-text-primary);
}

.related-item span {
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
}

/* =========================================
   SVG 动效与插画 (SVG Motion)
   ========================================= */
.svg-mockup {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border);
    aspect-ratio: 16 / 9;
    max-width: 800px;
    margin: 0 auto;
}

/* 折线逐段绘制动效 */
@keyframes draw-route {
    0% { stroke-dashoffset: 1; }
    40% { stroke-dashoffset: 0; }
    90% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 1; }
}

.animate-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: draw-route 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 节点轻微浮动 */
@keyframes float-node {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.animate-float {
    animation: float-node 4s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

/* 路径延迟错开 */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* 减少动态效果适配 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        animation: none !important;
    }
}
