/* 
 * SafeW 全站共享样式
 * 设计系统：蓝紫深底 + 朱红强调 · 灰白纸面
 */

/* === 设计变量 === */
:root {
    /* 颜色体系 */
    --bg-dark: #21163C;
    --bg-paper: #E9E8EA;
    --text-main: #191523;
    --brand: #5214EB;
    --accent: #ED926E;
    
    /* 文字色（按面切换） */
    --color-text-hero: #F0F0F5;
    --color-text-body: #191523;
    
    /* 组件颜色 */
    --btn-primary-bg: var(--accent);
    --btn-primary-text: var(--bg-dark);
    --card-border: 0;
    --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
    
    /* 间距与圆角 */
    --radius-card: 20px;
    --radius-btn: 12px;
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);
    --content-max: 960px;
}

/* === 基础重置 === */
*, *::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: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-main);
    background-color: var(--bg-paper);
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

/* === 排版系统 === */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--text-main);
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    max-width: 38em;
}

strong {
    font-weight: 700;
}

.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
}

/* === 眉标 (Kicker) === */
.kicker {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: var(--brand);
}

.dark-section .kicker {
    color: var(--accent);
}

/* === 按钮 === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 48px;
    padding: 0 24px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
}

.btn-primary:hover {
    background-color: #d9805b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 146, 110, 0.3);
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-main);
    color: var(--text-main);
}

.dark-section .btn-secondary {
    border-color: var(--color-text-hero);
    color: var(--color-text-hero);
}

.btn-secondary:hover {
    background-color: rgba(25, 21, 35, 0.05);
    text-decoration: none;
}

.dark-section .btn-secondary:hover {
    background-color: rgba(240, 240, 245, 0.1);
}

/* === 卡片 === */
.card {
    background-color: #fff;
    border: var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35);
}

/* === 网格布局 === */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
}

/* === 表格 === */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-card);
    border: 1px solid rgba(25, 21, 35, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: #fff;
}

th, td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}

th {
    font-weight: 700;
    color: var(--brand);
    background-color: rgba(82, 20, 235, 0.05);
}

tr:last-child td {
    border-bottom: none;
}

/* === FAQ === */
details {
    background: #fff;
    border-radius: var(--radius-card);
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

summary {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 3rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "+";
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--brand);
    transition: transform 0.2s ease;
}

details[open] summary::after {
    content: "-";
}

details p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0;
    color: #4a4a55;
}

/* === 导航 === */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(233, 232, 234, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(25, 21, 35, 0.05);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-main);
    text-decoration: none;
}

.logo img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    color: var(--brand);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

/* === 页脚 === */
.footer {
    background-color: var(--bg-dark);
    color: var(--color-text-hero);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand p {
    opacity: 0.7;
    margin-top: 1rem;
    max-width: 300px;
}

.footer-col h4 {
    color: var(--accent);
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: var(--color-text-hero);
    opacity: 0.8;
    font-size: 0.95rem;
}

.footer-col a:hover {
    opacity: 1;
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(240, 240, 245, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.5;
}

/* === 响应式适配 === */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* === SVG 动效 === */
@keyframes pulse-opacity {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes draw-line {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

.svg-node {
    fill: var(--brand);
    animation: pulse-opacity 3s infinite alternate ease-in-out;
}

.svg-float {
    animation: float 6s infinite ease-in-out;
}

.svg-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: draw-line 2s ease-in-out forwards;
}

/* 减少动态效果 */
@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;
    }
}
