/* 全局重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2d3436;
    background: #f0f2f5;
    transition: background 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}

body.dark {
    background: #0f0f1a;
    color: #dfe6e9;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 头部导航 */
header {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #fd79a8 100%);
    color: #fff;
    padding: 18px 0;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-blend-mode: overlay;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(to right, #fff, #ffeaa7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

nav ul {
    list-style: none;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 0;
    position: relative;
    transition: color 0.3s;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffeaa7;
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: #ffeaa7;
}

.menu-toggle {
    display: none;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    font-size: 26px;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.35);
}

.search-box {
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 14px;
    width: 200px;
    outline: none;
    transition: all 0.3s;
}

.search-box::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-box:focus {
    background: rgba(255,255,255,0.25);
    border-color: #ffeaa7;
    box-shadow: 0 0 0 3px rgba(255,234,167,0.2);
}

/* 面包屑 */
.breadcrumb {
    padding: 14px 0;
    font-size: 14px;
    color: #636e72;
}

.breadcrumb a {
    color: #6c5ce7;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #fd79a8;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #a29bfe 0%, #fd79a8 50%, #fdcb6e 100%);
    padding: 80px 30px;
    text-align: center;
    border-radius: 28px;
    margin: 28px 0;
    box-shadow: 0 20px 60px rgba(108, 92, 231, 0.2);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: heroGlow 6s ease-in-out infinite;
}

@keyframes heroGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 16px;
    color: #fff;
    text-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.hero p {
    font-size: 20px;
    max-width: 700px;
    margin: 0 auto 24px;
    color: rgba(255,255,255,0.9);
    position: relative;
}

/* 卡片 */
.card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 32px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    border: 1px solid rgba(255,255,255,0.3);
}

.card:hover {
    transform: translateY(-12px) scale(1.01);
    box-shadow: 0 16px 48px rgba(108, 92, 231, 0.15);
}

body.dark .card {
    background: rgba(30, 30, 50, 0.8);
    border-color: rgba(255,255,255,0.1);
}

/* 网格 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* 图片 */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    transition: transform 0.4s, filter 0.4s;
}

.card img:hover {
    transform: scale(1.03);
    filter: brightness(1.05);
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::after {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(108, 92, 231, 0.4);
}

/* FAQ */
.faq-item {
    margin: 12px 0;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    transition: background 0.3s;
}

body.dark .faq-item {
    border-color: rgba(255,255,255,0.08);
    background: rgba(30,30,50,0.4);
}

.faq-item:hover {
    background: rgba(255,255,255,0.6);
}

.faq-question {
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: #2d3436;
}

body.dark .faq-question {
    color: #dfe6e9;
}

.faq-question::after {
    content: '+';
    font-size: 22px;
    font-weight: 300;
    transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.05);
    color: #636e72;
    line-height: 1.7;
}

body.dark .faq-answer {
    color: #b2bec3;
    border-color: rgba(255,255,255,0.05);
}

/* 页脚 */
footer {
    background: linear-gradient(135deg, #2d3436 0%, #1a1a2e 100%);
    color: #dfe6e9;
    padding: 48px 0;
    margin-top: 60px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6c5ce7, #fd79a8, #fdcb6e);
}

footer a {
    color: #b2bec3;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: #ffeaa7;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 36px;
}

footer h3 {
    font-size: 18px;
    margin-bottom: 14px;
    color: #fff;
    position: relative;
    display: inline-block;
}

footer h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #6c5ce7, #fd79a8);
    margin-top: 6px;
    border-radius: 4px;
}

footer ul {
    list-style: none;
}

footer ul li {
    margin: 8px 0;
}

/* 回到顶部 */
.back-to-top {
    position: fixed;
    bottom: 36px;
    right: 36px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    font-size: 26px;
    cursor: pointer;
    display: none;
    z-index: 999;
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
    transition: all 0.3s;
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.5);
}

/* 懒加载 */
.lazy {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* 滚动动画 */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 轮播 */
.carousel {
    overflow: hidden;
    position: relative;
    border-radius: 24px;
}

.carousel-inner {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-item {
    min-width: 100%;
}

/* 标题样式 */
h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 40px 0 24px;
    position: relative;
    display: inline-block;
    color: #2d3436;
}

body.dark h2 {
    color: #dfe6e9;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #6c5ce7, #fd79a8);
    border-radius: 4px;
    margin-top: 8px;
}

h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2d3436;
}

body.dark h3 {
    color: #dfe6e9;
}

/* 暗黑模式切换按钮 */
.dark-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
    transition: all 0.3s;
}

.dark-toggle:hover {
    transform: scale(1.1);
}

/* 文章卡片内图片 */
.card img {
    margin-top: 16px;
    border-radius: 16px;
}

/* 列表样式 */
aside ul {
    list-style: none;
    padding: 0;
}

aside ul li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    color: #636e72;
}

body.dark aside ul li {
    border-color: rgba(255,255,255,0.05);
    color: #b2bec3;
}

/* 联系信息 */
#contact .card p {
    margin: 10px 0;
    font-size: 16px;
}

#contact .card img {
    display: inline-block;
    margin-top: 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(0, 0, 0, 0.15);
        backdrop-filter: blur(12px);
        padding: 16px;
        border-radius: 16px;
        margin-top: 12px;
    }

    nav ul.active {
        display: flex;
    }

    nav ul li {
        margin: 6px 0;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero {
        padding: 50px 20px;
    }

    .search-box {
        width: 100%;
        margin-top: 8px;
    }

    header .container {
        flex-direction: column;
        align-items: stretch;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    .card {
        padding: 20px;
    }

    h2 {
        font-size: 26px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .back-to-top {
        width: 44px;
        height: 44px;
        font-size: 20px;
        bottom: 20px;
        right: 20px;
    }
}

/* 附加动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    animation: fadeInUp 0.8s ease;
}

/* 数字统计样式（预留） */
.stat-number {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #6c5ce7, #fd79a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f2f5;
}

body.dark ::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a4bd1, #8e7ff0);
}

/* 选中文字样式 */
::selection {
    background: #6c5ce7;
    color: #fff;
}

body.dark ::selection {
    background: #fd79a8;
}