/* ============================================================
   Arevyna – 基于 Apple UIKit System Gray
   浅色 / 深色模式使用对应灰色，无主色叙事
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root[data-theme="light"] {
    /* 背景 */
    --bg-main: #f2f2f7; /* systemGray6 */
    --bg-card: #ffffff; /* 纯白 */
    --bg-header: rgba(242, 242, 247, 0.92);
    --bg-dev: #e5e5ea; /* systemGray5 */
    --bg-footer: #d1d1d6; /* systemGray4 */

    /* 文字 */
    --text-primary: #000000; /* 纯黑 */
    --text-secondary: #8e8e93; /* systemGray */

    /* 边框 & 分割线 */
    --border-color: #c7c7cc; /* systemGray3 */
    --border-light: #d1d1d6; /* systemGray4 */

    /* 卡片 & 元素 */
    --card-bg: #ffffff;
    --card-hover-border: #aeaeb2; /* systemGray2 */

    /* 按钮 */
    --btn-bg: #8e8e93; /* systemGray */
    --btn-hover: #636366; /* systemGray2 深色模式值，但这里保持浅色下可用 */
    --btn-text: #ffffff;

    /* 代码 */
    --code-bg: #1c1c1e; /* 深色模式下用深色，但代码块统一深色 */
    --code-header: #2c2c2e;

    /* 其他 */
    --theme-btn-bg: rgba(0, 0, 0, 0.05);
    --theme-btn-hover: rgba(0, 0, 0, 0.08);
    --mobile-nav-bg: rgba(242, 242, 247, 0.98);
    --icon-color: #000000;
    --card-shadow: rgba(0, 0, 0, 0.04);
}

:root[data-theme="dark"] {
    /* 背景 */
    --bg-main: #1c1c1e; /* systemGray6 深色 */
    --bg-card: #2c2c2e; /* systemGray5 深色 */
    --bg-header: rgba(28, 28, 30, 0.92);
    --bg-dev: #3a3a3c; /* systemGray4 深色 */
    --bg-footer: #48484a; /* systemGray3 深色 */

    /* 文字 */
    --text-primary: #ffffff; /* 纯白 */
    --text-secondary: #8e8e93; /* systemGray 不变 */

    /* 边框 & 分割线 */
    --border-color: #3a3a3c; /* systemGray4 深色 */
    --border-light: #48484a; /* systemGray3 深色 */

    /* 卡片 & 元素 */
    --card-bg: #2c2c2e;
    --card-hover-border: #636366; /* systemGray2 深色 */

    /* 按钮 */
    --btn-bg: #8e8e93; /* systemGray 不变 */
    --btn-hover: #aeaeb2; /* systemGray2 浅色值，但这里用浅色模式下的亮灰 */
    --btn-text: #ffffff;

    /* 代码 */
    --code-bg: #0a0a0a; /* 接近纯黑 */
    --code-header: #1c1c1e;

    /* 其他 */
    --theme-btn-bg: rgba(255, 255, 255, 0.05);
    --theme-btn-hover: rgba(255, 255, 255, 0.08);
    --mobile-nav-bg: rgba(28, 28, 30, 0.98);
    --icon-color: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.3);
}

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

html,
body {
    overflow-x: hidden;
    background-color: var(--bg-main);
    color: var(--text-primary);
    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(20px);
    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-primary);
    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(--text-secondary);
}

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

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

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

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

.btn-header {
    background: var(--theme-btn-bg);
    color: var(--text-primary);
    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(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-bg);
}

/* ---------- 汉堡菜单 ---------- */
.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(--text-primary);
    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-primary);
    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(--text-secondary);
}

.mobile-nav .btn-header-mobile {
    background: var(--btn-bg);
    color: var(--btn-text);
    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;
}

.mobile-nav .btn-header-mobile:hover {
    background: var(--btn-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.1);
    transition: all 0.3s ease;
    padding: 0;
}

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

.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;
    padding-top: 100px;
    padding-left: 20px;
    padding-right: 20px;
}

.hero-badge {
    background: var(--theme-btn-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    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.05;
    margin-bottom: 24px;
    max-width: 100%;
}

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

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

/* ---------- 按钮 ---------- */
.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 16px 36px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition:
        transform 0.2s,
        background 0.2s;
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    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-secondary);
    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;
}

.metric-item p {
    color: var(--text-secondary);
    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(--card-bg);
    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: 3px;
    background: transparent;
    transition: background 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--card-hover-border);
    box-shadow: 0 10px 30px var(--card-shadow);
}

.product-card:hover::before {
    background: var(--text-secondary);
}

.product-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    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-secondary);
    font-size: 0.95rem;
    margin-bottom: 25px;
    min-height: 70px;
}

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

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

/* ---------- 策略区域 ---------- */
.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-secondary);
    margin-bottom: 20px;
}

.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;
}
.number {
    color: #79c0ff;
}

/* ---------- 治理 ---------- */
.safety-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    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-secondary);
    margin-bottom: 20px;
}

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

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

/* ---------- 控股企业 ---------- */
.holdings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.holding-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px 30px;
    transition: all 0.3s ease;
}

.holding-card:hover {
    border-color: var(--card-hover-border);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--card-shadow);
}

.holding-sector {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 1.2px;
    display: inline-block;
    margin-bottom: 8px;
}

.holding-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.holding-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---------- 新闻 ---------- */
.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(--card-bg);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.news-card:hover {
    border-color: var(--card-hover-border);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: var(--bg-dev);
}

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

.news-content .date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    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(--text-secondary);
}

/* ---------- 页脚 ---------- */
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-primary);
    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(--text-secondary);
}

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

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

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

/* ---------- 响应式 ---------- */
@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,
    .holdings-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;
    }
    .holding-card {
        padding: 22px 24px;
    }

    .footer-grid {
        gap: 36px;
    }
    .footer-column {
        padding-bottom: 4px;
    }
    .footer-column h5 {
        font-size: 1rem;
        margin-bottom: 16px;
    }
    .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;
    }
}

@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,
    .holdings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .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;
}
