/* ============================================================
   账号 / 会员 / 卡密 页面共用样式
   设计 token 与全站统一顶栏（style.css）同源：
   墨蓝 #0b2f60 / 主蓝 #0b4182 / 亮蓝 #1e88e5 / 会员金 #e08600
   认证页为简易模式（统一顶栏 + 居中单栏表单，参考 number.ftcbb.com）
   ============================================================ */

:root {
    /* 色板 */
    --ink-900: #0b2f60;
    --ink-700: #374151;
    --ink-500: #6b7c93;
    --ink-400: #93a1b3;
    --primary: #0b4182;
    --accent: #1e88e5;
    --gold: #e08600;
    --line: #e3edf8;
    --surface: #ffffff;
    --bg-soft: #f4f8ff;
    --success: #2e7d32;
    /* 圆角 */
    --r-sm: 9px;
    --r-md: 14px;
    --r-lg: 18px;
    /* 阴影 */
    --sh-card: 0 10px 36px rgba(11, 65, 130, 0.09);
    --sh-soft: 0 6px 24px rgba(11, 65, 130, 0.06);
    /* 间距 */
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
}

/* ---------- 用户区导航按钮（user-ui.js 注入 .site-user-slot） ---------- */
.user-nav-area { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.user-nav-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.5rem 0.9rem; border-radius: 8px;
    font-size: 0.9rem; text-decoration: none; font-weight: 500;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: #fff;
    white-space: nowrap; transition: filter 0.2s;
}
.user-nav-btn:hover { filter: brightness(1.08); color: #fff; }
.user-nav-btn.ghost { background: transparent; color: var(--primary); border: 1px solid #b9d4f0; }
.user-nav-btn.ghost:hover { background: #e8f1fb; }

/* ============================================================
   认证页：简易模式（统一顶栏 + 居中单栏表单卡片，参考 number 站）
   ============================================================ */
.auth-simple {
    min-height: calc(100vh - 62px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem 3.5rem;
    background: radial-gradient(900px 420px at 50% -8%, #e6f0ff 0%, rgba(230, 240, 255, 0) 70%),
                linear-gradient(180deg, var(--bg-soft) 0%, #f7f9fc 100%);
}
.auth-simple .auth-card {
    max-width: 440px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 2.4rem 2.2rem 2rem;
    box-shadow: var(--sh-card);
}
/* 品牌图标徽章：认证页视觉锚点 */
.auth-badge {
    width: 58px; height: 58px;
    margin: 0 auto 1.15rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff; font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(30, 136, 229, 0.28);
}
.auth-simple .auth-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink-900);
    letter-spacing: -0.01em;
    margin: 0 0 0.45rem;
}
.auth-simple .auth-sub {
    text-align: center;
    color: var(--ink-500);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0 0 1.6rem;
}

/* ---------- 注册两步流程：步骤指示器 ---------- */
.auth-steps {
    display: flex; align-items: center; justify-content: center;
    gap: 0.55rem; margin: 0 0 1.5rem;
}
.auth-step {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.78rem; color: var(--ink-400); white-space: nowrap;
}
.auth-step-num {
    width: 21px; height: 21px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #eef2f8; color: var(--ink-400);
    font-size: 0.7rem; font-weight: 700;
}
.auth-step.active { color: var(--primary); font-weight: 600; }
.auth-step.active .auth-step-num { background: var(--accent); color: #fff; }
.auth-step.done { color: var(--success); }
.auth-step.done .auth-step-num { background: var(--success); color: #fff; }
.auth-step-line { width: 30px; height: 1px; background: #dbe4f0; }

/* ---------- 认证表单 ---------- */
.auth-form .form-group { margin-bottom: 1.15rem; }
.auth-form label {
    display: block; color: var(--ink-700); font-size: 0.85rem;
    margin-bottom: 0.5rem; font-weight: 600;
}
.auth-form label i { color: var(--accent); margin-right: 0.3rem; }
.auth-form input {
    width: 100%; min-height: 46px; padding: 0.72rem 0.9rem;
    border: 1.5px solid #d8e3f0; border-radius: var(--r-sm);
    font-size: 0.95rem; box-sizing: border-box; background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.12); }
.auth-form input::placeholder { color: #aab6c4; }
.auth-form .inline { display: flex; gap: 0.6rem; }
.auth-form .inline input { flex: 1; min-width: 0; }
.auth-form .code-btn {
    min-height: 46px; padding: 0 0.95rem; background: #e8f1fb; color: var(--primary);
    border: 1px solid #b9d4f0; border-radius: var(--r-sm); cursor: pointer;
    font-size: 0.88rem; white-space: nowrap; font-weight: 600;
    transition: background 0.15s;
}
.auth-form .code-btn:hover:not(:disabled) { background: #d9e9fa; }
.auth-form .code-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-form .agree { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.82rem; color: #6b7280; line-height: 1.6; }
.auth-form .agree input { width: auto; min-height: 0; margin-top: 0.18rem; }
.auth-form .agree a { color: #1565c0; text-decoration: underline; }

.primary-btn {
    width: 100%; min-height: 48px; padding: 0.85rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff; border: none; border-radius: var(--r-sm);
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(11, 65, 130, 0.28); filter: brightness(1.05); }
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.primary-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.auth-msg { padding: 0.7rem 0.9rem; border-radius: 8px; font-size: 0.88rem; margin-bottom: 1rem; display: none; line-height: 1.5; }
.auth-msg.error { display: block; background: #ffebee; color: #c62828; border-left: 3px solid #c62828; }
.auth-msg.ok { display: block; background: #e8f5e9; color: var(--success); border-left: 3px solid var(--success); }
.auth-msg.info { display: block; background: #e3f2fd; color: #1565c0; border-left: 3px solid #1565c0; }
.auth-links { text-align: center; margin-top: 1.05rem; font-size: 0.88rem; color: #8a94a3; }
.auth-links a { color: #1565c0; text-decoration: none; font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }
.auth-switch {
    margin: 1.4rem 0 0; padding-top: 1.15rem; border-top: 1px solid #eef2f8;
    text-align: center; font-size: 0.9rem; color: var(--ink-500);
}
.auth-switch a { color: var(--primary); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-foot { margin: 0.9rem 0 0; font-size: 0.8rem; line-height: 1.7; color: #9aa5b4; text-align: center; }
.auth-foot a { color: #5c6b80; text-decoration: underline; }

/* ============================================================
   内容页：账户 / 会员 / 卡密（独立的块级容器，避免复用出题页 .container）
   ============================================================ */
.page-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2.2rem 1.25rem 4rem;
}
.page-head { text-align: center; margin-bottom: 2.1rem; }
.page-head-icon {
    width: 56px; height: 56px; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--gold) 0%, #f5a623 100%);
    color: #fff; font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(224, 134, 0, 0.25);
}
.page-head h2,
.page-head h1 { color: var(--ink-900); font-size: 1.8rem; margin: 0 0 0.5rem; font-weight: 700; }
.page-head p { color: #7a8899; font-size: 0.92rem; margin: 0; line-height: 1.7; }
.page-section {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 1.5rem; box-shadow: var(--sh-soft); margin-bottom: 1.2rem;
}

/* ---------- 账户页 ---------- */
/* 标题区蓝色图标徽章（与会员页金色皇冠区分层级） */
.page-head-icon.user {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 8px 20px rgba(30, 136, 229, 0.28);
}

/* 未登录引导卡（独立组件，不依赖 .auth-simple 父容器） */
.guest-card {
    max-width: 430px; margin: 1.5rem auto 3rem;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 2.6rem 2.2rem 2.2rem;
    text-align: center; box-shadow: var(--sh-card);
}
.guest-icon {
    width: 58px; height: 58px; margin: 0 auto 1.15rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff; font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(30, 136, 229, 0.28);
}
.guest-card h2 { font-size: 1.5rem; color: var(--ink-900); margin: 0 0 0.5rem; font-weight: 700; }
.guest-card p { color: var(--ink-500); font-size: 0.9rem; line-height: 1.65; margin: 0 0 1.6rem; }
.guest-card .primary-btn { display: block; text-decoration: none; }
.guest-foot { margin-top: 1.3rem; font-size: 0.85rem; color: var(--ink-500); }
.guest-foot a { color: var(--primary); font-weight: 700; text-decoration: none; }
.guest-foot a:hover { text-decoration: underline; }

/* 会员状态横幅：登录后视觉焦点 */
.member-banner {
    display: flex; align-items: center; gap: 1.1rem;
    padding: 1.3rem 1.5rem; margin-bottom: 1.2rem;
    border-radius: var(--r-md); color: #fff;
    background: linear-gradient(120deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: var(--sh-soft);
}
.member-banner.vip { background: linear-gradient(120deg, #b26a00 0%, var(--gold) 55%, #f5a623 100%); }
.member-banner-icon {
    width: 52px; height: 52px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px; background: rgba(255, 255, 255, 0.16); font-size: 1.5rem;
}
.member-banner-main { flex: 1; min-width: 0; }
.member-banner-main .tier { font-size: 1.1rem; font-weight: 700; }
.member-banner-main .meta { font-size: 0.85rem; opacity: 0.88; margin-top: 0.3rem; line-height: 1.5; }
.member-banner-action {
    flex: none; padding: 0.55rem 1rem; border-radius: 9px;
    background: rgba(255, 255, 255, 0.18); color: #fff;
    text-decoration: none; font-size: 0.88rem; font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.32);
}
.member-banner-action:hover { background: rgba(255, 255, 255, 0.3); }
@media (max-width: 560px) {
    .member-banner { flex-wrap: wrap; gap: 0.8rem; padding: 1.1rem; }
    .member-banner-action { width: 100%; text-align: center; }
}

/* 面板与信息行 */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 720px) { .account-grid { grid-template-columns: 1fr; } }
.panel {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 1.5rem; box-shadow: var(--sh-soft);
}
.panel h2 {
    color: var(--primary); font-size: 1.1rem; margin: 0 0 1rem;
    padding-bottom: 0.7rem; border-bottom: 2px solid #e8f1fb;
    display: flex; align-items: center; gap: 0.5rem;
}
.panel h2 i { color: var(--accent); }
.panel .row { display: flex; justify-content: space-between; padding: 0.62rem 0; font-size: 0.92rem; border-bottom: 1px solid #f2f6fb; }
.panel .row:last-of-type { border-bottom: none; }
.panel .row .label { color: var(--ink-500); }
.panel .row .value { color: var(--ink-900); font-weight: 600; text-align: right; }
.panel-lead { color: var(--ink-500); font-size: 0.88rem; line-height: 1.6; margin: -0.2rem 0 1.1rem; }
.panel-actions { display: flex; gap: 0.6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.panel-orders { margin-top: 1.2rem; }
.badge { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.badge.vip { background: #fff3e0; color: #ef6c00; }
.badge.free { background: #eceff1; color: #607d8b; }

/* ---------- 会员套餐卡片 ---------- */
.plan-grid {
    display: grid;
    /* 5 个方案（免费+日/月/季/年）自适应列数，避免 4+1 换行破格 */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.1rem;
    align-items: stretch;
}
.plan-card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1.6rem 1.2rem 1.4rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.plan-card:hover { transform: translateY(-5px); box-shadow: var(--sh-card); border-color: var(--accent); }
.plan-card.featured { border: 2px solid var(--gold); box-shadow: 0 12px 32px rgba(224, 134, 0, 0.14); }
.plan-card.featured:hover { box-shadow: 0 16px 38px rgba(224, 134, 0, 0.22); }
.plan-ribbon {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, var(--gold) 0%, #f5a623 100%);
    color: #fff; font-size: 0.72rem; font-weight: 700;
    padding: 0.28rem 0.85rem; border-radius: 20px; white-space: nowrap;
    box-shadow: 0 4px 10px rgba(224, 134, 0, 0.3);
}
.plan-card .plan-name { font-size: 1.15rem; color: var(--ink-900); font-weight: 700; }
.plan-card .plan-days { font-size: 0.82rem; color: var(--ink-500); margin: 0.35rem 0 1rem; }
.plan-card .plan-price { font-size: 2.1rem; color: var(--gold); font-weight: 800; line-height: 1.1; margin-bottom: 0.2rem; }
.plan-card .plan-price .currency { font-size: 1.15rem; vertical-align: 0.28em; margin-right: 0.05rem; }
.plan-card .plan-price .unit { font-size: 0.8rem; color: var(--ink-500); font-weight: 500; vertical-align: 0.1em; }
.plan-card .plan-divider { height: 1px; background: var(--line); margin: 1rem 0; }
.plan-card .plan-perks { list-style: none; padding: 0; margin: 0 0 1.3rem; text-align: left; display: flex; flex-direction: column; gap: 0.6rem; }
.plan-card .plan-perks li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.8rem; color: #5c6b80; line-height: 1.5; }
.plan-card .plan-perks i { color: var(--success); margin-top: 0.15rem; flex: none; }
.plan-card .primary-btn { margin-top: auto; padding: 0.7rem; font-size: 0.92rem; }
.plan-card.featured .primary-btn { background: linear-gradient(135deg, var(--gold) 0%, #f5a623 100%); }
.plan-card.featured .primary-btn:hover { box-shadow: 0 6px 18px rgba(224, 134, 0, 0.32); }

/* ---------- 会员页底部：信任背书 + 卡密入口 ---------- */
.plan-footer { margin-top: 2rem; text-align: center; }
.plan-trust {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 0.5rem 1.6rem; margin-bottom: 1.1rem;
    font-size: 0.84rem; color: var(--ink-500);
}
.plan-trust span { display: inline-flex; align-items: center; gap: 0.4rem; }
.plan-trust i { color: var(--success); }
.plan-card-link {
    font-size: 0.9rem; color: var(--ink-500);
}
.plan-card-link a { color: var(--primary); font-weight: 700; text-decoration: none; }
.plan-card-link a:hover { text-decoration: underline; }

/* ---------- 表格 ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid #edf2f8; text-align: left; }
.data-table th { color: var(--primary); background: #f5f9ff; position: sticky; top: 0; }
.data-table tr:hover td { background: #fafcff; }
.data-table .empty-row td { text-align: center; color: #9aa5b4; padding: 2.6rem 1rem; font-size: 0.9rem; }
.data-table .empty-row i { display: block; font-size: 1.8rem; color: #c3cede; margin-bottom: 0.6rem; }
.redeem-form .form-group { margin-bottom: 1rem; }
.redeem-form input {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.08em; text-transform: uppercase; text-align: center;
}
.status-unused { color: #1565c0; }
.status-active { color: var(--success); }
.status-disabled { color: #c62828; }
.table-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
/* 订单号：等宽字体便于比对 */
.data-table td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; color: #5c6b80; }
/* 订单状态标签 */
.status-tag { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 20px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.status-tag.st-paid { background: #e8f7ef; color: #1a7f4b; }
.status-tag.st-pending { background: #fff5e6; color: #b26a00; }
.status-tag.st-cancelled, .status-tag.st-closed { background: #f0f2f5; color: #7a8698; }
.status-tag.st-refunded { background: #fdecec; color: #c62828; }
/* 邮箱验证状态 */
.verify-ok { color: #1a7f4b; font-weight: 600; }
.verify-no { color: #b26a00; font-weight: 600; }

/* ---------- 免费版套餐卡：弱化展示，不作视觉焦点 ---------- */
.plan-card.free-card { background: #f8fafc; border-style: dashed; }
.plan-card.free-card .plan-name { color: var(--ink-700); }
.plan-card.free-card .plan-price { color: var(--ink-500); }
.plan-card.free-card .plan-perks i { color: #94a3b8; }
.plan-card.free-card .plan-btn-static {
    display: block; margin-top: auto; padding: 0.7rem; border-radius: 8px;
    background: #eef3fa; color: var(--primary); font-size: 0.92rem; font-weight: 600;
    text-align: center; cursor: default;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; align-items: center; }
.toolbar select, .toolbar input {
    padding: 0.5rem 0.7rem; border: 1px solid #ccd8e6; border-radius: 6px; font-size: 0.88rem;
}
.mini-btn {
    padding: 0.4rem 0.75rem; border: 1px solid #b9d4f0; background: #e8f1fb;
    color: var(--primary); border-radius: 7px; cursor: pointer; font-size: 0.82rem; text-decoration: inline-block;
}
.mini-btn.danger { border-color: #ffcdd2; background: #ffebee; color: #c62828; }
.mini-btn:hover { filter: brightness(0.96); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) { .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .page-container { padding: 1.6rem 1rem 3rem; }
    .page-head h2,
    .page-head h1 { font-size: 1.55rem; }
}
@media (max-width: 520px) {
    .auth-simple { padding: 1.8rem 0.9rem 2.5rem; align-items: flex-start; }
    .auth-simple .auth-card { padding: 2rem 1.35rem 1.7rem; }
    .plan-grid { grid-template-columns: 1fr; }
    .plan-card { padding: 1.5rem 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-simple .auth-card, .plan-card, .primary-btn { transition: none; }
}

/* ============================================================
   页脚吸底（登录 / 注册 / 找回密码 / 账户 / 会员 / 卡密页）
   内容不满一屏时页脚贴住视口底部，避免下方留大片空白
   ============================================================ */
body.site-flex {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body.site-flex > .site-header { flex: none; }
body.site-flex .auth-simple { flex: 1 1 auto; min-height: 0; }
body.site-flex .page-container { flex: 1 1 auto; }
/* 关键：flex 纵向容器中的自动外边距会让元素收缩到内容宽度，
   这里显式给满宽，否则会员/账户页内容会被挤成窄条。 */
body.site-flex .page-container { width: 100%; }
body.site-flex > .footer { margin-top: auto; }
