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

:root {
    --color-primary: #ff6f00;
    --color-primary-light: #ff8f00;
    --color-primary-dark: #e65c00;
    --color-bg: #fefcf9;
    --color-bg-alt: #f5f0eb;
    --color-bg-card: rgba(255, 255, 255, 0.85);
    --color-text: #2c2c2c;
    --color-text-muted: #5a5a5a;
    --color-border: #e0d6cc;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --color-hero-start: #fff7e6;
    --color-hero-end: #ffe0b2;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    --font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --max-width: 1200px;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1a1a1e;
        --color-bg-alt: #25252b;
        --color-bg-card: rgba(30, 30, 36, 0.85);
        --color-text: #e8e6e3;
        --color-text-muted: #a8a6a3;
        --color-border: #3a3a42;
        --color-shadow: rgba(0, 0, 0, 0.4);
        --color-hero-start: #2a2015;
        --color-hero-end: #3a2a1a;
        --glass-bg: rgba(30, 30, 36, 0.7);
        --glass-border: rgba(255, 255, 255, 0.08);
    }
}

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

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--color-primary-light);
}

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

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin-bottom: 0.5rem;
}

h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
}

p {
    margin-bottom: 0.8rem;
    color: var(--color-text-muted);
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.3rem;
}

/* 面包屑导航 */
nav[aria-label="面包屑导航"] {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
}

nav[aria-label="面包屑导航"] ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0;
}

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

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

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

/* 吸顶导航 (header 已内联样式, 这里覆盖补充) */
#site-header {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--color-primary) !important;
    box-shadow: 0 2px 20px var(--color-shadow);
    padding: 0.6rem 1.2rem !important;
    transition: background var(--transition);
}

#site-header div[style*="font-size"] {
    font-size: 1.4rem !important;
}

#site-header nav ul {
    gap: 1rem !important;
}

#site-header nav a {
    color: var(--color-text);
    font-weight: 500;
    padding: 0.3rem 0;
    position: relative;
    transition: color var(--transition);
}

#site-header nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition);
}

#site-header nav a:hover {
    color: var(--color-primary);
}

#site-header nav a:hover::after {
    width: 100%;
}

#site-header form input[type="search"] {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border) !important;
    border-radius: 20px;
    padding: 0.3rem 0.8rem !important;
    font-size: 0.9rem;
    transition: border var(--transition), box-shadow var(--transition);
}

#site-header form input[type="search"]:focus {
    outline: none;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.15);
}

#site-header form button {
    background: var(--color-primary) !important;
    border-radius: 20px !important;
    padding: 0.3rem 0.8rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform 0.2s;
}

#site-header form button:hover {
    background: var(--color-primary-dark) !important;
    transform: scale(1.03);
}

/* 首屏 Hero */
#hero {
    background: linear-gradient(135deg, var(--color-hero-start), var(--color-hero-end)) !important;
    padding: 4rem 1rem !important;
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: "";
    position: absolute;
    top: -30%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 111, 0, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

#hero h1 {
    color: var(--color-text);
    animation: fadeInUp 0.8s ease-out;
}

#hero p {
    color: var(--color-text-muted);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* 通用 section 样式 */
section {
    padding: 3rem 1rem !important;
}

section > div, 
section > article {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* 标题下划线 */
h2[style*="border-bottom"] {
    border-bottom: 3px solid var(--color-primary) !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 1.5rem;
    display: inline-block;
}

/* 品牌、产品、方案、案例等卡片化 */
#brand article,
#products article,
#solutions article,
#cases article {
    background: var(--color-bg-card);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: 0 4px 24px var(--color-shadow);
    border: 1px solid var(--glass-border);
    transition: transform var(--transition), box-shadow var(--transition);
}

#brand article:hover,
#products article:hover,
#solutions article:hover,
#cases article:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--color-shadow);
}

#products ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

#products ul li {
    background: var(--color-bg-alt);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--color-primary);
    font-weight: 500;
    transition: background var(--transition), transform 0.2s;
}

#products ul li:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateX(4px);
}

/* 客户评价 */
blockquote {
    background: var(--color-bg-alt);
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--color-text-muted);
    position: relative;
}

blockquote::before {
    content: "\201C";
    font-size: 2rem;
    color: var(--color-primary);
    position: absolute;
    top: -0.2rem;
    left: 0.5rem;
    opacity: 0.3;
}

/* 新闻网格 */
#news > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

#news article {
    background: var(--color-bg-card);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--color-shadow);
    border: 1px solid var(--glass-border);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

#news article:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px var(--color-shadow);
}

#news article h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

#news article h3 a {
    color: var(--color-text);
    transition: color var(--transition);
}

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

#news article time {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

#news article p {
    flex: 1;
    font-size: 0.95rem;
}

#news article > a {
    align-self: flex-start;
    margin-top: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    transition: color var(--transition);
}

#news article > a:hover {
    color: var(--color-primary-dark);
}

/* FAQ 手风琴 */
#faq details {
    background: var(--color-bg-card);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: var(--radius-sm);
    margin-bottom: 0.8rem;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

#faq details:hover {
    box-shadow: 0 4px 16px var(--color-shadow);
}

#faq summary {
    padding: 1rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition);
}

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

#faq summary::after {
    content: "+";
    font-size: 1.4rem;
    color: var(--color-primary);
    transition: transform 0.3s;
    line-height: 1;
}

#faq details[open] summary::after {
    content: "−";
    transform: rotate(180deg);
}

#faq details[open] summary {
    background: var(--color-bg-alt);
}

#faq details div {
    padding: 0 1.2rem 1rem 1.2rem;
}

#faq details div p {
    margin-bottom: 0;
}

/* HowTo 教程 */
#howto > div {
    background: var(--color-bg-card);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 4px 24px var(--color-shadow);
    border: 1px solid var(--glass-border);
}

#howto ol {
    list-style: none;
    counter-reset: step;
    padding: 0;
}

#howto ol li {
    counter-increment: step;
    padding: 1rem 1rem 1rem 3rem;
    position: relative;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 0.8rem;
    transition: transform var(--transition);
}

#howto ol li:hover {
    transform: translateX(4px);
}

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

#howto ol li span {
    font-weight: 700;
    display: block;
    margin-bottom: 0.2rem;
}

/* 底部 footer */
footer {
    background: #1e1e22 !important;
    color: #ccc !important;
    padding: 3rem 1rem !important;
}

footer h3 {
    color: var(--color-primary) !important;
    margin-top: 0;
    margin-bottom: 0.8rem;
}

footer a {
    color: #ccc !important;
    transition: color var(--transition);
}

footer a:hover {
    color: var(--color-primary) !important;
}

footer ul {
    list-style: none;
    padding: 0;
}

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

footer > div:last-child {
    border-top: 1px solid #3a3a42 !important;
    margin-top: 2rem;
    padding-top: 1.2rem;
    font-size: 0.9rem;
}

footer > div:last-child p {
    margin-bottom: 0.3rem;
    color: #aaa;
}

/* 返回顶部按钮 */
div[style*="position:fixed"][style*="bottom:2rem"] a {
    background: var(--color-primary) !important;
    border-radius: 30px !important;
    padding: 0.6rem 1.2rem !important;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(255, 111, 0, 0.3);
    transition: background var(--transition), transform 0.2s, box-shadow var(--transition);
}

div[style*="position:fixed"][style*="bottom:2rem"] a:hover {
    background: var(--color-primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 111, 0, 0.4);
}

/* 滚动动画 (使用 Intersection Observer 兼容, 这里提供基础class, 实际可用JS触发) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式 */
@media (max-width: 768px) {
    #site-header {
        flex-direction: column;
        gap: 0.6rem;
        padding: 0.6rem 0.8rem !important;
    }

    #site-header nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.6rem !important;
    }

    #site-header form {
        width: 100%;
        justify-content: center;
    }

    #site-header form input[type="search"] {
        flex: 1;
        max-width: 200px;
    }

    #hero {
        padding: 2.5rem 1rem !important;
    }

    section {
        padding: 2rem 0.8rem !important;
    }

    #products ul {
        grid-template-columns: 1fr;
    }

    #news > div {
        grid-template-columns: 1fr;
    }

    footer > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    #howto ol li {
        padding-left: 2.5rem;
    }

    #howto ol li::before {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
        left: 0.5rem;
    }
}

@media (max-width: 480px) {
    #site-header nav ul {
        gap: 0.4rem !important;
        font-size: 0.85rem;
    }

    #site-header nav a {
        padding: 0.2rem 0.4rem;
    }

    #brand article,
    #products article,
    #solutions article,
    #cases article,
    #howto > div {
        padding: 1.2rem;
    }

    #news article {
        padding: 1rem;
    }
}

/* 毛玻璃效果增强 (已在卡片中使用) */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

/* 自定义滚动条 (可选) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* 暗色模式下的微调 */
@media (prefers-color-scheme: dark) {
    #site-header {
        border-bottom-color: var(--color-primary) !important;
    }

    #hero::before {
        background: radial-gradient(circle, rgba(255, 111, 0, 0.12) 0%, transparent 70%);
    }

    blockquote {
        background: #2a2a30;
    }

    #faq details {
        background: rgba(30, 30, 36, 0.8);
    }

    #howto ol li {
        background: #2a2a30;
    }

    #products ul li {
        background: #2a2a30;
    }

    footer {
        background: #121216 !important;
    }
}

/* 打印样式 */
@media print {
    #site-header,
    div[style*="position:fixed"],
    #hero::before {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    a {
        color: #000 !important;
    }
}