/* ============================================================
   XDGAME游戏盒子 — 现代化主题样式
   设计: 靛蓝→紫品牌渐变 / 玻璃态导航 / 大圆角柔阴影 / 暗色模式
   ============================================================ */

:root {
    /* 品牌色 */
    --brand: #6d5efc;
    --brand-2: #9b5cff;
    --brand-3: #4f8cff;
    --brand-grad: linear-gradient(120deg, #4f8cff 0%, #6d5efc 45%, #9b5cff 100%);
    --brand-glow: rgba(109, 94, 252, 0.45);

    /* 图标黄色（沿用原品牌黄） */
    --icon-yellow: #f5b423;
    --icon-yellow-2: #ffcf4a;
    --icon-grad: linear-gradient(135deg, #ffcf4a 0%, #f5b423 100%);
    --icon-glow: rgba(245, 180, 35, 0.42);

    /* 亮色主题 */
    --bg: #f6f7fb;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --text: #171a2b;
    --text-muted: #5c6178;
    --border: rgba(23, 26, 43, 0.08);
    --shadow-sm: 0 4px 16px rgba(23, 26, 43, 0.06);
    --shadow-md: 0 14px 40px rgba(23, 26, 43, 0.10);
    --shadow-lg: 0 30px 70px rgba(79, 76, 130, 0.18);
    --nav-bg: rgba(255, 255, 255, 0.72);
    --radius: 20px;
}

[data-theme="dark"] {
    --bg: #0b0d1a;
    --bg-elev: #12152a;
    --surface: #161a33;
    --text: #eef1ff;
    --text-muted: #a4a9c9;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.55);
    --nav-bg: rgba(18, 21, 42, 0.72);
}

/* ---------- 基础 ---------- */
* { scroll-behavior: smooth; }

body {
    font-family: 'Microsoft YaHei', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 { font-weight: 800; letter-spacing: -0.02em; }
.text-muted { color: var(--text-muted) !important; }

section { padding: 96px 0; position: relative; }

/* 品牌渐变文字 */
.text-gradient {
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 通用节标题 */
.section-eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}

/* ---------- 导航栏（玻璃态） ---------- */
.navbar {
    background: var(--nav-bg) !important;
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    transition: box-shadow .3s ease, background .3s ease;
    padding-top: .7rem;
    padding-bottom: .7rem;
}
.navbar.scrolled { box-shadow: var(--shadow-sm); }
.navbar-brand { font-weight: 800; color: var(--text) !important; }
.navbar .nav-link { color: var(--text-muted) !important; font-weight: 600; position: relative; margin: 0 .35rem; }
.navbar .nav-link::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
    background: var(--brand-grad); border-radius: 2px; transform: scaleX(0); transform-origin: left;
    transition: transform .3s ease;
}
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--text) !important; }
.navbar .nav-link:hover::after, .navbar .nav-link.active::after { transform: scaleX(1); }

/* 主题切换按钮 */
.theme-toggle {
    width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform .3s ease, box-shadow .3s ease; font-size: 1.1rem;
}
.theme-toggle:hover { transform: rotate(20deg); box-shadow: var(--shadow-sm); }

/* ---------- 按钮 ---------- */
.btn { border-radius: 999px; padding: 10px 26px; font-weight: 700; transition: all .25s ease; border: none; }
.btn-lg { padding: 14px 34px; }
.btn-primary {
    background: var(--brand-grad); color: #fff;
    box-shadow: 0 10px 26px var(--brand-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px var(--brand-glow); color: #fff; }
.btn-outline-secondary {
    background: transparent; color: var(--text);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn-outline-secondary:hover { background: var(--surface); color: var(--brand); border-color: var(--brand); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero-section {
    background: var(--bg);
    padding: 150px 0 110px;
    overflow: hidden;
}
.hero-section::before {
    content: ""; position: absolute; top: -220px; right: -140px;
    width: 620px; height: 620px; border-radius: 50%;
    background: radial-gradient(circle, rgba(109,94,252,.28), transparent 62%);
    filter: blur(20px); z-index: 0; pointer-events: none;
}
.hero-section::after {
    content: ""; position: absolute; bottom: -240px; left: -160px;
    width: 560px; height: 560px; border-radius: 50%;
    background: radial-gradient(circle, rgba(79,140,255,.22), transparent 62%);
    filter: blur(20px); z-index: 0; pointer-events: none;
}
.hero-section .container { position: relative; z-index: 1; }
.hero-section h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1.15; }
/* 标语整行显示，不在中间断字 */
.hero-slogan { display: inline-block; white-space: nowrap; }
@media (max-width: 400px) { .hero-slogan { white-space: normal; } }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    padding: 8px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600;
    color: var(--text-muted); box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.hero-img-wrap { position: relative; }
.hero-img-wrap img {
    border-radius: 24px; box-shadow: var(--shadow-lg);
    border: 1px solid var(--border); animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* 统计条 */
.hero-stats { display: flex; align-items: flex-start; gap: 34px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats .stat { min-width: 0; }
.hero-stats .stat .num { font-size: 1.9rem; font-weight: 800; white-space: nowrap; line-height: 1.15; }
.hero-stats .stat .num.num-sm { font-size: 1.4rem; }
.hero-stats .stat .label { font-size: .85rem; color: var(--text-muted); }

/* ---------- 卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, border-color .35s ease;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md) !important;
    border-color: color-mix(in srgb, var(--brand) 40%, transparent) !important;
}

/* 功能卡图标 */
.feature-icon {
    width: 64px; height: 64px; border-radius: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.7rem; color: #4a3500; margin-bottom: 20px;
    background: var(--icon-grad); box-shadow: 0 10px 24px var(--icon-glow);
}

/* 功能卡图标 — 多彩配色（每张卡不同色，保留黄色其一） */
.feature-icon.c-yellow { background: linear-gradient(135deg, #ffcf4a 0%, #f5b423 100%); color: #4a3500; box-shadow: 0 10px 24px rgba(245,180,35,.42); }
.feature-icon.c-blue   { background: linear-gradient(135deg, #5ea2ff 0%, #4f8cff 100%); color: #06214d; box-shadow: 0 10px 24px rgba(79,140,255,.40); }
.feature-icon.c-purple { background: linear-gradient(135deg, #b07bff 0%, #7c4dff 100%); color: #2a0e5c; box-shadow: 0 10px 24px rgba(124,77,255,.40); }
.feature-icon.c-green  { background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%); color: #06341b; box-shadow: 0 10px 24px rgba(22,163,74,.38); }
.feature-icon.c-pink   { background: linear-gradient(135deg, #ff8fb1 0%, #f43f7f 100%); color: #4d0a24; box-shadow: 0 10px 24px rgba(244,63,127,.38); }
.feature-icon.c-cyan   { background: linear-gradient(135deg, #4fd6e0 0%, #14b8c4 100%); color: #053a40; box-shadow: 0 10px 24px rgba(20,184,196,.38); }
.card-title { color: var(--text); }
.card-text { color: var(--text-muted); }

/* 分类卡 */
.category-card { text-align: center; padding: 8px; }
.category-card .cat-emoji {
    font-size: 2.6rem; display: block; margin-bottom: 8px;
}

/* ---------- 技术特点 ---------- */
.tech-item { display: flex; gap: 18px; padding: 22px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease; height: 100%; }
.tech-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.tech-item .tech-ico {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem;
    color: var(--icon-yellow); background: color-mix(in srgb, var(--icon-yellow) 16%, transparent);
}
.tech-item h4 { font-size: 1.12rem; margin-bottom: 6px; }
.tech-item p { color: var(--text-muted); margin: 0; }

/* ---------- 界面展示 ---------- */
.shot .card-img-container { cursor: pointer; }
.shot img { height: 220px; object-fit: cover; width: 100%; transition: transform .5s ease; }
.shot:hover img { transform: scale(1.06); }
.shot .overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, rgba(11,13,26,0) 40%, rgba(11,13,26,.55));
    opacity: 0; transition: opacity .3s ease;
}
.shot:hover .overlay { opacity: 1; }
.shot .overlay .badge { background: var(--brand-grad); padding: 10px 16px; border-radius: 999px; font-weight: 700; }

/* ---------- 下载区 ---------- */
.download-section {
    background: var(--brand-grad); color: #fff; overflow: hidden; position: relative;
}
.download-section::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.18), transparent 40%);
    pointer-events: none;
}
.download-card {
    background: rgba(255,255,255,.12); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.25); border-radius: 26px; padding: 42px 34px;
}
.download-inner {
    background: var(--surface); border-radius: 20px; padding: 34px; box-shadow: var(--shadow-md);
}
.download-inner .feature-icon { background: var(--icon-grad); color: #4a3500; box-shadow: 0 10px 24px var(--icon-glow); }
.download-inner h5, .download-inner .card-title { color: var(--text); }
.version-pill {
    display: inline-block; font-size: .8rem; font-weight: 700; color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    padding: 4px 12px; border-radius: 999px; margin-top: 6px;
}
.download-notice {
    display: flex; align-items: center; gap: 10px; text-align: left;
    font-size: .9rem; font-weight: 700; color: #7a4a00;
    background: #fff7e0;
    border: 1px solid #f5b423;
    border-radius: 12px; padding: 12px 16px;
}
.download-notice i { color: #e59400; font-size: 1.2rem; flex: 0 0 auto; }
.download-notice strong { color: #c2410c; }
[data-theme="dark"] .download-notice {
    color: #ffd97a; background: rgba(245,180,35,.12); border-color: rgba(245,180,35,.5);
}
[data-theme="dark"] .download-notice i { color: #ffcf4a; }
[data-theme="dark"] .download-notice strong { color: #ffcf4a; }

/* ---------- 页脚 ---------- */
footer {
    background: var(--bg-elev); color: var(--text); padding: 56px 0 40px;
    border-top: 1px solid var(--border);
}
footer p { color: var(--text-muted); }
footer .brand-name { color: var(--text); }
.footer-divider { border-color: var(--border); opacity: 1; margin: 36px 0 22px; }
.footer-bottom {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.footer-copyright { color: var(--text-muted); font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .9rem; }
.footer-links-label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-weight: 600; }
.footer-links a {
    color: var(--text-muted); text-decoration: none; font-weight: 600;
    padding: 5px 14px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); transition: all .25s ease;
}
.footer-links a:hover {
    color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, transparent);
    transform: translateY(-2px); box-shadow: var(--shadow-sm);
}
@media (max-width: 575px) { .footer-bottom { justify-content: center; text-align: center; } }

/* ---------- 模态框 ---------- */
.modal-content { background: var(--surface); color: var(--text); border-radius: 20px; border: 1px solid var(--border); }
.modal-header { border-bottom: 1px solid var(--border); }

/* 截图放大弹窗 — 尽量大，图片看清 */
.shot-modal { max-width: min(1100px, 96vw); }
.shot-modal .modal-body { padding: 0; }
.shot-modal .modal-body img { width: 100%; height: auto; display: block; border-radius: 0 0 20px 20px; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ---------- 滚动进场动画 ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero-img-wrap img { animation: none; }
    * { scroll-behavior: auto; }
}

/* ---------- 回到顶部 ---------- */
.back-to-top {
    position: fixed; right: 24px; bottom: 24px; width: 48px; height: 48px; border-radius: 50%;
    background: var(--brand-grad); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 26px var(--brand-glow); cursor: pointer; opacity: 0; pointer-events: none;
    transform: translateY(12px); transition: all .3s ease; z-index: 1000; font-size: 1.2rem;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { transform: translateY(-3px); }

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
    .navbar-collapse { background: var(--surface); border-radius: 16px; padding: 10px; margin-top: 12px; box-shadow: var(--shadow-md); }
    /* 手机端菜单竖排：去掉下划线动效，改用整块高亮，避免出现悬空短横线 */
    .navbar .nav-link { margin: 0; padding: 10px 14px !important; border-radius: 10px; }
    .navbar .nav-link::after { display: none; }
    .navbar .nav-link.active, .navbar .nav-link:hover {
        background: color-mix(in srgb, var(--brand) 10%, transparent);
    }
}
@media (max-width: 768px) {
    section { padding: 64px 0; }
    .hero-section { padding: 120px 0 70px; }
    .hero-stats { gap: 22px; }
}
