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

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: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* 暗色模式 */
body.dark-mode {
    background: linear-gradient(135deg, #0b1a2e 0%, #1a2a4a 100%);
    color: #e0e0e0;
}

body.dark-mode section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3 {
    color: #f0c040;
}

body.dark-mode p,
body.dark-mode li,
body.dark-mode blockquote p {
    color: #c0c0c0;
}

body.dark-mode header {
    background: rgba(11, 26, 46, 0.95);
    border-bottom: 1px solid rgba(240, 192, 64, 0.3);
}

body.dark-mode nav ul li a {
    color: #e0e0e0;
}

body.dark-mode nav ul li a:hover {
    color: #f0c040;
}

body.dark-mode article {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(240, 192, 64, 0.2);
}

body.dark-mode details {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode details[open] {
    background: rgba(240, 192, 64, 0.1);
}

body.dark-mode footer {
    background: rgba(11, 26, 46, 0.98);
    border-top: 1px solid rgba(240, 192, 64, 0.3);
}

body.dark-mode #searchModal > div {
    background: rgba(11, 26, 46, 0.98);
    border: 1px solid rgba(240, 192, 64, 0.3);
}

body.dark-mode #searchInput {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(240, 192, 64, 0.3);
}

body.dark-mode #backToTop {
    background: #f0c040;
    color: #0b1a2e;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 通用section样式 */
section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.6s ease-out;
    transition: all 0.3s ease;
}

section:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #1a3a5c;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #f0c040, #1a3a5c);
    border-radius: 2px;
    transition: width 0.3s ease;
}

section:hover h2::after {
    width: 100px;
}

/* 头部导航 */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav ul li a {
    text-decoration: none;
    color: #1a1a2e;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #f0c040;
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 80%;
}

nav ul li a:hover {
    color: #1a3a5c;
    background: rgba(240, 192, 64, 0.1);
}

nav button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

nav button:hover {
    background: rgba(240, 192, 64, 0.2);
    transform: scale(1.1);
}

/* Hero 区域 */
#hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 50%, #f0c040 100%);
    color: #fff;
    padding: 3rem 2rem;
    border: none;
    border-radius: 24px;
    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 70%);
    animation: shimmer 8s linear infinite;
    pointer-events: none;
}

#hero > div:first-child {
    flex: 1;
    z-index: 1;
}

#hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

#hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.9);
    max-width: 500px;
}

#hero div[role="button"] a,
#hero a[role="button"] {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

#hero a[role="button"]:first-child {
    background: #f0c040;
    color: #1a3a5c;
}

#hero a[role="button"]:first-child:hover {
    background: #e0b030;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(240, 192, 64, 0.4);
}

#hero a[role="button"]:last-child {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

#hero a[role="button"]:last-child:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-3px);
}

#hero > div:last-child {
    flex: 0 0 auto;
    z-index: 1;
}

#hero svg {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* About 区域 */
#about > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

#about > div > div {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    animation: scaleIn 0.5s ease-out;
}

#about > div > div:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 0.8);
}

#about h3 {
    color: #1a3a5c;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

/* Products 区域 */
#products > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

#products article {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    transition: all 0.4s ease;
    cursor: default;
    animation: fadeInUp 0.6s ease-out;
}

#products article:nth-child(2) { animation-delay: 0.1s; }
#products article:nth-child(3) { animation-delay: 0.2s; }
#products article:nth-child(4) { animation-delay: 0.3s; }

#products article:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 0.9);
    border-color: #f0c040;
}

#products article svg {
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

#products article:hover svg {
    transform: rotate(10deg) scale(1.1);
}

#products h3 {
    color: #1a3a5c;
    margin-bottom: 0.8rem;
}

/* Services 区域 */
#services > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

#services > div > div {
    background: linear-gradient(135deg, rgba(26,58,92,0.05) 0%, rgba(240,192,64,0.05) 100%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(26,58,92,0.1);
    transition: all 0.3s ease;
}

#services > div > div:hover {
    background: linear-gradient(135deg, rgba(26,58,92,0.1) 0%, rgba(240,192,64,0.1) 100%);
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

#services h3 {
    color: #1a3a5c;
    margin-bottom: 0.8rem;
}

/* Insights 区域 */
#insights > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

#insights article {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

#insights article:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    background: rgba(255, 255, 255, 0.8);
}

#insights time {
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: #888;
    background: rgba(240, 192, 64, 0.2);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
}

/* FAQ 区域 */
#faq > div {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

details {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

details:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

details[open] {
    background: rgba(240, 192, 64, 0.1);
    border-color: #f0c040;
}

details summary {
    font-weight: 600;
    color: #1a3a5c;
    padding: 0.3rem 0;
    outline: none;
}

details summary::-webkit-details-marker {
    color: #f0c040;
}

details p {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    color: #555;
}

/* HowTo 区域 */
#howto ol {
    padding-left: 1.5rem;
    list-style-position: inside;
}

#howto li {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

#howto li:hover {
    padding-left: 1rem;
    background: rgba(240, 192, 64, 0.05);
    border-radius: 8px;
}

#howto li:last-child {
    border-bottom: none;
}

#howto li strong {
    color: #1a3a5c;
}

/* Testimonials 区域 */
#testimonials > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

blockquote {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    transition: all 0.3s ease;
}

blockquote::before {
    content: '"';
    font-size: 3rem;
    color: #f0c040;
    position: absolute;
    top: -5px;
    left: 15px;
    opacity: 0.3;
}

blockquote:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

blockquote footer {
    margin-top: 1rem;
    font-style: italic;
    color: #888;
    background: none;
    border: none;
    padding: 0;
}

/* Contact 区域 */
#contact > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

#contact p {
    margin-bottom: 0.5rem;
}

#contact strong {
    color: #1a3a5c;
}

/* 页脚 */
footer {
    background: rgba(26, 58, 92, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #e0e0e0;
    padding: 2rem 1.5rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(240, 192, 64, 0.3);
}

footer > div:first-child {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

footer h3 {
    color: #f0c040;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

footer ul {
    list-style: none;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer ul li a {
    color: #c0c0c0;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer ul li a:hover {
    color: #f0c040;
}

footer > div:last-child {
    max-width: 1200px;
    margin: 1.5rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
}

/* 搜索弹窗 */
#searchModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeInUp 0.3s ease;
}

#searchModal[hidden] {
    display: none;
}

#searchModal > div {
    background: rgba(255, 255, 255, 0.98);
    padding: 2rem;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

#searchModal form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#searchModal label {
    font-weight: 600;
    color: #1a3a5c;
}

#searchInput {
    padding: 0.8rem 1rem;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    outline: none;
}

#searchInput:focus {
    border-color: #f0c040;
    box-shadow: 0 0 0 3px rgba(240, 192, 64, 0.2);
}

#searchModal button[type="submit"] {
    background: #f0c040;
    color: #1a3a5c;
    border: none;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#searchModal button[type="submit"]:hover {
    background: #e0b030;
    transform: translateY(-2px);
}

#closeSearch {
    background: transparent;
    border: 1px solid #ddd;
    padding: 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#closeSearch:hover {
    background: #f5f5f5;
    border-color: #aaa;
}

/* 返回顶部按钮 */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1a3a5c;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#backToTop:hover {
    background: #f0c040;
    color: #1a3a5c;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(240, 192, 64, 0.4);
}

/* 响应式布局 */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    section {
        margin: 1rem;
        padding: 1.5rem 1rem;
    }

    #hero {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }

    #hero h1 {
        font-size: 1.8rem;
    }

    #hero p {
        max-width: 100%;
    }

    #hero > div:last-child {
        width: 100%;
    }

    #hero svg {
        max-width: 100%;
        height: auto;
    }

    nav {
        padding: 0.6rem 1rem;
    }

    nav ul {
        gap: 0.5rem;
        justify-content: center;
        width: 100%;
        order: 3;
        margin-top: 0.5rem;
    }

    nav ul li a {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    #about > div,
    #products > div,
    #services > div,
    #insights > div,
    #testimonials > div,
    #contact > div,
    footer > div:first-child {
        grid-template-columns: 1fr;
    }

    #searchModal > div {
        padding: 1.5rem;
    }

    #backToTop {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    section {
        padding: 1rem 0.8rem;
    }

    #hero h1 {
        font-size: 1.5rem;
    }

    #hero p {
        font-size: 0.95rem;
    }

    #hero a[role="button"] {
        display: block;
        margin: 0.5rem auto;
        width: 80%;
        text-align: center;
    }

    nav ul li a {
        font-size: 0.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }
}

/* 滚动动画支持（利用Intersection Observer的备用方案） */
@media (prefers-reduced-motion: no-preference) {
    section {
        opacity: 0;
        animation: fadeInUp 0.6s ease-out forwards;
    }

    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; }
}

/* 平滑过渡与工具类 */
.transition-all {
    transition: all 0.3s ease;
}

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

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1a3a5c, #f0c040);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2a5a8c, #e0b030);
}

/* 暗色模式滚动条 */
body.dark-mode ::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f0c040, #1a3a5c);
}