/* 朝夕校园 —— 后台管理子站共享样式
   复用 :root 设计 token。布局壳分两套:PC = 左侧 sidebar + 顶部 topbar;
   移动 = 顶部 app-bar + 底部 tab-bar + 抽屉。切换通过 body 上的 .is-pc / .is-mobile
   class 控制,CSS 内部决定可见性。登录页(.auth-page)单独使用,不受壳影响。 */

:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary: #F97316;
    --accent: #10B981;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --surface-2: #F1F5F9;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --sidebar-w: 240px;
    --sidebar-w-collapsed: 64px;
    --topbar-h: 60px;
    --appbar-h: 56px;
    --tabbar-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ========== PC 布局壳 ========== */
body.is-pc { padding-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh; }
body.is-pc.sidebar-collapsed { padding-left: var(--sidebar-w-collapsed); }

/* 默认(无 class)时,壳是隐藏的,避免登录页抖动。脚本在 renderShell 中加 class。 */
body:not(.is-pc):not(.is-mobile):not(.auth-body) .sidebar,
body:not(.is-pc):not(.is-mobile):not(.auth-body) .topbar,
body:not(.is-pc):not(.is-mobile):not(.auth-body) .app-bar,
body:not(.is-pc):not(.is-mobile):not(.auth-body) .tab-bar,
body:not(.is-pc):not(.is-mobile):not(.auth-body) .drawer-backdrop,
body:not(.is-pc):not(.is-mobile):not(.auth-body) .drawer-menu { display: none; }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 50;
    transition: width .2s ease;
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.sidebar-header {
    height: var(--topbar-h);
    display: flex; align-items: center; padding: 0 16px; gap: 10px;
    border-bottom: 1px solid var(--border);
    font-weight: 700; color: var(--primary);
    font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-header .logo-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar-header .sidebar-title { white-space: nowrap; }
.sidebar-header .sidebar-sub {
    font-size: 11px; color: var(--text-secondary); font-weight: 500; margin-left: 4px;
}
body.sidebar-collapsed .sidebar-header .sidebar-title,
body.sidebar-collapsed .sidebar-header .sidebar-sub { display: none; }

.sidebar-collapse-btn {
    position: absolute; right: -12px; top: 18px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); font-size: 10px;
    box-shadow: var(--shadow-sm); z-index: 2;
    transition: transform .2s;
}
body.sidebar-collapsed .sidebar-collapse-btn { transform: rotate(180deg); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500; font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-nav a i { width: 18px; text-align: center; font-size: 16px; flex-shrink: 0; }
.sidebar-nav a:hover:not(.active) { background: var(--background); text-decoration: none; color: var(--text-primary); }
.sidebar-nav a.active { background: var(--primary); color: #fff; }

body.sidebar-collapsed .sidebar-nav a { justify-content: center; padding: 10px; }
body.sidebar-collapsed .sidebar-nav a span { display: none; }

.sidebar-footer {
    position: relative;
    border-top: 1px solid var(--border);
    padding: 12px; display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background .15s;
}
.sidebar-footer:hover { background: var(--background); }
.sidebar-footer:focus { outline: none; background: var(--background); }
.sidebar-footer .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface-2); flex-shrink: 0;
    background-size: cover; background-position: center;
}
.sidebar-footer .info { line-height: 1.3; min-width: 0; flex: 1; overflow: hidden; }
.sidebar-footer .info .name { font-weight: 600; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sidebar-footer .info .role { font-size: 11px; color: var(--text-secondary); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
body.sidebar-collapsed .sidebar-footer .info { display: none; }
.sidebar-footer-caret { font-size: 11px; color: var(--text-secondary); transition: transform .2s; flex-shrink: 0; }
.sidebar-footer .account-popover { display: none; }
.sidebar-footer .account-popover.open {
    display: block;
    position: absolute;
    left: 12px; right: 12px; bottom: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 50;
    min-width: 180px;
}
.popover-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 12px;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-primary); font-size: 14px;
    border-radius: var(--radius-sm);
    text-align: left;
}
.popover-item:hover { background: var(--background); }
.popover-item i { width: 16px; text-align: center; color: var(--text-secondary); }
.popover-item.popover-danger { color: var(--danger); }
.popover-item.popover-danger i { color: var(--danger); }
.popover-divider { height: 1px; background: var(--border); margin: 4px 8px; }
body.sidebar-collapsed .sidebar-footer-caret { display: none; }
body.sidebar-collapsed .sidebar-footer .account-popover.open { left: calc(100% + 8px); bottom: 0; min-width: 180px; }

/* ========== 顶部 topbar (PC) ========== */
.topbar {
    position: fixed; top: 0; left: var(--sidebar-w); right: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px; gap: 16px;
    z-index: 40;
    transition: left .2s ease;
}
body.sidebar-collapsed .topbar { left: var(--sidebar-w-collapsed); }
.topbar .crumb { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; }
.topbar .crumb .sep { color: var(--text-light); }
.topbar .crumb .current { color: var(--text-primary); font-weight: 600; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar .icon-btn {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--surface-2); border: none; cursor: pointer;
    color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.topbar .icon-btn:hover { background: var(--border); color: var(--text-primary); }
.topbar .home-link { color: var(--text-secondary); font-size: 13px; padding: 6px 12px; border-radius: 6px; }
.topbar .home-link:hover { background: var(--background); text-decoration: none; color: var(--text-primary); }

/* ========== 内容容器(沿用,只是 padding 适应壳) ========== */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 13px;
}
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

/* ========== 卡片 ========== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 16px;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-row { display: flex; gap: 16px; flex-wrap: wrap; }
.card-row > .card { flex: 1; min-width: 200px; }

/* ========== 统计卡片 ========== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
}
.stat-icon.warning { background: linear-gradient(135deg, var(--warning) 0%, #FCD34D 100%); }
.stat-icon.danger { background: linear-gradient(135deg, var(--danger) 0%, #FCA5A5 100%); }
.stat-icon.success { background: linear-gradient(135deg, var(--accent) 0%, #6EE7B7 100%); }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: rgba(79, 70, 229, 0.08); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ========== 表格 ========== */
.table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table thead {
    background: var(--surface-2);
}
.admin-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: var(--background); }
.admin-table .actions { display: flex; gap: 6px; }
.admin-table .empty-row td {
    text-align: center;
    color: var(--text-light);
    padding: 48px 16px;
    font-size: 14px;
}

/* ========== 状态徽章 ========== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge.pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge.approved { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge.rejected { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge.global { background: rgba(99, 102, 241, 0.1); color: #6366F1; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-row { display: flex; gap: 16px; }
.form-row > .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ========== 弹窗 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 640px; }
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--surface-2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ========== 绑定账号 modal 资料卡 ========== */
.bind-result-area { margin-top: 16px; min-height: 40px; }
.bind-loading { color: var(--text-light); font-size: 13px; padding: 20px 0; text-align: center; }
.bind-empty { color: var(--text-light); font-size: 13px; padding: 20px 0; text-align: center; background: var(--surface-2); border-radius: var(--radius-md); }
.bind-card {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    padding: 16px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.bind-card-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    object-fit: cover; background: var(--surface);
    flex-shrink: 0;
}
.bind-card-body { flex: 1; min-width: 180px; }
.bind-card-row { display: flex; gap: 8px; padding: 3px 0; font-size: 13px; line-height: 1.4; }
.bind-card-label { color: var(--text-secondary); width: 64px; flex-shrink: 0; }
.bind-card-value { color: var(--text-primary); word-break: break-all; }
.bind-cert { color: var(--primary); font-weight: 600; }
.bind-confirm-btn { flex-shrink: 0; }

/* ========== 空状态 ========== */
.empty {
    text-align: center;
    padding: 80px 16px;
    color: var(--text-light);
}
.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-secondary);
}
.empty-title { font-size: 16px; color: var(--text-primary); margin-bottom: 8px; }
.empty-desc { font-size: 13px; }

/* ========== Loading / Toast ========== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 9999;
    font-size: 14px;
    opacity: 0;
    transition: opacity .2s;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 登录页(.auth-page) ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px;
}
.auth-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo .title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.auth-logo .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}
.auth-form .form-control {
    padding: 12px 16px;
    font-size: 15px;
}
.auth-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 8px;
}

/* ========== 详情布局 ========== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.detail-label { font-size: 12px; color: var(--text-secondary); }
.detail-value { font-size: 14px; color: var(--text-primary); font-weight: 500; }

.warn-banner {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--warning);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #92400E;
    margin-bottom: 16px;
}

/* =====================================================
   移动端布局 (max-width: 767px)
   独立布局:app-bar (顶) + tab-bar (底) + 抽屉 (右)
   ===================================================== */
@media (max-width: 767px) {
    /* body 在 .is-mobile 时,内容从顶部 56px 起算,底部留 60px 给 tab-bar */
    body.is-mobile { padding-top: var(--appbar-h); padding-bottom: var(--tabbar-h); }
    body.is-mobile > .admin-container {
        max-width: 100%;
        padding: 16px;
    }
    body.is-mobile .topbar,
    body.is-mobile .sidebar,
    body.is-mobile .sidebar-collapse-btn { display: none; }

    /* 顶部 app-bar */
    .app-bar {
        position: fixed; top: 0; left: 0; right: 0;
        height: var(--appbar-h);
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        display: flex; align-items: center; gap: 8px;
        padding: 0 8px;
        z-index: 60;
    }
    .app-bar .menu-btn {
        width: 44px; height: 44px; border-radius: 8px;
        border: none; background: transparent;
        cursor: pointer; font-size: 18px;
        color: var(--text-primary);
        display: flex; align-items: center; justify-content: center;
        flex-shrink: 0;
    }
    .app-bar .menu-btn:active { background: var(--background); }
    .app-bar .app-bar-logo {
        font-weight: 700; color: var(--primary);
        font-size: 15px;
        display: flex; align-items: center; gap: 6px;
        flex-shrink: 0;
    }
    .app-bar .app-bar-logo i { font-size: 18px; }
    .app-bar .app-bar-logo .sub {
        font-size: 11px; color: var(--text-secondary); font-weight: 500;
        padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px;
    }
    .app-bar .page-title-mobile {
        flex: 1; font-weight: 600; font-size: 16px;
        margin-left: 4px;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        color: var(--text-primary);
    }
    .app-bar .user-btn {
        width: 44px; height: 44px; border-radius: 50%;
        background: var(--surface-2);
        border: none; cursor: pointer; flex-shrink: 0;
        background-size: cover; background-position: center;
        display: flex; align-items: center; justify-content: center;
        font-size: 14px; color: var(--text-secondary);
    }
    .app-bar .user-btn:active { background: var(--border); }

    /* 底部 tab-bar */
    .tab-bar {
        position: fixed; bottom: 0; left: 0; right: 0;
        height: var(--tabbar-h);
        background: var(--surface);
        border-top: 1px solid var(--border);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        z-index: 60;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .tab-bar a {
        display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        gap: 4px;
        padding: 8px 4px;
        min-height: 44px;
        color: var(--text-secondary);
        font-size: 11px;
        text-decoration: none;
    }
    .tab-bar a i { font-size: 20px; }
    .tab-bar a.active { color: var(--primary); }
    .tab-bar a.active i { color: var(--primary); }
    .tab-bar a:active { background: var(--background); }

    /* 抽屉 */
    .drawer-backdrop {
        position: fixed; inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 70;
        display: none;
    }
    .drawer-backdrop.open { display: block; }
    .drawer-menu {
        position: fixed; top: 0; right: 0; bottom: 0;
        width: 280px; max-width: 80vw;
        background: var(--surface);
        z-index: 71;
        transform: translateX(100%);
        transition: transform .25s ease;
        overflow-y: auto;
        display: flex; flex-direction: column;
    }
    .drawer-menu.open { transform: translateX(0); }
    .drawer-menu .drawer-header {
        padding: 16px;
        border-bottom: 1px solid var(--border);
        display: flex; align-items: center; gap: 10px;
        flex-shrink: 0;
    }
    .drawer-menu .drawer-header .avatar {
        width: 40px; height: 40px; border-radius: 50%;
        background: var(--surface-2);
        background-size: cover; background-position: center;
    }
    .drawer-menu .drawer-header .info { flex: 1; min-width: 0; }
    .drawer-menu .drawer-header .info .name { font-weight: 600; font-size: 14px; }
    .drawer-menu .drawer-header .info .role { font-size: 12px; color: var(--text-secondary); }
    .drawer-menu .drawer-close {
        width: 44px; height: 44px; border-radius: 50%;
        border: none; background: var(--surface-2);
        cursor: pointer; font-size: 16px; color: var(--text-secondary);
    }
    .drawer-menu .drawer-section {
        padding: 12px 8px;
        flex: 1;
    }
    .drawer-menu .drawer-section h4 {
        font-size: 11px; color: var(--text-light);
        text-transform: uppercase; letter-spacing: 0.5px;
        margin: 8px 8px 12px;
    }
    .drawer-menu a {
        display: flex; align-items: center; gap: 12px;
        padding: 14px 16px;
        min-height: 44px;
        color: var(--text-primary);
        font-size: 15px;
        border-radius: 8px;
        text-decoration: none;
    }
    .drawer-menu a i { width: 20px; text-align: center; font-size: 16px; color: var(--text-secondary); }
    .drawer-menu a.active { background: var(--primary); color: #fff; }
    .drawer-menu a.active i { color: #fff; }
    .drawer-menu a:active:not(.active) { background: var(--background); }
    .drawer-menu .drawer-account-actions {
        display: flex; gap: 10px; padding: 12px 16px;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }
    .drawer-menu .drawer-account-btn {
        flex: 1;
        display: flex; align-items: center; justify-content: center; gap: 8px;
        min-height: 44px;
        background: var(--background); color: var(--text-primary);
        border: 1px solid var(--border); border-radius: 8px;
        font-size: 14px; cursor: pointer;
    }
    .drawer-menu .drawer-account-btn:active { background: var(--surface-2); }
    .drawer-menu .drawer-logout {
        border-top: 1px solid var(--border);
        padding: 12px 16px;
        flex-shrink: 0;
    }
    .drawer-menu .drawer-logout a {
        color: var(--danger);
    }
    .drawer-menu .drawer-logout a i { color: var(--danger); }

    /* 移动端表格 → 卡片化
       1) table 改为 block,每行变卡片
       2) 隐藏 thead
       3) td::before 显示对应 th 的列名 (优先取 data-label,否则取 th 文本) */
    body.is-mobile .table-wrap { background: transparent; box-shadow: none; padding: 0; }
    body.is-mobile table.admin-table { display: block; }
    body.is-mobile .admin-table thead { display: none; }
    body.is-mobile .admin-table tbody { display: block; }
    body.is-mobile .admin-table tr {
        display: block;
        background: var(--surface);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
        margin-bottom: 12px;
        overflow: hidden;
    }
    body.is-mobile .admin-table tr:hover { background: var(--surface); }
    body.is-mobile .admin-table td {
        display: flex; justify-content: space-between; align-items: center;
        padding: 10px 14px;
        border-bottom: 1px solid var(--border);
        font-size: 14px;
        gap: 12px;
    }
    body.is-mobile .admin-table td:last-child { border-bottom: none; }
    body.is-mobile .admin-table td::before {
        content: attr(data-label);
        color: var(--text-secondary); font-size: 12px;
        flex-shrink: 0; min-width: 60px;
        font-weight: 500;
    }
    body.is-mobile .admin-table .actions { width: 100%; justify-content: flex-end; }
    body.is-mobile .admin-table .empty-row { display: block; text-align: center; }
    body.is-mobile .admin-table .empty-row td { display: block; padding: 32px 16px; }
    body.is-mobile .admin-table .empty-row td::before { display: none; }

    /* 隐藏次要列(.hide-on-mobile) */
    body.is-mobile .hide-on-mobile { display: none !important; }

    /* 内容容器微调 */
    .page-title { font-size: 18px; }
    .card { padding: 16px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-icon { width: 40px; height: 40px; font-size: 18px; }
    .stat-value { font-size: 20px; }
    .form-row { flex-direction: column; gap: 0; }
    .detail-grid { grid-template-columns: 1fr; }
    .admin-table .actions { flex-wrap: wrap; }
    .modal { width: 92%; max-width: 100%; border-radius: var(--radius); }
    .modal-lg { max-width: 100%; }
    .modal-body { padding: 16px; }
}

/* =====================================================
   朋友圈式帖子预览 (PC + mobile 共用)
   ===================================================== */
.post-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.post-card-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px;
}
.post-card-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    background-size: cover; background-position: center;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600;
    position: relative;
}
.post-card-avatar .verified-tick {
    position: absolute; bottom: 0; right: 0;
    width: 16px; height: 16px;
    background: var(--success);
    border: 2px solid var(--surface);
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    display: flex; align-items: center; justify-content: center;
}
.post-card-user { flex: 1; min-width: 0; }
.post-card-name {
    display: flex; align-items: center; gap: 6px;
    font-size: 15px; font-weight: 600; color: var(--text-primary);
}
.post-card-name .anon-tag {
    background: var(--surface-2); color: var(--text-secondary);
    font-size: 11px; padding: 1px 6px; border-radius: 4px;
    font-weight: 500;
}
.post-card-meta {
    font-size: 12px; color: var(--text-light);
    margin-top: 2px;
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.post-card-meta .category-pill {
    background: rgba(58,175,169,0.12); color: var(--primary);
    padding: 2px 8px; border-radius: 12px; font-weight: 500;
}
.post-card-title {
    font-size: 16px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 8px; line-height: 1.4;
}
.post-card-text {
    font-size: 15px; line-height: 1.7; color: var(--text-primary);
    white-space: pre-wrap; word-break: break-word;
    margin-bottom: 12px;
}
.post-card-images { margin: 0 0 12px; }

/* 图片网格(QQ 朋友圈式) */
.image-grid { display: grid; gap: 4px; }
.image-grid.cols-1 {
    grid-template-columns: minmax(0, 280px);
    max-width: 320px;
}
.image-grid.cols-1 .image-item { aspect-ratio: 4 / 3; }
.image-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.image-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.image-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
.image-grid.cols-multi { grid-template-columns: repeat(3, 1fr); }
.image-item {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: var(--surface-2);
    background-size: cover; background-position: center;
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
    transition: opacity .15s;
}
.image-item:hover { opacity: 0.85; }
.image-item.more::after {
    content: '+' attr(data-more);
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700;
    pointer-events: none;
}

/* 视频封面 */
.post-card-videos { margin: 0 0 12px; }
.video-cover {
    position: relative;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    max-width: 320px;
    aspect-ratio: 16 / 10;
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
}
.video-cover .play-btn {
    width: 64px; height: 64px;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    color: var(--primary);
    font-size: 28px;
    display: flex; align-items: center; justify-content: center;
    padding-left: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    pointer-events: none;
}
.video-cover .duration {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.6); color: #fff;
    padding: 2px 6px; border-radius: 3px;
    font-size: 11px;
}
.video-cover .video-multi {
    position: absolute; top: 8px; left: 8px;
    background: rgba(0,0,0,0.6); color: #fff;
    padding: 2px 8px; border-radius: 12px;
    font-size: 11px;
}

/* 数据 + 操作栏 */
.post-card-stats {
    display: flex; gap: 16px; flex-wrap: wrap;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    font-size: 13px; color: var(--text-secondary);
}
.post-card-stats .stat { display: inline-flex; align-items: center; gap: 4px; }
.post-card-stats .stat i { color: var(--text-light); }

/* 点赞用户列表 */
.like-list-toggle {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 13px; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: space-between;
    border: 1px solid var(--border);
    transition: background .15s;
}
.like-list-toggle:hover { background: var(--border); }
.like-list {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}
.like-list.open { display: block; }
.like-list-item {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}
.like-list-item img {
    width: 28px; height: 28px; border-radius: 50%;
    object-fit: cover; background: var(--primary-light);
}
.like-list-empty { color: var(--text-light); font-size: 13px; padding: 8px 0; text-align: center; }

/* ========== Lightbox 全屏预览 ========== */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 10000;
    display: none;
    align-items: center; justify-content: center;
    flex-direction: column;
}
.lightbox.open { display: flex; }
.lightbox-img {
    max-width: 96vw; max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    -webkit-user-drag: none;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    background: rgba(0,0,0,0.5); color: #fff;
    border: none; cursor: pointer;
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: background .15s;
    z-index: 2;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(0,0,0,0.8);
}
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
    color: #fff; font-size: 14px;
    margin-top: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* 视频全屏预览 */
.media-viewer {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
}
.media-viewer video {
    max-width: 96vw; max-height: 88vh;
    border-radius: 8px;
    background: #000;
}
.media-viewer .lightbox-close { position: absolute; top: 16px; right: 16px; }
