/* =========================================================
   ucard 主题 - 响应式层
   叠加在基础 assets/css/style.css 之上：
   - 移动优先沿用原有布局
   - 平板/桌面：居中容器、顶部导航、多栏栅格
   断点：480 / 768 / 1024 / 1280
   ========================================================= */

:root {
    --container-mobile: 480px;
    --container-tablet: 720px;
    --container-desktop: 1080px;
    --topbar-h: 64px;
}

* { box-sizing: border-box; }

/* 顶部导航（桌面）与站点页脚默认隐藏（移动端用 bottom-nav） */
.topbar { display: none; }
.site-footer { display: none; }

/* ---------------- 语言切换器 ---------------- */
.lang-switcher { position: relative; display: inline-block; }
.lang-switcher-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border, rgba(255,255,255,0.1));
    color: var(--text-secondary, #c9d1d9);
    padding: 6px 10px; border-radius: 999px;
    font-size: 13px; cursor: pointer; line-height: 1;
    white-space: nowrap;
    transition: background .2s, border-color .2s;
}
.lang-switcher-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--primary, #00D4AA); }
.lang-caret { font-size: 10px; opacity: .7; }
.lang-switcher-menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 150px; list-style: none; margin: 0; padding: 6px;
    background: var(--bg-secondary, #161b22);
    border: 1px solid var(--card-border, rgba(255,255,255,0.1));
    border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s, transform .18s, visibility .18s; z-index: 1200;
}
.lang-switcher.open .lang-switcher-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option {
    display: block; padding: 9px 12px; border-radius: 8px;
    color: var(--text-secondary, #c9d1d9); text-decoration: none; font-size: 14px;
}
.lang-option:hover { background: rgba(255,255,255,0.06); color: var(--text-primary, #fff); }
.lang-option.is-active { color: var(--primary, #00D4AA); font-weight: 600; }

@media (max-width: 480px) {
    .header-action .lang-switcher-btn,
    .auth-topbar .lang-switcher-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        padding: 0;
        align-items: center;
        justify-content: center;
    }

    .header-action .lang-current,
    .header-action .lang-caret,
    .auth-topbar .lang-current,
    .auth-topbar .lang-caret {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
}

/* ---------------- 认证页布局（登录/注册/改密） ---------------- */
.auth-wrap {
    min-height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; padding: 40px 20px;
}
.auth-topbar {
    position: fixed; top: 0; left: 0; right: 0;
    display: flex; justify-content: flex-end; padding: 16px 20px; z-index: 50;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo-icon {
    width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 20px;
    display: grid; place-items: center; font-size: 38px; font-weight: 800; color: #04110d;
    background: linear-gradient(135deg, var(--primary,#00D4AA) 0%, var(--accent,#7B61FF) 100%);
    box-shadow: 0 12px 32px var(--primary-glow, rgba(0,212,170,.35));
}
.auth-logo h1 { font-size: 24px; color: var(--text-primary,#fff); margin: 0 0 6px; }
.auth-logo p { font-size: 14px; color: var(--text-muted,#6e7681); margin: 0; }
.auth-footer-link { text-align: center; margin-top: 26px; font-size: 14px; color: var(--text-muted,#6e7681); }
.auth-footer-link a { color: var(--primary,#00D4AA); text-decoration: none; }
.auth-divider { display: flex; align-items: center; margin: 26px 0; }
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background: var(--border-color, rgba(255,255,255,.1)); }
.auth-divider span { padding: 0 16px; color: var(--text-muted,#6e7681); font-size: 12px; }
.auth-alert { max-width: 420px; width:100%; margin: 0 auto 18px; padding: 12px 14px; border-radius: 10px; text-align:center; font-size:14px; }
.auth-alert.is-error { background: rgba(193,39,45,.15); border:1px solid #c1272d; color:#ff6b71; }
.auth-alert.is-success { background: rgba(0,212,170,.12); border:1px solid var(--primary,#00D4AA); color: var(--primary,#00D4AA); }
@media (min-width: 1024px) {
    /* 认证页不显示站点顶栏/底栏/底部导航 */
    body.is-auth { padding-top: 0; }
    body.is-auth .topbar, body.is-auth .site-footer, body.is-auth .bottom-nav { display: none !important; }
}

/* =========================================================
   平板 ≥768px：容器变宽，间距加大
   ========================================================= */
@media (min-width: 768px) {
    .page-container {
        max-width: var(--container-tablet) !important;
        padding-left: 24px; padding-right: 24px;
    }
    .balance-card .balance-amount span:last-child { font-size: 40px !important; }
    .action-buttons { gap: 16px; }
}

/* =========================================================
   桌面 ≥1024px：顶部导航 + 隐藏底部导航 + 多栏
   ========================================================= */
@media (min-width: 1024px) {
    body { padding-top: var(--topbar-h); }

    /* 顶部导航 */
    .topbar {
        display: block; position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
        background: rgba(11,14,17,.85); backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--card-border, rgba(255,255,255,0.08)); z-index: 1000;
    }
    .topbar-inner {
        max-width: var(--container-desktop); margin: 0 auto; height: 100%;
        display: flex; align-items: center; gap: 28px; padding: 0 24px;
    }
    .topbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
    .topbar-logo { height: 34px; width: auto; border-radius: 8px; }
    .topbar-logo-mark {
        width: 34px; height: 34px; display: grid; place-items: center;
        background: linear-gradient(135deg, var(--primary,#00D4AA), var(--accent,#7B61FF));
        color: #04110d; font-weight: 800; border-radius: 9px; font-size: 18px;
    }
    .topbar-brand-name { color: var(--text-primary,#fff); font-weight: 700; font-size: 17px; }
    .topbar-nav { display: flex; gap: 6px; margin-left: 8px; }
    .topbar-nav a {
        color: var(--text-secondary,#c9d1d9); text-decoration: none; font-size: 14.5px;
        padding: 8px 14px; border-radius: 8px; transition: background .2s, color .2s;
    }
    .topbar-nav a:hover { background: rgba(255,255,255,.06); color: var(--text-primary,#fff); }
    .topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
    .topbar-btn {
        text-decoration: none; font-size: 14px; padding: 8px 16px; border-radius: 999px;
        color: var(--text-primary,#fff); border: 1px solid var(--card-border,rgba(255,255,255,.15));
    }
    .topbar-btn-primary {
        background: linear-gradient(135deg, var(--primary,#00D4AA), var(--accent,#7B61FF));
        border: none; color: #04110d; font-weight: 700;
    }

    /* 桌面隐藏移动端底部导航与移动端页内 header */
    .bottom-nav { display: none !important; }
    .page-container > .header { display: none !important; }

    /* 主内容居中、更宽 */
    .page-container {
        max-width: var(--container-desktop) !important;
        padding: 32px 24px 64px !important;
        min-height: calc(100vh - var(--topbar-h));
    }

    /* 首页两栏栅格 */
    body.is-home .page-container {
        display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start;
    }
    body.is-home .banner-swiper { grid-column: 1 / -1; }
    body.is-home .banner-img { height: 280px !important; }
    body.is-home .info-bar,
    body.is-home .list-item { grid-column: 1 / -1; }

    /* 卡片/表单容器在桌面限制可读宽度并居中（非首页） */
    body:not(.is-home) .page-container > .card,
    body:not(.is-home) .auth-card,
    body:not(.is-home) form {
        max-width: 560px; margin-left: auto; margin-right: auto;
    }

    /* 站点页脚 */
    .site-footer { display: block; border-top: 1px solid var(--card-border,rgba(255,255,255,.08)); margin-top: 48px; }
    .site-footer-inner {
        max-width: var(--container-desktop); margin: 0 auto; padding: 32px 24px;
        display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    }
    .site-footer-brand { font-weight: 700; color: var(--text-primary,#fff); font-size: 18px; }
    .site-footer-links { display: flex; gap: 20px; margin-left: 24px; }
    .site-footer-links a { color: var(--text-secondary,#c9d1d9); text-decoration: none; font-size: 14px; }
    .site-footer-links a:hover { color: var(--primary,#00D4AA); }
    .site-footer-copy { margin-left: auto; color: var(--text-muted,#6e7681); font-size: 13px; }
}

/* =========================================================
   大屏 ≥1280px：再放宽栅格
   ========================================================= */
@media (min-width: 1280px) {
    .topbar-inner,
    .page-container,
    .site-footer-inner { max-width: 1200px !important; }
    body.is-home .page-container { grid-template-columns: 1.2fr 1fr; }
}
