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

:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --accent: #e74c3c;
    --accent-hover: #c0392b;
    --bg: #f5f6fa;
    --card-bg: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
    --header-height: 70px;
    --banner-gradient: linear-gradient(135deg, #1abc9c, #16a085);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #1a1a2e;
        --primary-light: #16213e;
        --accent: #ff6b6b;
        --accent-hover: #ee5a24;
        --bg: #0f0f1a;
        --card-bg: rgba(30, 30, 50, 0.85);
        --glass-bg: rgba(255, 255, 255, 0.05);
        --glass-border: rgba(255, 255, 255, 0.1);
        --text: #e0e0e0;
        --text-light: #a0a0b0;
        --white: #1a1a2e;
        --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        --banner-gradient: linear-gradient(135deg, #0f3460, #533483);
    }
    
    body {
        background: var(--bg);
    }
    
    .banner-slide svg rect {
        fill: #1a1a2e !important;
    }
    
    .banner-slide svg text {
        fill: #e0e0e0 !important;
    }
    
    .banner-slide svg text:last-child {
        fill: #a0a0b0 !important;
    }
    
    .search-box input {
        background: rgba(255, 255, 255, 0.1);
        color: #e0e0e0;
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .search-box input::placeholder {
        color: #a0a0b0;
    }
    
    .search-box button {
        background: var(--accent);
        color: #fff;
    }
    
    .nav-list a {
        color: #e0e0e0;
    }
    
    .breadcrumb {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .breadcrumb a {
        color: #a0a0b0;
    }
    
    .breadcrumb li[aria-current="page"] {
        color: var(--accent);
    }
    
    footer {
        background: #0a0a15;
        color: #a0a0b0;
    }
    
    footer a {
        color: #e0e0e0;
    }
    
    .faq-item {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    blockquote {
        background: rgba(255, 255, 255, 0.05);
        border-left-color: var(--accent);
    }
    
    #back-to-top {
        background: var(--accent);
        color: #fff;
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }
}

/* 头部 */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: var(--header-height);
    transition: var(--transition);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo svg {
    display: block;
    height: 40px;
    width: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-list li a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-list li a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: var(--transition);
    border-radius: 1px;
}

.nav-list li a:hover,
.nav-list li a:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-list li a:hover::after,
.nav-list li a:focus::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-box input {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    width: 180px;
    transition: var(--transition);
    outline: none;
}

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

.search-box input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.15);
    width: 220px;
}

.search-box button {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* 面包屑 */
.breadcrumb {
    margin-top: var(--header-height);
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    gap: 8px;
    max-width: var(--max-width);
    margin: 0 auto;
    font-size: 0.85rem;
}

.breadcrumb li {
    color: var(--text-light);
}

.breadcrumb li + li::before {
    content: '/';
    margin-right: 8px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb li[aria-current="page"] {
    color: var(--accent);
    font-weight: 600;
}

/* Banner 轮播 */
.banner {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: var(--banner-gradient);
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: scale(1.05);
}

.banner-slide.active {
    opacity: 1;
    transform: scale(1);
}

.banner-slide svg {
    width: 100%;
    height: 100%;
    display: block;
}

.banner-prev,
.banner-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.banner-prev:hover,
.banner-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.banner-prev {
    left: 20px;
}

.banner-next {
    right: 20px;
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.banner-dots::before {
    content: '';
    display: flex;
    gap: 10px;
}

/* 通用区块 */
.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 20px;
    animation: fadeInUp 0.6s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
.section:nth-child(5) { animation-delay: 0.4s; }
.section:nth-child(6) { animation-delay: 0.5s; }
.section:nth-child(7) { animation-delay: 0.6s; }
.section:nth-child(8) { animation-delay: 0.7s; }
.section:nth-child(9) { animation-delay: 0.8s; }
.section:nth-child(10) { animation-delay: 0.9s; }

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 40px 0 20px;
    color: var(--primary);
    position: relative;
    padding-bottom: 12px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 30px 0 15px;
    color: var(--primary-light);
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 10px;
    color: var(--text);
}

p {
    margin-bottom: 16px;
    color: var(--text);
    line-height: 1.8;
}

/* 卡片样式 */
.card, .faq-item, blockquote, article {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover, .faq-item:hover, article:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* FAQ */
.faq-item {
    margin-bottom: 16px;
    cursor: pointer;
    position: relative;
    padding-right: 40px;
}

.faq-item::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 24px;
    font-size: 1.5rem;
    color: var(--accent);
    transition: var(--transition);
}

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

.faq-item h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.faq-item p {
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin 0.3s ease;
}

.faq-item.active p {
    max-height: 200px;
    margin-top: 12px;
}

/* 引用块 */
blockquote {
    border-left: 4px solid var(--accent);
    margin: 20px 0;
    font-style: italic;
    position: relative;
}

blockquote::before {
    content: '"';
    font-size: 3rem;
    color: var(--accent);
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
    font-family: Georgia, serif;
}

blockquote p {
    margin: 0;
    padding-left: 20px;
}

/* 文章卡片 */
article {
    margin-bottom: 20px;
}

article time {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

article a {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

article a::after {
    content: '→';
    margin-left: 6px;
    transition: var(--transition);
}

article a:hover {
    color: var(--accent-hover);
}

article a:hover::after {
    margin-left: 12px;
}

/* 列表样式 */
ul, ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* 网站地图 & 友情链接 */
#sitemap ul,
#friends ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

#sitemap li a,
#friends li a {
    display: block;
    padding: 12px 16px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

#sitemap li a:hover,
#friends li a:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

/* 页脚 */
footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 20px;
    text-align: center;
    margin-top: 40px;
}

footer p {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition);
    margin: 0 8px;
}

footer a:hover {
    color: var(--accent);
}

/* 返回顶部 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 999;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(231, 76, 60, 0.5);
}

/* 滚动动画支持 */
@media (prefers-reduced-motion: no-preference) {
    .section {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
    
    .section.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 1024px) {
    .nav-list {
        gap: 4px;
    }
    
    .nav-list li a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .search-box input {
        width: 140px;
    }
    
    .search-box input:focus {
        width: 160px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }
    
    .header-inner {
        padding: 0 12px;
    }
    
    .logo svg {
        height: 32px;
        width: auto;
    }
    
    .nav-list {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: rgba(44, 62, 80, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    
    .nav-list.open {
        display: flex;
    }
    
    .nav-list li a {
        padding: 12px 16px;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }
    
    .nav-list li a::after {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .search-box {
        order: -1;
        margin-right: auto;
        margin-left: 12px;
    }
    
    .search-box input {
        width: 120px;
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .search-box input:focus {
        width: 140px;
    }
    
    .search-box button {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .banner {
        height: 280px;
    }
    
    .banner-prev,
    .banner-next {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .banner-prev {
        left: 10px;
    }
    
    .banner-next {
        right: 10px;
    }
    
    .section {
        padding: 40px 16px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    #sitemap ul,
    #friends ul {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .banner {
        height: 220px;
    }
    
    .search-box input {
        width: 100px;
    }
    
    .search-box input:focus {
        width: 120px;
    }
    
    .section {
        padding: 30px 12px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    #sitemap ul,
    #friends ul {
        grid-template-columns: 1fr 1fr;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* 毛玻璃增强 */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

/* 渐变按钮效果 */
.btn-gradient {
    background: linear-gradient(135deg, var(--accent), #e67e22);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

/* 图片占位符 */
.img-placeholder {
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    border-radius: var(--radius-sm);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
}