/*
 * 网站首页：参考 StyleKit「视差滚动分区」（Parallax Sections）。
 * 每个分区占满一屏，背景固定（background-attachment: fixed），内容放在半透明磨砂面板上。
 * 触屏设备和「减少动态效果」时背景改为随页面滚动。
 */
:root {
    --gm-primary: #1e3a5f;
    --gm-secondary: #f8fafc;
    --gm-blue: #3b82f6;
    --gm-sky: #93c5fd;
    --gm-cyan: #0ea5e9;
    --gm-violet: #c559f0;
    --gm-text: #0f172a;
    --gm-muted: #475569;
    --gm-gradient: linear-gradient(135deg, #1e3a5f, #3b82f6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--gm-text);
    background: var(--gm-secondary);
    line-height: 1.6;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }

/* 顶部导航 */
.gm-nav {
    position: fixed; inset: 0 0 auto; z-index: 50;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .75rem clamp(1rem, 4vw, 2.5rem);
    background: rgba(30, 58, 95, .55);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, .15);
    color: #fff;
}
.gm-nav-brand { display: flex; align-items: center; gap: .625rem; text-decoration: none; font-weight: 600; }
.gm-nav-brand img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
/* 导航链接：悬停时文字变亮并滑出下划线 */
.gm-nav-links { display: flex; align-items: center; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.gm-nav-links a { position: relative; display: block; padding: .5rem .75rem; border-radius: .5rem; text-decoration: none; font-size: .9375rem; line-height: 1.25rem; color: rgba(255, 255, 255, .82); transition: color .2s, background-color .2s, box-shadow .2s; }
.gm-nav-links a::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: .25rem; height: 2px; border-radius: 1px; background: currentColor; transform: scaleX(0); transition: transform .2s; }
.gm-nav-links a:hover { color: #fff; }
.gm-nav-links a:hover::after { transform: scaleX(1); }
@media (max-width: 640px) { .gm-nav-links .gm-nav-optional { display: none; } }

/* 分区 */
.gm-section {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex; align-items: center; justify-content: center;
    padding: 6rem clamp(1rem, 4vw, 2.5rem) 4rem;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.gm-bg-sky { background-image: linear-gradient(180deg, rgba(30, 58, 95, .35), rgba(30, 58, 95, .2) 45%, rgba(30, 58, 95, .6)), url("../images/bg-sky.jpg"); background-color: #3b6fb0; }
.gm-bg-clouds { background-image: url("../images/bg-clouds.jpg"); background-color: #dbeafe; }
.gm-bg-night { background-image: linear-gradient(180deg, rgba(15, 23, 42, .25), rgba(30, 58, 95, .35)), url("../images/bg-night.jpg"); background-color: #1e3a5f; color: #fff; }
.gm-inner { width: 100%; max-width: 1120px; margin: 0 auto; }

/* 首屏 */
.gm-hero { text-align: center; color: #fff; }
.gm-hero-logo {
    width: min(320px, 70vw);
    filter: drop-shadow(0 18px 40px rgba(15, 23, 42, .35));
    animation: gm-float 6s ease-in-out infinite;
}
.gm-hero h1 { margin: 1.25rem 0 .5rem; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.2; letter-spacing: .02em; text-shadow: 0 2px 12px rgba(15, 23, 42, .35); }
.gm-hero p { margin: 0 auto 2rem; max-width: 36rem; padding: .5rem 1rem; border-radius: .75rem; background: rgba(30, 58, 95, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: clamp(1rem, 2.2vw, 1.1875rem); color: rgba(255, 255, 255, .92); text-shadow: 0 1px 6px rgba(15, 23, 42, .4); }
.gm-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.gm-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .75rem 1.5rem; border-radius: .75rem;
    font-weight: 600; text-decoration: none;
    transition: transform .2s, box-shadow .2s, background-color .2s;
}
.gm-btn:hover { transform: translateY(-2px); }
.gm-btn:focus-visible, .gm-card:focus-visible, .gm-nav a:focus-visible { outline: 3px solid var(--gm-sky); outline-offset: 3px; }
.gm-btn-primary { background: var(--gm-gradient); color: #fff; box-shadow: 0 10px 25px -8px rgba(59, 130, 246, .7); }
.gm-btn-ghost { background: rgba(255, 255, 255, .9); color: var(--gm-primary); }
.gm-scroll-hint { position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%); color: #fff; text-decoration: none; font-size: .875rem; text-shadow: 0 1px 4px rgba(15, 23, 42, .6); }
.gm-scroll-hint::after { content: ""; display: block; width: 10px; height: 10px; margin: .375rem auto 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); animation: gm-bounce 2s infinite; }

/* 磨砂面板与标题 */
.gm-panel {
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 1.25rem;
    padding: clamp(1.5rem, 4vw, 3rem);
    box-shadow: 0 25px 50px -20px rgba(30, 58, 95, .35);
}
.gm-eyebrow { display: inline-block; margin-bottom: .5rem; font-size: .8125rem; font-weight: 600; letter-spacing: .12em; color: var(--gm-blue); }
.gm-title { margin: 0 0 .75rem; font-size: clamp(1.625rem, 3.5vw, 2.375rem); line-height: 1.25; }
.gm-gradient-text { background: var(--gm-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gm-lead { margin: 0 0 2rem; color: var(--gm-muted); max-width: 40rem; }

/* 系统卡片 */
.gm-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); list-style: none; margin: 0; padding: 0; }
.gm-card {
    position: relative; display: flex; flex-direction: column; gap: .5rem; height: 100%;
    padding: 1.5rem; border-radius: 1rem; overflow: hidden;
    background: #fff; border: 1px solid #e2e8f0; color: inherit; text-decoration: none;
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.gm-card::before { content: ""; position: absolute; inset: 0; background: var(--gm-gradient); opacity: 0; transition: opacity .25s; z-index: 0; }
.gm-card::after { content: ""; position: absolute; top: 0; right: 0; width: 22px; height: 22px; background: linear-gradient(135deg, transparent 50%, var(--gm-sky) 50%); }
.gm-card > * { position: relative; z-index: 1; transition: color .25s; }
.gm-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -18px rgba(30, 58, 95, .45); border-color: transparent; }
.gm-card:hover::before { opacity: 1; }
.gm-card:hover, .gm-card:hover .gm-card-desc, .gm-card:hover .gm-card-tag { color: #fff; }
.gm-card-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: .75rem; background: #eff6ff; color: var(--gm-blue); }
.gm-card:hover .gm-card-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.gm-card-icon svg { width: 24px; height: 24px; }
.gm-card strong { font-size: 1.125rem; }
.gm-card-desc { color: var(--gm-muted); font-size: .9375rem; flex: 1; }
.gm-card-tag { font-size: .8125rem; font-weight: 600; color: var(--gm-blue); }

/* 开放平台分区 */
.gm-open { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: center; }
.gm-open .gm-eyebrow { color: var(--gm-sky); }
.gm-open .gm-lead { color: rgba(255, 255, 255, .85); }
.gm-open .gm-lead code { padding: .1rem .375rem; border-radius: .375rem; background: rgba(147, 197, 253, .2); color: #fff; font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.gm-open-title { margin: 0 0 .75rem; font-size: clamp(1.625rem, 3.5vw, 2.375rem); line-height: 1.25; }
.gm-features { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: .75rem; }
.gm-features li { display: flex; gap: .75rem; align-items: flex-start; }
.gm-features li::before { content: ""; flex: none; width: .5rem; height: .5rem; margin-top: .55rem; border-radius: 50%; background: linear-gradient(135deg, var(--gm-cyan), var(--gm-violet)); }
.gm-code {
    margin: 0; padding: 1.25rem 1.5rem; border-radius: 1rem; overflow-x: auto;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(147, 197, 253, .3);
    font: .875rem/1.7 ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
    color: #e2e8f0;
}
.gm-code .c { color: #94a3b8; }
.gm-code .k { color: var(--gm-sky); }
.gm-code .s { color: #f9a8d4; }

.gm-footer { padding: 2rem 1rem; text-align: center; font-size: .875rem; color: var(--gm-muted); background: var(--gm-secondary); }

/* 进入视口时淡入；没有脚本时直接显示 */
.gm-js .gm-reveal { opacity: 0; transform: translateY(8px); }
.gm-js .gm-reveal.gm-visible { animation: gm-fade-in .7s ease-out forwards; }

@keyframes gm-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gm-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes gm-bounce { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(5px) rotate(45deg); } }

/* 触屏设备上 fixed 背景表现不稳定（iOS 会放大或不生效），改为随页面滚动 */
@media (hover: none), (max-width: 1024px) {
    .gm-section { background-attachment: scroll; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .gm-section { background-attachment: scroll; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .gm-js .gm-reveal { opacity: 1; transform: none; }
}
