/* ========================================
   朋友圈小程序后台管理系统 - 样式表
   ======================================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #0f172a;
    --gray: #64748b;
    --light: #f1f5f9;
    --border: rgba(99,102,241,0.15);
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: rgba(99,102,241,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0b0f19;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
}
.theme-toggle{width:36px;height:36px;border:1px solid var(--border);border-radius:6px;background:#1e293b;color:#e2e8f0;cursor:pointer;font-size:18px}
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}
html[data-theme="light"] body{background:#f4f6f8;color:#1f2937}
html[data-theme="light"] .sidebar{--sidebar-bg:#fff;--sidebar-text:#5f6772;--sidebar-active:#eef2ff;border-right-color:#e5e7eb}
html[data-theme="light"] .sidebar-header h2,html[data-theme="light"] .menu-item:hover{color:#1f2937}
html[data-theme="light"] .topbar{background:rgba(255,255,255,.94);border-bottom-color:#e5e7eb}
html[data-theme="light"] .theme-toggle{background:#fff;color:#374151}
html[data-theme="light"] .card,html[data-theme="light"] .search-bar,html[data-theme="light"] .modal{background:#fff;color:#1f2937;border-color:#e5e7eb}
html[data-theme="light"] .card-header,html[data-theme="light"] .modal-header,html[data-theme="light"] .modal-footer{border-color:#e5e7eb}
html[data-theme="light"] .data-table th{background:#f8fafc;color:#475569}
html[data-theme="light"] .data-table td{border-color:#edf0f2;color:#334155}
html[data-theme="light"] .form-control{background:#fff;color:#1f2937;border-color:#d7dce2}
html[data-theme="light"] .form-help,html[data-theme="light"] small{color:#64748b}

/* 登录页 */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
}
.login-theme-toggle{position:fixed;right:20px;top:20px;width:42px;height:42px;border:1px solid rgba(255,255,255,.2);border-radius:6px;background:#1e293b;color:#fff;font-size:20px;cursor:pointer;z-index:5}html[data-theme="light"] .login-body{background:#eef1f5}html[data-theme="light"] .login-box{background:#fff;color:#1f2937;border-color:#dce1e8;box-shadow:0 18px 45px rgba(15,23,42,.12)}html[data-theme="light"] .login-theme-toggle{background:#fff;color:#1f2937;border-color:#d7dce2}

.login-box {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.login-box .logo { text-align: center; margin-bottom: 30px; }
.login-box .logo h1 {
    font-size: 24px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-box .logo p { color: #94a3b8; margin-top: 6px; font-size: 13px; }

/* 布局 */
.admin-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
}

.sidebar-menu { padding: 12px 0; }
.menu-label {
    padding: 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--gray);
    letter-spacing: 0.5px;
}
.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 16px;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.menu-item:hover {
    background: rgba(99,102,241,0.08);
    color: #e2e8f0;
}
.menu-item.active {
    background: var(--sidebar-active);
    color: var(--primary);
    border-left-color: var(--primary);
}
.menu-item .icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 60px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.mobile-menu-btn {
    display: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.breadcrumb { color: var(--gray); font-size: 13px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }

.user-menu { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}
.user-info .name { font-weight: 500; font-size: 13px; }
.user-info .role { font-size: 11px; color: var(--gray); }

.page-content { padding: 24px; flex: 1; }

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.dashboard-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}

.stat-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-card.blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-card.green::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.stat-card.orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.cyan::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.stat-card.red::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.stat-card .icon-wrap {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
    background: rgba(99,102,241,0.1);
}
.stat-card .number {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.stat-card .label { color: var(--gray); font-size: 13px; }
.stat-card .trend {
    font-size: 12px;
    margin-top: 8px;
    font-weight: 500;
}
.stat-card .trend.up { color: var(--success); }

/* 卡片 */
.card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* 表格 */
.table-responsive { overflow-x: auto; }
.moment-search-row{display:flex;gap:10px;align-items:center;flex-wrap:nowrap}.moment-search-row .form-control{min-width:160px}.moment-search-row input{flex:1}.moment-search-row .btn{flex:none;white-space:nowrap}.batch-toolbar .form-group{min-width:150px}.batch-toolbar .btn{white-space:nowrap}
.batch-blur-options{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}.batch-blur-options[hidden]{display:none}.batch-blur-options .form-control{width:150px}
@media(max-width:768px){.moment-search-row{flex-wrap:wrap}.moment-search-row input{flex-basis:100%}.batch-toolbar{align-items:stretch!important}.batch-toolbar .form-group,.batch-toolbar .btn{width:100%}.batch-toolbar .form-control{width:100%!important}}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--gray);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(99,102,241,0.05);
    vertical-align: middle;
}
.data-table tr:hover td { background: rgba(99,102,241,0.03); }
.data-table .empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

/* 用户单元格 */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(99,102,241,0.1);
}
.user-cell .name { font-weight: 500; }
.user-cell .sub { font-size: 12px; color: var(--gray); }

/* 图片预览 */
.img-preview {
    width: 48px; height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(99,102,241,0.1);
}
.media-preview-grid{display:grid;grid-template-columns:repeat(2,72px);gap:6px;width:max-content;max-width:150px}.media-preview-grid .img-preview{width:72px;height:72px;object-fit:cover;border-radius:5px;border:1px solid var(--border);background:#111827;cursor:zoom-in}.video-preview{width:220px;max-width:100%;height:124px;object-fit:contain;border-radius:6px;background:#000;border:1px solid var(--border)}
html[data-theme="light"] .media-preview-grid .img-preview,html[data-theme="light"] .video-preview{background:#eef1f4;border-color:#d7dce2}
@media(max-width:768px){.media-preview-grid{grid-template-columns:repeat(2,58px);max-width:122px}.media-preview-grid .img-preview{width:58px;height:58px}.video-preview{width:160px;height:96px}}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-info { background: var(--info); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-help { display: block; margin-top: 6px; color: var(--gray); font-size: 12px; line-height: 1.5; }
.modal-wide { max-width: 820px; }
.comment-moment-summary { display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 14px; background: rgba(15,23,42,.55); border: 1px solid var(--border); border-radius: 10px; }
.comment-moment-summary span { color: var(--gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-admin-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-admin-item.is-hidden { opacity: .55; }
.comment-admin-item .avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: rgba(99,102,241,.1); flex: none; }
.comment-admin-main { flex: 1; min-width: 0; }
.comment-admin-main p { margin-top: 5px; color: #cbd5e1; word-break: break-word; }
.comment-time { margin-left: 10px; color: var(--gray); font-size: 11px; }
.comment-admin-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 600px) { .comment-admin-item { flex-wrap: wrap; } .comment-admin-actions { width: 100%; padding-left: 50px; } .comment-moment-summary { flex-direction: column; } }

/* 搜索栏 */
.search-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}
.search-bar .form-control { max-width: 300px; }

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(100,116,139,0.2);
    color: var(--gray);
}
.badge-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-info { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-purple { background: rgba(139,92,246,0.15); color: #a78bfa; }

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.pagination span { color: var(--gray); font-size: 13px; margin-right: 8px; }
.pagination a {
    padding: 6px 12px;
    background: rgba(30,41,59,0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}
.pagination a:hover { background: rgba(99,102,241,0.1); border-color: var(--primary); }
.pagination a.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-color: transparent;
}

/* 提示消息 */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.2);
    color: #86efac;
}
.alert-danger {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #fca5a5;
}

/* 页面头部 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 600; }

/* 模态框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
    transform: scale(0.95);
    transition: transform 0.3s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 16px; }
.modal-close {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 22px;
    cursor: pointer;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.modal-cancel {
    background: rgba(100,116,139,0.2);
    color: #cbd5e1;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .dashboard-grid{grid-template-columns:1fr}
    .settings-grid { grid-template-columns:1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr !important; }
    .search-bar { flex-direction: column; }
    .search-bar .form-control { max-width: 100%; }
}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.admin-filter{display:flex;gap:10px;flex-wrap:wrap;width:100%}.admin-filter .form-control{max-width:260px}
@media(max-width:600px){.form-grid{grid-template-columns:1fr}}
