/* ========================================
   i8n.com Flarum Design System — 100% Match
   ======================================== */
:root {
    /* Flarum 精确 token（来自 demo.flarum.site 编译 CSS） */
    --primary-color: #4D698E;
    --secondary-color: #4D698E;
    --body-bg: #fff;
    --body-bg-shaded: #f7f7f7;
    --body-bg-light: #fff;
    --text-color: #111;
    --link-color: #426799;
    --heading-color: #111;
    --muted-color: hsl(214.15, 15%, 50%);
    --muted-color-light: hsl(214.15, 15%, 60%);
    --shadow-color: rgba(0,0,0,0.35);
    --control-bg: hsl(214.15, 29.68%, 93%);
    --control-bg-light: hsl(214.15, 29.68%, 96%);
    --control-bg-shaded: hsl(214.15, 29.68%, 88%);
    --control-color: var(--muted-color);
    --error-color: #d83e3e;
    --success-color: #58a400;
    --header-bg-light: #ffffff;
    --header-bg-dark: hsl(214.15, 20%, 15%);
    --header-bg: var(--header-bg-light);
    --header-color-light: #1a1a1a;
    --header-color-dark: #ffffff;
    --header-color: var(--header-color-light);
    --header-control-bg-light: rgba(0,0,0,0.08);
    --header-control-bg-dark: rgba(255,255,255,0.12);
    --header-control-bg: var(--header-control-bg-light);
    --header-control-color: #fff;
    --header-colored-control-color-light: #1a1a1a;
    --header-colored-control-color-dark: #ffffff;
    --header-colored-control-color: var(--header-colored-control-color-light);
    --header-border-light: rgba(0,0,0,0.08);
    --header-border-dark: rgba(255,255,255,0.1);
    --header-border: var(--header-border-light);
    --header-link-color-light: rgba(26,26,26,0.85);
    --header-link-color-dark: rgba(255,255,255,0.85);
    --header-link-color: var(--header-link-color-light);
    --header-icon-color-light: rgba(26,26,26,0.55);
    --header-icon-color-dark: rgba(255,255,255,0.55);
    --header-icon-color: var(--header-icon-color-light);
    --header-input-bg-light: rgba(0,0,0,0.05);
    --header-input-bg-dark: rgba(255,255,255,0.12);
    --header-input-bg: var(--header-input-bg-light);
    --header-input-border-light: rgba(0,0,0,0.15);
    --header-input-border-dark: rgba(255,255,255,0.22);
    --header-input-border: var(--header-input-border-light);
    --overlay-bg: rgba(77,105,142,0.9);
    --code-bg: #f7f7f7;
    --code-color: #5e5e5e;
    --discussion-title-color: hsl(214.15, 15%, 35%);
    --discussion-list-item-bg-hover: var(--control-bg-light);
    --button-color: var(--muted-color);
    --button-bg: var(--control-bg);
    --button-bg-hover: var(--control-bg-shaded);
    --button-bg-active: var(--control-bg-shaded);
    --button-primary-color: #fff;
    --button-primary-bg: #4D698E;
    --button-primary-bg-hover: #42527f;
    --button-primary-bg-active: #42527f;
    --badge-bg: var(--muted-color);
    --badge-color: #fff;
    --border-radius: 4px;
    --border-width: 2px;
    --border-color: hsl(214.15, 29.68%, 88%);
    --icon-color: hsl(214.15, 15%, 45%);
    --header-height: 52px;
    --app-bottom-padding: 50px;
    --avatar-column-width: 85px;
    --container-hd: 1200px;
    --container-xl: 1300px;
    --container-xxl: 1500px;
    --zindex-header: 1000;
    --alert-error-bg: #d83e3e;
    --alert-success-bg: #B4F1AF;
    --alert-bg: #fff2ae;
    --alert-color: #ad6c00;
    --screen-phone-max: 767.98px;
    --screen-tablet: 768px;
    --screen-desktop: 992px;
    --screen-desktop-hd: 1100px;

    /* 短名别名（兼容 detail/profile 等页面内联 <style> 中的 var() 引用） */
    --primary: var(--primary-color);
    --primary-hover: #3F5A7A;
    --primary-light: hsl(214.15, 29.68%, 93%);
    --border: var(--border-color);
    --radius: var(--border-radius);
    --success: var(--success-color);
    --text: var(--text-color);
    --text-muted: var(--muted-color);
    --card: var(--body-bg);
}

/* ====== Reset & Base ====== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--body-bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== App Shell (Flarum .App) ====== */
.App {
    padding-top: var(--header-height);
    padding-bottom: var(--app-bottom-padding);
    min-height: 100vh;
}
.App-header {
    background: var(--header-bg);
    color: var(--header-color);
    height: var(--header-height);
}
.App-body { background: var(--body-bg); }
.App-content { position: relative; }

/* ====== Container (Flarum responsive 阶梯) ====== */
.container {
    margin: 0 auto;
    padding: 0 15px;
    width: auto;
    max-width: 100%;
}
@media (min-width: 768px) {
    .container { width: min(991.98px, 100%); }
}
@media (min-width: 992px) {
    .container { width: min(1099.98px, 100%); }
}
@media (min-width: 1100px) {
    .container { width: min(var(--container-hd), 100%); }
}
@media (min-width: 1600px) {
    .container { width: var(--container-xl); }
}
@media (min-width: 2000px) {
    .container { width: var(--container-xxl); }
}

/* Flarum .Button base (shared by .btn, sidebar, header) */
.Button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 8px 13px;
    border: 0;
    border-radius: var(--border-radius);
    line-height: 20px;
    font-size: 14px;
    font-family: inherit;
    font-weight: normal;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    color: var(--button-color);
    background: var(--button-bg);
    transition: background .15s;
}
.Button:hover { background: var(--button-bg-hover); text-decoration: none; }
.Button--primary {
    color: var(--button-primary-color);
    background: var(--button-primary-bg);
    font-weight: bold;
}
.Button--primary:hover { background: var(--button-primary-bg-hover); }
.Button--link { background: transparent; color: var(--muted-color); }
.Button--link:hover { background: var(--control-bg); color: var(--text-color); }
.Button-label { line-height: 20px; }

/* Flarum .FormControl (inputs/selects/textarea) */
.FormControl {
    width: 100%;
    padding: 8px 13px;
    border: var(--border-width) solid var(--control-bg);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-color);
    background: var(--control-bg);
    outline: none;
    transition: border-color .15s, background .15s;
}
.FormControl:focus {
    border-color: var(--primary-color);
    background: var(--body-bg);
}
textarea.FormControl { resize: vertical; min-height: 80px; }

/* Flarum .Avatar */
.Avatar {
    --size: 48px;
    width: var(--size);
    height: var(--size);
    border-radius: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--control-bg);
}
.Avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 100%; }

/* Flarum .Modal shell */
.Modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--overlay-bg);
}

/* ====== Header / Navbar (Flarum 2.0 Style) ====== */
.navbar {
    background: var(--header-bg);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    color: var(--header-color);
    border-bottom: 1px solid var(--header-border, rgba(0,0,0,0.08));
    box-sizing: border-box;
}
/* 与 .container 组合使用：宽度/居中/响应式阶梯由 .container 提供，
   此处只负责头条内部的横向 flex 布局。 */
.navbar-container {
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 0;
}

/* 左侧区域：Logo + 导航 */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-icon {
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
    transition: transform .2s;
}
.logo-icon img,
img.logo-icon {
    display: block;
    height: 40px;
    width: auto;
    object-fit: contain;
}
.navbar-logo:hover .logo-icon { transform: scale(1.1) rotate(-5deg); }
.navbar-logo:hover img.logo-icon { transform: scale(1.05); }
.logo-text {
    font-size: 17px;
    font-weight: 600;
    color: var(--header-color);
    letter-spacing: 0.3px;
}

/* 导航链接 */
.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}
.nav-link {
    color: var(--header-link-color, rgba(255,255,255,.85));
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 13px;
    border-radius: var(--border-radius);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.nav-link:hover {
    background: var(--header-control-bg);
    color: var(--header-color);
    text-decoration: none;
}
.nav-link.active {
    color: var(--header-color);
    font-weight: bold;
}

/* ====== 搜索按钮（Flarum Search-input 风格） ====== */
.nav-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 6px;
    color: var(--header-color);
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background .15s, color .15s;
    line-height: 0;
    font-size: 16px;
    flex-shrink: 0;
}
.nav-search-btn:hover { background: var(--header-control-bg); color: var(--header-color); }
.nav-search-btn .icon { font-size: 16px; }

/* ====== 搜索面板（Flarum 弹窗式） ====== */
.search-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 16px 16px;
}
.search-panel {
    width: 100%;
    max-width: 640px;
    background: var(--body-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}
.search-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}
.search-panel-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--control-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 10px;
    height: 40px;
    min-width: 0;
}
.search-panel-input-wrap:focus-within { border-color: var(--primary-color); }
.search-panel-icon { color: var(--muted-color); flex-shrink: 0; font-size: 15px; }
.search-panel-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-color);
    font-size: 14px;
    min-width: 0;
}
.search-panel-input-wrap input::placeholder { color: var(--muted-color); opacity: .7; }
.search-panel-clear {
    background: none; border: none; cursor: pointer;
    color: var(--muted-color); font-size: 14px; padding: 4px; line-height: 1; flex-shrink: 0;
}
.search-panel-clear:hover { color: var(--text-color); }
.search-panel-close {
    background: none; border: none; cursor: pointer;
    color: var(--muted-color); font-size: 14px; padding: 6px 10px; flex-shrink: 0; border-radius: 6px;
}
.search-panel-close:hover { color: var(--text-color); background: var(--control-bg); }
.search-panel-body { overflow-y: auto; }
.search-panel-results { padding: 8px; }
.search-panel-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px 16px; color: var(--muted-color); text-align: center; font-size: 14px; gap: 12px;
}
.search-panel-loading {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 32px; text-align: center; color: var(--muted-color); font-size: 14px;
}
.sp-loading-spinner {
    width: 16px; height: 16px; border: 2px solid var(--border-color); border-top-color: var(--primary-color);
    border-radius: 50%; animation: sp-spin .7s linear infinite;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }
.search-panel-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--text-color);
    transition: background .12s;
}
.search-panel-item:hover { background: var(--control-bg-light); }
.sp-item-cover {
    width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--control-bg);
}
.sp-item-cover-ph { display: flex; align-items: center; justify-content: center; color: var(--muted-color); }
.sp-item-main { flex: 1; min-width: 0; }
.sp-item-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.sp-item-cat {
    font-size: 11px; color: var(--primary-color); background: rgba(84,104,160,.12);
    padding: 1px 8px; border-radius: 10px; white-space: nowrap;
}
.sp-item-price { font-size: 12px; color: var(--muted-color); }
.sp-item-price-free { color: var(--success-color); font-weight: 600; }
.sp-item-arrow { flex-shrink: 0; color: var(--muted-color); }

/* ====== 列表工具栏（Flarum IndexPage-toolbar：排序 + 搜索 + 刷新） ====== */
.IndexPage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.toolbar-left { display: flex; align-items: center; }
.toolbar-right { display: flex; align-items: center; gap: 6px; }

.sort-dropdown { position: relative; }
.sort-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--control-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
    transition: background .15s;
}
.sort-toggle:hover { background: var(--control-bg-shaded); }
.sort-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 500;
    min-width: 140px;
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 6px 20px var(--shadow-color);
    list-style: none;
    margin: 0;
    padding: 4px;
}
.sort-menu.show { display: block; }
.sort-menu li {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
    white-space: nowrap;
}
.sort-menu li:hover { background: var(--control-bg-light); }
.sort-menu li.active { background: var(--control-bg-shaded); font-weight: 600; }

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--control-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--muted-color);
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.toolbar-btn:hover { background: var(--control-bg-shaded); color: var(--text-color); }
.toolbar-btn .icon { font-size: 15px; }

/* 搜索框 */
.navbar-search {
    display: flex;
    align-items: center;
    position: relative;
}
.search-box {
    display: flex;
    align-items: center;
    width: 200px;
    background: var(--header-input-bg, rgba(255,255,255,.1));
    border: 1px solid var(--header-input-border, rgba(255,255,255,.12));
    border-radius: 24px;
    overflow: hidden;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    position: relative;
}
.search-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,.05) 0%, transparent 100%);
    pointer-events: none;
}
.search-box:focus-within {
    background: var(--header-control-bg);
    border-color: var(--header-input-border, rgba(255,255,255,.25));
}
.search-icon {
    display: flex;
    align-items: center;
    padding: 0 4px 0 14px;
    color: var(--header-icon-color, rgba(255,255,255,.5));
    flex-shrink: 0;
    transition: color .2s;
    cursor: pointer;
}
.search-box:focus-within .search-icon { color: var(--header-link-color, rgba(255,255,255,.8)); }
.search-input {
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: var(--header-color);
    min-width: 0;
}
.search-input::placeholder { color: var(--header-icon-color, rgba(255,255,255,.45)); }
.search-btn {
    padding: 8px 14px 8px 6px;
    border: none;
    background: transparent;
    color: var(--header-icon-color, rgba(255,255,255,.6));
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all .2s;
    border-radius: 0 24px 24px 0;
}
.search-btn:hover { color: var(--header-color); background: var(--header-control-bg); }

/* 移动端搜索按钮 */
.mobile-search-btn {
    display: none;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--header-link-color, rgba(255,255,255,.8));
    cursor: pointer;
    margin-left: auto;
    border-radius: 8px;
    transition: all .2s;
}
.mobile-search-btn:hover { background: var(--header-control-bg); color: var(--header-color); }

/* 移动端搜索遮罩 */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.6);
    z-index: 998;
    backdrop-filter: blur(8px);
    animation: overlayFadeIn .25s ease;
}
.mobile-search-overlay.active { display: flex; align-items: flex-start; justify-content: center; padding-top: 60px; }
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }

.mobile-search-container {
    width: 100%;
    max-width: 560px;
    margin: 0 16px;
    animation: searchSlideDown .3s cubic-bezier(.4,0,.2,1);
}
@keyframes searchSlideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}
.search-title {
    color: rgba(255,255,255,.9);
    font-size: 16px;
    font-weight: 600;
}
.mobile-search-close {
    padding: 8px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s;
}
.mobile-search-close:hover { background: rgba(255,255,255,.1); color: #fff; }

.mobile-search-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 16px;
    padding: 4px;
    gap: 4px;
}
.search-icon-lg {
    padding: 0 12px;
    color: rgba(255,255,255,.5);
    flex-shrink: 0;
}
.mobile-search-input {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    color: #fff;
    min-width: 0;
}
.mobile-search-input::placeholder { color: rgba(255,255,255,.4); }
.mobile-search-go {
    padding: 10px 20px;
    border: none;
    background: var(--button-primary-bg);
    color: var(--button-primary-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.mobile-search-go:hover { background: var(--button-primary-bg-hover); }

/* 右侧用户区 */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
}
.navbar-right > * { flex-shrink: 0; }

/* 语言切换器（Flarum 风格小下拉） */
.lang-switch {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: var(--header-color, #fff);
    border: 1px solid var(--header-input-border, rgba(255,255,255,.35));
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
    outline: none;
    line-height: 18px;
    transition: background .15s;
}
.lang-switch:hover { background: var(--header-control-bg, rgba(255,255,255,.18)); }
.lang-switch option { color: #333; background: #fff; }

/* 登录按钮（Flarum 头条 session 控件） */
.login-btn {
    color: var(--header-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 13px;
    border-radius: var(--border-radius);
    border: none;
    background: transparent;
    transition: background .15s;
    white-space: nowrap;
    line-height: 20px;
}
.login-btn:hover {
    background: var(--header-control-bg);
    color: var(--header-color);
}

/* 用户头像下拉（Flarum session 控件）
   结构：<div class="user-dropdown"> > <button class="user-btn"> + <div class="dropdown-menu"> */
.user-dropdown { position: relative; }
.user-btn, .Session-user {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--heading-color);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    line-height: 20px;
    font-weight: 500;
    white-space: nowrap;
}
.user-btn:hover, .Session-user:hover {
    background: transparent;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 100%;
    background: var(--avatar-bg, var(--button-primary-bg));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
    border: none;
}
.user-name { font-weight: 600; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

/* 下拉菜单（Flarum 弹层） */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--body-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 6px var(--shadow-color);
    z-index: 1050;
    padding: 6px;
    overflow: hidden;
    animation: dropdownFadeIn .15s ease;
    border: var(--border-width) solid var(--border-color);
}
@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.user-dropdown.open .dropdown-menu { display: block; }
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 13px;
    border: none;
    background: none;
    color: var(--text-color);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    white-space: nowrap;
    transition: background .15s, color .15s;
    border-radius: var(--border-radius);
}
.dropdown-item:hover { background: var(--control-bg); color: var(--primary-color); }
.dropdown-item--danger { color: var(--error-color); }
.dropdown-item--danger:hover { background: var(--alert-error-bg); color: #fff; }
.dropdown-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 6px 0; }
.admin-link:hover { color: var(--error-color); background: var(--alert-error-bg); }

/* Flarum session 控件容器 */
.header-nav-controls { display: flex; align-items: center; gap: 8px; }
/* PC 端右上角只显示用户胶囊（目标站：其余控件移入抽屉/用户菜单） */
.nav-icon-btn.pc-hide, .notif-bell.pc-hide { display: none !important; }

/* 深色模式切换按钮（Flarum 齿轮/太阳图标按钮，铃铛左侧） */
.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--header-color);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background .15s, color .15s;
    line-height: 0;
    font-size: 16px;
}
.nav-icon-btn:hover { background: var(--header-control-bg); color: var(--header-color); }

/* PC 端主题切换（目标站 ThemeSwitcher：Change theme 按钮 + 5项下拉） */
.theme-dropdown { position: relative; }
.theme-toggle-btn { width: auto; padding: 0 9px; gap: 5px; }
.theme-toggle-btn .icon { font-size: 14px; }
.theme-toggle-label { display: none; }
.theme-switcher {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 235px;
    background: var(--body-bg);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 1060;
    display: none;
    overflow: hidden;
    animation: dropdownFadeIn .15s ease;
}
.theme-switcher.open { display: block; }
.theme-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-size: 13px;
    text-align: left;
    transition: background .12s;
}
.theme-option:hover { background: var(--control-bg); }
.theme-option .theme-option-icon {
    width: 16px;
    text-align: center;
    color: var(--muted-color);
    font-size: 13px;
    flex-shrink: 0;
}
.theme-option.active { color: var(--primary-color); font-weight: 600; }
.theme-option.active .theme-option-icon { color: var(--primary-color); }

/* PC 端语言切换（目标站 LanguageDropdown：完整文本 + 右侧上下箭头） */
.lang-dropdown { position: relative; }
.lang-toggle-btn { width: auto; padding: 0 9px; gap: 5px; }
.lang-toggle-label { font-size: 12px; white-space: nowrap; margin-left: 1px; color: var(--header-color); }
.lang-caret { font-size: 11px; color: var(--header-link-color, rgba(255,255,255,.75)); margin-left: 2px; }
.lang-switcher { min-width: 180px; }

/* 通知铃铛（Flarum session 控件） */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--header-color);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background .15s, color .15s;
    line-height: 0;
}
.notif-bell:hover { background: var(--header-control-bg); color: var(--header-color); }
.notif-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: var(--alert-error-bg);
    border-radius: 10px;
    font-weight: 700;
    pointer-events: none;
    border: 1px solid var(--header-bg);
}

/* 通知面板（Flarum 风格下拉：NOTIFICATIONS 标题 + 操作图标 + 列表/空态） */
.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: var(--body-bg);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 1060;
    display: none;
    overflow: hidden;
    animation: dropdownFadeIn .15s ease;
}
.notif-panel.open { display: block; }
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}
.notif-panel-header h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.notif-panel-actions { display: flex; gap: 6px; }
.notif-panel-actions button {
    background: none;
    border: none;
    color: var(--muted-color);
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1;
}
.notif-panel-actions button:hover { background: var(--control-bg); color: var(--primary-color); }
.notif-panel-body { max-height: 380px; overflow-y: auto; }
.notif-empty {
    padding: 42px 20px;
    text-align: center;
    color: var(--muted-color);
}
.notif-empty i { font-size: 28px; opacity: .4; display: block; margin-bottom: 10px; }
.notif-empty p { font-size: 13px; margin: 0; }
.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--control-bg-light); }
.notif-item:hover { background: var(--control-bg); }
.notif-item-icon {
    color: var(--primary-color);
    font-size: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}
.notif-item-body { min-width: 0; flex: 1; }
.notif-item-text { font-size: 13px; line-height: 1.45; }
.notif-item-text b { color: var(--primary-color); font-weight: 700; }
.notif-item-title {
    font-size: 12px;
    color: var(--muted-color);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notif-item-snippet {
    font-size: 12px;
    color: var(--muted-color);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notif-item-time { font-size: 11px; color: var(--muted-color); margin-top: 4px; opacity: .8; }

/* 用户卡片（下拉顶部用户信息块） */
.user-card-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 10px;
    border-bottom: var(--border-width) solid var(--border-color);
    margin-bottom: 4px;
}
.user-card-avatar {
    width: 40px;
    height: 40px;
    background: var(--button-primary-bg);
    color: var(--button-primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}
.user-card-info { min-width: 0; flex: 1; }
.user-card-name { font-weight: 600; color: var(--heading-color); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-role { font-size: 12px; color: var(--muted-color); margin-top: 2px; }

/* Flarum 按钮涟漪效果（Flarum UX 招牌动效）
   注意：.user-btn 与 .dropdown-item 不加 overflow:hidden，
   否则会影响 .dropdown-menu（absolute 子元素）的渲染与 z-index。 */
.Button, .login-btn, .hamburger-btn, .modal-submit-btn, .search-btn, .notif-bell, .tab-btn, .social-btn {
    position: relative;
    overflow: hidden;
}
.user-btn, .dropdown-item { position: relative; }
.ripple {
    position: absolute;
    border-radius: 100%;
    background: rgba(255, 255, 255, .35);
    transform: scale(0);
    animation: rippleAnim .55s ease-out forwards;
    pointer-events: none;
}
html.dark .ripple { background: rgba(255, 255, 255, .18); }
@keyframes rippleAnim {
    0%   { transform: scale(0); opacity: .9; }
    100% { transform: scale(4); opacity: 0; }
}

/* 汉堡菜单按钮（移动端） */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background .2s;
}

/* Flarum App-titleControl：移动端 header 分类下拉（桌面端隐藏，桌面用侧栏分类） */
.Header-titleDropdown { display: none; }

/* 移动端 header 发布按钮（桌面端隐藏，桌面用侧栏 IndexPage-newDiscussion） */
.nav-publish-btn { display: none; }
.hamburger-btn:hover { background: var(--header-control-bg); }
.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--header-color);
    border-radius: 2px;
    transition: all .3s ease;
    transform-origin: center;
}
.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端侧边导航 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    backdrop-filter: blur(4px);
    animation: overlayFadeIn .3s ease;
}
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
.mobile-overlay.active { display: block; }

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 270px;
    height: 100%;
    background: var(--body-bg);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    box-shadow: 2px 0 6px var(--shadow-color);
}
.mobile-nav.active { display: block; transform: translateX(0); }

.mobile-nav-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 16px;
    background: transparent;
    color: var(--text-color);
}
.mobile-site-title {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}
.mobile-close-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 13px;
    border: none;
    background: transparent;
    color: var(--muted-color);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background .15s;
    font-size: 18px;
}
.mobile-close-btn:hover { background: var(--control-bg); }

/* 目标站 Flarum 抽屉胶囊按钮组（Search Forum / Light Mode / 用户） */
.mobile-drawer-pills {
    padding: 4px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.drawer-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 36px;
    padding: 8px 13px;
    background: transparent;
    border: none;
    border-radius: 18px;
    font-size: 13px;
    color: rgb(102, 124, 153);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: background .15s;
}
.drawer-pill:hover { background: var(--control-bg); }
.drawer-pill i.icon { width: 16px; text-align: center; font-size: 14px; flex-shrink: 0; }
.drawer-pill-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-pill .drawer-caret { margin-left: auto; color: rgb(102, 124, 153); font-size: 12px; }
.drawer-search .drawer-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-color);
    padding: 0;
    height: 20px;
}
.drawer-search .drawer-search-input::placeholder { color: rgb(102, 124, 153); }
.mobile-user-toggle .mobile-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 100%;
    background: var(--button-primary-bg);
    color: var(--button-primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.mobile-nav-link {
    display: block;
    padding: 10px 20px;
    color: var(--muted-color);
    text-decoration: none;
    font-size: 15px;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.mobile-nav-link:hover {
    background: var(--control-bg-light);
    color: var(--text-color);
}
.mobile-nav-link.active {
    background: var(--control-bg);
    color: var(--primary-color);
    font-weight: 700;
    border-left-color: var(--primary-color);
}
/* 抽屉内的 <button> 型链接：复位浏览器按钮默认样式，使其外观与 <a> 一致 */
button.mobile-nav-link {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    font-family: inherit;
    cursor: pointer;
}
/* 抽屉导航菜单：移到抽屉最上面，底部加分隔线，与下方胶囊组区分 */
.mobile-nav-menu {
    padding: 4px 0 8px;
    border-bottom: var(--border-width) solid var(--border-color);
}

/* 详情页顶部：返回 + 操作按钮（移动端，目标站 Back/actions 风格） */
.navbar-back-btn,
.nav-action-btn,
.navbar-drawer-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--header-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    flex-shrink: 0;
    transition: background .15s;
}
.navbar-back-btn:hover,
.nav-action-btn:hover,
.navbar-drawer-btn:hover { background: var(--header-control-bg); }

/* PC 端详情页顶部不显示返回按钮和 ⋮；显示左侧抽屉触发按钮 */
@media (min-width: 769px) {
    .navbar-back-btn { display: none !important; }
    .nav-action-btn { display: none !important; }
    .navbar-drawer-btn { display: flex !important; }
}

/* 详情页顶部中间下拉按钮（目标站 "1 of 1 post" 风格） */
.navbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 5;
}
.navbar-center-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--header-color);
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
    max-width: 42vw;
    white-space: nowrap;
    overflow: hidden;
}
.navbar-center-btn:hover { background: rgba(255,255,255,.1); }
.navbar-center-btn .Button-caret { font-size: 12px; color: var(--header-color); opacity: .75; }
@media (min-width: 768px) {
    .navbar-center { display: none !important; }
}
.mobile-login-btn {
    display: block;
    width: 100%;
    padding: 8px 13px;
    background: var(--button-primary-bg);
    color: var(--button-primary-color);
    text-align: center;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    line-height: 20px;
    transition: background .15s;
}
.mobile-login-btn:hover { background: var(--button-primary-bg-hover); }

/* 抽屉内语言切换区 */
.mobile-lang {
    padding: 12px 20px;
    border-bottom: var(--border-width) solid var(--border-color);
}
.mobile-lang-label {
    font-size: 13px;
    color: var(--muted-color);
    margin-bottom: 10px;
    font-weight: 600;
}
.mobile-lang-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mobile-lang-option {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--control-bg);
    color: var(--text-color);
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    font-family: inherit;
}
.mobile-lang-option:hover { border-color: var(--primary-color); color: var(--primary-color); }
.mobile-lang-option.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}
.mobile-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 100%;
    background: var(--avatar-bg, var(--button-primary-bg));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    border: none;
}
.mobile-user-name { color: var(--text-color); font-weight: 500; }

/* Dark Mode — 统一 Flarum HSL 暗色调色板（仅覆写变量，组件全部引用变量自适应） */
html.dark {
    --header-bg: var(--header-bg-dark);
    --header-color: var(--header-color-dark);
    --header-control-bg: var(--header-control-bg-dark);
    --header-colored-control-color: var(--header-colored-control-color-dark);
    --header-border: var(--header-border-dark);
    --header-link-color: var(--header-link-color-dark);
    --header-icon-color: var(--header-icon-color-dark);
    --header-input-bg: var(--header-input-bg-dark);
    --header-input-border: var(--header-input-border-dark);
}

html.dark {
    --body-bg: hsl(214.15, 20%, 10%);
    --body-bg-shaded: hsl(214.15, 20%, 7%);
    --body-bg-light: hsl(214.15, 20%, 15%);
    --text-color: hsl(214.15, 15%, 90%);
    --heading-color: hsl(214.15, 15%, 95%);
    --link-color: hsl(214.15, 60%, 70%);
    --muted-color: hsl(214.15, 15%, 55%);
    --muted-color-light: hsl(214.15, 15%, 65%);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --control-bg: hsl(214.15, 20%, 13%);
    --control-bg-light: hsl(214.15, 20%, 16%);
    --control-bg-shaded: hsl(214.15, 20%, 18%);
    --control-color: var(--muted-color);
    --border-color: hsl(214.15, 20%, 20%);
    --icon-color: hsl(214.15, 15%, 60%);
    --code-bg: hsl(214.15, 20%, 13%);
    --code-color: hsl(214.15, 15%, 70%);
    --discussion-title-color: hsl(214.15, 15%, 85%);
    --discussion-list-item-bg-hover: var(--control-bg-light);
    --overlay-bg: rgba(0, 0, 0, 0.85);
    /* 暗色短名别名（与 :root 短名别名对应） */
    --primary-hover: #6b7e9a;
    --primary-light: hsl(214.15, 20%, 22%);
    --card: var(--control-bg);
    --input-bg: hsl(214.15, 20%, 15%);
}

/* ====== Hero / Page Header ====== */
.hero {
    background: var(--control-bg);
    padding: 20px 0;
    margin-bottom: 0;
}
.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.hero h1 { font-size: 18px; font-weight: normal; color: var(--text-color); }
.hero p { color: var(--muted-color); font-size: 14px; }

/* ====== IndexPage (Flarum Layout: Sidebar + Main) ====== */
.IndexPage { padding-top: 20px; padding-bottom: 40px; }
.IndexPage-content {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

/* Sidebar */
.IndexPage-sidebar {
    width: 200px;
    flex-shrink: 0;
}
.SideNav {
    background: var(--body-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
}
.SideNav-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 12px 16px 6px;
}

/* New Discussion Button (i8n.com Flarum style) */
.IndexPage-newDiscussion {
    padding: 0 0 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--control-bg);
}
.IndexPage-newDiscussion-btn {
    display: block;
    width: 100%;
    text-align: center;
    line-height: 20px;
    padding: 8px 13px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    border: 0;
    color: var(--button-primary-color);
    background: var(--button-primary-bg);
    transition: background .15s;
}
.IndexPage-newDiscussion-btn:hover {
    background: var(--button-primary-bg-hover);
    text-decoration: none;
}

.SideNav-list { list-style: none; padding: 4px 0 12px; }
.SideNav-item {
    border-bottom: none;
}
.SideNav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    line-height: 40px;
    color: var(--muted-color);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.SideNav-item a:hover {
    background: var(--control-bg-light);
    color: var(--text-color);
    text-decoration: none;
}
.SideNav-item.active a {
    color: var(--primary-color);
    font-weight: 600;
    background: var(--control-bg-light);
    border-left-color: var(--primary-color);
}

/* Button-icon (Flarum sidebar category icon) */
.Button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--icon-bg, #e8eaf0);
    color: var(--icon-fg, #5b6470);
    flex-shrink: 0;
    vertical-align: middle;
    font-size: 13px;
    line-height: 1;
}
/* 不再全局隐藏 FA ::before；保留让 fa-folder/fa-home 等 unicode 字形显示。
   桌面侧栏要看分类图标；header dropdown / mobile-category-list 已有自己的 override。 */
.SideNav-item.active .Button-icon {
    background: var(--icon-bg, #e8eaf0);
}

/* 强制分类图标用 flex 居中：覆盖 FontAwesome .fas 的 inline-block
   （否则 glyph 会缩在背景块左上角，不居中）。.Button-icon.fas 优先级高于 .fas。 */
.Button-icon.fas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.Button-icon.fas::before {
    display: block;
    text-align: center;
}

/* Main Content Area */
.IndexPage-main {
    flex: 1;
    min-width: 0;
}
.DiscussionList {
    background: var(--body-bg);
    border-radius: var(--border-radius);
}
.DiscussionList-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 0;
}
.DiscussionList-title {
    font-size: 18px;
    font-weight: normal;
    color: var(--heading-color);
    margin: 0;
}

/* DiscussionListItem (Flarum style file listing) */
.DiscussionList-discussions {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--control-bg);
    padding: 0 16px;
}
.DiscussionList-discussions .loading,
.DiscussionList-discussions .empty,
.DiscussionList-discussions .error {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted-color);
    font-size: 14px;
}
.DiscussionListItem {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: 0;
    cursor: pointer;
    border-bottom: none;
    transition: background .15s;
    position: relative;
}
.DiscussionListItem:hover { background: var(--discussion-list-item-bg-hover); }

.DiscussionListItem-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--control-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    overflow: hidden;
}
.DiscussionListItem-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
/* 列表用户头像：首字母 + avatarBg 配色，白字居中（覆盖 .Avatar 默认 48px 与灰底） */
.DiscussionListItem-avatar .Avatar {
    --size: 100%;
    width: 100%;
    height: 100%;
    background: var(--control-bg);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
}

.DiscussionListItem-main { flex: 1; min-width: 0; }
.DiscussionListItem-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.45;
}
.DiscussionListItem:hover .DiscussionListItem-title { color: var(--link-color); }

/* 内容列表项 hover / 点击 / 聚焦 均不显示下划线（覆盖全局 a:hover 下划线） */
a.DiscussionListItem,
a.DiscussionListItem:hover,
a.DiscussionListItem:focus,
a.DiscussionListItem:active,
.DiscussionListItem a,
.DiscussionListItem a:hover,
.DiscussionListItem a:focus,
.DiscussionListItem a:active {
    text-decoration: none !important;
}

/* 元信息：用户名 + • + 时间（与 Flarum DiscussionList 一致的轻量分隔） */
.DiscussionListItem-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted-color);
    margin-bottom: 4px;
    line-height: 1.4;
}
.DiscussionListItem-author { color: var(--muted-color); font-weight: 500; }
.DiscussionListItem-dot { color: var(--muted-color); opacity: .6; }
.DiscussionListItem-time { color: var(--muted-color); }

/* 摘要：描述截断后 2 行省略，对齐 Flarum 列表紧凑密度 */
.DiscussionListItem-excerpt {
    font-size: 13px;
    color: var(--muted-color);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* 老 class 名保留为空壳，避免其它页引用残留 */
.DiscussionListItem-tags {
    display: none;
}
.DiscussionListItem-tag {
    display: none;
}
.DiscussionListItem-category {
    display: none;
}

/* 右侧分类色块徽章：hash 配色 inline style 决定具体颜色，这里只定义布局 */
.DiscussionListItem-tagBadge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.DiscussionListItem-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    text-align: right;
    padding-top: 2px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 260px;
}
.DiscussionListItem-stat {
    font-size: 13px;
    color: var(--muted-color);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.DiscussionListItem-stat--bubble { gap: 4px; }
.DiscussionListItem-stat--bubble .icon { font-size: 13px; opacity: .8; }
.DiscussionListItem-stat .stat-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted-color);
}

.DiscussionListItem-price {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted-color);
    white-space: nowrap;
}
.DiscussionListItem-price.free { color: #58a400; }

/* 首页：右侧 stats 拆两行 —— 分类名称上行，评论+价格下行 */
.DiscussionListItem-stats--home {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: 200px;
}
.DiscussionListItem-stats--home .stats-line {
    display: flex;
    align-items: center;
    width: 100%;
}
.DiscussionListItem-stats--home .stats-line--top {
    justify-content: flex-end;
    gap: 8px;
}
.DiscussionListItem-stats--home .stats-line--bottom {
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* 播放按钮：PC 端放在右侧上行「分类名称」左边；移动端放在标题下方「分类名称」左边
   注意：这两个默认值必须放在下方 768px 媒体查询之前，否则同特异性下会覆盖移动端显隐规则（修复 2026-09-04） */
.AudioPlayBtn--home {
    display: inline-flex;
}
.AudioPlayBtn--mobile {
    display: none;
    margin-right: 6px;
    vertical-align: middle;
}

/* 首页：移动端把分类名称移到标题下方 */
.DiscussionListItem-tagBadge--mobile {
    display: none;
}
@media (max-width: 768px) {
    .DiscussionListItem-tagBadge--mobile {
        display: inline-block;
    }
    .DiscussionListItem-stats--home .stats-line--top {
        display: none;
    }
    .DiscussionListItem-stats--home {
        gap: 4px;
        max-width: 140px;
    }
    .AudioPlayBtn--home {
        display: none;
    }
    .AudioPlayBtn--mobile {
        display: inline-flex;
    }
}

/* Audio Play Button in List Items */
.AudioPlayBtn {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--control-bg);
    color: var(--button-color);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    flex-shrink: 0;
    user-select: none;
}
.AudioPlayBtn:hover {
    background: var(--button-primary-bg);
    color: #fff;
}
.AudioPlayBtn.playing {
    background: var(--button-primary-bg);
    color: #fff;
    animation: AudioPulse 1.2s ease-in-out infinite;
}
.AudioPlayBtn.playing i::before { content: "\f04c"; } /* fa-pause */
@keyframes AudioPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--button-primary-bg); opacity: .85; }
    50% { box-shadow: 0 0 0 6px transparent; opacity: 1; }
}

/* ====== Search Bar (removed from homepage, kept in CSS for reference) ====== */
.search-bar {
    display: flex;
    gap: 8px;
    margin: 20px 0;
}
.search-bar input {
    flex: 1;
    padding: 8px 13px;
    border: 1px solid var(--control-bg);
    border-radius: var(--border-radius);
    font-size: 14px;
    outline: none;
    background: var(--control-bg);
    color: var(--control-color);
    transition: border-color .15s, background .15s;
}
.search-bar input:focus {
    border-color: var(--primary-color);
    background: var(--body-bg);
}
.search-bar select {
    padding: 8px 13px;
    border: 1px solid var(--control-bg);
    border-radius: var(--border-radius);
    font-size: 14px;
    background: var(--control-bg);
    cursor: pointer;
    outline: none;
    color: var(--control-color);
    min-width: 120px;
}

/* ====== Legacy File Card (detail page etc.) ====== */
.file-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    background: var(--body-bg);
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid var(--control-bg);
}

/* ====== Buttons (Flarum Button pattern) ====== */
.btn {
    display: inline-block;
    margin-bottom: 0;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    white-space: nowrap;
    line-height: 20px;
    padding: 8px 13px;
    border-radius: var(--border-radius);
    user-select: none;
    color: var(--button-color);
    background: var(--button-bg);
    border: 0;
    font-size: 14px;
    font-weight: normal;
    transition: background .15s;
    text-decoration: none;
    font-family: inherit;
}
.btn:hover { background: var(--button-bg-hover); text-decoration: none; }
.btn-primary {
    --button-color: var(--button-primary-color);
    --button-bg: var(--button-primary-bg);
    --button-bg-hover: var(--button-primary-bg-hover);
    --button-bg-active: var(--button-primary-bg-active);
    color: var(--button-primary-color);
    background: var(--button-primary-bg);
    font-weight: bold;
    padding-left: 20px;
    padding-right: 20px;
}
.btn-primary:hover { background: var(--button-primary-bg-hover); }
.btn-outline {
    color: var(--control-color);
    background: var(--control-bg);
}
.btn-outline:hover { background: var(--control-bg-shaded); }
.btn-danger { color: var(--error-color); background: transparent; }
.btn-danger:hover { background: #fdd; }
.btn-success { background: #58a400; color: #fff; }
.btn-success:hover { background: #4a8a00; }
.btn-sm { padding: 4px 10px; font-size: 12px; line-height: 18px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; display: block; }

/* ====== Auth Page ====== */
.auth-container {
    max-width: 400px;
    margin: 48px auto;
    background: var(--body-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 6px var(--shadow-color);
}
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--control-bg);
}
.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--muted-color);
    cursor: pointer;
    transition: color .15s;
    font-family: inherit;
}
.tab-btn.active {
    color: var(--primary-color);
    font-weight: bold;
    box-shadow: inset 0 -2px 0 var(--primary-color);
}
.auth-form {
    padding: 24px;
}
.auth-form h2 {
    font-size: 18px;
    font-weight: normal;
    margin-bottom: 16px;
    text-align: center;
    color: var(--heading-color);
}
.auth-form .btn { width: 100%; margin-top: 12px; }

/* ====== Forms (FormControl pattern) ====== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: normal;
    color: var(--text-color);
    margin-bottom: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 13px;
    border: 1px solid var(--control-bg);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-color);
    background: var(--control-bg);
    outline: none;
    transition: border-color .15s, background .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: var(--body-bg);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group .hint { font-size: 12px; color: var(--muted-color); margin-top: 4px; }
.form-group .req { color: var(--error-color); margin-right: 2px; }
.error-msg { color: var(--error-color); font-size: 14px; margin-bottom: 12px; }

/* ====== Profile Page ====== */
.profile-container {
    display: flex;
    gap: 50px;
    margin-top: 20px;
}
.profile-sidebar { width: 220px; flex-shrink: 0; }
.user-info {
    background: var(--body-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    margin-bottom: 15px;
}
.avatar { font-size: 2.5rem; margin-bottom: 8px; }
.name { font-weight: normal; font-size: 16px; color: var(--heading-color); }
.email { color: var(--muted-color); font-size: 14px; margin-top: 2px; }
.sidebar-menu {
    list-style: none;
    background: var(--body-bg);
    overflow: hidden;
    padding: 15px 0;
}
.sidebar-menu li {
    padding: 8px 20px;
    cursor: pointer;
    color: var(--muted-color);
    font-size: 14px;
    transition: background .15s;
    border-left: 3px solid transparent;
}
.sidebar-menu li:hover { background: var(--control-bg); color: var(--text-color); }
.sidebar-menu li.active {
    color: var(--primary-color);
    background: var(--control-bg);
    font-weight: normal;
    border-left-color: var(--primary-color);
}
.profile-content {
    flex: 1;
    background: var(--body-bg);
    padding: 0;
    min-height: 400px;
}
.profile-content h2 {
    font-size: 18px;
    font-weight: normal;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--control-bg);
    color: var(--heading-color);
}

.purchase-item, .order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--control-bg);
}
.purchase-item:last-child, .order-item:last-child { border-bottom: none; }
.purchase-info h4, .order-info h4 {
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 2px;
    color: var(--text-color);
}
.purchase-meta, .order-meta {
    font-size: 12px;
    color: var(--muted-color);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Status colors */
.status-pending { color: #ad6c00; }
.status-paid { color: #58a400; }
.status-cancelled { color: var(--muted-color-light); }
.expired { color: var(--error-color); }

/* ====== Pagination ====== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 20px 0;
}
.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--control-bg);
    background: var(--control-bg);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    color: var(--control-color);
    transition: background .15s;
    font-family: inherit;
}
.pagination button:hover:not(:disabled) { background: var(--control-bg-shaded); }
.pagination button.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: bold;
}
.pagination button:disabled { opacity: .4; cursor: default; }

/* ====== Utility States ====== */
.loading { text-align: center; padding: 48px 20px; color: var(--muted-color); font-size: 14px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted-color-light); font-size: 14px; }
.error { text-align: center; padding: 48px 20px; color: var(--error-color); font-size: 14px; }
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 8px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: normal;
    background: var(--badge-bg);
    color: var(--badge-color);
    box-shadow: 0 2px 4px var(--shadow-color);
    vertical-align: middle;
}

/* ====== Markdown Editor ====== */
.mde-wrap {
    border: 1px solid var(--control-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--body-bg);
}
.mde-wrap:focus-within {
    border-color: var(--primary-color);
}
.mde-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px 6px;
    background: var(--control-bg-light);
    border-bottom: 1px solid var(--control-bg);
    flex-wrap: wrap;
}
.mde-btn {
    padding: 4px 8px;
    border: none;
    background: transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    color: var(--control-color);
    font-family: monospace;
    transition: all .15s;
    min-width: 28px;
}
.mde-btn:hover { background: var(--control-bg-shaded); color: var(--text-color); }
.mde-toggle { display: flex; gap: 0; padding: 4px 8px; background: var(--control-bg-light); }
.mde-tab {
    padding: 4px 12px;
    border: none;
    background: transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    color: var(--muted-color);
    transition: all .15s;
}
.mde-tab.active { background: var(--primary-color); color: #fff; font-weight: bold; }
.mde-tab:hover:not(.active) { color: var(--text-color); }
textarea.mde-edit {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 0;
    font-family: "SF Mono", "Fira Code", "Consolas", "Monaco", monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    color: var(--text-color);
    min-height: 240px;
}
.mde-preview {
    display: none;
    padding: 14px 16px;
    min-height: 240px;
    max-height: 600px;
    overflow-x: auto;
    overflow-y: auto;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-color);
}
.mde-preview h1 { font-size: 1.4rem; margin: 16px 0 8px; font-weight: bold; }
.mde-preview h2 { font-size: 1.2rem; margin: 14px 0 6px; font-weight: bold; }
.mde-preview h3 { font-size: 1.05rem; margin: 12px 0 4px; font-weight: bold; }
.mde-preview h4 { font-size: .95rem; margin: 10px 0 4px; font-weight: bold; }
.mde-preview p { margin-bottom: 8px; }
.mde-preview ul, .mde-preview ol { padding-left: 20px; margin-bottom: 8px; }
.mde-preview li { margin-bottom: 2px; }
.mde-preview code {
    background: var(--code-bg);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 13px;
    font-family: "SF Mono", "Fira Code", "Consolas", "Monaco", monospace;
    color: var(--code-color);
}
.mde-preview pre {
    background: var(--code-bg);
    color: var(--code-color);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 100%;
}
.mde-preview pre code { background: none; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.mde-preview blockquote {
    border-left: 3px solid var(--control-bg);
    padding: 4px 12px;
    margin: 8px 0;
    color: var(--muted-color);
    background: var(--body-bg-shaded);
}
.mde-preview hr { border: none; border-top: 1px solid var(--control-bg); margin: 14px 0; }
.mde-preview a { color: var(--link-color); }
.mde-preview img { max-width: 100%; border-radius: var(--border-radius); }

/* ====== Footer ====== */
.site-footer {
    padding: 20px 15px;
    text-align: center;
    font-size: 12px;
    color: var(--muted-color);
    border-top: 1px solid var(--control-bg);
    margin-top: 40px;
}
.site-footer a { color: var(--link-color); }
.site-footer b { font-weight: bold; }

/* IndexPage/SideNav/Footer 暗色已由 :root 变量统一处理，无需组件级覆写。 */

/* ====== Auth Sheet（仿 Flarum 风格：PC 居中卡片，≤768px 整页） ====== */
.auth-sheet {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--auth-overlay-bg);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(96px, 10vh, 144px) 16px 16px;
    box-sizing: border-box;
    animation: authSheetIn .18s ease;
}
.auth-sheet-card {
    background: var(--auth-sheet-header-bg);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: authCardIn .22s ease;
}
@keyframes authSheetIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes authCardIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-sheet-header {
    position: relative;
    height: 48px;
    background: var(--auth-sheet-header-bg);
    border-bottom: 1px solid var(--auth-sheet-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.auth-sheet-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--auth-sheet-accent);
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .15s;
}
.auth-sheet-close:hover { background: var(--auth-sheet-hover-bg); }
.auth-sheet-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--auth-sheet-accent);
}
.auth-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 28px 32px 32px;
    width: 100%;
    box-sizing: border-box;
    background: var(--auth-sheet-bg);
}

/* ≤767.98px：整页 sheet，无遮罩无圆角 */
@media (max-width: 767.98px) {
    .auth-sheet {
        background: var(--auth-sheet-bg);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
        align-items: stretch;
        justify-content: flex-start;
    }
    .auth-sheet-card {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
        animation: authSheetIn .18s ease;
    }
}
.auth-field {
    margin-bottom: 16px;
}
.auth-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--auth-sheet-accent);
    margin-bottom: 8px;
}
.auth-input {
    width: 100%;
    display: block;
    box-sizing: border-box;
    background: var(--auth-input-bg);
    border: none;
    border-radius: var(--border-radius);
    padding: 13px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--auth-sheet-accent);
    outline: none;
    text-align: center;
    transition: box-shadow .15s, background .15s;
}
.auth-input::placeholder {
    color: var(--auth-input-placeholder);
    font-weight: normal;
    opacity: 1;
}
.auth-input:focus {
    box-shadow: 0 0 0 3px var(--auth-focus-ring);
}
.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 22px;
    font-size: 14px;
    color: var(--auth-sheet-accent);
    cursor: pointer;
    user-select: none;
}
.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--auth-submit-bg);
}
.auth-error {
    background: var(--alert-error-bg);
    color: #fff;
    border-radius: var(--border-radius);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
}
.auth-submit-btn {
    display: block;
    margin: 8px auto 0;
    padding: 10px 36px;
    min-width: 130px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--auth-submit-bg);
    color: var(--auth-submit-color);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    font-family: inherit;
    line-height: 22px;
}
.auth-submit-btn:hover { background: var(--auth-submit-bg-hover); }
.auth-submit-btn:active { transform: translateY(1px); }
.auth-meta {
    text-align: center;
    margin: 14px 0 0;
    font-size: 14px;
}
.auth-meta a {
    color: var(--auth-sheet-accent);
    text-decoration: none;
}
.auth-meta a:hover { text-decoration: underline; }
.auth-switch {
    text-align: center;
    margin: 18px 0 0;
    font-size: 14px;
    color: var(--auth-sheet-accent);
}
.auth-switch a {
    color: var(--auth-sheet-accent);
    text-decoration: none;
    margin-left: 4px;
    font-weight: 500;
}
.auth-switch a:hover { text-decoration: underline; }

/* Auth Sheet 颜色变量 — 浅色（仿 Flarum demo 截图） */
:root {
    --auth-sheet-bg: #e8eef5;
    --auth-sheet-header-bg: #ffffff;
    --auth-sheet-border: rgba(26, 54, 93, .08);
    --auth-sheet-accent: #1a365d;
    --auth-sheet-hover-bg: rgba(26, 54, 93, .08);
    --auth-input-bg: #ffffff;
    --auth-input-placeholder: #8aa6c1;
    --auth-focus-ring: rgba(59, 91, 126, .18);
    --auth-submit-bg: #3b5b7e;
    --auth-submit-bg-hover: #324e6d;
    --auth-submit-color: #ffffff;
    --auth-overlay-bg: rgba(20, 30, 50, .55);
}
/* Auth Sheet 暗色覆写 */
html.dark {
    --auth-sheet-bg: #1a2230;
    --auth-sheet-header-bg: #232b3a;
    --auth-sheet-border: rgba(255, 255, 255, .08);
    --auth-sheet-accent: #c5d6e8;
    --auth-sheet-hover-bg: rgba(255, 255, 255, .08);
    --auth-input-bg: #2a3242;
    --auth-input-placeholder: #6e819a;
    --auth-focus-ring: rgba(125, 160, 200, .25);
    --auth-submit-bg: #4a6584;
    --auth-submit-bg-hover: #5a7594;
    --auth-submit-color: #ffffff;
    --auth-overlay-bg: rgba(5, 10, 20, .7);
}

/* ========================================
   Responsive — 四层断点全设备适配
   ======================================== */

/* ---------- Desktop Large (>= 1100px) ---------- */
@media (min-width: 1100px) {
    .IndexPage-sidebar { width: 220px; }
    .DiscussionListItem-title { font-size: 16px; }
    .DiscussionListItem { padding: 14px 16px; gap: 16px; }
    .DiscussionListItem-avatar { width: 44px; height: 44px; font-size: 18px; }
    .DiscussionListItem-stats { gap: 16px; }
    .DiscussionListItem-stat { font-size: 13px; }
    .DiscussionListItem-stat .stat-value { font-size: 14px; }
    .DiscussionListItem-price { font-size: 15px; }
}

/* ---------- Desktop (992px - 1099px) — 默认样式的微调 ---------- */
@media (min-width: 992px) and (max-width: 1099.98px) {
    .IndexPage-sidebar { width: 190px; }
    .DiscussionListItem { padding: 12px 16px; gap: 14px; }
}

/* ---------- Tablet (768px - 991px) — 侧边栏变窄，部分折叠 ---------- */
@media (min-width: 768px) and (max-width: 991.98px) {
    .IndexPage { padding-top: 16px; }
    .IndexPage-content { gap: 20px; }
    .IndexPage-sidebar { width: 160px; }
    .SideNav-list { padding: 2px 0 8px; }
    .SideNav-item a {
        padding: 8px 12px;
        font-size: 13px;
        gap: 6px;
    }
    .Button-icon { width: 20px; height: 20px; font-size: 14px; }
    .IndexPage-newDiscussion-btn { padding: 8px 14px; font-size: 13px; }
    .DiscussionList-title { font-size: 17px; }
    .DiscussionList-header { padding: 8px 0; }
    .DiscussionListItem { padding: 10px 16px; gap: 12px; }
    .DiscussionListItem-avatar { width: 36px; height: 36px; font-size: 15px; }
    .DiscussionListItem-title { font-size: 14px; }
    .DiscussionListItem-tags { gap: 4px; }
    .DiscussionListItem-tag { font-size: 11px; }
    .DiscussionListItem-category { font-size: 11px; }
    .DiscussionListItem-stats { gap: 10px; }
    .DiscussionListItem-stat { font-size: 11px; }
    .DiscussionListItem-stat .stat-value { font-size: 12px; }
    .DiscussionListItem-price { font-size: 13px; }

    /* Detail page tablet */
    .product-page { padding: 0 16px; }
    .product-grid { grid-template-columns: 1fr; gap: 20px; }
    .sidebar { position: static; }
    .purchase-card { margin-bottom: 16px; }
    .pc-header { padding: 24px 20px; }
    .pc-header .price-tag { font-size: 2.2rem; }
    .pc-body { padding: 18px 20px; }
    .discussion-post { padding: 20px; gap: 16px; }

    /* Header tablet */
    .navbar-container { padding: 0 16px; gap: 12px; }
    .navbar-nav { gap: 8px; }
    .navbar-nav a { font-size: 13px; padding: 6px 8px; }
}

/* ---------- Mobile (< 768px) — 侧边栏置顶横向滚动，主内容单列 ---------- */
@media (max-width: 767.98px) {
    /* Container */
    .container { padding: 0 12px; }

    /* Header */
    .navbar { padding: 0; }
    .navbar-container { padding: 0 12px; gap: 8px; width: 100%; }
    .navbar-nav { display: none; }
    .hamburger-btn { display: flex; }
    .login-btn { display: none !important; }
    .theme-toggle-btn, .lang-toggle-btn { display: none !important; }
    .user-name { display: none; }
    .user-btn { padding: 5px; }
    .user-avatar { width: 28px; height: 28px; font-size: 14px; }

    /* ===== Flarum 手机端 Header：☰ + 分类下拉(中) + 发布(右)，搜索/用户移入抽屉 ===== */
    /* index/分类页：隐藏 logo，header 中间显示分类下拉 */
    body.index-page .navbar-logo { display: none; }
    .navbar-search, .nav-login, #nav-user-area { display: none !important; }
    /* 搜索按钮移动到列表工具栏（Flarum：移动端顶部右侧不放搜索按钮） */
    .nav-search-btn { display: none; }

    /* 搜索面板移动端全屏 */
    .search-panel-overlay { padding: 0; align-items: stretch; }
    .search-panel { max-width: none; max-height: 100vh; height: 100vh; border-radius: 0; }
    .search-panel-header { position: sticky; top: 0; z-index: 1; }
    .search-panel-close { color: var(--primary-color); font-weight: 600; }

    /* 内容页（非首页）：header 中间显示品牌 logo（图片+名称），标题居中 */
    body:not(.index-page) .navbar-container { position: relative; }
    body:not(.index-page) .navbar-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        max-width: 50%;
        gap: 6px;
    }
    body:not(.index-page) .navbar-logo img.logo-icon { height: 32px; }
    body:not(.index-page) .navbar-logo .logo-text {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 15px;
    }

    /* index/分类页：分类下拉相对整个 header 水平居中（Flarum App-titleControl 居中样式，用 margin auto 居中避免 transform 影响 fixed 子菜单） */
    body.index-page .navbar-container { position: relative; }
    body.index-page .Header-titleDropdown { display: block; }
    body.index-page .Header-titleDropdown {
        position: absolute;
        left: 0;
        right: 0;
        margin: 0 auto;
        width: 50%;
    }
    .Header-titleDropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        padding: 6px 10px;
        border: none;
        border-radius: 6px;
        background: transparent;
        color: var(--header-color);
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
    }
    .Header-titleDropdown-toggle:hover,
    .Header-titleDropdown-toggle:focus,
    .Header-titleDropdown-toggle:active {
        background: transparent !important;
    }
    .Header-titleDropdown-toggle .Button-labelText {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .Header-titleDropdown-toggle .Button-caret { font-size: 11px; opacity: .75; }
    .Header-titleDropdown.open .Dropdown-menu--header { display: block; }
    .Dropdown-menu--header {
        position: absolute;
        top: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        min-width: 180px;
        max-height: 60vh;
        overflow-y: auto;
        margin: 0;
        padding: 4px 0;
        list-style: none;
        background: var(--body-bg);
        border: var(--border-width) solid var(--border-color);
        border-radius: var(--border-radius);
        box-shadow: 0 4px 16px var(--shadow-color);
        z-index: 1200;
        display: none;
    }
    .Dropdown-menu--header .SideNav-item { border-bottom: 1px solid var(--control-bg); }
    .Dropdown-menu--header .SideNav-item:last-child { border-bottom: none; }
    .Dropdown-menu--header .SideNav-item a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 16px;
        font-size: 15px;
        height: auto;
        line-height: 1.4;
        color: var(--text-color);
        text-decoration: none;
        border-left: 4px solid transparent;
        transition: background .15s, color .15s, border-color .15s;
    }
    .Dropdown-menu--header .SideNav-item a:hover { background: var(--control-bg-light); }
    .Dropdown-menu--header .SideNav-item.active a {
        color: var(--primary-color);
        font-weight: 600;
        border-left-color: var(--primary-color);
        background: var(--control-bg-light);
    }
    /* 抽屉分类项：恢复 FA 专属图标（按分类色着色、透明底）。
       注意：故意不写 ::before{content:none}，让 fontawesome 的 .fa-XXX::before unicode 规则生效。*/
    .Dropdown-menu--header .Button-icon {
        width: 20px;
        height: 20px;
        border-radius: 4px;
        background: var(--icon-bg, #e8eaf0);
        color: var(--icon-fg, #5b6470);
        font-size: 13px;
    }
    /* 「全部资源」分类：固定显示搜索图标 */
    .Dropdown-menu--header .SideNav-item[data-slug=""] .Button-icon {
        background: transparent !important;
        width: 18px;
        height: 18px;
        font-size: 14px;
        color: var(--muted-color);
        text-align: center;
    }
    .Dropdown-menu--header .SideNav-item[data-slug=""] .Button-icon::before { content: "\f002"; }

    /* 移动端发布按钮（纯图标：无背景、无圆角；点击瞬间闪一下，参照目标站） */
    .nav-publish-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        color: var(--header-color);
        cursor: pointer;
        font-size: 18px;
        flex-shrink: 0;
        transition: background .12s ease;
    }
    .nav-publish-btn:active { background: rgba(255,255,255,.28); }
    .nav-publish-btn .Button-icon {
        width: 18px;
        height: 18px;
        font-size: 18px;
        color: inherit;
        /* 覆盖全局 .Button-icon 的 14×14 实色方块背景，让图标显示为纯字形 */
        background: transparent;
    }

    /* 移动端：顶部隐藏语言切换器（移入左侧抽屉） */
    .lang-switch { display: none !important; }

    /* 移动端：排序下拉 → 底部弹出（Flarum 移动端 Select 样式） */
    .sort-dropdown { position: static; }
    .sort-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        min-width: 0;
        max-height: 62vh;
        overflow-y: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        padding: 10px 12px calc(16px + env(safe-area-inset-bottom));
        z-index: 1600;
        transform: translateY(100%);
        transition: transform .22s ease;
        display: block;
        visibility: hidden;
        background: var(--body-bg);
    }
    .sort-menu.show {
        transform: translateY(0);
        visibility: visible;
    }
    .sort-menu li {
        padding: 15px 16px;
        font-size: 15px;
        border-radius: 0;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .sort-menu li.active {
        color: var(--primary-color);
        font-weight: 600;
        background: none;
    }
    .sort-menu li.active::after {
        content: '\2713';
        font-weight: 700;
        margin-left: 8px;
    }

    /* 移动端：分类下拉 → 保持底部弹起抽屉，内部结构对齐 Flarum demo 分层 */
    .Header-titleDropdown.open .Dropdown-menu--header,
    .Dropdown-menu--header {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        border: none;
        border-radius: 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
        margin: 0;
        padding: 0 0 calc(8px + env(safe-area-inset-bottom));
        z-index: 1500;
        transform: translateY(100%);
        visibility: hidden;
        transition: transform 0s, visibility 0s; /* fix 2026-08-29: close instant, avoid iOS WebKit BFCache freeze on transform mid-state */
        display: block;
        background: var(--body-bg);
    }
    .Header-titleDropdown.open .Dropdown-menu--header {
        transform: translateY(0);
        visibility: visible;
        transition: transform .25s ease, visibility 0s linear 0s;
    }
    /* 抽屉点击外部关闭遮罩 */
    .Header-dropdownMask { position: fixed; inset: 0; background: transparent; z-index: 1499; display: none; }
    .Header-dropdownMask.open { display: block; }
    /* 顶部"全部资源"高亮蓝条（All Discussions 入口） */
    .Header-dropdownTopEntry {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        background: var(--primary-color);
        color: #fff !important;
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        line-height: 1.4;
    }
    .Header-dropdownTopEntry i { font-size: 16px; width: 20px; text-align: center; opacity: .9; }
    .Header-dropdownTopEntry:active { filter: brightness(0.92); }
    /* 极细分隔线（hairline） */
    .Header-dropdownDivider {
        height: 1px;
        background: var(--control-bg);
        margin: 0;
    }
    /* "分类"分组标题（Tags 入口图标 + 文字，平实风格贴近 demo） */
    .Header-dropdownSection {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        color: var(--text-color);
        font-size: 14px;
        font-weight: 600;
    }
    .Header-dropdownSection i { font-size: 14px; color: var(--muted-color); }
    /* 分类列表（专用 ul，避免和外层 SideNav 选择器冲突） */
    .Header-dropdownList { list-style: none; padding: 0; margin: 0 0 8px; }
    .Header-dropdownList .SideNav-item { border-bottom: 1px solid var(--control-bg); }
    .Header-dropdownList .SideNav-item:last-child { border-bottom: none; }
    .Header-dropdownList .SideNav-item a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        height: 44px;
        font-size: 14px;
        color: var(--text-color);
        text-decoration: none;
        border: none;
        line-height: 1.4;
    }
    .Header-dropdownList .SideNav-item:active { background: var(--control-bg-light); }
    .Header-dropdownList .SideNav-item.active a {
        color: var(--primary-color);
        font-weight: 600;
    }
    /* 抽屉分类项：恢复 FA 专属图标（按分类色着色、透明底） */
    .Header-dropdownList .Button-icon {
        width: 20px;
        height: 20px;
        border-radius: 4px;
        background: var(--icon-bg, #e8eaf0);
        color: var(--icon-fg, #5b6470);
        font-size: 13px;
    }
    /* 删除 ::before content: none override，让 fa-XXX::before 的 unicode 规则生效 */
    .Header-dropdownList .SideNav-item.active .Button-icon {
        background: var(--icon-bg, #e8eaf0);
        color: var(--icon-fg, #5b6470);
    }

    /* 移动端：用户下拉 → 底部弹出（与分类/排序下拉一致） */
    .user-dropdown { position: static; }
    .user-dropdown .dropdown-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        min-width: 0;
        max-height: 62vh;
        overflow-y: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        padding: 10px 12px calc(16px + env(safe-area-inset-bottom));
        z-index: 1600;
        transform: translateY(100%);
        transition: transform .22s ease;
        display: block;
        visibility: hidden;
        background: var(--body-bg);
        animation: none;
    }
    .user-dropdown.open .dropdown-menu {
        transform: translateY(0);
        visibility: visible;
        display: block;
    }
    .user-dropdown .dropdown-menu::before { display: none; }
    .user-dropdown .dropdown-item {
        padding: 15px 16px;
        font-size: 15px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    /* 移动端分类下拉模糊遮罩 */
    .header-cat-mask {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .38);
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
        z-index: 990;
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease;
    }
    .header-cat-mask.active {
        opacity: 1;
        visibility: visible;
    }

    /* 移动端隐藏内容区分类侧栏与 PC 抽屉按钮 */
    .IndexPage-sidebar { display: none; }
    .IndexPage-main { width: 100%; }
    .navbar-drawer-btn { display: none !important; }

    /* 抽屉：导航菜单（已移到顶部） */
    .mobile-nav-menu { padding: 4px 0 8px; }
    .mobile-nav-menu .mobile-nav-list { padding: 0; }

    /* 抽屉内主题切换（Flarum System preference 风格胶囊） */
    .mobile-theme { padding: 0 20px; border-bottom: var(--border-width) solid var(--border-color); }

    /* 主题选项：移动端底部弹出（与全站下拉一致） */
    .mobile-theme-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-height: 62vh;
        overflow-y: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        padding: 10px 12px calc(16px + env(safe-area-inset-bottom));
        z-index: 1600;
        transform: translateY(100%);
        transition: transform .22s ease;
        display: block;
        visibility: hidden;
        background: var(--body-bg);
    }
    .mobile-theme-menu.show {
        transform: translateY(0);
        visibility: visible;
    }
    .mobile-theme-menu li {
        list-style: none;
        padding: 15px 16px;
        font-size: 15px;
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
    }
    .mobile-theme-menu li i.icon { width: 22px; text-align: center; font-size: 15px; }
    .mobile-theme-menu li span { flex: 1; }
    .mobile-theme-menu li.active {
        color: var(--primary-color);
        font-weight: 600;
    }
    .mobile-theme-menu li.active::after {
        content: '\2713';
        font-weight: 700;
        margin-left: 8px;
    }

    /* 主题菜单遮罩（盖住抽屉与页面，低于主题菜单 1600） */
    .theme-cat-mask {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .38);
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
        z-index: 1500;
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease;
    }
    .theme-cat-mask.active {
        opacity: 1;
        visibility: visible;
    }

    /* 移动端用户菜单（全宽底部弹出，Flarum Session 风格） */
    .mobile-user-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--body-bg);
        margin: 0;
        padding: 8px 0 12px;
        max-height: 55vh;
        overflow-y: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        z-index: 1600;
        list-style: none;
        transform: translateY(100%);
        opacity: 0;
        visibility: hidden;
        transition: transform .25s ease, opacity .2s ease;
    }
    .mobile-user-menu.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    .mobile-user-menu li {
        list-style: none;
        padding: 15px 16px;
        font-size: 15px;
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
    }
    .mobile-user-menu li i.icon { width: 22px; text-align: center; font-size: 15px; }
    .mobile-user-menu li span { flex: 1; }
    .mobile-user-menu li:active { background: var(--hover-bg); }

    /* 移动端语言菜单（全宽底部弹出，与主题/用户菜单一致） */
    .mobile-lang-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--body-bg);
        margin: 0;
        padding: 8px 0 12px;
        max-height: 55vh;
        overflow-y: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        z-index: 1600;
        list-style: none;
        transform: translateY(100%);
        opacity: 0;
        visibility: hidden;
        transition: transform .25s ease, opacity .2s ease;
    }
    .mobile-lang-menu.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    .mobile-lang-menu li {
        list-style: none;
        padding: 15px 16px;
        font-size: 15px;
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
    }
    .mobile-lang-menu li i.icon { width: 22px; text-align: center; font-size: 15px; }
    .mobile-lang-menu li span { flex: 1; }
    .mobile-lang-menu li.active {
        color: var(--primary-color);
        font-weight: 600;
    }
    .mobile-lang-menu li.active::after {
        content: '\2713';
        font-weight: 700;
        margin-left: 8px;
    }
    .mobile-nav-section { padding: 4px 0 8px; }
    .mobile-nav-title {
        padding: 10px 20px 4px;
        font-size: 11px;
        font-weight: bold;
        color: var(--muted-color);
        text-transform: uppercase;
        letter-spacing: .5px;
    }
    .mobile-category-list { list-style: none; margin: 0; padding: 0; }
    .mobile-category-list .SideNav-item { border-bottom: 1px solid var(--control-bg); }
    .mobile-category-list .SideNav-item:last-child { border-bottom: none; }
    .mobile-category-list .SideNav-item a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 20px;
        font-size: 15px;
        height: auto;
        line-height: 1.4;
        color: var(--text-color);
        text-decoration: none;
        border-left: 4px solid transparent;
        transition: background .15s, color .15s, border-color .15s;
    }
    .mobile-category-list .SideNav-item a:hover { background: var(--control-bg-light); }
    .mobile-category-list .SideNav-item.active a {
        color: var(--primary-color);
        font-weight: 600;
        border-left-color: var(--primary-color);
        background: var(--control-bg-light);
    }
    /* 移动端：分类图标显示为 14×14 实色圆角方块（隐藏 FA 字形） */
    .mobile-category-list .Button-icon { width: 16px; height: 16px; border-radius: 4px; background: var(--icon-bg, #e8eaf0); color: var(--icon-fg, #5b6470); font-size: 11px; }
    /* 「全部资源」分类：图标显示为搜索图标（保留 ::before） */
    .mobile-category-list .SideNav-item[data-slug=""] .Button-icon { background: transparent !important; width: 16px; height: 16px; font-size: 14px; color: var(--muted-color); text-align: center; }
    .mobile-category-list .SideNav-item[data-slug=""] .Button-icon::before { content: "\f002"; }

    /* 移动端搜索：折叠为圆形图标，点击 label 聚焦后展开 */
    .search-box { width: 36px; padding: 0; transition: width .25s ease; }
    .search-box .search-input { width: 0; padding: 9px 0; min-width: 0; transition: width .25s ease, padding .25s ease; }
    .search-box .search-btn { display: none; }
    .search-box:focus-within { width: 150px; }
    .search-box:focus-within .search-input { width: 100%; padding: 9px 12px; }

    /* IndexPage */
    .IndexPage { padding-top: 12px; }
    .IndexPage-content { flex-direction: column; gap: 12px; }
    .IndexPage-sidebar { width: 100%; }
    .SideNav { background: none; }
    .SideNav-title { padding: 8px 0 4px; font-size: 11px; }
    .IndexPage-newDiscussion { padding: 0 0 8px; margin-bottom: 4px; }
    .IndexPage-newDiscussion-btn { padding: 6px 10px; font-size: 13px; }
    .SideNav-list {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 0 0 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .SideNav-item { flex-shrink: 0; }
    .SideNav-item a {
        display: inline-flex;
        gap: 4px;
        height: auto;
        line-height: 1.4;
        padding: 6px 12px;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        font-size: 13px;
        white-space: nowrap;
    }
    .SideNav-item.active a {
        border-left-color: transparent;
        border-bottom-color: var(--primary-color);
        background: transparent;
    }
    .Button-icon { width: 18px; height: 18px; font-size: 13px; background: var(--icon-bg, #e8eaf0); color: var(--icon-fg, #5b6470); }
    .DiscussionList-title { font-size: 16px; }
    .DiscussionList-header { padding: 8px 0; }
    .DiscussionListItem { padding: 10px 16px; gap: 10px; }
    .DiscussionListItem-avatar { width: 32px; height: 32px; font-size: 14px; }
    .DiscussionListItem-title { font-size: 14px; }
    .DiscussionListItem-meta { font-size: 12px; gap: 4px; margin-bottom: 3px; }
    .DiscussionListItem-excerpt { font-size: 12px; -webkit-line-clamp: 2; }
    .DiscussionListItem-tagBadge { font-size: 11px; padding: 1px 7px; }
    .DiscussionListItem-stats { gap: 8px; max-width: 200px; }
    .DiscussionListItem-stat { font-size: 11px; }
    .DiscussionListItem-stat .stat-value { font-size: 12px; }
    .DiscussionListItem-price { font-size: 13px; }

    /* Detail Page */
    .preview-thumb { padding: 24px 16px; min-height: 140px; }
    .preview-thumb .file-icon { font-size: 3rem; }
    .preview-info { padding: 16px; }
    .preview-info h1 { font-size: 18px; }
    .meta-strip { gap: 10px; }
    .meta-item { font-size: 12px; }
    .tab-btn { padding: 8px 12px; font-size: 13px; }
    .discussion-post { flex-direction: column; gap: 12px; padding: 16px; }
    .post-sidebar { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding-right: 0; border-right: none; }
    .post-avatar-wrap { display: flex; align-items: center; gap: 8px; text-align: left; }
    .post-avatar-circle { width: 36px; height: 36px; font-size: 16px; margin: 0; }
    .post-avatar-name { font-size: 13px; }
    .post-avatar-role { font-size: 11px; margin-top: 0; }
    .post-type-badge { font-size: 11px; max-width: none; }
    .post-meta-top { gap: 6px; }
    .post-content { font-size: 13px; }
    .access-link-box { flex-direction: column; }
    .access-link-box .link-text { padding: 8px; font-size: 13px; white-space: normal; word-break: break-all; }
    .btn-copy { width: 100%; text-align: center; }

    /* Comment */
    .comment-form-wrap { flex-direction: column; gap: 10px; padding: 12px; }
    .comment-item { padding: 12px; gap: 10px; }
    .comment-avatar { width: 30px; height: 30px; font-size: 12px; }
    .comment-author { font-size: 13px; }
    .comment-content { font-size: 13px; }

    /* Purchase card */
    .sidebar { position: static; }
    .purchase-card { margin-bottom: 12px; }
    .pc-header { padding: 16px; }
    .pc-header .price-tag { font-size: 1.6rem; }
    .pc-body { padding: 14px 16px; }
    .pc-footer { padding: 0 16px 12px; }
    .sidebar-stats { margin-top: 8px; }
    .sidebar-stat-item { padding: 8px 12px; font-size: 12px; justify-content: center; text-align: center; }
    .file-info-pills { gap: 4px; }

    /* Modal mobile — bottom sheet style */
    .modal { width: 100%; max-width: 100%; border-radius: 12px 12px 0 0; }
    .modal-header { padding: 14px 16px 10px; }
    .modal-header h3 { font-size: 16px; }
    .modal-body { padding: 14px 16px; }
    .modal-footer { padding: 0 16px 14px; flex-wrap: wrap; }
    .modal-footer .btn { flex: 1; min-width: 80px; }
    .modal-overlay.show { align-items: flex-end; }
    .toast { top: auto !important; bottom: 16px; right: 12px; left: 12px; text-align: center; font-size: 13px; }
    .user-card-popup { left: 0; transform: translateX(0); width: 240px; }
    .user-card-popup::before { left: 28px; }
    .product-grid { grid-template-columns: 1fr; gap: 16px; }

    /* Login */
    .auth-container { margin: 24px 12px; max-width: none; }
    .auth-form { padding: 16px; }
    .auth-form h2 { font-size: 16px; }

    /* Profile */
    .profile-container { flex-direction: column; gap: 16px; padding: 0 12px; margin-top: 12px; }
    .profile-sidebar { width: 100%; }
    .user-info { padding: 16px; }
    .balance-box { padding: 16px !important; margin-bottom: 12px !important; }
    .balance-box > div:first-child { font-size: 0.75rem !important; }
    .sidebar-menu { display: flex; overflow-x: auto; padding: 8px 0; }
    .sidebar-menu li {
        flex-shrink: 0;
        white-space: nowrap;
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 6px 12px;
    }
    .sidebar-menu li.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary-color);
    }
    .profile-content { padding: 0; }
    .profile-content h2 { font-size: 16px; }
    .purchase-item, .order-item { flex-direction: column; gap: 8px; align-items: flex-start; }
    .purchase-meta, .order-meta { gap: 8px; }

    /* Pagination */
    .pagination { gap: 4px; }
    .pagination button { padding: 6px 10px; font-size: 12px; min-width: 32px; }

    /* Footer */
    .site-footer { padding: 16px 0; font-size: 12px; }
}

/* ---------- Small Mobile (< 480px) — 极限压缩 ---------- */
@media (max-width: 479.98px) {
    .navbar-logo { font-size: 16px; }
    .DiscussionListItem { flex-wrap: wrap; }
    .DiscussionListItem-avatar { width: 28px; height: 28px; font-size: 12px; }
    .DiscussionListItem-title { font-size: 13px; }
    .DiscussionListItem-stats { flex-wrap: wrap; gap: 6px; }
    .DiscussionListItem-stat { font-size: 10px; }
    .DiscussionListItem-price { font-size: 12px; }
    .pagination button { padding: 5px 8px; font-size: 11px; min-width: 28px; }
    .preview-info h1 { font-size: 16px; }
    .post-content { font-size: 13px; }
    .pc-header .price-tag { font-size: 1.4rem; }
    .pc-body { padding: 12px; }
    .btn-buy, .btn-login, .btn-dl { font-size: 13px; padding: 10px 12px; }
    .btn-copy { font-size: 12px; padding: 8px 10px; }
    .user-card-popup { left: -10px; width: 230px; }
    .user-card-popup::before { left: 24px; }
}

/* 帖子操作栏（目标站 Like / Reply / ⋯ 风格） */
.post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 4px 4px;
    border-top: 1px solid var(--border-color, #e8ecf3);
    margin-top: 18px;
}
.post-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border: 1px solid transparent;
    background: transparent;
    color: #5b6b82;
    font-size: 13px;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s ease;
}
.post-action-btn:hover {
    background: var(--primary-light, #edf2f8);
    color: var(--primary, #4D698E);
    border-color: rgba(77,105,142,.15);
}
.post-action-btn .icon { font-size: 15px; }
.post-action-btn.liked {
    color: var(--primary, #4D698E);
    background: var(--primary-light, #edf2f8);
    border-color: rgba(77,105,142,.18);
    font-weight: 600;
}
.post-action-btn.liked .icon { animation: likePop .3s ease; }
@keyframes likePop {
    0% { transform: scale(.8); }
    60% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
.post-action-more { margin-left: auto; }

/* PC 端隐藏移动端专属底部弹出菜单与遮罩（仅移动端 @media 内定义，此处兜底） */
#mobileUserMenu, #detailActionMenu, #detailMiddleMenu, #mobileLangMenu, #mobileThemeMenu,
#themeCatMask, #userCatMask, #detailActionMask, #detailMiddleMask, #langCatMask { display: none; }
@media (max-width: 767.98px) {
    #mobileUserMenu, #detailActionMenu, #detailMiddleMenu, #mobileLangMenu, #mobileThemeMenu,
    #themeCatMask, #userCatMask, #detailActionMask, #detailMiddleMask, #langCatMask { display: block; }
}

/* 详情页「更多操作」菜单：PC 端在 ⋯ 按钮下方弹出下拉框（移动端保持底部抽屉不变）。
   原抽屉样式仅定义在 @media(max-width:767.98px) 内，PC 端无 position/fixed 样式且被 display:none 兜底隐藏，
   导致 toggleDetailActions 只切了 .show 但容器不可见。这里单独放行 #detailActionMenu / #detailActionMask，
   其它移动端专属菜单（#mobileUserMenu 等）仍保持 PC 隐藏。下拉框定位由 JS 按触发按钮位置设置。 */
@media (min-width: 768px) {
    #detailActionMenu {
        display: block;
        position: fixed;
        width: 168px;
        max-width: calc(100vw - 24px);
        max-height: 80vh;
        overflow-y: auto;
        background: var(--body-bg);
        padding: 6px 0;
        border: 1px solid var(--border-color, rgba(0,0,0,.12));
        border-radius: 10px;
        box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
        z-index: 1600;
        list-style: none;
        opacity: 0;
        visibility: hidden;
        transform: none;
        transition: opacity .15s ease;
    }
    #detailActionMenu.show { opacity: 1; visibility: visible; }
    #detailActionMenu li { list-style: none; padding: 11px 18px; font-size: 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
    #detailActionMenu li i.icon { width: 20px; text-align: center; font-size: 14px; }
    #detailActionMenu li span { flex: 1; }
    #detailActionMenu li:hover { background: var(--hover-bg); }
    /* PC 端只保留「编辑 / 删除 / 刷新」，隐藏「复制链接 / 分享」 */
    #detailActionMenu li:nth-child(3),
    #detailActionMenu li:nth-child(4) { display: none; }
    #detailActionMask {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .3);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        z-index: 1550;
        opacity: 0;
        visibility: hidden;
        transition: opacity .15s ease;
    }
    #detailActionMask.active { opacity: 1; visibility: visible; }
}

/* 回复 Composer（Flarum 风格：桌面底部浮层 / 移动端全屏） */
.composer-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .38);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 1700;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}
.composer-mask.show { opacity: 1; visibility: visible; }
.composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1800;
    margin: 0 auto;
    max-width: 720px;
    background: var(--body-bg);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .18);
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform .25s ease, opacity .2s ease;
    padding: 6px 16px 12px;
}
.composer.show { transform: translateY(0); opacity: 1; visibility: visible; }
/* PC：Composer 宽度跟随详情页两栏总宽度（与 product-page 容器等宽，居中），高度参考目标站 300px */
@media (min-width: 768px) {
    .composer { max-width: none; left: calc((100vw - min(calc(100vw - 48px), 1400px)) / 2); right: auto; width: min(calc(100vw - 48px), 1400px); height: 300px; display: flex; flex-direction: column; }
    .composer-body { flex: 1; min-height: 0; }
    .composer-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
    .composer textarea { flex: 1; min-height: 0; height: auto; resize: none; }
    .composer-footer { flex: none; justify-content: flex-start; padding-left: 90px; }
    /* 右上角按钮组：关闭 ✕ + Post Reply（参考目标站 Flarum 右上角按钮） */
    .composer-controls { position: absolute; top: 12px; right: 12px; z-index: 5; }
    .composer-post { position: absolute; bottom: 8px; left: 12px; z-index: 6; }
    .composer-ctrl { width: 30px; height: 30px; border: none; border-radius: 4px; background: transparent; color: var(--text-muted, #8596ad); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
    .composer-ctrl:hover { background: rgba(0, 0, 0, .06); color: var(--text, #333); }
}
.composer-handle { height: 5px; width: 36px; margin: 0 auto 6px; border-radius: 3px; background: var(--border-color, #e4e9f0); cursor: row-resize; }
.composer-controls { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.composer-ctrl {
    border: none;
    background: transparent;
    color: #7c8ba1;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 4px;
    line-height: 1;
}
.composer-ctrl:hover { background: rgba(0, 0, 0, .06); color: var(--text); }
.composer-body { display: flex; gap: 10px; margin-top: 2px; }
.composer-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary, #4D698E);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex: none;
}
.composer-content { flex: 1; min-width: 0; }
.composer-head { display: flex; align-items: center; gap: 6px; color: var(--primary, #4D698E); font-weight: 600; font-size: 14px; margin-bottom: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.composer-head a { color: var(--primary, #4D698E); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.composer-head a:hover { text-decoration: underline; }
.composer textarea {
    width: 100%;
    min-height: 90px;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: var(--input-bg, #fff);
    color: var(--text);
    outline: none;
    box-sizing: border-box;
}
.composer textarea:hover { border-color: rgba(0, 0, 0, .12); }
.composer textarea:focus { border-color: var(--primary, #4D698E); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.composer-post {
    border: none;
    background: var(--primary, #4D698E);
    color: #fff;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.composer-post:hover { opacity: .9; }
.composer-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
}
.composer-toolbar::-webkit-scrollbar { display: none; }
.composer-toolbar button {
    border: none;
    background: transparent;
    color: #7c8ba1;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.composer-toolbar button:hover { background: rgba(0, 0, 0, .06); color: var(--text); }

.composer-author {
    text-align: center;
    color: #9aa9ba;
    font-size: 13px;
    padding: 10px 0 2px;
    letter-spacing: .3px;
}

/* 收回到底部的草稿条（Flarum minimized composer） */
.composer-minimized {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%) translateY(130%);
    max-width: 720px;
    width: calc(100% - 32px);
    background: var(--body-bg, #fff);
    border: 1px solid var(--border-color, #e8ecf3);
    border-radius: 24px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .14);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1850;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: transform .25s ease, opacity .2s ease;
    box-sizing: border-box;
}
.composer-minimized.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.composer-minimized:hover { border-color: var(--primary, #4D698E); }
.composer-minimized .cm-icon { color: var(--primary, #4D698E); font-size: 14px; flex: none; }
.composer-minimized .cm-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
}

/* 评论区草稿预览（Flarum Post.editing）：与真实评论同结构，轻微透明暗示未发布 */
.draft-preview { opacity: .75; }
.draft-preview .Post-body { cursor: default; }

/* 评论操作按钮（Reply / Like / 删除）与点赞提示 */
.Post-actions ul { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.Post-actions li { list-style: none; }
.Post-actions .Button--link { display: inline-flex; align-items: center; gap: 4px; }
.Post-actions ul li .Button--link.is-liked { color: var(--primary, #4d698e); font-weight: 600; }
.Post-actions ul li .Button--link.is-liked i { color: var(--primary, #4d698e); }
.Post-likedBy { font-size: 12px; color: #999; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.Post-likedBy i { color: var(--primary, #4d698e); }
.PostMention {
    color: var(--primary, #4d698e);
    background: var(--control-bg, #eef1f6);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.PostMention i { margin-right: 4px; font-size: 11px; }
.PostMention:hover { text-decoration: underline; }
.Post-repliedBy { font-size: 12px; color: #999; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.Post-repliedBy i { color: var(--primary, #4d698e); font-size: 11px; }
/* mention 引用浮层 */
.mention-popover {
    position: fixed;
    z-index: 1050;
    width: 300px;
    max-width: calc(100vw - 24px);
    background: var(--body-bg, #fff);
    border: 1px solid rgba(128,128,128,.18);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.14);
    padding: 12px;
    font-size: 13px;
}
.mention-popover-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mention-popover-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--primary, #4d698e); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex: none;
}
.mention-popover-user { display: flex; flex-direction: column; min-width: 0; }
.mention-popover-name { font-weight: 700; color: var(--text, #111); font-size: 13px; }
.mention-popover-time { font-size: 11px; color: #9aa9b9; }
.mention-popover-body { color: var(--text, #222); line-height: 1.6; word-break: break-word; max-height: 200px; overflow-y: auto; }
.mention-popover-body p { margin: 0 0 6px; }
.mention-popover-body p:last-child { margin-bottom: 0; }

@media (max-width: 767.98px) {
    .composer {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        height: 55vh;
        max-height: 560px;
        max-width: none;
        border-radius: 0;
        padding: 8px 0 0;
        display: flex;
        flex-direction: column;
        background: var(--body-bg);
        box-shadow: 0 4px 24px rgba(0, 0, 0, .18);
    }
    .composer-handle { display: none; }
    .composer-controls { position: absolute; top: 10px; left: 12px; z-index: 5; }
    .composer-avatar { display: none; }
    .composer-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px 0 0; }
    .composer-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
    .composer-head { order: 0; justify-content: center; margin: 2px 0 6px; font-size: 12px; text-align: center; padding: 0 96px; flex: none; white-space: nowrap; overflow: hidden; color: var(--text, #333); }
    .composer-head a { text-overflow: ellipsis; display: inline-block; vertical-align: middle; max-width: 100%; color: var(--text, #333); }
    .composer textarea {
        flex: 1;
        min-height: 0;
        height: auto;
        resize: none;
        border: none;
        border-top: 1px solid rgba(128, 128, 128, .22);
        border-radius: 0;
        padding: 10px 14px;
    }
    .composer-footer { order: 2; margin-top: 0; justify-content: flex-start; padding: 6px 14px 10px; flex: none; }
    .composer-post span { display: none; }
    .composer-post { position: absolute; top: 6px; right: 12px; z-index: 5; padding: 8px 10px; border-radius: 50%; }
    .composer-minimized { width: calc(100% - 24px); bottom: 10px; padding: 9px 14px; }
}

/* ===== Scrubber 帖子导航（参考目标站 Flarum 极简透明风）===== */
.scrubber-reply {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 10px 16px; margin-bottom: 14px;
    border: none; border-radius: 6px;
    background: var(--primary, #4D698E); color: #fff;
    font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    transition: opacity .15s;
}
.scrubber-reply:hover { opacity: .9; }
.scrubber {
    display: flex; flex-direction: column;
    padding: 0;
    margin-bottom: 16px;
}
.scrubber-first, .scrubber-last {
    display: flex; align-items: center; gap: 6px;
    border: 0; background: transparent; padding: 2px 0;
    font-size: 13px; font-weight: 400; color: var(--text-muted, #6c7d93);
    cursor: pointer; font-family: inherit;
}
.scrubber-first:hover, .scrubber-last:hover { color: var(--link, #4D698E); }
.scrubber-first i, .scrubber-last i { font-size: 11px; }
.scrubber-scrollbar {
    flex: 1;
    min-height: 180px;
    margin: 12px 0;
    position: relative;
    cursor: pointer;
    touch-action: none;
    user-select: none;
}
.scrubber-before, .scrubber-after {
    position: absolute; left: 4px; right: 0;
    background: transparent;
}
.scrubber-before { top: 0; }
.scrubber-after { bottom: 0; }
.scrubber-handle {
    position: absolute; left: 0; right: 0;
    background: transparent;
    cursor: pointer;
    min-height: 30px;
}
.scrubber-bar {
    position: absolute; top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--primary, #4D698E);
    opacity: .9;
    border-radius: 2px;
}
.scrubber-info {
    position: absolute; left: 24px; right: 0; top: 50%; transform: translateY(-50%);
    text-align: left; white-space: nowrap;
    font-size: 13px; color: var(--text, #333);
    pointer-events: none;
    line-height: 1.4;
    font-weight: 400;
}
.scrubber-info strong { color: var(--text, #333); font-weight: 600; }
.scrubber-desc { font-size: 11px; color: var(--text-muted, #6c7d93); font-weight: 400; }
.scrubber-unread {
    position: absolute; bottom: 0; left: 4px;
    font-size: 11px; color: var(--text-muted, #6c7d93);
    font-weight: 600;
}
@media (max-width: 767.98px) {
    .scrubber-reply, .scrubber { display: none; }
}

/* 移动端：顶部右上角语言切换隐藏（左侧抽屉内已有语言切换） */
@media (max-width: 767.98px) {
    .lang-dropdown { display: none !important; }
}

/* 移动端：底部空白紧凑 — pager/seo-pagination/footer 间距收紧
   桌面端保持原来的 100px gap (给大屏充足的视觉间隔)。
   这里仅 mobile (max-width: 767.98px) 生效。 */
@media (max-width: 767.98px) {
    /* pager 上下间距从 20 减到 12 */
    .pagination { margin: 12px 0; }
    .seo-pagination { padding: 6px 0; }
    /* footer 上间距从 40 减到 20,padding 上下 16 */
    .site-footer { margin-top: 20px; padding: 14px 15px; font-size: 12px; }
    /* 详情页右侧 sidebar 移动端整体隐藏(scubber / 购买卡 / 统计卡):
       main-col 桌面端是 grid 第一列,sidebar 是第二列并排显示;
       移动端降级为单列堆叠,sidebar 被推到 main-col 下面,占 ~ 320px,
       看上去就是"底部一大片空白"。隐藏后 main-col 后直接接 seo-related/footer。 */
    .product-page .sidebar { display: none !important; }
}

/* Scrubber 拖动兜底：确保滚动条始终可交互、不被其他层遮挡 */
.scrubber-scrollbar { position: relative; z-index: 5; }
.scrubber-scrollbar .scrubber-handle,
.scrubber-scrollbar .scrubber-before,
.scrubber-scrollbar .scrubber-after { z-index: 1; }

/* 通知铃铛定位容器：让 notif-panel 相对铃铛按钮对齐（PC 右上角） */
.notif-bell-wrap { position: relative; display: inline-flex; }

/* ===== 滑块拼图验证码 ===== */
.slider-captcha { margin: 14px 0; user-select: none; -webkit-user-select: none; }
.sc-canvas { position: relative; width: 100%; max-width: 320px; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 320 / 160; background: #eef0f3; }
.sc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.sc-puzzle { position: absolute; width: 13.75%; height: auto; aspect-ratio: 1/1; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); pointer-events: none; z-index: 2; }
.sc-refresh { position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; font-size: 13px; line-height: 24px; text-align: center; z-index: 3; opacity: 0; transition: opacity .2s; pointer-events: none; }
.sc-canvas:hover .sc-refresh { opacity: 1; }
.sc-track { position: relative; width: 100%; max-width: 320px; height: 38px; margin-top: 10px; background: #f2f3f5; border: 1px solid #e2e4e8; border-radius: 19px; overflow: hidden; box-sizing: border-box; }
.sc-tip { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #98a1af; transition: opacity .2s; pointer-events: none; }
.sc-thumb { position: absolute; top: 0; left: 0; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 1px solid #d0d4dc; box-shadow: 0 2px 6px rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center; cursor: grab; z-index: 3; box-sizing: border-box; touch-action: none; }
.sc-thumb:active { cursor: grabbing; }
.sc-thumb-icon { font-size: 16px; color: #6b7686; line-height: 1; }
.sc-success .sc-track { border-color: #4caf7d; background: #e9f7ef; }
.sc-success .sc-thumb { background: #4caf7d; border-color: #4caf7d; }
.sc-success .sc-thumb-icon { color: #fff; }
.sc-success .sc-tip { color: #4caf7d; }
.sc-fail .sc-thumb { border-color: #e0604f; background: #fdecea; }
.sc-fail .sc-thumb-icon { color: #e0604f; }
html.dark .sc-track { background: #23242a; border-color: #33353d; }
html.dark .sc-tip { color: #7a7e88; }
html.dark .sc-thumb { background: #2b2d35; border-color: #3a3d46; }
/* ===== 滑块拼图验证码（美化版） ===== */
.slider-captcha { margin: 16px 0; user-select: none; -webkit-user-select: none; }
.sc-canvas {
    position: relative; width: 100%; max-width: 320px;
    border-radius: 12px; overflow: hidden; cursor: pointer;
    aspect-ratio: 320 / 160;
    background: #eef0f3;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 6px 20px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05);
}
.sc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.sc-puzzle {
    position: absolute; width: 21.25%; height: auto; aspect-ratio: 1/1;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.45));
    pointer-events: none; z-index: 2;
}
.sc-refresh {
    position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
    border-radius: 50%; background: rgba(0,0,0,.32); color: #fff;
    font-size: 14px; line-height: 26px; text-align: center;
    z-index: 3; opacity: 0; transition: opacity .2s, transform .2s; cursor: pointer; pointer-events: auto;
    backdrop-filter: blur(2px);
}
.sc-canvas:hover .sc-refresh { opacity: 1; }
.sc-refresh:hover { transform: rotate(60deg); }
.sc-track {
    position: relative; width: 100%; max-width: 320px; height: 42px; margin-top: 12px;
    background: linear-gradient(180deg, #f8f9fb, #eef0f4);
    border: 1px solid #e4e7ec; border-radius: 21px; overflow: hidden;
    box-sizing: border-box;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.06);
}
.sc-tip { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #9aa3b2; transition: opacity .2s; pointer-events: none; letter-spacing: .3px; }
.sc-thumb {
    position: absolute; top: -1px; left: -1px; width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7e90ff, #5b6ef0);
    box-shadow: 0 3px 10px rgba(91,110,240,.45), inset 0 1px 0 rgba(255,255,255,.35);
    display: flex; align-items: center; justify-content: center;
    cursor: grab; z-index: 3; box-sizing: border-box; touch-action: none;
    transition: box-shadow .2s;
}
.sc-thumb:hover { box-shadow: 0 4px 14px rgba(91,110,240,.55), inset 0 1px 0 rgba(255,255,255,.35); }
.sc-thumb:active { cursor: grabbing; }
.sc-thumb-icon { font-size: 18px; color: #fff; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sc-success .sc-canvas { border-color: rgba(47,174,93,.4); }
.sc-success .sc-track { border-color: #37b06b; background: linear-gradient(180deg, #e9f8f0, #ddf3e6); box-shadow: inset 0 1px 3px rgba(55,176,107,.12); }
.sc-success .sc-thumb { background: linear-gradient(135deg, #45c878, #2fae5d); box-shadow: 0 3px 10px rgba(47,174,93,.45), inset 0 1px 0 rgba(255,255,255,.35); }
.sc-success .sc-thumb-icon { color: #fff; }
.sc-success .sc-tip { color: #2fae5d; font-weight: 500; }
.sc-fail .sc-thumb { background: linear-gradient(135deg, #ff8f7d, #f05a4a); box-shadow: 0 3px 10px rgba(240,90,74,.4); }
.sc-fail .sc-thumb-icon { color: #fff; }
@keyframes scShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }
.sc-fail { animation: scShake .5s ease; }
html.dark .sc-canvas { border-color: rgba(255,255,255,.08); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
html.dark .sc-track { background: linear-gradient(180deg, #26282f, #202228); border-color: #343740; }
html.dark .sc-tip { color: #7d828e; }
html.dark .sc-success .sc-track { border-color: #37b06b; background: linear-gradient(180deg, #1d2e26, #1a2a22); }
html.dark .sc-success .sc-tip { color: #5cc98a; }
html.dark .sc-fail .sc-thumb { background: linear-gradient(135deg, #ff8f7d, #f05a4a); }

/* ===== Markdown 表格样式（前端内容 + 后台预览） ===== */
.post-content table, .mde-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.6;
}
.post-content th, .post-content td, .mde-preview th, .mde-preview td {
    border: 1px solid var(--control-bg);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.post-content thead th, .mde-preview thead th {
    background: var(--control-bg-light);
    font-weight: 600;
}
.post-content tbody tr:nth-child(even) td, .mde-preview tbody tr:nth-child(even) td {
    background: var(--control-bg-shaded);
}
.post-content table code, .mde-preview table code { white-space: nowrap; }

/* SEO: 面包屑导航（服务端直出，利于爬行与面包屑富结果） */
.seo-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,.85);
    margin-bottom: 8px;
}
.seo-breadcrumb a { color: rgba(255,255,255,.9); text-decoration: none; }
.seo-breadcrumb a:hover { text-decoration: underline; }
.seo-breadcrumb span { color: #fff; font-weight: 600; }
/* SEO: 分页内链（服务端直出，利于深页发现） */
.seo-pagination {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: center;
    padding: 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.seo-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 6px 10px;
    text-align: center;
    border-radius: 6px;
    background: var(--control-bg);
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    flex: 0 0 auto;
}
.seo-pagination a:hover { background: var(--control-bg-shaded); }
.seo-pagination a.active { background: var(--primary-color); color: #fff; }
/* 上一页 / 下一页 侧边按钮（与后台 admin 分页一致） */
.seo-pagination .pg-prev,
.seo-pagination .pg-next {
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
}
.seo-pagination .pg-disabled { opacity: .4; cursor: default; pointer-events: none; }
.seo-pagination .pg-ellipsis {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    color: #999;
    align-self: center;
}


/* SEO: 视觉隐藏类（屏幕阅读器/SEO 可见，对布局零影响） */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* SEO: 详情正文 Markdown 标题整体下移一级(h1->h2)后，严格对齐下移前的视觉(浏览器默认 h1~h5 相对字号) */
.desc-text h2, .post-content h2 { font-size: 2em; font-weight: 700; margin: .67em 0; line-height: 1.25; }
.desc-text h3, .post-content h3 { font-size: 1.5em; font-weight: 700; margin: .83em 0; line-height: 1.3; }
.desc-text h4, .post-content h4 { font-size: 1.17em; font-weight: 700; margin: 1em 0; }
.desc-text h5, .post-content h5 { font-size: 1em; font-weight: 700; margin: 1.33em 0; }
.desc-text h6, .post-content h6 { font-size: .83em; font-weight: 700; margin: 1.67em 0; }

/* 移动端抽屉顶部：显示站标图标，隐藏站名文字 */
.mobile-drawer-logo-link { display: flex; align-items: center; }
.mobile-drawer-logo { height: 32px; width: auto; object-fit: contain; display: block; }
