/* 全局样式重置与基础 */
* {
    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.4s ease, color 0.4s ease;
}

a {
    color: #f5a623;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #d48a1a;
}

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

/* 头部导航（毛玻璃效果） */
header {
    background: rgba(245, 166, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background 0.4s ease;
}

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

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

nav a {
    color: #fff;
    margin-left: 20px;
    font-size: 16px;
    position: relative;
    transition: color 0.3s ease;
}

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

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

nav a:hover {
    text-decoration: none;
    color: #ffe0b2;
}

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

.search-box input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    background: rgba(255,255,255,0.9);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.search-box input:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
    outline: none;
}

.search-box button {
    padding: 8px 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.search-box button:hover {
    background: #555;
    transform: scale(1.02);
}

/* 渐变Banner */
.hero {
    background: linear-gradient(135deg, #fdf6e3, #f5a623, #e8912e);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero h1 {
    font-size: 48px;
    color: #333;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 20px;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease 0.2s both;
}

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

/* 通用区块 */
.section {
    padding: 60px 0;
    transition: background 0.4s ease;
}

.section h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #f5a623;
    margin: 12px auto 0;
    border-radius: 2px;
}

.section h3 {
    font-size: 24px;
    color: #444;
    margin-bottom: 20px;
}

.section h4 {
    font-size: 20px;
    color: #555;
    margin-bottom: 15px;
}

/* 网格布局与圆角卡片 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: rgba(249, 249, 249, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease;
    border: 1px solid rgba(255,255,255,0.3);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.9);
}

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

.card p {
    color: #666;
    transition: color 0.3s ease;
}

/* 文章列表 */
.article-list {
    margin-top: 20px;
}

.article-item {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease, padding-left 0.3s ease;
    border-radius: 8px;
    padding-left: 10px;
}

.article-item:hover {
    background: rgba(245, 166, 35, 0.05);
    padding-left: 20px;
}

.article-item h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #333;
}

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

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

/* FAQ 手风琴 */
.faq-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 8px;
    padding-left: 10px;
}

.faq-item:hover {
    background: rgba(245, 166, 35, 0.03);
}

.faq-item h3 {
    font-size: 18px;
    margin-bottom: 5px;
    position: relative;
    padding-right: 30px;
}

.faq-item h3::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 0;
    font-size: 22px;
    color: #f5a623;
    transition: transform 0.3s ease;
}

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

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

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

@keyframes fadeIn {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

/* HowTo 步骤 */
.howto-steps {
    counter-reset: step;
}

.howto-step {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    transition: padding-left 0.3s ease;
}

.howto-step:hover {
    padding-left: 10px;
}

.howto-step::before {
    counter-increment: step;
    content: "步骤 " counter(step) ": ";
    font-weight: bold;
    color: #f5a623;
}

/* 页脚 */
footer {
    background: #333;
    color: #fff;
    padding: 40px 0;
    transition: background 0.4s ease;
}

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

footer h4 {
    margin-bottom: 15px;
    color: #f5a623;
}

footer a {
    color: #ddd;
    display: block;
    margin-bottom: 8px;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

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

.copyright {
    text-align: center;
    padding: 20px 0;
    background: #222;
    color: #aaa;
    font-size: 14px;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #f5a623;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
    z-index: 999;
}

.back-to-top:hover {
    opacity: 1;
    transform: scale(1.1) translateY(-2px);
    background: #d48a1a;
}

/* 暗黑模式切换按钮 */
.dark-mode-toggle {
    position: fixed;
    bottom: 90px;
    right: 30px;
    background: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease, transform 0.3s ease, color 0.3s ease;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.dark-mode-toggle:hover {
    transform: scale(1.05);
    background: #555;
}

/* 暗黑模式样式 */
body.dark-mode {
    background: #1a1a1a;
    color: #ddd;
}

body.dark-mode header {
    background: rgba(40, 40, 40, 0.9);
    backdrop-filter: blur(12px);
}

body.dark-mode .hero {
    background: linear-gradient(135deg, #2a2a2a, #444, #333);
}

body.dark-mode .hero h1 {
    color: #f5a623;
}

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

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

body.dark-mode .card:hover {
    background: rgba(60, 60, 60, 0.9);
}

body.dark-mode .card h3 {
    color: #f0f0f0;
}

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

body.dark-mode .section h2 {
    color: #eee;
}

body.dark-mode .section h3 {
    color: #ddd;
}

body.dark-mode .section h4 {
    color: #ccc;
}

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

body.dark-mode .article-item:hover {
    background: rgba(245, 166, 35, 0.1);
}

body.dark-mode .article-item h3 {
    color: #eee;
}

body.dark-mode .article-item .meta {
    color: #aaa;
}

body.dark-mode .article-item p {
    color: #bbb;
}

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

body.dark-mode .faq-item:hover {
    background: rgba(245, 166, 35, 0.08);
}

body.dark-mode .faq-item h3 {
    color: #eee;
}

body.dark-mode .faq-item .answer {
    color: #bbb;
}

body.dark-mode .howto-step {
    border-color: #444;
}

body.dark-mode footer {
    background: #222;
}

body.dark-mode .copyright {
    background: #111;
    color: #888;
}

body.dark-mode .search-box input {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

body.dark-mode .search-box input:focus {
    background: rgba(255,255,255,0.2);
}

body.dark-mode .search-box button {
    background: #f5a623;
    color: #222;
}

body.dark-mode .search-box button:hover {
    background: #d48a1a;
}

body.dark-mode .back-to-top {
    background: #f5a623;
    color: #222;
}

body.dark-mode .dark-mode-toggle {
    background: #f5a623;
    color: #222;
}

body.dark-mode .dark-mode-toggle:hover {
    background: #d48a1a;
}

/* 滚动动画（通用） */
.section {
    animation: sectionFadeIn 0.6s ease both;
}

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

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

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

/* 响应式布局 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    nav a {
        margin-left: 10px;
        font-size: 14px;
    }
    
    .search-box input {
        width: 100px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .section h2 {
        font-size: 26px;
    }
    
    .card {
        padding: 20px;
    }
    
    footer .container {
        grid-template-columns: 1fr;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .dark-mode-toggle {
        bottom: 70px;
        right: 20px;
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    header .container {
        flex-direction: column;
        gap: 10px;
    }
    
    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav a {
        margin: 0 8px;
        font-size: 13px;
    }
    
    .search-box {
        width: 100%;
        justify-content: center;
    }
    
    .search-box input {
        width: 60%;
    }
    
    .hero h1 {
        font-size: 26px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section h2 {
        font-size: 22px;
        margin-bottom: 30px;
    }
}

/* 其他增强 */
::selection {
    background: #f5a623;
    color: #fff;
}

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #f5a623;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d48a1a;
}

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

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #f5a623;
}