/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部 */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(224, 224, 224, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #1a73e8;
    text-decoration: none;
    transition: transform 0.3s;
}

.logo span {
    color: #ff6f00;
}

.logo:hover {
    transform: scale(1.05);
}

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

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

nav a:hover {
    color: #1a73e8;
    transform: translateY(-2px);
}

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

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: #fff;
    color: #333;
}

.search-box input:focus {
    border-color: #1a73e8;
    outline: none;
}

.search-box button {
    padding: 8px 12px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #1557b0;
}

.dark-mode-toggle {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 20px;
    color: #333;
    transition: transform 0.3s;
}

.dark-mode-toggle:hover {
    transform: rotate(20deg);
}

/* Hero Banner */
.hero {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
    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.05) 0%, transparent 70%);
    animation: heroGlow 10s ease-in-out infinite;
}

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

.banner-slider {
    position: relative;
    overflow: hidden;
}

.banner-slide {
    display: none;
    animation: fadeSlide 0.8s ease;
}

.banner-slide.active {
    display: block;
}

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

.hero h1 {
    font-size: 42px;
    margin-bottom: 20px;
    position: relative;
}

.hero p {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto 30px;
    position: relative;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #ff6f00;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.btn:hover {
    background: #e65100;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

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

.banner-nav button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.banner-nav button.active {
    background: #fff;
    transform: scale(1.3);
}

/* 通用区块 */
.section {
    padding: 60px 0;
    opacity: 0;
    transform: translateY(30px);
    animation: sectionFadeIn 0.8s ease forwards;
}

@keyframes sectionFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.section:nth-child(odd) { animation-delay: 0.1s; }
.section:nth-child(even) { animation-delay: 0.2s; }

.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #1a73e8, #ff6f00);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* 网格布局 */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* 卡片 */
.card {
    background: rgba(249, 249, 249, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 25px;
    border-radius: 16px;
    transition: transform 0.4s, box-shadow 0.4s, background 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    background: rgba(249, 249, 249, 0.95);
}

.card h3 {
    margin-bottom: 15px;
    color: #1a73e8;
}

.card p {
    color: #555;
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
    transition: border-color 0.3s;
}

.faq-question {
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s;
}

.faq-question:hover {
    color: #1a73e8;
}

.faq-answer {
    display: none;
    padding-top: 10px;
    color: #555;
    animation: faqSlide 0.3s ease;
}

.faq-answer.active {
    display: block;
}

@keyframes faqSlide {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 200px; }
}

/* HowTo */
.howto-step {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateX(-20px);
    animation: stepSlide 0.6s ease forwards;
}

.howto-step:nth-child(1) { animation-delay: 0.1s; }
.howto-step:nth-child(2) { animation-delay: 0.2s; }
.howto-step:nth-child(3) { animation-delay: 0.3s; }
.howto-step:nth-child(4) { animation-delay: 0.4s; }
.howto-step:nth-child(5) { animation-delay: 0.5s; }
.howto-step:nth-child(6) { animation-delay: 0.6s; }

@keyframes stepSlide {
    to { opacity: 1; transform: translateX(0); }
}

.howto-step .step-num {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    transition: transform 0.3s;
}

.howto-step:hover .step-num {
    transform: scale(1.15);
}

.howto-step .step-content {
    flex: 1;
}

/* 文章列表 */
.article-list {
    display: grid;
    gap: 20px;
}

.article-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    transition: transform 0.3s, border-color 0.3s;
}

.article-item:hover {
    transform: translateX(5px);
    border-color: #1a73e8;
}

.article-item h4 {
    margin-bottom: 5px;
    transition: color 0.3s;
}

.article-item:hover h4 {
    color: #1a73e8;
}

.article-item .meta {
    color: #888;
    font-size: 14px;
    margin-bottom: 8px;
}

.article-item p {
    color: #555;
}

.read-more {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s, padding-left 0.3s;
}

.read-more:hover {
    color: #0d47a1;
    padding-left: 5px;
}

/* 页脚 */
footer {
    background: linear-gradient(135deg, #222, #333);
    color: #ccc;
    padding: 40px 0;
    transition: background 0.3s;
}

footer a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s, padding-left 0.3s;
}

footer a:hover {
    color: #fff;
    padding-left: 3px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer-grid h4 {
    color: #fff;
    margin-bottom: 15px;
    position: relative;
}

.footer-grid h4::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: #ff6f00;
    margin-top: 5px;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    margin-top: 30px;
    text-align: center;
}

/* 回到顶部 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 24px;
    display: none;
    z-index: 999;
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.back-to-top.show {
    display: flex;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* 暗色模式 */
.dark-mode {
    background: #222;
    color: #eee;
}

.dark-mode header {
    background: rgba(51, 51, 51, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: #444;
}

.dark-mode .card {
    background: rgba(51, 51, 51, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(255,255,255,0.1);
}

.dark-mode .card:hover {
    background: rgba(51, 51, 51, 0.95);
}

.dark-mode .card h3 {
    color: #64b5f6;
}

.dark-mode .card p {
    color: #ccc;
}

.dark-mode footer {
    background: linear-gradient(135deg, #111, #222);
}

.dark-mode .faq-item {
    border-color: #444;
}

.dark-mode .article-item {
    border-color: #444;
}

.dark-mode .search-box input {
    background: #444;
    color: #eee;
    border-color: #555;
}

.dark-mode .search-box input:focus {
    border-color: #64b5f6;
}

.dark-mode .dark-mode-toggle {
    color: #eee;
}

.dark-mode nav a {
    color: #ccc;
}

.dark-mode nav a:hover {
    color: #64b5f6;
}

.dark-mode .section-title::after {
    background: linear-gradient(90deg, #64b5f6, #ff8a65);
}

.dark-mode .hero {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
}

.dark-mode .howto-step .step-num {
    background: linear-gradient(135deg, #64b5f6, #1a237e);
}

/* 响应式 */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .header-inner {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

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

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

    .section-title {
        font-size: 26px;
    }

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

    .search-box {
        width: 100%;
        justify-content: center;
    }

    .search-box input {
        width: 60%;
    }

    .banner-nav {
        bottom: 10px;
    }

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

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .btn {
        padding: 10px 20px;
    }

    .card {
        padding: 20px;
    }
}

/* 额外动画与效果 */
[class*="grid-"] > * {
    animation: cardPop 0.5s ease forwards;
    opacity: 0;
}

@keyframes cardPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.grid-3 > *:nth-child(1) { animation-delay: 0.05s; }
.grid-3 > *:nth-child(2) { animation-delay: 0.1s; }
.grid-3 > *:nth-child(3) { animation-delay: 0.15s; }
.grid-3 > *:nth-child(4) { animation-delay: 0.2s; }
.grid-3 > *:nth-child(5) { animation-delay: 0.25s; }
.grid-3 > *:nth-child(6) { animation-delay: 0.3s; }

.grid-2 > *:nth-child(1) { animation-delay: 0.05s; }
.grid-2 > *:nth-child(2) { animation-delay: 0.1s; }

.grid-4 > *:nth-child(1) { animation-delay: 0.05s; }
.grid-4 > *:nth-child(2) { animation-delay: 0.1s; }
.grid-4 > *:nth-child(3) { animation-delay: 0.15s; }
.grid-4 > *:nth-child(4) { animation-delay: 0.2s; }

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1557b0, #0a3a7a);
}

.dark-mode ::-webkit-scrollbar-track {
    background: #333;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #64b5f6, #1a237e);
}

/* 选中文本样式 */
::selection {
    background: #1a73e8;
    color: #fff;
}

.dark-mode ::selection {
    background: #64b5f6;
    color: #222;
}

/* 列表样式 */
ul[style*="list-style:disc"] li {
    margin-bottom: 8px;
    transition: padding-left 0.3s;
}

ul[style*="list-style:disc"] li:hover {
    padding-left: 5px;
    color: #1a73e8;
}

.dark-mode ul[style*="list-style:disc"] li:hover {
    color: #64b5f6;
}

/* 联系页面样式 */
#contact ul {
    list-style: none;
}

#contact ul li {
    margin-bottom: 8px;
}

#contact ul li a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.3s, padding-left 0.3s;
}

#contact ul li a:hover {
    color: #0d47a1;
    padding-left: 5px;
}

.dark-mode #contact ul li a {
    color: #64b5f6;
}

.dark-mode #contact ul li a:hover {
    color: #90caf9;
}