/* ============================================================
   RetailLib 主样式
   基准：docs/素材/参考/RetailLib_index.css（品牌色板保留）
   修正：
   1. 嵌套 @media 提到规则外层（原生 CSS 兼容性）
   2. 系统字体栈，去除境外字体 CDN 依赖
   3. 新增 .navbar-logo（移动端顶部 Logo）
   4. 新增 .footer-disclaimer（合规免责声明）
   ============================================================ */

/* ---------- GLOBAL RESET & VARIABLES ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    /* Brand Colors（1_2 色彩框架：金/红/蓝 50/30/20） */
    --brand-gold: #D4A84B;
    --brand-gold-light: #FED6B8;
    --brand-amber: #FDC41F;
    --brand-orange: #FF9119;
    --brand-red: #EB4743;
    --brand-burgundy: #80001E;
    --brand-blue-deep: #002870;
    --brand-blue-dark: #002169;
    --brand-bg: #0B1219;
    --brand-bg-card: #121C26;
    --brand-slate: #29313C; /* 1_2 色彩框架·青灰（暗色滚动条滑块） */
    --brand-text: #E8EDF2;
    --brand-text-muted: #9AA9B9;
    --brand-border: rgba(255, 255, 255, 0.08);
    /* Typography：系统字体栈（中文回退无衬线，无境外依赖） */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
    /* 统一 APP 形态内容最大宽度（2026-08-15：全端一致，PC 大屏居中） */
    --container-max: 768px;
    --section-gap: 6rem;
    --card-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.45);
}
html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-margin-top: 90px;
}
body {
    font-family: var(--font-family);
    background-color: var(--brand-bg);
    color: var(--brand-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
/* 暗色滚动条（背景同页面底色，滑块青灰，浅色主题留白不刺眼） */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--brand-slate) var(--brand-bg);
}
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--brand-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--brand-slate);
    border-radius: 5px;
    border: 2px solid var(--brand-bg);
}
::-webkit-scrollbar-thumb:hover {
    background: #3A4653;
}
a {
    text-decoration: none;
    color: inherit;
}
img,
svg {
    display: block;
    max-width: 100%;
}
button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
}
ul,
li {
    list-style: none;
}

/* ---------- 导航（2026-08-15 统一 APP 形态） ----------
   侧边栏及其子元素样式已删除：全端统一由底部 Tab 导航（.app-tabbar）
   主导航；顶部横向导航栏（.navbar）为统一顶栏（logo + 登录/头像）。 */

/* ---------- CONTAINER ---------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}
@media (min-width: 640px) {
    .container {
        padding: 0 2rem;
    }
}
@media (min-width: 1280px) {
    .container {
        padding: 0;
    }
}

/* ---------- NAVBAR 顶部横向导航栏 ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 99;
    background: rgba(11, 18, 25, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--brand-border);
}
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.3rem;
}
.logo-icon {
    /* 品牌 LOGO 由 assets/logo-gold.svg 提供（1129×970，约 1.16:1），高度定宽自动等比 */
    height: 38px;
    width: auto;
    flex-shrink: 0;
}
.logo-text {
    color: white;
    letter-spacing: -0.02em;
}
.logo-highlight {
    color: var(--brand-gold);
}
/* 顶部导航 Logo：统一显示（全端 APP 形态，2026-08-15） */
.navbar-logo {
    display: flex;
}
/* 顶部横向链接导航 .nav-links 已移除（全端由底部 Tab 主导航，2026-08-15） */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ---------- BUTTONS ---------- */
/* hidden 属性不被 .btn 的 display:inline-flex 覆盖（登录按钮隐藏态等，2026-08-14） */
.btn[hidden] {
    display: none;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid transparent;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    line-height: 1.5;
    white-space: nowrap;
}
.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 1rem;
}
.btn-lg {
    font-size: 1rem;
    padding: 0.75rem 2rem;
}
.btn-primary {
    background-color: var(--brand-gold);
    color: #0B1219;
    border-color: var(--brand-gold);
}
.btn-primary:hover {
    background-color: #c4973e;
    border-color: #c4973e;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 168, 75, 0.3);
}
.btn-outline {
    background: transparent;
    color: var(--brand-text);
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}
.btn-ghost {
    background: transparent;
    color: var(--brand-text-muted);
    border-color: transparent;
}
.btn-ghost:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* ---------- HERO ---------- */
.hero {
    position: relative;
    padding: 5rem 0 4rem;
    text-align: center;
    overflow: hidden;
    min-height: 85vh;
    display: flex;
    align-items: center;
}
.hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1.1rem;
    border-radius: 9999px;
    background: rgba(212, 168, 75, 0.12);
    border: 1px solid rgba(212, 168, 75, 0.25);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--brand-gold);
    letter-spacing: 0.02em;
}
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-gold);
    animation: pulse-dot 2s infinite ease-in-out;
}
@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}
.hero-title {
    font-size: clamp(2.6rem, 9vw, 4.8rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
}
.hero-subline {
    display: block;
    color: var(--brand-text-muted);
    font-weight: 500;
    margin-bottom: 0.4rem;
}
.hero-mainline {
    display: block;
    color: white;
    background: linear-gradient(135deg, #ffffff 0%, var(--brand-gold) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc {
    max-width: 660px;
    font-size: 1.1rem;
    color: var(--brand-text-muted);
    line-height: 1.75;
}
.hero-desc strong {
    color: white;
    font-weight: 600;
}
.highlight-text {
    color: var(--brand-gold);
    font-weight: 600;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 0.6rem;
}
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.6rem 2.4rem;
    margin-top: 2rem;
    padding: 1.4rem 2.2rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--brand-border);
}
.stat-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.stat-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}
.stat-label {
    font-size: 0.82rem;
    color: var(--brand-text-muted);
}
.stat-divider {
    width: 1px;
    height: 28px;
    background: var(--brand-border);
}
/* Hero 氛围光晕 */
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.22;
    pointer-events: none;
    z-index: 1;
}
.glow-1 {
    width: 460px;
    height: 460px;
    top: -120px;
    right: -120px;
    background: var(--brand-gold);
}
.glow-2 {
    width: 340px;
    height: 340px;
    bottom: -100px;
    left: -100px;
    background: var(--brand-blue-deep);
}
@media (max-width: 480px) {
    .hero {
        padding: 3rem 0 2.5rem;
        min-height: auto;
    }
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        border-radius: 1.5rem;
        padding: 1.2rem 1.6rem;
    }
    .stat-divider {
        display: none;
    }
}

/* ---------- SECTION HEADER ---------- */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}
.section-tag {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-gold);
    background: rgba(212, 168, 75, 0.1);
    padding: 0.3rem 1.1rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
}
/* 金色标签可作跳转链接（任务看板「策略制定」→ 策略制定页，2026-08-15） */
.section-tag a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}
.section-tag a:hover {
    color: #fff;
}
.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: white;
    line-height: 1.2;
}
.section-title strong {
    color: var(--brand-gold);
}
.section-desc {
    max-width: 600px;
    margin: 1rem auto 0;
    color: var(--brand-text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ---------- TOOLS 工具卡片区块 ---------- */
.tools {
    padding: var(--section-gap) 0;
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}
.tool-card {
    background: var(--brand-bg-card);
    border: 1px solid var(--brand-border);
    border-radius: 1.6rem;
    padding: 2rem 1.8rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    height: 100%;
}
.tool-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 168, 75, 0.32);
    box-shadow: var(--card-shadow-hover);
}
.tool-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tool-accent, var(--brand-gold));
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.tool-icon svg {
    width: 30px;
    height: 30px;
}
.tool-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin-top: 0.3rem;
}
.tool-desc {
    font-size: 0.92rem;
    color: var(--brand-text-muted);
    line-height: 1.65;
    flex: 1;
}
.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.2rem;
}
.tool-tags span {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.2rem 0.8rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--brand-text-muted);
}
.tool-link {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--brand-gold);
    transition: color 0.2s ease;
    margin-top: 0.4rem;
}
.tool-link:hover {
    color: #c4973e;
}

/* ---------- COMPARE 对比区块 ---------- */
.compare {
    padding: var(--section-gap) 0;
    border-top: 1px solid var(--brand-border);
    border-bottom: 1px solid var(--brand-border);
}
.compare-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-width: 840px;
    margin: 0 auto 3rem;
}
.compare-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.4rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
}
.compare-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
.compare-label {
    width: 140px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-text-muted);
    flex-shrink: 0;
}
.compare-values {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.2rem;
}
.compare-vs {
    font-size: 0.88rem;
    color: var(--brand-text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
}
.compare-our {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--brand-gold);
    background: rgba(212, 168, 75, 0.08);
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
}
.compare-quote {
    text-align: center;
    font-size: 1.3rem;
    color: var(--brand-text-muted);
    font-style: italic;
    padding: 2rem 1rem;
    border-top: 1px solid var(--brand-border);
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.8;
}
.compare-quote strong {
    color: white;
    font-style: normal;
}
@media (max-width: 640px) {
    .compare-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        padding: 1rem 0.2rem;
    }
    .compare-label {
        width: auto;
    }
}

/* ---------- CTA 转化区块 ---------- */
.cta {
    padding: var(--section-gap) 0;
    position: relative;
    overflow: hidden;
}
.cta-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    background: radial-gradient(circle at 30% 30%, rgba(212, 168, 75, 0.09), transparent 72%);
    border-radius: 2.2rem;
    padding: 4rem 2rem;
    border: 1px solid var(--brand-border);
}
.cta-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-gold);
    background: rgba(212, 168, 75, 0.1);
    padding: 0.3rem 1.1rem;
    border-radius: 9999px;
    margin-bottom: 1.2rem;
}
.cta-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: white;
    line-height: 1.2;
}
.cta-title strong {
    color: var(--brand-gold);
}
.cta-desc {
    max-width: 540px;
    margin: 1rem auto 1.8rem;
    color: var(--brand-text-muted);
    font-size: 1.08rem;
    line-height: 1.7;
}
.cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
}
.cta-glow {
    position: absolute;
    width: 360px;
    height: 360px;
    bottom: -100px;
    right: -100px;
    background: var(--brand-gold);
    filter: blur(120px);
    opacity: 0.18;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* ---------- FOOTER 页脚 ---------- */
.footer {
    padding: 4rem 0 2.5rem;
    border-top: 1px solid var(--brand-border);
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2.5rem 5rem;
}
.footer-brand {
    flex: 1 1 260px;
}
.footer-brand .logo {
    font-size: 1.15rem;
}
.footer-slogan {
    margin-top: 0.8rem;
    font-weight: 600;
    color: white;
    font-size: 1.05rem;
}
.footer-sub {
    font-size: 0.82rem;
    color: var(--brand-text-muted);
    font-style: italic;
    margin-top: 0.4rem;
}
.footer-copy {
    margin-top: 1.4rem;
    font-size: 0.78rem;
    color: var(--brand-text-muted);
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem 5rem;
}
.footer-col h4 {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-text-muted);
    margin-bottom: 1rem;
}
.footer-col a {
    display: block;
    font-size: 0.88rem;
    color: var(--brand-text-muted);
    padding: 0.3rem 0;
    transition: color 0.2s ease;
}
.footer-col a:hover {
    color: white;
}
/* 合规免责声明 */
.footer-disclaimer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--brand-border);
    font-size: 0.78rem;
    color: var(--brand-text-muted);
    line-height: 1.7;
    max-width: 720px;
}
@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        gap: 2.5rem;
    }
    .footer-links {
        flex-direction: column;
        gap: 2rem;
    }
}

/* ---------- 全局响应式兜底 ---------- */
@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    .section-header {
        margin-bottom: 3rem;
    }
}

/* ============================================================
   统一 APP 形态（2026-08-15 定案）
   全端（手机/PC）结构一致：底部 Tab 主导航 + 顶部横向栏 + 无侧边栏，
   内容列最大 768px 居中。管理后台 admin.html 为独立桌面界面
   （PC 直连，移动端跳首页，见 admin.js）。
   ============================================================ */
/* 触控体验：去点击高亮 + 快速点击不缩放 */
* {
    -webkit-tap-highlight-color: transparent;
}
a,
button,
.strategy-card,
.tool-card {
    touch-action: manipulation;
}
/* 移动端更紧凑的容器留白 */
@media (max-width: 639px) {
    .container {
        padding: 0 1rem;
    }
}
/* 内容底部让位底部 Tab（2026-08-15：全端统一，仅含底部 Tab 的页面生效） */
body:has(.app-tabbar) {
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
}
/* 顶部栏精简：隐藏「开始使用」等主按钮（Hero / 表单内已有等价入口） */
.nav-actions .btn-primary {
    display: none;
}

/* ---------- 底部 Tab 导航（APP 形态） ---------- */
.app-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    align-items: stretch;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(15, 23, 32, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--brand-border);
}
.app-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 44px;
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--brand-text-muted);
    transition: color 0.2s ease;
}
.app-tab svg {
    width: 22px;
    height: 22px;
}
.app-tab.active {
    color: var(--brand-gold);
}
/* 中心「策略」金色主按钮（2026-08-14：缩小、收进底部栏，不再溢出轮廓） */
.app-tab-add {
    position: relative;
}
.app-tab-add .tab-add-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--brand-border);
    color: var(--brand-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
}
/* 仅当位于策略页时才金色高亮（避免与其他 Tab 激活金撞色） */
.app-tab-add.active .tab-add-icon {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #0B1219;
    box-shadow: 0 3px 10px rgba(212, 168, 75, 0.3);
}
.app-tab-add.active .tab-add-label {
    color: var(--brand-gold);
}
/* 底部 Tab：全端显示（2026-08-15 统一 APP 形态） */

/* ============================================================
   认证 / 会员共享组件（2026-08-14）
   供 用户页（pages.css）与管理后台（admin.css）共同使用
   ============================================================ */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
}
.auth-field span {
    font-size: 0.8rem;
    color: var(--brand-text-muted);
}
.auth-error {
    font-size: 0.82rem;
    color: var(--brand-red);
    text-align: left;
    line-height: 1.5;
}

.member-badge {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.14rem 0.5rem;
    border-radius: 999px;
    margin-left: 0.4rem;
    letter-spacing: 0.02em;
}
.member-badge-free {
    color: var(--brand-gold);
    background: rgba(212, 168, 75, 0.12);
    border: 1px solid rgba(212, 168, 75, 0.35);
}
.member-badge-paid {
    color: #7EE2A8;
    background: rgba(126, 226, 168, 0.1);
    border: 1px solid rgba(126, 226, 168, 0.4);
}

/* 导航栏已登录头像（2026-08-14 简化：点击跳「我的」页） */
.nav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(212, 168, 75, 0.14);
    border: 1px solid rgba(212, 168, 75, 0.4);
    color: var(--brand-gold);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}
/* 导航用户标识：头像 + 用户名（2026-08-14）。显式定义 hidden 保证登录态切换正确隐藏 */
.js-auth-user[hidden] {
    display: none;
}
.js-auth-user:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
}
.nav-username {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brand-gold);
    white-space: nowrap;
    max-width: 12em;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ICP 备案号（合规） */
.footer-beian {
    margin-top: 0.8rem;
    padding: 0 1rem 1.2rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--brand-text-muted);
}
.footer-beian a {
    color: inherit;
    text-decoration: none;
}
.footer-beian a:hover {
    text-decoration: underline;
}
