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

:root {
    --color-primary: #1a1a2e;
    --color-accent: #f5c518;
    --color-accent-hover: #e0b314;
    --color-bg: #0f0f23;
    --color-bg-card: rgba(26, 26, 46, 0.85);
    --color-bg-glass: rgba(255, 255, 255, 0.08);
    --color-text: #e0e0e0;
    --color-text-heading: #ffffff;
    --color-text-muted: #a0a0b0;
    --color-border: rgba(245, 197, 24, 0.2);
    --color-shadow: rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
    --header-height: 72px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 暗色模式基础 (默认即为暗色) */
@media (prefers-color-scheme: light) {
    :root {
        --color-primary: #1a1a2e;
        --color-bg: #0f0f23;
        --color-bg-card: rgba(26, 26, 46, 0.9);
        --color-text: #e0e0e0;
        --color-text-heading: #ffffff;
        --color-text-muted: #a0a0b0;
    }
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover, a:focus-visible {
    color: var(--color-accent-hover);
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button, [role="button"] {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

/* ===== 滚动动画基础 ===== */
[data-aos] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Header / Nav ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
    transition: background var(--transition), box-shadow var(--transition);
}

header:hover,
header:focus-within {
    background: rgba(15, 15, 35, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

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

nav > div:first-child {
    flex-shrink: 0;
}

nav > div:first-child a {
    display: block;
    line-height: 0;
}

nav ul {
    display: flex;
    gap: 8px;
    align-items: center;
}

nav ul li a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: background var(--transition), color var(--transition), transform var(--transition);
    position: relative;
}

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

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

nav ul li a:hover {
    background: var(--color-bg-glass);
    color: var(--color-accent);
    transform: translateY(-1px);
}

nav > div:last-child {
    display: flex;
    gap: 12px;
    align-items: center;
}

nav > div:last-child a[role="button"] {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

nav > div:last-child a[role="button"]:first-child {
    background: var(--color-accent);
    color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(245, 197, 24, 0.3);
}

nav > div:last-child a[role="button"]:first-child:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(245, 197, 24, 0.4);
}

nav > div:last-child a[role="button"]:last-child {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

nav > div:last-child a[role="button"]:last-child:hover {
    background: var(--color-accent);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 197, 24, 0.3);
}

/* ===== 主内容 ===== */
main {
    padding-top: var(--header-height);
}

/* ===== 通用 Section ===== */
section {
    padding: 80px 24px;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
}

section h2 {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--color-text-heading);
    text-align: center;
    margin-bottom: 48px;
    position: relative;
    display: inline-block;
    width: 100%;
}

section h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), #ff8c00);
    margin: 16px auto 0;
    border-radius: 4px;
}

/* ===== 首页 Banner (渐变) ===== */
#home {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    min-height: calc(100vh - var(--header-height));
    padding-top: 40px;
    padding-bottom: 40px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin-bottom: 40px;
    max-width: 100%;
    padding-left: 5%;
    padding-right: 5%;
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(245, 197, 24, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 140, 0, 0.05) 0%, transparent 50%);
    animation: gradientShift 20s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(2%, 2%) rotate(3deg); }
}

#home > div:first-child {
    flex: 1;
    max-width: 600px;
    z-index: 1;
}

#home h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--color-text-heading);
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff, var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#home p {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    max-width: 480px;
}

#home > div:first-child > div {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

#home > div:first-child > div a[role="button"] {
    padding: 14px 36px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#home > div:first-child > div a[role="button"]:first-child {
    background: var(--color-accent);
    color: var(--color-primary);
    box-shadow: 0 8px 30px rgba(245, 197, 24, 0.3);
}

#home > div:first-child > div a[role="button"]:first-child:hover {
    background: var(--color-accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(245, 197, 24, 0.4);
}

#home > div:first-child > div a[role="button"]:last-child {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

#home > div:first-child > div a[role="button"]:last-child:hover {
    background: var(--color-accent);
    color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(245, 197, 24, 0.3);
}

#home > div:last-child {
    flex: 1;
    max-width: 500px;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#home > div:last-child img {
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform var(--transition), box-shadow var(--transition);
    width: 100%;
    height: auto;
}

#home > div:last-child img:hover {
    transform: scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* ===== About 区域 ===== */
#about {
    text-align: center;
}

#about > p {
    max-width: 800px;
    margin: 0 auto 24px;
    font-size: 1.05rem;
    color: var(--color-text);
}

#about > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

#about > div article {
    background: var(--color-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    text-align: center;
}

#about > div article:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--color-accent);
}

#about > div article h3 {
    font-size: 1.4rem;
    color: var(--color-accent);
    margin-bottom: 16px;
}

#about > div article p {
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ===== Products & Services (卡片网格) ===== */
#products > div,
#services > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

#products article,
#services article {
    background: var(--color-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    position: relative;
    overflow: hidden;
}

#products article::before,
#services article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), #ff8c00);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

#products article:hover::before,
#services article:hover::before {
    transform: scaleX(1);
}

#products article:hover,
#services article:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--color-accent);
}

#products article h3,
#services article h3 {
    font-size: 1.3rem;
    color: var(--color-accent);
    margin-bottom: 12px;
}

#products article p,
#services article p {
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ===== Insights 资讯 ===== */
#insights > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

#insights article {
    background: var(--color-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
}

#insights article:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
    border-color: var(--color-accent);
}

#insights article h3 {
    font-size: 1.15rem;
    color: var(--color-text-heading);
    margin-bottom: 10px;
    transition: color var(--transition);
}

#insights article:hover h3 {
    color: var(--color-accent);
}

#insights article p {
    color: var(--color-text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 16px;
}

#insights article time {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    opacity: 0.7;
}

#insights article a {
    align-self: flex-start;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-glass);
    color: var(--color-accent);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background var(--transition), color var(--transition), transform var(--transition);
    border: 1px solid var(--color-border);
}

#insights article a:hover {
    background: var(--color-accent);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* ===== FAQ (毛玻璃折叠) ===== */
#faq > div {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

details {
    background: var(--color-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

details:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

details[open] {
    border-color: var(--color-accent);
    box-shadow: 0 6px 30px rgba(245, 197, 24, 0.1);
}

summary {
    padding: 18px 24px;
    font-weight: 600;
    color: var(--color-text-heading);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color var(--transition), background var(--transition);
    user-select: none;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--color-accent);
    transition: transform 0.3s ease;
    line-height: 1;
}

details[open] summary::after {
    transform: rotate(45deg);
}

summary:hover {
    background: var(--color-bg-glass);
    color: var(--color-accent);
}

details p {
    padding: 0 24px 18px;
    color: var(--color-text-muted);
    line-height: 1.7;
    animation: fadeInUp 0.3s ease;
}

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

/* ===== HowTo ===== */
#howto {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px;
}

#howto h2 {
    text-align: center;
}

#howto > p {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 32px;
}

#howto ol {
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#howto ol li {
    counter-increment: step;
    padding: 20px 24px 20px 60px;
    background: var(--color-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    color: var(--color-text);
    line-height: 1.6;
}

#howto ol li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

#howto ol li:hover {
    transform: translateX(6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--color-accent);
}

#howto ol li strong {
    color: var(--color-accent);
}

#howto > p:last-child {
    text-align: center;
    margin-top: 24px;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    opacity: 0.8;
}

/* ===== Contact ===== */
#contact {
    text-align: center;
}

#contact address {
    font-style: normal;
    background: var(--color-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 40px 32px;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform var(--transition), box-shadow var(--transition);
}

#contact address:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
    border-color: var(--color-accent);
}

#contact address p {
    color: var(--color-text);
    font-size: 1.05rem;
}

#contact address p:first-child {
    color: var(--color-accent);
    font-weight: 600;
}

/* ===== Footer ===== */
footer {
    background: var(--color-primary);
    border-top: 1px solid var(--color-border);
    padding: 48px 24px 24px;
    margin-top: 40px;
}

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

footer h3 {
    color: var(--color-accent);
    font-size: 1.1rem;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

footer h3::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: var(--color-accent);
    margin-top: 8px;
    border-radius: 2px;
}

footer p {
    color: var(--color-text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

footer ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

footer ul li a {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    transition: color var(--transition), padding-left var(--transition);
}

footer ul li a:hover {
    color: var(--color-accent);
    padding-left: 4px;
}

footer > div:last-child {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

footer > div:last-child p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* ===== Back to Top ===== */
#back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-primary);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(245, 197, 24, 0.3);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

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

#back-to-top:hover {
    background: var(--color-accent-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(245, 197, 24, 0.4);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    #home {
        flex-direction: column;
        text-align: center;
        padding-top: 60px;
        padding-bottom: 60px;
        min-height: auto;
    }

    #home > div:first-child {
        max-width: 100%;
    }

    #home h1 {
        font-size: 2.8rem;
    }

    #home p {
        margin: 0 auto 32px;
    }

    #home > div:first-child > div {
        justify-content: center;
    }

    #home > div:last-child {
        max-width: 400px;
    }

    section {
        padding: 60px 20px;
    }

    section h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    nav ul {
        display: none; /* 移动端导航可扩展为汉堡菜单，此处简化 */
    }

    nav > div:last-child {
        gap: 8px;
    }

    nav > div:last-child a[role="button"] {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    #home h1 {
        font-size: 2.2rem;
    }

    #home p {
        font-size: 1rem;
    }

    #home > div:first-child > div a[role="button"] {
        padding: 12px 28px;
        font-size: 0.9rem;
    }

    section {
        padding: 48px 16px;
    }

    section h2 {
        font-size: 1.7rem;
        margin-bottom: 32px;
    }

    #about > div,
    #products > div,
    #services > div,
    #insights > div {
        grid-template-columns: 1fr;
    }

    footer > div:first-child {
        grid-template-columns: 1fr 1fr;
    }

    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    #home h1 {
        font-size: 1.8rem;
    }

    #home p {
        font-size: 0.9rem;
    }

    #home > div:first-child > div {
        flex-direction: column;
        align-items: center;
    }

    #home > div:first-child > div a[role="button"] {
        width: 100%;
        max-width: 280px;
    }

    section h2 {
        font-size: 1.4rem;
    }

    footer > div:first-child {
        grid-template-columns: 1fr;
        text-align: center;
    }

    footer h3::after {
        margin: 8px auto 0;
    }
}

/* ===== 辅助功能 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ===== 打印样式 ===== */
@media print {
    header, footer, #back-to-top {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    section {
        padding: 20px 0;
        page-break-inside: avoid;
    }
}