/* 基础重置与暗色模式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: #1a1a2e;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}
body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}
a {
    color: #f5c518;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
h1, h2, h3 {
    font-weight: 600;
}
h1 {
    font-size: 2.5rem;
}
h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}
h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
p {
    margin-bottom: 1rem;
}
ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* 布局 */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1a1a2e;
    color: white;
    padding: 0.75rem 2rem;
}
body.dark-mode header {
    background: #0d0d1a;
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
nav ul li a {
    color: white;
    font-weight: 500;
    padding: 0.25rem 0;
    transition: color 0.3s, border-bottom 0.3s;
}
nav ul li a:hover {
    color: #f5c518;
    text-decoration: none;
}
nav ul li a.active {
    border-bottom: 2px solid #f5c518;
}
nav ul.open {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
}
nav button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: transform 0.3s, opacity 0.3s;
}
nav button:hover {
    transform: scale(1.1);
    opacity: 0.8;
}
@media (max-width: 768px) {
    nav ul {
        display: none;
    }
    nav ul.open {
        display: flex;
    }
}
@media (min-width: 769px) {
    #menuToggle {
        display: none;
    }
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero - 渐变Banner + 毛玻璃效果 */
#hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 0;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 24px;
    padding: 3rem 2rem;
    margin: 2rem 0;
    overflow: hidden;
}
#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245,197,24,0.1) 0%, transparent 60%);
    animation: heroGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes heroGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20%, 20%); }
}
#hero > div:first-child {
    flex: 1;
    min-width: 280px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(4px);
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}
#hero h1 {
    color: white;
    font-size: 3rem;
}
#hero h1 span {
    color: #f5c518;
}
#hero > div:first-child p {
    color: rgba(255,255,255,0.9);
}
#hero a[role="button"] {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    margin-right: 1rem;
    margin-top: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}
#hero a[role="button"]:first-of-type {
    background: #f5c518;
    color: #1a1a2e;
}
#hero a[role="button"]:first-of-type:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(245,197,24,0.4);
    text-decoration: none;
}
#hero a[role="button"]:last-of-type {
    border: 2px solid #f5c518;
    color: #f5c518;
}
#hero a[role="button"]:last-of-type:hover {
    background: #f5c518;
    color: #1a1a2e;
    transform: translateY(-3px);
    text-decoration: none;
}
#hero svg {
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 20px rgba(245,197,24,0.3));
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 关于 - 圆角卡片 + 毛玻璃 */
#about {
    padding: 3rem 0;
}
#about > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
#about article {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 1.5rem;
    border-radius: 16px;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}
#about article:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.8);
}
body.dark-mode #about article {
    background: rgba(30,30,46,0.6);
    border-color: rgba(255,255,255,0.1);
}
body.dark-mode #about article:hover {
    background: rgba(30,30,46,0.9);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

/* 服务 - 圆角卡片 + 毛玻璃 */
#services {
    padding: 3rem 0;
}
#services > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
#services article {
    background: rgba(248,249,250,0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}
#services article:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    background: rgba(248,249,250,0.9);
}
body.dark-mode #services article {
    background: rgba(30,30,46,0.5);
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode #services article:hover {
    background: rgba(30,30,46,0.8);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}
#services article svg {
    margin-bottom: 1rem;
    transition: transform 0.3s;
}
#services article:hover svg {
    transform: rotate(10deg) scale(1.1);
}

/* 优势 - 圆角卡片 */
#features {
    padding: 3rem 0;
}
#features > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
#features article {
    background: #f0f0f5;
    padding: 1.5rem;
    border-radius: 16px;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}
#features article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    background: #e8e8f0;
}
body.dark-mode #features article {
    background: #2a2a3a;
}
body.dark-mode #features article:hover {
    background: #33334a;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* 资源 - 圆角卡片 */
#resources {
    padding: 3rem 0;
}
#resources > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
#resources article {
    background: rgba(248,249,250,0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem;
    border-radius: 16px;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}
#resources article:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    background: rgba(248,249,250,0.9);
}
body.dark-mode #resources article {
    background: rgba(30,30,46,0.5);
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode #resources article:hover {
    background: rgba(30,30,46,0.8);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
#resources article a {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 500;
    transition: color 0.3s, transform 0.3s;
}
#resources article a:hover {
    color: #d4a800;
    transform: translateX(4px);
    text-decoration: none;
}

/* HowTo */
#howto {
    padding: 3rem 0;
}
#howto ol li {
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(245,197,24,0.05);
    border-left: 3px solid #f5c518;
    border-radius: 0 8px 8px 0;
    transition: transform 0.3s, background 0.3s;
}
#howto ol li:hover {
    transform: translateX(5px);
    background: rgba(245,197,24,0.1);
}

/* FAQ - 毛玻璃手风琴 */
#faq {
    padding: 3rem 0;
}
#faq details {
    margin-bottom: 0.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(6px);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
#faq details:hover {
    background: rgba(255,255,255,0.6);
    border-color: rgba(245,197,24,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
body.dark-mode #faq details {
    border-color: rgba(255,255,255,0.1);
    background: rgba(30,30,46,0.3);
}
body.dark-mode #faq details:hover {
    background: rgba(30,30,46,0.5);
    border-color: rgba(245,197,24,0.2);
}
#faq summary {
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s;
}
#faq summary:hover {
    color: #f5c518;
}
#faq details[open] summary {
    margin-bottom: 0.5rem;
    color: #f5c518;
}
#faq details[open] {
    background: rgba(245,197,24,0.05);
    border-color: #f5c518;
}

/* 联系 */
#contact {
    padding: 3rem 0;
}
#contact address {
    font-style: normal;
    line-height: 2;
    background: rgba(245,197,24,0.03);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(245,197,24,0.1);
    transition: background 0.3s;
}
#contact address:hover {
    background: rgba(245,197,24,0.06);
}

/* 底部 */
footer {
    background: #1a1a2e;
    color: white;
    padding: 2rem;
    margin-top: 3rem;
}
body.dark-mode footer {
    background: #0d0d1a;
}
footer nav a {
    color: #f5c518;
    margin-right: 1rem;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}
footer nav a:hover {
    color: #d4a800;
    transform: translateY(-2px);
    text-decoration: none;
}

/* 返回顶部 - 毛玻璃 */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(245,197,24,0.8);
    backdrop-filter: blur(8px);
    color: #1a1a2e;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 200;
    transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
}
#backToTop:hover {
    transform: translateY(-5px) scale(1.1);
    background: #f5c518;
    box-shadow: 0 8px 25px rgba(245,197,24,0.4);
}

/* 搜索模态 - 毛玻璃 */
#searchModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    z-index: 300;
    justify-content: center;
    align-items: center;
}
#searchModal > div {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    display: flex;
    gap: 1rem;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
body.dark-mode #searchModal > div {
    background: rgba(42,42,58,0.9);
    border-color: rgba(255,255,255,0.1);
}
#searchModal input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255,255,255,0.8);
    transition: border-color 0.3s, box-shadow 0.3s;
}
#searchModal input:focus {
    outline: none;
    border-color: #f5c518;
    box-shadow: 0 0 0 3px rgba(245,197,24,0.2);
}
#searchModal button {
    padding: 0.75rem 1.5rem;
    background: #f5c518;
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}
#searchModal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245,197,24,0.4);
}
#searchClose {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s, transform 0.3s;
}
#searchClose:hover {
    color: #1a1a2e;
    transform: rotate(90deg);
}

/* 滚动监听 active */
nav ul li a.active {
    border-bottom: 2px solid #f5c518;
}

/* 滚动动画 - 使用 IntersectionObserver 的 fallback 过渡 */
section {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* 延迟动画使效果更平滑 */
#hero { animation-delay: 0s; }
#about { animation-delay: 0.1s; }
#services { animation-delay: 0.2s; }
#features { animation-delay: 0.3s; }
#resources { animation-delay: 0.4s; }
#howto { animation-delay: 0.5s; }
#faq { animation-delay: 0.6s; }
#contact { animation-delay: 0.7s; }

/* 响应式 */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    #hero {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
    }
    #hero h1 {
        font-size: 2.2rem;
    }
    #hero a[role="button"] {
        display: block;
        margin: 0.5rem auto;
        width: fit-content;
    }
    #searchModal > div {
        flex-direction: column;
        padding: 1.5rem;
    }
    #backToTop {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
@media (max-width: 768px) {
    header {
        padding: 0.5rem 1rem;
    }
    nav ul.open {
        gap: 0.75rem;
    }
    main {
        padding: 0 1rem;
    }
}