/*--------------------------------------------------------------
# front.css —— 前端网站公共样式
--------------------------------------------------------------*/
/* === 1. body 布局骨架：flex 纵向 + footer 推底 === */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; font-family: 'Inter', system-ui, sans-serif; }
body > main,
body > .container,
body > div:not(#header) { flex: 1 0 auto; }
#header { flex-shrink: 0; }

/* === 2. 统一页面容器 .page-wrap ===
   首页 / 句选 / 影子跟读 / 个人中心 / 消息 五页响应式收敛。
   max-width = 2xl 断点（1536px）：超过该宽度不再无限拉宽，避免超大屏下内容被撑成横幅；
   水平内边距与 header 内部对齐，logo 与内容左缘齐平。 */
.page-wrap {
    width: 100%;
    max-width: 1536px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}
@media (min-width: 1024px) {
    .page-wrap { padding-left: 32px; padding-right: 32px; }
}
@media (min-width: 1536px) {
    .page-wrap { padding-left: 48px; padding-right: 48px; }
}

/* === 3. 身份条容器（header 下方 identity-strip 的外层） ===
   宽度收敛与 .page-wrap 一致（同 max-width + 居中），超大屏不再无限拉宽。
   水平内边距与 .page-wrap 同步，确保身份条左缘与内容卡片左缘对齐。 */
.identity-wrap {
    width: 100%;
    max-width: 1536px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    padding-top: 12px;
    padding-bottom: 12px;
    box-sizing: border-box;
}
@media (min-width: 1024px) {
    .identity-wrap { padding-left: 32px; padding-right: 32px; }
}
@media (min-width: 1536px) {
    .identity-wrap { padding-left: 48px; padding-right: 48px; }
}

/* === 4. 顶部导航链接（2026-09-24 高优先级覆盖 Tailwind preflight 与 utility） === */
#header nav a.front-nav-link,
#header nav button.front-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px !important;
    color: rgba(255,255,255,.92) !important;
    background: transparent !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    border: none !important;
    border-radius: 8px !important;
    margin: 0 !important;
    cursor: pointer;
    position: relative;
    transition: background .2s, color .2s;
}
#header nav a.front-nav-link:hover,
#header nav button.front-nav-link:hover {
    background: rgba(255,255,255,.16) !important;
    color: #fff !important;
}
#header nav a.front-nav-link.is-active,
#header nav button.front-nav-link.is-active {
    background: #fff !important;
    color: #0a8a4f !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
/* 选中态底部小白条 */
#header nav a.front-nav-link.is-active::after,
#header nav button.front-nav-link.is-active::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}
/* 未登录登录按钮 */
#header nav a.front-nav-link.is-login {
    border: 1px solid rgba(255,255,255,.6) !important;
    padding: 7px 16px !important;
}
#header nav a.front-nav-link.is-login:hover {
    background: rgba(255,255,255,.16) !important;
}
#header nav a.front-nav-link.is-login.is-active {
    background: #fff !important;
    color: #0a8a4f !important;
    border-color: #fff !important;
}

/* === 5. 统一身份卡 identity-strip（2026-09-26 三态：游客 / 登录非 VIP / VIP） ===
     模板见 layout.html :: identity-strip fragment，所有前台页面零改动即可在
     header 下方获得统一身份条。三态 字体/字重/内边距/颜色 全部收敛到 token。 */
.identity-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    font-family: 'Inter', system-ui, sans-serif;
}
/* 三态通用：用户名文字（登录非 VIP / VIP） */
.identity-strip .identity-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}
/* 三态通用：积分 / VIP 到期时间 行（次级文字） */
.identity-strip .identity-meta {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
    line-height: 1.2;
}
/* 三态通用：注销按钮（type=submit 无边框背景透明） */
.identity-strip .identity-signout {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: none;
}
.identity-strip .identity-signout:hover {
    color: #64748b;
    text-decoration: underline;
}
/* 三态通用：VIP 角标 */
.identity-strip .identity-vip-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    letter-spacing: 0.3px;
}
/* 三态通用：头像（登录首字母 / 游客 logo / VIP 皇冠 emoji） */
.identity-strip .identity-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}
.identity-strip .identity-avatar-logo {
    object-fit: cover;
    background: #fff;
}
/* 三态通用：身份卡内圆角按钮统一尺寸 token
   游客「登录/注册」大号：padding 4px 14px
   已登录「开 VIP / 中心」小号：padding 4px 12px
   用 .identity-btn / .identity-btn-sm 两个 class 收敛尺寸 */
.identity-strip .identity-btn,
.identity-strip .identity-btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    border-radius: 999px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
}
.identity-strip .identity-btn {
    padding: 4px 14px;
    font-size: 13px;
}
.identity-strip .identity-btn-sm {
    padding: 4px 12px;
    font-size: 11px;
}

/* === 6. 页脚 === */
.footer-front { margin-top: auto; padding-top: 20px; padding-bottom: 20px; }

/* === 7. markdown 渲染容器（privacy / agreement 等页共用） === */
.markdown-body { box-sizing: border-box; min-width: 200px; max-width: 800px; margin: 0 auto; padding: 24px; }
@media (max-width: 768px) { .markdown-body { padding: 16px; } }
