/* style.css - 今年会官方网站 */
/* 随机风格：渐变Banner、圆角卡片、毛玻璃效果、响应式布局、暗色模式、滚动动画、hover动画 */

/* 基础重置与变量 */
:root {
    --primary: #1a3a5c;
    --primary-light: #2a5a8c;
    --primary-dark: #0f2a44;
    --accent: #f0a500;
    --accent-hover: #d49400;
    --bg: #f5f7fa;
    --bg-card: rgba(255,255,255,0.85);
    --bg-glass: rgba(255,255,255,0.6);
    --text: #222;
    --text-light: #555;
    --text-muted: #888;
    --border: #e0e4e8;
    --shadow: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-hover: 0 12px 40px rgba(0,0,0,0.15);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
    --banner-gradient: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 50%, #3a7abf 100%);
    --banner-overlay: linear-gradient(135deg, rgba(26,58,92,0.85) 0%, rgba(42,90,140,0.7) 100%);
}

/* 暗色模式 */
[data-theme="dark"] {
    --primary: #2a5a8c;
    --primary-light: #3a7abf;
    --primary-dark: #1a3a5c;
    --bg: #121820;
    --bg-card: rgba(30,40,55,0.9);
    --bg-glass: rgba(30,40,55,0.7);
    --text: #e8ecf0;
    --text-light: #b0b8c0;
    --text-muted: #788090;
    --border: #2a3040;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-hover: 0 12px 40px rgba(0,0,0,0.6);
    --banner-gradient: linear-gradient(135deg, #0f1a2a 0%, #1a3a5c 50%, #2a5a8c 100%);
    --banner-overlay: linear-gradient(135deg, rgba(15,26,42,0.9) 0%, rgba(26,58,92,0.8) 100%);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

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

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

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

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

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

/* 头部导航 */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    transition: background var(--transition), border-color var(--transition);
}

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

nav a[aria-label="首页"] {
    flex-shrink: 0;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

nav ul li a {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}

nav ul li a:hover {
    background: rgba(26,58,92,0.1);
    color: var(--primary-light);
}

[data-theme="dark"] nav ul li a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--accent);
}

/* 搜索框 */
nav div[role="search"] form {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

nav input[type="search"] {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    width: 140px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

nav input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26,58,92,0.15);
}

nav button[type="submit"] {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    color: var(--text-light);
    transition: color var(--transition);
}

nav button[type="submit"]:hover {
    color: var(--accent);
}

/* 暗色模式与菜单按钮 */
#dark-mode-toggle, #menu-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 50%;
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}

#dark-mode-toggle:hover, #menu-toggle:hover {
    background: rgba(0,0,0,0.08);
}

[data-theme="dark"] #dark-mode-toggle:hover,
[data-theme="dark"] #menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}

#menu-toggle {
    display: none;
}

/* 移动端菜单 */
@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--bg-glass);
        backdrop-filter: blur(20px);
        padding: 1rem;
        border-radius: var(--radius-sm);
        margin-top: 0.5rem;
    }

    nav ul.open {
        display: flex;
    }

    #menu-toggle {
        display: block;
    }

    nav input[type="search"] {
        width: 100px;
    }
}

/* Banner 轮播 */
#banner {
    position: relative;
    overflow: hidden;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--banner-gradient);
    border-radius: 0 0 var(--radius) var(--radius);
    margin: 0 0.5rem 2rem;
    box-shadow: var(--shadow);
}

.banner-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.8s ease;
    background: var(--banner-overlay);
    color: #fff;
}

.banner-slide.active {
    opacity: 1;
    position: relative;
}

.banner-slide h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
    letter-spacing: -0.02em;
}

.banner-slide p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    max-width: 700px;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.6;
}

.banner-slide a {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    background: var(--accent);
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(240,165,0,0.4);
    transition: transform var(--transition), box-shadow var(--transition);
}

.banner-slide a:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(240,165,0,0.5);
}

.banner-prev, .banner-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    font-size: 2.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), transform var(--transition);
    z-index: 10;
}

.banner-prev:hover, .banner-next:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-50%) scale(1.05);
}

.banner-prev { left: 1.5rem; }
.banner-next { right: 1.5rem; }

@media (max-width: 600px) {
    #banner { min-height: 60vh; margin: 0 0.2rem 1.5rem; }
    .banner-prev, .banner-next { width: 44px; height: 44px; font-size: 1.8rem; }
    .banner-prev { left: 0.5rem; }
    .banner-next { right: 0.5rem; }
}

/* 通用 section 样式 */
main section {
    max-width: 1280px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

section h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary);
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 4px;
}

[data-theme="dark"] section h2 {
    color: var(--accent);
}

/* 圆角卡片通用 */
section > div, section > article, section > details {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

section > div:hover, section > article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* 毛玻璃细节增强 */
#brand > div, #products > div, #solutions > div, #cases > div {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 新闻卡片 */
#news article {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#news article h3 {
    font-size: 1.15rem;
}

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

#news article a[aria-label="阅读全文"] {
    align-self: flex-start;
    font-weight: 600;
    color: var(--primary-light);
}

#news article a[aria-label="阅读全文"]:hover {
    color: var(--accent);
}

/* FAQ details 样式 */
#faq details {
    cursor: pointer;
    padding: 1.2rem 1.8rem;
    transition: background var(--transition), box-shadow var(--transition);
}

#faq details[open] {
    background: var(--bg-card);
    box-shadow: var(--shadow-hover);
}

#faq summary {
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.3rem 0;
    outline: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

#faq summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary-light);
    transition: transform var(--transition);
}

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

#faq details p {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    line-height: 1.7;
}

/* 教程列表 */
#howto ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

#howto ol li {
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

#howto p {
    margin: 0.6rem 0;
    color: var(--text-light);
}

/* 联系与站点地图 */
#contact p, #sitemap ul, #links ul {
    margin: 0.5rem 0;
}

#sitemap ul, #links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

#sitemap ul li a, #links ul li a {
    font-weight: 500;
}

/* 页脚 */
footer {
    background: var(--primary);
    color: #ccd8e4;
    text-align: center;
    padding: 2rem 1.5rem;
    margin-top: 4rem;
    border-radius: var(--radius) var(--radius) 0 0;
}

footer a {
    color: var(--accent);
}

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

footer p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

/* 返回顶部 */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-light);
    color: #fff;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: transform var(--transition), opacity var(--transition), background var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    background: var(--accent);
}

/* 响应式调整 */
@media (max-width: 768px) {
    main section {
        padding: 0 1rem;
        margin: 2rem auto;
    }

    section > div, section > article, section > details {
        padding: 1.2rem;
    }

    #sitemap ul, #links ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    nav { padding: 0.6rem 1rem; }
    .banner-slide h1 { font-size: 1.8rem; }
    #back-to-top { width: 44px; height: 44px; font-size: 1.3rem; bottom: 1.2rem; right: 1.2rem; }
}