/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Keep centered store window from shifting when detail view locks/unlocks outer scrollbars. */
    scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

:root {
    --bg-primary: #06060a;
    --bg-secondary: #111118;
    --border-color: #2a2a36;
    --text-primary: #f4f4f8;
    --text-secondary: #9b9ba8;
    --accent-blue: #818cf8;
    --accent-blue-hover: #a5b4fc;
    --accent-glow: rgba(129, 140, 248, 0.35);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#top,
#home-sidebar,
#section-premium,
#section-explore-recommend,
#section-apps {
    scroll-margin-top: 76px;
}

.nav-link:focus-visible,
.lang-toggle:focus-visible,
.app-card--compact:focus-visible,
.featured-card-main:focus-visible,
.recommend-card:focus-visible,
.sidebar-nav .nav-item:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8000;
    /* 实色顶栏：任何 backdrop-filter 在白底内容上滚过时都可能在底缘产生「穿透/横缝」合成伪影 */
    background: #0a0b0d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-logo-img {
    height: 48px;
    width: auto;
    display: block;
    background: #ffffff;
    padding: 6px;
    border-radius: 12px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.lang-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.lang-toggle:hover {
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.09);
}

/* ===== Main Content ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

/* 首页：全宽渐变舞台（借鉴 Linear 上半区氛围） */
.main-content--home {
    max-width: none;
    margin: 0;
    padding: 0;
}

/*
 * Linear 英雄区式舞台：采用 linear.app 生产样式的实际实现
 *   - 面板底色：#0f1011（他们的 Hero 面板色）
 *   - 页基：#08090a（他们的 theme-color）
 *   - 顶部到页基的一段极弱纵向过渡（<4% 明度差），整体几乎接近纯色
 *   - 不使用大面积径向「灯光」径向（原站本就没有）
 *   - 颗粒/dither 由 .home-linear-grain + ::before 承担
 */
.home-linear-stage {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    height: auto;
    max-height: none;
    /* 顶栏固定 60px：标题区下移 */
    padding: calc(60px + clamp(32px, 4.2vh, 56px)) clamp(12px, 3vw, 28px) 0;
    overflow-x: hidden;
    overflow-y: auto;
    isolation: isolate;
    background-color: #08090a;
    background-image:
        radial-gradient(52.53% 57.5% at 50% 100%, rgba(8, 9, 10, 0) 0%, rgba(8, 9, 10, 0.5) 100%),
        linear-gradient(180deg, #08090a 10%, #4e5058 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* 详情打开时：关闭页面与 stage 外层滚动，只保留详情内容区单独滚动 */
html.store-detail-open,
html.store-detail-open body {
    overflow: hidden;
    overscroll-behavior: none;
}

html.store-detail-open .home-linear-stage,
.home-linear-stage.home-linear-stage--detail-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

html.store-detail-open #store-main {
    overflow: hidden;
}

@supports (height: 100svh) {
    .home-linear-stage {
        min-height: 100svh;
        height: auto;
        max-height: none;
    }
}

/* 主窗口与页脚之间：短留白（略像 Linear 分节，避免过大） */
.home-linear-stage-tail {
    flex: 0 0 auto;
    width: 100%;
    min-height: clamp(20px, 3.5vh, 44px);
    pointer-events: none;
    position: relative;
    z-index: 3;
    /* 首屏内容较矮时把尾区顶到底，不把「多出来的竖直空间」全塞进白窗（避免详情态 flex 把窗体撑大） */
    margin-top: auto;
}

.home-linear-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Grain: 1:1 copy of Linear.app production Grain component (633fdec72d1565ed.css) */
.home-linear-grain {
    z-index: 2;
    background-image: url("/static/grain.png?v=20260423e");
    background-size: 256px 256px;
    opacity: .9;
    mix-blend-mode: overlay;
}
.home-linear-grain,
.home-linear-grain::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
}
.home-linear-grain::after {
    content: "";
    background: rgba(255, 255, 255, .06);
}
@supports (-webkit-hyphens: none) {
    .home-linear-grain::after {
        background: none;
    }
}

/* 不需要 dither / vignette：linear.app 首屏并没有，多加反而「脏」 */
.home-linear-stage::before,
.home-linear-stage::after {
    content: none;
}

.home-linear-stage .hero,
.home-linear-stage .app-store-window-shell,
.home-linear-stage .app-store-window,
.home-linear-stage .home-linear-stage-tail {
    position: relative;
    z-index: 3;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    flex-shrink: 0;
    padding: clamp(10px, 1.2vh, 18px) 4px 10px clamp(12px, 2.2vw, 32px);
    text-align: left;
    overflow: visible;
    margin-bottom: 8px;
}

.mm-store-shell-wrap {
    position: relative;
    align-self: center;
    width: auto;
    max-width: min(1760px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.mm-store-shell-note {
    position: absolute;
    right: 0;
    top: 0;
    transform: translateY(calc(-100% - 10px));
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 2px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
    font-weight: 520;
    letter-spacing: -0.01em;
    user-select: text;
    cursor: default;
    white-space: nowrap;
}

.mm-store-shell-note[hidden] {
    display: none !important;
}

/* Fullscreen: move note into the fixed fullscreen shell area (inside top-right). */
html.store-window-fullscreen .mm-store-shell-note {
    position: fixed;
    top: calc(60px + 14px + 14px);
    right: calc(16px + 18px);
    transform: none;
    z-index: 7705; /* above fullscreen shell (7600) */
}

.mm-store-shell-note:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.55);
    outline-offset: 4px;
    border-radius: 10px;
}

.mm-store-shell-note__sep {
    opacity: 0.55;
    margin: 0 -2px;
}

.mm-store-shell-note__copy {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font: inherit;
    letter-spacing: inherit;
    position: relative;
}

.mm-store-shell-note__copy:hover {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.24);
    text-underline-offset: 3px;
}

.mm-store-shell-note__copy:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.55);
    outline-offset: 4px;
    border-radius: 10px;
}

.mm-store-shell-note__copy-icon {
    opacity: 0.72;
}

.mm-store-shell-note__copy[data-copied="1"] .mm-store-shell-note__copy-icon {
    opacity: 1;
}

.mm-store-shell-note__copy[data-copied="1"]::after {
    content: attr(data-copied-label);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    background: rgba(10, 11, 13, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.86);
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* 1:1 复刻 Linear 的 Hero_pulseDot：16px 圆点 + box-shadow 脉冲扩散 */
.mm-store-shell-note__pulse {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: rgba(94, 106, 210, 0.15);
    position: relative;
    box-shadow: 0 0 0 0 rgba(94, 106, 210, 0.1);
    animation: mmPulseDot 1.75s cubic-bezier(0.66, 0, 0, 1) infinite;
}

.mm-store-shell-note__pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(94, 106, 210, 0.95);
    box-shadow: 0 0 10px rgba(94, 106, 210, 0.32);
}

@keyframes mmPulseDot {
    to {
        box-shadow: 0 0 0 10px rgba(243, 79, 82, 0);
    }
}

.mm-store-shell-note:hover,
.mm-store-shell-note:focus-visible {
    color: rgba(255, 255, 255, 0.72);
    /* Linear: .Hero_newFeatureLink__:hover { filter: brightness(1.3) } */
    filter: brightness(1.3);
}

@media (max-width: 720px) {
    .mm-store-shell-note {
        display: none;
    }
}

@media (max-height: 700px) {
    .home-linear-stage {
        padding-top: calc(60px + 22px);
    }

    .home-linear-stage-tail {
        min-height: clamp(16px, 3vh, 36px);
    }

    .hero {
        padding: 4px 4px 6px clamp(10px, 2vw, 24px);
        margin-bottom: 6px;
    }

    .hero-title {
        margin-bottom: 6px;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: min(42rem, 100%);
    margin: 0;
    margin-right: auto;
}

.hero-title {
    font-size: clamp(28px, 5vw + 12px, 48px);
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 14px;
    line-height: 1.15;
    letter-spacing: -0.04em;
    text-shadow:
        0 0 72px rgba(255, 255, 255, 0.06),
        0 0 36px rgba(255, 255, 255, 0.035),
        0 1px 36px rgba(0, 0, 0, 0.55);
}

.hero-subtitle {
    font-size: clamp(15px, 1.5vw + 12px, 18px);
    color: rgba(255, 255, 255, 0.58);
    margin-bottom: 0;
    font-weight: 450;
}

/* ===== Site footer（整页最底部、全宽黑色背景，不在 main 限宽内） ===== */
.site-footer {
    margin: 0;
}

.site-footer--page-bottom {
    width: 100%;
    margin-top: 32px;
    padding: 44px 20px 48px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    box-sizing: border-box;
}

.site-footer-inner {
    max-width: min(1760px, 100%);
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

.site-footer-trust {
    margin: 0 auto 14px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 560px;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.site-footer-nav a {
    color: var(--accent-blue);
    text-decoration: none;
}

.site-footer-nav a:hover {
    text-decoration: underline;
}

.site-footer-contact-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 13px;
    font-weight: inherit;
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: none;
}

.site-footer-contact-btn:hover {
    text-decoration: underline;
}

.site-footer-sep {
    color: var(--text-secondary);
    user-select: none;
}

.site-footer-line {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .site-footer--page-bottom {
        padding: 32px 20px 40px;
    }

    .site-footer-inner {
        padding: 0;
    }
}

/* ===== 联系我们弹窗 ===== */
.contact-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.contact-modal.contact-modal--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.contact-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 14, 0.62);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.contact-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 26px 22px 22px;
    border-radius: 18px;
    background: linear-gradient(165deg, rgba(38, 38, 48, 0.98) 0%, rgba(22, 22, 30, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 24px 64px rgba(0, 0, 0, 0.55),
        0 0 80px -20px rgba(255, 255, 255, 0.05);
    transform: scale(0.96) translateY(8px);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-modal.contact-modal--open .contact-modal__panel {
    transform: scale(1) translateY(0);
}

.contact-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(235, 235, 245, 0.75);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.contact-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.contact-modal__close:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.85);
    outline-offset: 2px;
}

.contact-modal__head {
    padding-right: 40px;
    margin-bottom: 18px;
}

.contact-modal__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.03em;
    color: #f5f5f8;
}

.contact-modal__hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(168, 168, 188, 0.95);
}

.contact-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-modal__row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 10px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.contact-modal__row:hover {
    background: rgba(0, 0, 0, 0.38);
    border-color: rgba(255, 255, 255, 0.1);
}

.contact-modal__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.contact-modal__icon--wechat {
    background: linear-gradient(145deg, #09d366 0%, #07a855 100%);
}

.contact-modal__icon--xhs {
    background: linear-gradient(145deg, #ff4d6a 0%, #e61e3c 100%);
}

.contact-modal__icon--douyin {
    background: linear-gradient(135deg, #0f0f12 0%, #1a1a22 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(0, 242, 234, 0.15),
        0 0 0 1px rgba(255, 0, 80, 0.12);
}

.contact-modal__icon--mail {
    background: linear-gradient(145deg, #5b8def 0%, #3d6fd8 100%);
}

.contact-modal__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-modal__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(180, 180, 198, 0.75);
}

.contact-modal__value {
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    font-weight: 500;
    color: #f0f0f5;
    user-select: all;
    word-break: break-all;
    line-height: 1.35;
}

.contact-modal__copy {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #e8e8f0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.contact-modal__copy:hover {
    background: rgba(129, 140, 248, 0.25);
    border-color: rgba(129, 140, 248, 0.45);
    color: #fff;
}

.contact-modal__copy:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.9);
    outline-offset: 2px;
}

.contact-modal__copy.is-copied {
    background: rgba(52, 199, 89, 0.22);
    border-color: rgba(52, 199, 89, 0.45);
    color: #b8f5c8;
}

@media (max-width: 400px) {
    .contact-modal__row {
        grid-template-columns: 44px 1fr;
        grid-template-rows: auto auto;
    }

    .contact-modal__icon {
        grid-row: 1 / span 2;
    }

    .contact-modal__copy {
        grid-column: 2;
        justify-self: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-modal,
    .contact-modal__panel {
        transition: none;
    }
}
