/* ==========================================================================
   Muse Invite — 主样式表
   纯 CSS，无框架；移动优先 + 自适应 PC / H5
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
    --brand-500: #4f46e5;
    --brand-600: #4338ca;
    --brand-400: #6366f1;
    --brand-050: #eef2ff;

    --ok-500: #16a34a;
    --ok-050: #ecfdf5;
    --no-500: #dc2626;
    --no-050: #fef2f2;
    --low-500: #d97706;
    --low-050: #fffbeb;

    --bg: #f6f7fb;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --text: #111827;
    --text-muted: #5b6472;
    --text-soft: #8b93a1;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
    --shadow: 0 4px 16px rgba(17, 24, 39, .07);
    --shadow-lg: 0 18px 48px rgba(17, 24, 39, .12);

    --maxw: 1120px;
    --header-h: 64px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
            "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0d13;
        --bg-alt: #12141c;
        --surface: #161923;
        --surface-2: #1c202c;
        --border: #262b39;
        --border-strong: #333a4d;

        --text: #eef1f7;
        --text-muted: #a4adbe;
        --text-soft: #7d8698;

        --brand-050: #1e1b4b88;
        --ok-050: #052e1c;
        --no-050: #2a0f10;
        --low-050: #2a1f05;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 4px 16px rgba(0, 0, 0, .45);
        --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
    }
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0; }
img, svg { max-width: 100%; }
a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}
.container--narrow { max-width: 780px; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--brand-500);
    color: #fff;
    padding: 10px 16px;
    border-radius: 0 0 var(--radius-sm) 0;
    z-index: 999;
}
.skip-link:focus { left: 0; }

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .28);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(79, 70, 229, .36); text-decoration: none; }

.btn-outline {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-outline:hover { border-color: var(--brand-400); color: var(--brand-600); }

/* ---------- 头部 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, background .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--border); }

.header-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.02em;
    text-decoration: none !important;
    flex-shrink: 0;
}
.brand-mark {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.site-nav a {
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--brand-600); background: var(--brand-050); }

.lang-switch { position: relative; margin-left: auto; }
.site-nav + .lang-switch { margin-left: 8px; }
.lang-switch > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    user-select: none;
    transition: color .15s, background .15s;
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary:hover { color: var(--text); background: var(--surface); }
.lang-switch[open] > summary { color: var(--brand-600); background: var(--brand-050); }
.lang-switch .chev { transition: transform .18s ease; }
.lang-switch[open] .chev { transform: rotate(180deg); }

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 190px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.lang-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    text-decoration: none;
}
.lang-menu a:hover { background: var(--surface-2); text-decoration: none; }
.lang-menu a[aria-current="true"] { background: var(--brand-050); color: var(--brand-600); font-weight: 700; }
.lang-code { font-size: 11px; font-weight: 700; color: var(--text-soft); letter-spacing: .06em; }

.nav-toggle {
    display: none;
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    padding: 9px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

@media (max-width: 760px) {
    .nav-toggle { display: none; }
    .site-nav { display: flex; }
}

@media (max-width: 480px) {
    .header-inner { gap: 8px; }
    .brand { gap: 7px; font-size: 15px; }
    .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
    .brand-mark svg { width: 19px; height: 19px; }
    .lang-switch > summary { padding: 6px 10px; font-size: 13px; gap: 4px; }
    .lang-switch > summary svg[width="15"] { display: none; }
    .site-nav a { padding: 6px 8px; font-size: 12.5px; }
}

/* ---------- Hero ---------- */
.hero {
    padding: 56px 0 40px;
    background:
        radial-gradient(900px 420px at 50% -160px, rgba(99, 102, 241, .16), transparent 70%),
        var(--bg);
    text-align: center;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }

.hero-title {
    font-size: clamp(30px, 6.4vw, 54px);
    max-width: 16em;
    letter-spacing: -.03em;
    text-wrap: balance;
}
.hero-subtitle {
    max-width: 40em;
    color: var(--text-muted);
    font-size: clamp(15px, 2.4vw, 18px);
}

/* ---------- 区块 ---------- */
.section-title { font-size: clamp(23px, 4vw, 33px); letter-spacing: -.025em; text-align: center; }
.section-sub { color: var(--text-muted); margin-top: 10px; font-size: 16px; text-align: center; }

/* ---------- 邀请码池（统计头 + 标签页 + 码卡列表） ---------- */
.container--pool { max-width: 780px; }
.pool { padding: 10px 0 6px; }

.pool-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-soft);
    display: inline-block;
    flex-shrink: 0;
}
.pool-dot--ok {
    background: var(--ok-500);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
}
.pool-dot--low {
    background: var(--low-500);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, .14);
}

/* 统计头卡 */
.pool-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px 20px;
    box-shadow: var(--shadow-sm);
}
.pool-hero-label { font-size: 14px; color: var(--text-muted); }
.pool-hero-value {
    font-size: clamp(38px, 9vw, 54px);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.pool-hero-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 7px;
    font-size: 13.5px;
    color: var(--text-soft);
    margin-top: 4px;
}
.pool-hero-sub b { color: var(--text-muted); font-weight: 700; font-variant-numeric: tabular-nums; }

/* 标签栏 */
.pool-tabs {
    display: flex;
    gap: 4px;
    margin: 18px 0 14px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.pool-tab {
    flex: 1;
    padding: 9px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s, color .16s;
    -webkit-tap-highlight-color: transparent;
}
.pool-tab:hover { color: var(--text); }
.pool-tab[aria-selected="true"] {
    background: var(--brand-050);
    color: var(--brand-600);
}

/* 码卡列表 */
.pool-list { display: grid; gap: 12px; }

.pool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: border-color .16s, box-shadow .16s;
}
.pool-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.pool-card.is-dead { opacity: .55; }

.pool-card-top {
    display: flex;
    align-items: center;
    gap: 6px 12px;
    flex-wrap: wrap;
}
.pool-code {
    font-family: var(--mono);
    font-size: clamp(24px, 6.4vw, 30px);
    font-weight: 800;
    letter-spacing: .12em;
    line-height: 1.25;
    color: var(--text);
    background: none;
    border: 0;
    padding: 0;
    cursor: copy;
    transition: color .16s;
}
.pool-code:hover { color: var(--brand-600); }

.pool-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .16s, border-color .16s, background .16s;
    -webkit-tap-highlight-color: transparent;
}
.pool-copy:hover { border-color: var(--brand-400); color: var(--brand-600); }
.pool-copy.is-copied { border-color: var(--ok-500); color: var(--ok-500); background: var(--ok-050); }

.pool-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13.5px;
    color: var(--text-soft);
    line-height: 1.5;
}

.pool-votes {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.pool-vote {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .16s, border-color .16s, background .16s;
    -webkit-tap-highlight-color: transparent;
}
.pool-vote b { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.pool-vote svg { flex-shrink: 0; }
.pool-vote--ok:hover:not(.is-locked) { background: var(--ok-050); border-color: var(--ok-500); color: var(--ok-500); }
.pool-vote--no:hover:not(.is-locked) { background: var(--no-050); border-color: var(--no-500); color: var(--no-500); }
.pool-vote.is-locked { opacity: .55; cursor: default; pointer-events: none; }
.pool-vote.is-picked { border-color: var(--brand-400); background: var(--brand-050); color: var(--brand-600); }
.pool-vote.is-picked b { color: inherit; }
.pool-vote.is-busy { opacity: .6; pointer-events: none; }

.pool-vote.is-wait { opacity: .45; }
.pool-vote.is-wait b { opacity: .75; }

/* 引导复制：复制按钮脉冲高亮 */
.pool-code.is-nudge,
.pool-copy.is-nudge { border-color: var(--brand-400); animation: muse-nudge .45s ease 3; }

@keyframes muse-nudge {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
    .pool-code.is-nudge,
    .pool-copy.is-nudge { animation: none; border-color: var(--brand-600); }
}

.pool-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 15px;
}
.pool-empty a { font-weight: 600; }

/* ---------- 活动流 ---------- */
.activity-head { text-align: center; margin-bottom: 18px; }
.activity-head h3 { font-size: 18px; }
.activity-head p { color: var(--text-muted); font-size: 14px; margin-top: 6px; }

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}
.activity-kind {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand-400);
    flex-shrink: 0;
}
.activity-kind[data-kind="share"] { background: var(--ok-500); }
.activity-kind[data-kind="claim"] { background: var(--brand-400); }
.activity-text { flex: 1; color: var(--text-muted); min-width: 0; }
.activity-time { color: var(--text-soft); font-size: 12.5px; white-space: nowrap; }

/* ---------- 步骤 ---------- */
.steps { padding: 56px 0; }
.step-list {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
}
.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}
.step-num {
    display: inline-grid;
    place-items: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--brand-050);
    color: var(--brand-600);
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 10px;
}
.step-title { font-size: 16.5px; margin-bottom: 6px; }
.step-text { color: var(--text-muted); font-size: 14.5px; }

/* ---------- 分享邀请码 ---------- */
.share { padding: 12px 0 56px; }
.share-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 26px;
    box-shadow: var(--shadow);
}
.share-title { font-size: clamp(20px, 3.4vw, 26px); text-align: center; }
.share-sub {
    color: var(--text-muted);
    font-size: 15px;
    text-align: center;
    margin-top: 8px;
}
.share-form { margin-top: 20px; }
.share-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.share-row { display: flex; gap: 10px; flex-wrap: wrap; }
.share-input {
    flex: 1;
    min-width: 180px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-family: var(--mono);
    font-size: 17px;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.share-input:focus { outline: 2px solid var(--brand-500); outline-offset: 1px; border-color: var(--brand-400); }
.share-btn { flex-shrink: 0; }
.share-hint { color: var(--text-soft); font-size: 12.5px; margin-top: 10px; }
.share-privacy { color: var(--text-soft); font-size: 12.5px; margin-top: 4px; }
.share-msg {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    min-height: 1.3em;
}
.share-msg.is-ok { color: var(--ok-500); }
.share-msg.is-err { color: var(--no-500); }

/* ---------- FAQ ---------- */
.faq { padding: 56px 0; }
.faq-list {
    margin-top: 26px;
    display: grid;
    gap: 10px;
}
.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.faq-item > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    font-size: 15.5px;
    font-weight: 600;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:hover { background: var(--surface-2); }
.faq-item > summary h3 { flex: 1; font-size: 15.5px; font-weight: 600; }
.faq-icon {
    position: relative;
    width: 14px; height: 14px;
    flex-shrink: 0;
}
.faq-icon::before,
.faq-icon::after {
    content: "";
    position: absolute;
    background: var(--text-soft);
    border-radius: 2px;
    transition: transform .2s ease;
}
.faq-icon::before { left: 0; top: 6px; width: 14px; height: 2px; }
.faq-icon::after  { left: 6px; top: 0; width: 2px; height: 14px; }
.faq-item[open] .faq-icon::after { transform: scaleY(0); }
.faq-answer {
    padding: 0 18px 18px;
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.75;
}

/* ---------- 页脚 ---------- */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 44px 0 26px;
    margin-top: 20px;
}
.footer-inner {
    display: grid;
    gap: 28px;
    grid-template-columns: 1fr;
}
.footer-about h3,
.footer-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-soft);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.footer-about p { color: var(--text-muted); font-size: 13.5px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-col a { color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: var(--brand-600); }
.footer-bottom {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-disclaimer { color: var(--text-soft); font-size: 12.5px; }
.footer-rights { color: var(--text-soft); font-size: 12.5px; margin-top: 4px; }

@media (min-width: 760px) {
    .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}

/* ---------- 浮动分享条 ---------- */
.share-float {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) translateY(140%);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px 18px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    transition: transform .32s cubic-bezier(.32, .72, 0, 1), opacity .3s ease;
    opacity: 0;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.share-float.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.share-float-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.share-float-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    color: #fff;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.share-float-close {
    width: 26px; height: 26px;
    border: 0;
    background: none;
    color: var(--text-soft);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
}
.share-float-close:hover { background: var(--surface-2); color: var(--text); }

@media (max-width: 560px) {
    .share-float { left: 12px; right: 12px; transform: translateY(140%); max-width: none; }
    .share-float.is-visible { transform: translateY(0); }
}

/* ---------- 404 ---------- */
.error-page { padding: 80px 0; text-align: center; }
.error-page h1 { font-size: 56px; color: var(--brand-600); }
.error-page p { margin-top: 12px; }

/* ---------- 动效与工具类 ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}
