/* ============================================================
   AnyVera – 完整样式表
   品牌色：蓝色系 (#2563eb 主色 / #38bdf8 辅色)
   语义化变量命名，支持深色/浅色主题
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root[data-theme="dark"] {
    --bg-main: #060913;
    --bg-card: #0f1322;
    --bg-header: rgba(6, 9, 19, 0.85);
    --bg-dev: #080c16;
    --bg-footer: #03050a;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-glow: rgba(37, 99, 235, 0.15);
    --code-bg: #010409;
    --code-header: #0d1117;
    --theme-btn-bg: rgba(255, 255, 255, 0.05);
    --theme-btn-hover: rgba(255, 255, 255, 0.1);
    --mobile-nav-bg: rgba(6, 9, 19, 0.98);
    --icon-color: #f3f4f6;
}

:root[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: rgba(248, 250, 252, 0.85);
    --bg-dev: #f1f5f9;
    --bg-footer: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: rgba(15, 23, 42, 0.08);
    --primary-glow: rgba(37, 99, 235, 0.08);
    --code-bg: #1e1e24;
    --code-header: #15151a;
    --theme-btn-bg: rgba(15, 23, 42, 0.05);
    --theme-btn-hover: rgba(15, 23, 42, 0.1);
    --mobile-nav-bg: rgba(248, 250, 252, 0.98);
    --icon-color: #0f172a;
}

:root {
    /* 品牌主色（蓝色系） */
    --primary-color: #2563eb;
    --secondary-color: #38bdf8;
    --primary-hover: #1d4ed8;
    --primary-dark: #1e3a8a;
}

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    scroll-behavior: smooth;
}

html,
body {
    overflow-x: hidden;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.7;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 导航栏 ---------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 8%;
    position: fixed;
    width: 100%;
    top: 0;
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition:
        background 0.3s,
        border-color 0.3s;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-link img {
    height: 24px;
    width: auto;
    display: block;
}

.logo-text {
    color: var(--text-main);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    transition: color 0.3s;
}

.logo-text sup {
    font-size: 0.55em;
    font-weight: 600;
    vertical-align: super;
    margin-left: 2px;
    color: var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 35px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
}

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

.btn-header {
    background: var(--theme-btn-bg);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.btn-header:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
}

/* ---------- 汉堡菜单 ---------- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2.5px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ---------- 移动端导航 ---------- */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--mobile-nav-bg);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
    padding: 80px 40px 60px;
}

.mobile-nav.open {
    opacity: 1;
    visibility: visible;
}

.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 0;
}

.mobile-nav ul li a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 600;
    transition: color 0.25s;
    letter-spacing: -0.5px;
}

.mobile-nav ul li a:hover {
    color: var(--primary-color);
}

.mobile-nav .btn-header-mobile {
    background: var(--primary-color);
    color: white;
    padding: 14px 48px;
    border-radius: 10px;
    border: none;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.25s,
        transform 0.2s;
    margin-top: 12px;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
}

.mobile-nav .btn-header-mobile:hover {
    background: var(--primary-hover);
    transform: scale(1.03);
}

/* ---------- 主题切换按钮 ---------- */
.theme-toggle-fab {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 28px;
    height: 28px;
    background: var(--theme-btn-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    padding: 0;
}

.theme-toggle-fab:hover {
    transform: scale(1.15);
    background: var(--theme-btn-hover);
    border-color: var(--primary-color);
}

.theme-toggle-fab .material-symbols-outlined {
    font-size: 22px;
    color: var(--icon-color);
    font-variation-settings:
        "FILL" 0,
        "wght" 400,
        "GRAD" 0,
        "opsz" 26;
    display: none;
    line-height: 1;
}

:root[data-setting="system"] #icon-system {
    display: block;
}
:root[data-setting="dark"] #icon-dark {
    display: block;
}
:root[data-setting="light"] #icon-light {
    display: block;
}

#top {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
}

/* ---------- Hero 区域 ---------- */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    background: radial-gradient(
        circle at 50% 45%,
        var(--primary-glow) 0%,
        transparent 55%
    );
    padding-top: 100px;
    padding-left: 20px;
    padding-right: 20px;
}

.hero-badge {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #60a5fa;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.15;
    margin-bottom: 24px;
    background: linear-gradient(
        135deg,
        var(--text-main) 40%,
        #60a5fa 70%,
        var(--primary-color) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 100%;
}

.hero p {
    font-size: 1.35rem;
    color: var(--text-muted);
    max-width: 750px;
    margin-bottom: 45px;
}

.cta-group {
    display: flex;
    gap: 20px;
}

/* ---------- 按钮 ---------- */
.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 16px 36px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 25px rgba(37, 99, 235, 0.4);
    transition:
        transform 0.2s,
        background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    padding: 16px 36px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition:
        background 0.2s,
        border-color 0.2s;
}

.btn-secondary:hover {
    background: var(--theme-btn-bg);
}

/* ---------- 通用章节 ---------- */
section {
    padding: 120px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- 指标栏 ---------- */
.metrics-bar {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 40px 0;
    transition: background 0.3s;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    gap: 20px;
}

.metric-item h4 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(
        135deg,
        var(--text-main),
        var(--secondary-color)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-item p {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---------- 产品/解决方案网格 ---------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .product-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.product-card:hover::before {
    background: linear-gradient(
        90deg,
        var(--primary-color),
        var(--secondary-color)
    );
}

.product-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    display: inline-block;
}

.product-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.product-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
    min-height: 70px;
}

.product-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.product-link:hover {
    color: var(--primary-color);
}

/* ---------- 研发与开发者区域 ---------- */
.dev-section {
    background: var(--bg-dev);
    transition: background 0.3s;
}

.dev-split {
    display: flex;
    align-items: center;
    gap: 60px;
}

.dev-text {
    flex: 1;
}

.dev-text h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.dev-text p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.code-window {
    flex: 1;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: "Fira Code", Consolas, Monaco, monospace;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

.code-header {
    background: var(--code-header);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.dot-r {
    background: #ff5f56;
}
.dot-y {
    background: #ffbd2e;
}
.dot-g {
    background: #27c93f;
}
.code-title {
    color: #8b949e;
    font-size: 0.8rem;
    margin-left: 10px;
}

.code-body {
    padding: 25px;
    font-size: 0.9rem;
    color: #c9d1d9;
    overflow-x: auto;
    max-width: 100%;
}

.code-body pre {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
}

.keyword {
    color: #ff7b72;
}
.string {
    color: #a5d6ff;
}
.comment {
    color: #8b949e;
}
.function {
    color: #d2a8ff;
}

/* ---------- 质量与合规（安全类） ---------- */
.safety-box {
    background: radial-gradient(rgba(56, 189, 248, 0.05), transparent);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 20px;
    padding: 60px;
    display: flex;
    gap: 40px;
}

.safety-left {
    flex: 1;
}
.safety-right {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.safety-box h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}
.safety-box p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.safety-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 12px;
    transition: background 0.3s;
}

.safety-card h4 {
    margin-bottom: 10px;
    color: var(--text-main);
}
.safety-card p {
    font-size: 0.85rem;
    margin: 0;
    color: var(--text-muted);
}

/* ---------- 新闻与见解网格 ---------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.news-card {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.news-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.news-content {
    padding: 20px 20px 24px;
}

.news-content .date {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
}

.news-content h3 {
    font-size: 1.25rem;
    line-height: 1.4;
    transition: color 0.2s;
    font-weight: 600;
}

.news-card:hover .news-content h3 {
    color: var(--primary-color);
}

/* ---------- 页脚 ---------- */
footer {
    background: var(--bg-footer);
    padding: 80px 0 40px 0;
    border-top: 1px solid var(--border-color);
    transition: background 0.3s;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo {
    display: flex;
    flex-direction: column;
}

.footer-logo-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 20px;
}

.footer-logo-brand img {
    height: 20px;
    width: auto;
    display: block;
}

.footer-logo-text {
    color: var(--text-main);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    transition: color 0.3s;
}

.footer-logo-text sup {
    font-size: 0.55em;
    font-weight: 600;
    vertical-align: super;
    margin-left: 2px;
    color: var(--primary-color);
}

.footer-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 260px;
    margin: 0;
}

.footer-column h5 {
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 20px;
}
.footer-column ul {
    list-style: none;
}
.footer-column li {
    margin-bottom: 12px;
}
.footer-column a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-column a:hover {
    color: var(--text-main);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---------- 响应式：平板（≤1024px） ---------- */
@media (max-width: 1024px) {
    html,
    body {
        overflow-x: hidden;
    }

    header nav,
    .header-right .btn-header {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    header {
        padding: 14px 24px;
    }

    .container {
        padding: 0 24px;
    }

    .hero {
        padding-left: 28px;
        padding-right: 28px;
    }

    .hero h1 {
        font-size: 2.8rem;
        letter-spacing: -1px;
    }

    .hero p {
        font-size: 1.1rem;
        padding: 0 4px;
    }

    .products-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .safety-right {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .dev-split,
    .safety-box {
        flex-direction: column;
    }

    .cta-group {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
    }

    .safety-box {
        padding: 30px 24px;
    }

    .code-window {
        max-width: 100%;
    }

    .news-image {
        height: 160px;
    }

    .logo-text,
    .footer-logo-text {
        font-size: 1.2rem;
    }
    .logo-link img {
        height: 20px;
    }
    .footer-logo-brand img {
        height: 18px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }

    section {
        padding: 80px 0;
    }
    .section-header {
        margin-bottom: 40px;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    .product-card {
        padding: 28px;
    }
    .product-card p {
        min-height: auto;
    }

    .footer-grid {
        gap: 36px;
    }
    .footer-column {
        padding-bottom: 4px;
    }
    .footer-column h5 {
        font-size: 1rem;
        margin-bottom: 16px;
        color: var(--text-main);
    }
    .footer-column ul li {
        margin-bottom: 10px;
    }
    .footer-logo p {
        max-width: 100%;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding-top: 24px;
    }
    .footer-bottom p {
        font-size: 0.8rem;
    }
}

/* ---------- 响应式：手机（≤600px） ---------- */
@media (max-width: 600px) {
    .container {
        padding: 0 20px;
    }

    header {
        padding: 12px 20px;
    }

    .hero {
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 80px;
    }

    .hero h1 {
        font-size: 2.2rem;
        letter-spacing: -0.5px;
    }

    .hero p {
        font-size: 1rem;
        padding: 0;
    }

    .products-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-header h2 {
        font-size: 1.7rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .metric-item h4 {
        font-size: 1.8rem;
    }

    .product-card {
        padding: 24px;
    }

    .news-image {
        height: 140px;
    }

    .mobile-nav ul li a {
        font-size: 1.4rem;
    }
    .mobile-nav .btn-header-mobile {
        padding: 12px 36px;
        font-size: 1rem;
    }

    .safety-box {
        padding: 24px 20px;
    }

    .footer-grid {
        gap: 28px;
    }
    .footer-logo-brand img {
        height: 18px;
    }
    .footer-logo-text {
        font-size: 1.2rem;
    }
    .footer-column h5 {
        font-size: 0.95rem;
    }
    .footer-column ul li a {
        font-size: 0.85rem;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .footer-bottom p {
        font-size: 0.75rem;
    }

    .theme-toggle-fab {
        width: 24px;
        height: 24px;
        bottom: 20px;
        left: 20px;
    }
    .theme-toggle-fab .material-symbols-outlined {
        font-size: 18px;
    }
}

/* ---------- 工具类 ---------- */
.no-scroll {
    overflow: hidden !important;
}
