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

:root {
    --primary: #1a3c6e;
    --primary-dark: #0f2442;
    --primary-light: #2a5a9e;
    --accent: #f5a623;
    --accent-hover: #d48e1a;
    --bg: #f8f9fb;
    --card-bg: rgba(255,255,255,0.85);
    --card-border: rgba(255,255,255,0.3);
    --text: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255,255,255,0.6);
    --glass-border: rgba(255,255,255,0.25);
    --shadow: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-hero: linear-gradient(135deg, #1a3c6e 0%, #2a5a9e 50%, #3b7bc0 100%);
    --gradient-card: linear-gradient(145deg, #ffffff, #f0f2f6);
    --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --card-bg: rgba(30,41,59,0.85);
        --card-border: rgba(255,255,255,0.08);
        --text: #e2e8f0;
        --text-muted: #94a3b8;
        --glass-bg: rgba(30,41,59,0.6);
        --glass-border: rgba(255,255,255,0.08);
        --shadow: 0 8px 32px rgba(0,0,0,0.3);
        --shadow-hover: 0 12px 40px rgba(0,0,0,0.4);
        --gradient-card: linear-gradient(145deg, #1e293b, #0f172a);
        --gradient-hero: linear-gradient(135deg, #0f2442 0%, #1a3c6e 50%, #2a5a9e 100%);
    }
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    transition: background 0.4s ease, color 0.4s ease;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== 通用动画 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

section {
    animation: fadeInUp 0.7s ease forwards;
}

/* ===== 头部导航 ===== */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: background 0.3s ease;
}

header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

header nav a {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    position: relative;
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all var(--transition);
    transform: translateX(-50%);
    border-radius: 1px;
}

header nav a:hover {
    background: rgba(245,166,35,0.1);
    color: var(--accent);
}

header nav a:hover::after {
    width: 60%;
}

header form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

header input[type="search"] {
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    width: 200px;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}

header input[type="search"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
    width: 250px;
}

header button[type="submit"] {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.9rem;
}

header button[type="submit"]:hover {
    background: var(--primary-light);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(26,60,110,0.3);
}

/* ===== Hero 横幅 ===== */
#hero {
    background: var(--gradient-hero);
    color: white;
    text-align: center;
    padding: 5rem 2rem 4rem;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 var(--radius) var(--radius);
    margin: 0 1rem;
    box-shadow: 0 10px 40px rgba(26,60,110,0.2);
}

#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: shimmer 8s infinite linear;
    background-size: 200% 200%;
    pointer-events: none;
}

#hero h1 {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

#hero p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 650px;
    margin: 0 auto 1.5rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

#hero a {
    display: inline-block;
    background: var(--accent);
    color: #1e293b;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: 0 4px 15px rgba(245,166,35,0.3);
    position: relative;
    z-index: 1;
    font-size: 1rem;
}

#hero a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245,166,35,0.4);
    background: var(--accent-hover);
}

/* ===== 面包屑 ===== */
nav[aria-label="面包屑导航"] {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1.5rem;
}

nav[aria-label="面包屑导航"] ol {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

nav[aria-label="面包屑导航"] ol li::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-muted);
    opacity: 0.5;
}

nav[aria-label="面包屑导航"] ol li:last-child::after {
    content: none;
}

nav[aria-label="面包屑导航"] a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition);
}

nav[aria-label="面包屑导航"] a:hover {
    color: var(--accent);
}

/* ===== 通用卡片样式 ===== */
section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

section h2 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    color: var(--text);
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 0.5rem;
}

article, blockquote, details, .card-like {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

article:hover, blockquote:hover, details:hover, .card-like:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(245,166,35,0.2);
}

article h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

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

/* ===== 特定区域增强 ===== */
#brand, #products, #solutions, #cases, #news, #faq, #howto, #contact, #about, #sitemap, #links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

#brand h2, #products h2, #solutions h2, #cases h2, #testimonials h2, #news h2, #faq h2, #howto h2, #contact h2, #about h2, #sitemap h2, #links h2 {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
}

/* 平板及以上：两列布局 */
@media (min-width: 768px) {
    #brand, #products, #solutions, #cases, #news {
        grid-template-columns: repeat(2, 1fr);
    }
    #faq {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 桌面：三列布局 */
@media (min-width: 1024px) {
    #brand, #products, #solutions, #cases {
        grid-template-columns: repeat(3, 1fr);
    }
    #news {
        grid-template-columns: repeat(3, 1fr);
    }
    #faq {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== 客户评价 ===== */
#testimonials blockquote {
    background: var(--glass-bg);
    border-left: 4px solid var(--accent);
    padding: 1.5rem 2rem;
    position: relative;
    font-style: italic;
}

#testimonials blockquote p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text);
}

/* ===== 新闻卡片特殊处理 ===== */
#news article a {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}

#news article a::after {
    content: ' →';
    opacity: 0;
    transition: all var(--transition);
}

#news article a:hover {
    color: var(--accent-hover);
}

#news article a:hover::after {
    opacity: 1;
    margin-left: 0.25rem;
}

/* ===== FAQ details ===== */
details {
    cursor: pointer;
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-sm);
}

details summary {
    font-weight: 600;
    font-size: 1rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
}

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

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

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

details p {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

/* ===== HowTo 教程 ===== */
#howto {
    background: var(--gradient-card);
    border-radius: var(--radius);
    padding: 2rem;
}

#howto ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

#howto ol li {
    margin-bottom: 0.5rem;
    color: var(--text);
}

#howto p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

#howto strong {
    color: var(--text);
}

/* ===== 联系我们 ===== */
#contact p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

#contact strong {
    color: var(--text);
}

/* ===== 网站地图 & 友情链接 ===== */
#sitemap ul, #links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

#sitemap ul li a, #links ul li a {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition);
    backdrop-filter: blur(8px);
}

#sitemap ul li a:hover, #links ul li a:hover {
    background: var(--accent);
    color: #1e293b;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245,166,35,0.2);
}

/* ===== Footer ===== */
footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

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

footer a:hover {
    color: white;
    text-decoration: underline;
}

footer p:last-child {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===== 响应式微调 ===== */
@media (max-width: 640px) {
    header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: stretch;
    }
    header nav {
        justify-content: center;
        gap: 0.3rem;
    }
    header nav a {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    header form {
        justify-content: center;
    }
    header input[type="search"] {
        width: 140px;
    }
    header input[type="search"]:focus {
        width: 160px;
    }
    #hero {
        margin: 0 0.5rem;
        padding: 3rem 1rem 2.5rem;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    }
    section {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }
    article, blockquote, details {
        padding: 1rem;
    }
    #howto {
        padding: 1.25rem;
    }
    footer {
        padding: 1.5rem 1rem;
    }
}

/* ===== 平滑过渡与辅助 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 毛玻璃特效增强 ===== */
.glass-morphism {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

/* ===== 选中高亮 ===== */
::selection {
    background: var(--accent);
    color: #1e293b;
}

/* ===== 焦点样式 ===== */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== 暗色模式下的微调 ===== */
@media (prefers-color-scheme: dark) {
    header nav a:hover {
        background: rgba(245,166,35,0.15);
    }
    #hero a {
        color: #0f172a;
    }
    footer {
        background: #0a0f1a;
    }
}