/* 基础变量：统一核心样式变量 */
:root {
    --bg: #fff;
    --fg: #0a0a0a;
    --muted: #697383;
    --primary: #1677ff; /* HIUI主蓝 */
    --primary-ink: #fff;
    --border: #eaecef;
    /* 主题色与辅助色 */
    --theme-color: #1F76E0; /* 导航主题色 */
    --secondary: #f59e0b;
    --accent: #63A7FB;
    --blue: #60a5fa;

    --radius: 10px;
    --max-width: 1400px; /* 统一最大宽度 */
    /* 固定间距变量 */
    --space-1: 6px;
    --space-2: 10px;
    --space-3: 14px;
    --space-4: 18px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 72px;
}

/* 字体引入：保留阿里妈妈黑体 */
@font-face {
    font-family: "AlimamaShuHeiTi";
    src: url("./assets/fonts/AlimamaShuHeiTi-Bold.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 基础样式：合并盒模型与全局样式 */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.65 "AlimamaShuHeiTi", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    opacity: 0;
    animation: pageLoad 0.8s ease forwards;
}

@keyframes pageLoad {
    to {
        opacity: 1;
    }
}

/* 卡通风格body类：单独定义差异化样式 */
body.cartoon {
    color: #1f2937;
}

/* 容器：统一最大宽度，固定内边距 */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-inline: var(--space-6); /* 固定32px内边距 */
}

/* 链接基础样式 */
a {
    color: inherit;
    text-decoration: none;
}

.link {
    color: var(--primary);
    opacity: 1;
    transition: opacity .2s ease;
}

.link:hover {
    opacity: .8;
}

/* 按钮样式：保留核心交互 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-weight: 600;
    transition: .2s box-shadow, .2s transform, .2s background, .2s color, .2s border-color;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-ink);
    border-color: transparent;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(22, 119, 255, .24);
}

.btn-link {
    background: #fff;
    color: var(--primary);
    border-color: rgba(22, 119, 255, .22);
}

.btn-link:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* 头部导航：简化版 */
.site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: transparent;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.header-bar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    display: block;
}

.nav-links {
    display: flex;
    gap: var(--space-5);
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s ease;
    padding: 8px 0;
    position: relative;
}

.nav-link:hover {
    color: var(--fg);
}

.nav-link.active {
    color: var(--theme-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--theme-color);
}

.saying-box {
    max-width: 400px;
}

.saying-text {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.5;
    font-weight: 500;
}

/* Hero Banner：全屏设计 */
.hero-banner {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    position: relative;
}

#particleCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-grid {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-left {
    max-width: 900px;
    margin: 0 auto;
    margin-top: 40px;
    text-align: center;
}

.hero-grid {
    display: grid;
    gap: 60px;
    align-items: center;
}

.hero-tag {
    display: inline-block;
    padding: 8px 18px;
    background: var(--accent);
    border: 3px solid #000;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--fg);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, .2);
    margin-bottom: 24px;
}

.hero-title {
    font-size: 7rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 24px;
    color: var(--fg);
    letter-spacing: -0.02em;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.2s forwards;
}

.hero-desc {
    font-size: 1.25rem;
    color: var(--muted);
    line-height: 1.7;
    margin: 0 0 32px;
    max-width: 500px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.4s forwards;
}

.hero-actions {
    display: flex;
    gap: 16px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.6s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border: 3px solid #000;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .3);
    transition: transform .1s ease, box-shadow .1s ease, background .2s ease;
}

.hero-btn-primary {
    background: var(--theme-color);
    color: #fff;
}

.hero-btn-primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 rgba(0, 0, 0, .4);
    background: #1864b8;
}

.hero-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    animation: fadeInRight 0.8s ease;
}

.hero-card {
    background: #fff;
    border: 3px solid #000;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .2);
    transition: transform .2s ease, box-shadow .2s ease;
}

.hero-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, .3);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--fg);
}

.card-desc {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

/* 页脚：固定底部 */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: 20px 0;
    z-index: 5;
    opacity: 0;
    animation: fadeIn 0.6s ease 0.8s forwards;
}

.footer-bar {
    display: flex;
    flex-direction: row; /* 宽屏横向 */
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    flex-wrap: wrap;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.footer-right .dot {
    opacity: .5;
    margin: 0 6px;
}

/* 备案与举报信息：固定样式 */
.footer-beian,
.footer-report {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.7;
    color: #b0b8c4;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px 10px;
    flex-wrap: wrap;
}

.footer-beian .dot,
.footer-report .dot {
    opacity: .4;
}

.footer-beian .beian-link {
    color: inherit;
    text-decoration: none;
    opacity: .8;
    transition: color .2s ease, opacity .2s ease;
}

.footer-beian .beian-link:hover {
    opacity: 1;
    color: #8a94a6;
}

/* 友情链接按钮 */
.friends-toggle {
    position: fixed;
    bottom: 80px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--theme-color);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(31, 118, 224, .3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
    z-index: 100;
    opacity: 0;
    animation: fadeIn 0.6s ease 1s forwards;
}

.friends-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(31, 118, 224, .4);
}

.friends-toggle:active {
    transform: translateY(0);
}

/* 友情链接面板 */
.friends-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
}

.friends-panel.active {
    pointer-events: auto;
    opacity: 1;
}

.friends-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background .3s ease;
}

.friends-panel.active .friends-overlay {
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(8px);
}

.friends-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.friends-panel.active .friends-content {
    transform: translate(-50%, -50%) scale(1);
}

.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.friends-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg);
}

.friends-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
    color: var(--muted);
}

.friends-close:hover {
    background: #e5e5e5;
    transform: rotate(90deg);
}

.friends-grid {
    padding: 24px;
    display: grid;
    gap: 12px;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all .2s ease;
}

.friend-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(22, 119, 255, .1);
    transform: translateY(-2px);
}

.friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg);
}

.friend-desc {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================================== 移动端自适应（960px以下）================================== */
@media (max-width: 960px) {
    /* 导航：卡通风格保持 */
    .header-bar {
        height: 64px;
    }
    
    .brand-name {
        font-size: 1.25rem;
    }
    
    .site-nav {
        gap: 12px;
    }
    
    .nav-link {
        padding: 8px 16px;
        font-size: 0.95rem;
    }

    /* 移动端隐藏一言 */
    .nav-links {
        gap: 16px;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    /* 备案信息缩小 */
    .footer-beian,
    .footer-report {
        font-size: 11px;
        gap: 4px 8px;
    }

    .record-icon {
        height: 16px !important;
    }

    /* Hero Banner：移动端单列 */
    .hero-banner {
        padding: 60px 0;
        min-height: auto;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-desc {
        font-size: 1.1rem;
    }

    .hero-right {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .hero-card {
        padding: 20px;
    }

    .card-icon {
        font-size: 2rem;
    }



    /* 关于我们：1列布局，隐藏图片 */
    .about-layout {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }
    .about-image {
        display: none; /* 窄屏隐藏图片 */
    }
    .about-lead {
        font-size: 20px;
        padding: 14px;
        margin: var(--space-5) 0 var(--space-6);
    }

    /* 步骤标题：缩小字号 */
    .meta-title {
        font-size: 20px;
        padding-left: 14px;
    }
    .meta-title::before {
        width: 12px;
    }

    /* 区块标题：缩小字号 */
    .section-title {
        font-size: 24px;
    }
    .section-title::after {
        width: 100px;
        height: 8px;
    }

    /* 卡片网格：2列布局 */
    .card-grid,
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }
    .card,
    .category-card {
        padding: var(--space-5);
    }
    .card-title,
    .category-title {
        font-size: 1.1rem;
    }

    /* 页脚：纵向布局 */
    .footer-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    .footer-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* ================================== 小屏手机自适应（640px以下）================================== */
@media (max-width: 640px) {
    /* 容器：缩小内边距 */
    .container {
        padding-inline: var(--space-4);
    }

    /* 导航：小屏优化 */
    .brand-name {
        font-size: 1.1rem;
    }
    
    .nav-link {
        padding: 8px 0;
        font-size: 0.85rem;
        border-width: 2px;
    }

    /* 备案信息进一步缩小 */
    .footer-beian,
    .footer-report {
        font-size: 10px;
        gap: 3px 6px;
    }

    .record-icon {
        height: 14px !important;
    }

    /* 友情链接小屏优化 */
    .friends-toggle {
        width: 44px;
        height: 44px;
        bottom: 60px;
        right: 16px;
    }

    .friends-toggle svg {
        width: 20px;
        height: 20px;
    }

    .friends-header {
        padding: 16px;
    }

    .friends-title {
        font-size: 1.1rem;
    }

    .friends-grid {
        padding: 16px;
        gap: 12px;
    }

    .friend-card {
        padding: 12px;
        gap: 12px;
    }

    .friend-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .friend-name {
        font-size: 1rem;
    }

    .friend-desc {
        font-size: 0.85rem;
    }

    /* Hero Banner：小屏单列 */
    .hero-banner {
        padding: 40px 0;
    }

    .hero-tag {
        font-size: 0.85rem;
        padding: 6px 14px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-btn {
        width: 100%;
        padding: 12px 24px;
    }

    .hero-right {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hero-card {
        padding: 18px;
    }

    .card-icon {
        font-size: 1.8rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-desc {
        font-size: 0.85rem;
    }



    /* 卡片网格：1列布局 */
    .card-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    /* 标签：缩小尺寸 */
    .band-item {
        padding: 6px 12px;
        font-size: .85rem;
        border-width: 2px;
    }
    .band-item::before {
        width: 5px;
        height: 5px;
    }
}