/* SafeW 全站共享样式 */
:root {
    /* 色板 */
    --color-dark: #21163C;
    --color-paper: #F4F3F7;
    --color-text: #191523;
    --color-brand: #5214EB;
    --color-accent: #ED926E;

    /* 语义化颜色变量（自动跟随所在的面） */
    --bg-surface: var(--color-paper);
    --bg-surface-alt: var(--color-dark);
    --text-primary: var(--color-text);
    --text-secondary: rgba(25, 21, 35, 0.7);
    --text-on-dark: var(--color-paper);
    --text-on-dark-secondary: rgba(244, 243, 247, 0.7);
    --accent-color: var(--color-brand);
    --accent-on-dark: var(--color-accent);
    --border-color: rgba(25, 21, 35, 0.16);
    --border-on-dark: rgba(244, 243, 247, 0.16);

    /* 设计 Token */
    --radius-card: 20px;
    --radius-btn: 12px;
    --card-border: 1px solid var(--border-color);
    --card-shadow: none;
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);
    --content-max: 1120px;
    
    /* 字体 */
    --font-sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* 重置与基础 */
*, *::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);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    line-height: 1.65;
    font-size: 16px;
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

ul, ol {
    list-style: none;
}

/* 容器 */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

/* 排版 */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--text-primary);
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--gap);
    text-wrap: balance;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: calc(var(--gap) * 1.5);
    text-wrap: balance;
}

.kicker {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.highlight {
    color: var(--accent-color);
}

.bg-dark .highlight,
.text-on-dark .highlight {
    color: #7B4AFF;
}

p {
    max-width: 40em;
}

/* 区块布局 */
section {
    padding: var(--section-y) 0;
    position: relative;
}

.bg-dark {
    background-color: var(--color-dark);
    color: var(--text-on-dark);
}

.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4 {
    color: var(--text-on-dark);
}

.bg-dark .kicker {
    color: var(--accent-on-dark);
}

.bg-dark a:not(.btn) {
    color: var(--accent-on-dark);
}

.card-light {
    background-color: var(--color-paper);
    color: var(--text-primary);
    border-radius: var(--radius-card);
    padding: calc(var(--gap) * 2);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
}

.card-light h1, .card-light h2, .card-light h3, .card-light h4 {
    color: var(--text-primary);
}

.card-light .kicker {
    color: var(--accent-color);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 24px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
    border: none;
    gap: 10px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #1A0E06;
}

.btn-primary:hover {
    background-color: #d9825e;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
}

.bg-dark .btn-secondary {
    border-color: var(--text-on-dark);
    color: var(--text-on-dark);
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 页头 */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    background-color: rgba(244, 243, 247, 0.9);
}

.bg-dark .header {
    background-color: rgba(33, 22, 60, 0.9);
    border-bottom-color: var(--border-on-dark);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.bg-dark .logo {
    color: #ffffff;
}

.logo img {
    height: 32px;
    width: auto;
}

.nav-list {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-link[aria-current="page"],
.nav-link:hover {
    color: var(--accent-color);
}

.bg-dark .nav-link[aria-current="page"],
.bg-dark .nav-link:hover {
    color: #ffffff;
}

/* 核心功能 Tab (纯CSS) */
.tabs-wrapper {
    margin-top: calc(var(--gap) * 2);
}

.tab-radio {
    display: none;
}

.tab-labels {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-label {
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-btn) var(--radius-btn) 0 0;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-label:hover {
    color: var(--accent-color);
    background-color: rgba(82, 20, 235, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-radio:checked + .tab-label {
    color: var(--accent-color);
    background-color: rgba(82, 20, 235, 0.08);
    border-bottom: 2px solid var(--accent-color);
}

#tab-private:checked ~ .tab-panels #panel-private,
#tab-group:checked ~ .tab-panels #panel-group,
#tab-channel:checked ~ .tab-panels #panel-channel,
#tab-sync:checked ~ .tab-panels #panel-sync {
    display: block;
}

/* 时间轴 */
.timeline {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: calc(var(--gap) * 2);
    padding-left: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -9px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: 3px solid var(--bg-surface);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.bg-dark .timeline-dot {
    border-color: var(--color-dark);
}

.timeline-time {
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 4px;
    display: block;
}

.bg-dark .timeline-time {
    color: var(--accent-on-dark);
}

/* 表格 */
.table-container {
    overflow-x: auto;
    border: var(--card-border);
    border-radius: var(--radius-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 700;
    background-color: rgba(82, 20, 235, 0.04);
    width: 30%;
}

tr:last-child th, tr:last-child td {
    border-bottom: none;
}

.bg-dark table th {
    background-color: rgba(244, 243, 247, 0.08);
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    border: var(--card-border);
    border-radius: var(--radius-btn);
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.5);
}

.bg-dark .faq-item {
    background-color: rgba(244, 243, 247, 0.05);
    border-color: var(--border-on-dark);
}

.faq-item summary {
    padding: 20px 24px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    background-color: rgba(82, 20, 235, 0.04);
}

.faq-item p {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.bg-dark .faq-item p {
    color: var(--text-on-dark-secondary);
}

/* 页脚 */
.footer {
    padding: 48px 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.bg-dark .footer {
    border-top-color: var(--border-on-dark);
    color: var(--text-on-dark-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.bg-dark .footer-col h4 {
    color: var(--text-on-dark);
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.bg-dark .footer-links a:hover {
    color: var(--accent-on-dark);
}

.footer-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.bg-dark .footer-bottom {
    border-top-color: var(--border-on-dark);
}

/* SVG 动效 Keyframes */
@keyframes drawLine {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes breathe {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes dashFlow {
    to { stroke-dashoffset: -10; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* SVG Class 应用 */
.anim-draw {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: drawLine 1.5s ease forwards;
}

.anim-breathe {
    animation: breathe 3s ease-in-out infinite;
}

.anim-float {
    animation: float 4s ease-in-out infinite;
}

.anim-slide-in {
    animation: slideInRight 0.8s ease forwards;
    animation-delay: 0.5s;
    opacity: 0; /* 初始隐藏，仅作为入场效果，但默认状态不依赖动画显示主体 */
}

.anim-flow {
    stroke-dasharray: 4 4;
    animation: dashFlow 1s linear infinite;
}

/* 减少动态效果 */
@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;
    }
    .anim-slide-in {
        opacity: 1;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .nav-list {
        display: none; /* 简化移动端处理，实际项目应加汉堡菜单，此处保持简洁 */
    }
    .header-inner {
        height: 60px;
    }
    .tabs-wrapper {
        margin-top: var(--gap);
    }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
