/* ===== 用户后台样式（基于 user.html） ===== */

/* ===== 全局重置 & 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    display: flex;
    min-height: 100vh;
}

/* ===== 左侧导航 ===== */
.sidebar {
    width: 240px;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px 20px;
    border-bottom: 1px solid #1e293b;
    text-decoration: none;
}

.sidebar-brand .brand-icon {
    width: 40px; height: 40px; background: #3b82f6; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; flex-shrink: 0;
}

.sidebar-brand .brand-text { font-size: 18px; font-weight: 700; letter-spacing: 0.3px; color: #ffffff; }
.sidebar-brand .brand-text span { color: #60a5fa; }

.sidebar-nav { flex: 1; padding: 20px 12px 12px 12px; }

.nav-item {
    display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 10px;
    color: #cbd5e1; text-decoration: none; font-size: 15px; font-weight: 500; cursor: pointer;
    transition: all 0.2s ease; margin-bottom: 4px;
}
.nav-item:hover { background: #1e293b; color: #ffffff; }
.nav-item.active { background: #1e293b; color: #ffffff; box-shadow: inset 3px 0 0 #3b82f6; }
.nav-item i { width: 22px; font-size: 17px; text-align: center; flex-shrink: 0; color: #94a3b8; }
.nav-item.active i { color: #60a5fa; }
.nav-item .badge { margin-left: auto; background: #3b82f6; color: #fff; font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 20px; line-height: 20px; }
.nav-item .badge.warning { background: #f59e0b; }
.nav-item .badge.danger { background: #ef4444; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid #1e293b; font-size: 13px; color: #64748b; display: flex; align-items: center; gap: 10px; }
.sidebar-footer i { color: #475569; }
.sidebar-footer a { color: #94a3b8; text-decoration: none; margin-left: auto; }
.sidebar-footer a:hover { color: #fff; }

/* ===== 右侧主区域 ===== */
.main-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: #ffffff; padding: 0 32px; height: 68px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid #e2e8f0; flex-shrink: 0; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left .menu-toggle { display: none; background: none; border: none; font-size: 22px; color: #334155; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.topbar-left .menu-toggle:hover { background: #f1f5f9; }
.topbar-left .page-title { font-size: 20px; font-weight: 600; color: #0f172a; letter-spacing: -0.3px; }
.topbar-left .page-title small { font-size: 14px; font-weight: 400; color: #64748b; margin-left: 12px; }

.topbar-right { display: flex; align-items: center; gap: 20px; }
.topbar-right .admin-profile { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 12px 4px 4px; border-radius: 30px; text-decoration: none; }
.topbar-right .admin-profile:hover { background: #f1f5f9; }
.topbar-right .admin-profile .avatar { width: 38px; height: 38px; border-radius: 50%; background: #3b82f6; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; flex-shrink: 0; }
.topbar-right .admin-profile .info { line-height: 1.3; }
.topbar-right .admin-profile .info .name { font-size: 14px; font-weight: 600; color: #0f172a; }
.topbar-right .admin-profile .info .role { font-size: 12px; color: #64748b; }

/* ===== 内容容器 ===== */
.content { flex: 1; padding: 28px 32px 40px 32px; overflow-y: auto; }

/* ===== 通用卡片 ===== */
.card { background: #ffffff; border-radius: 14px; border: 1px solid #eef2f6; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03); overflow: hidden; margin-bottom: 24px; }
.card-header { padding: 18px 24px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 16px; font-weight: 600; color: #0f172a; }
.card-header .action-link { font-size: 13px; color: #3b82f6; cursor: pointer; font-weight: 500; text-decoration: none; }
.card-header .action-link:hover { text-decoration: underline; }
.card-body { padding: 16px 24px 24px 24px; }

/* ===== 仪表盘 ===== */
.welcome-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); border-radius: 16px; padding: 28px 36px; color: #fff;
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}
.welcome-banner .left h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.2px; }
.welcome-banner .left p { color: #94a3b8; margin-top: 6px; font-size: 15px; }
.welcome-banner .right { display: flex; gap: 12px; }
.welcome-banner .right .stat-badge { background: rgba(255, 255, 255, 0.08); padding: 10px 20px; border-radius: 12px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.06); }
.welcome-banner .right .stat-badge .num { font-size: 20px; font-weight: 700; color: #fff; }
.welcome-banner .right .stat-badge .label { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-card { background: #ffffff; border-radius: 14px; padding: 22px 24px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); border: 1px solid #eef2f6; transition: all 0.25s ease; display: flex; align-items: center; gap: 16px; }
.stat-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06); transform: translateY(-2px); border-color: #dbe1e9; }
.stat-card .icon-wrap { width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.stat-card .icon-wrap.blue { background: #eff6ff; color: #3b82f6; }
.stat-card .icon-wrap.orange { background: #fffbeb; color: #f59e0b; }
.stat-card .icon-wrap.green { background: #ecfdf5; color: #10b981; }
.stat-card .icon-wrap.red { background: #fef2f2; color: #ef4444; }
.stat-card .info .number { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.stat-card .info .label { font-size: 14px; color: #64748b; margin-top: 2px; }

.dynamic-item { display: flex; justify-content: space-between; border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; margin-bottom: 8px; }
.dynamic-item:last-child { border-bottom: none; margin-bottom: 0; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; font-size: 14px; color: #0f172a; margin-bottom: 6px; }
.form-group label .required { color: #ef4444; margin-left: 2px; }
.form-group .help-text { font-size: 13px; color: #64748b; margin-top: 4px; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; transition: border-color 0.2s; background: #fff; }
.form-control:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.file-upload-area { border: 2px dashed #e2e8f0; border-radius: 8px; padding: 30px 20px; text-align: center; cursor: pointer; transition: all 0.2s; background: #fafbfc; }
.file-upload-area:hover { border-color: #3b82f6; background: #f8fafc; }
.file-upload-area i { font-size: 36px; color: #94a3b8; margin-bottom: 8px; }
.file-upload-area p { font-size: 14px; color: #64748b; }
.file-upload-area .note { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.btn { padding: 10px 24px; border-radius: 8px; font-size: 15px; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-outline { background: transparent; border: 1px solid #e2e8f0; color: #0f172a; }
.btn-outline:hover { background: #f1f5f9; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid #e2e8f0; font-weight: 600; color: #475569; }
table td { padding: 12px 12px 12px 0; border-bottom: 1px solid #f1f5f9; color: #1e293b; }
table tr:last-child td { border-bottom: none; }

.status-badge { display: inline-block; padding: 2px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.status-badge.approved { background: #ecfdf5; color: #059669; }
.status-badge.published { background: #ecfdf5; color: #059669; }
.status-badge.pending { background: #fffbeb; color: #d97706; }
.status-badge.rejected { background: #fef2f2; color: #dc2626; }
.status-badge.takedown { background: #fef2f2; color: #dc2626; }
.status-badge.info { background: #eff6ff; color: #3b82f6; }

.btn-sm { padding: 4px 12px; border-radius: 6px; font-size: 12px; border: 1px solid #e2e8f0; cursor: pointer; background: #fff; color: #0f172a; transition: all 0.2s; text-decoration: none; display: inline-block; }
.btn-sm:hover { background: #f1f5f9; border-color: #cbd5e1; }
.btn-sm.primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.btn-sm.primary:hover { background: #2563eb; border-color: #2563eb; }
.btn-sm.danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-sm.danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-sm.success { background: #22c55e; color: #fff; border-color: #22c55e; }
.btn-sm.success:hover { background: #16a34a; border-color: #16a34a; }

/* 表格操作列按钮间距 */
.table-wrap td a.btn-sm { margin-right: 10px; }

/* ===== 个人资料 ===== */
.profile-item { display: flex; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.profile-item:last-child { border-bottom: none; }
.profile-item .label { width: 120px; font-weight: 500; color: #475569; flex-shrink: 0; }
.profile-item .value { flex: 1; color: #0f172a; }
.profile-item .value .muted { color: #94a3b8; font-size: 13px; }

/* ===== 状态提示条 ===== */
.status-line { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 18px; }
.status-line.ok { background: #ecfdf5; color: #059669; }
.status-line.wait { background: #fffbeb; color: #d97706; }
.status-line.no { background: #fef2f2; color: #dc2626; }

/* ===== 底部版权 ===== */
.footer-copy { text-align: center; padding: 20px 0 4px 0; font-size: 13px; color: #94a3b8; border-top: 1px solid #eef2f6; margin-top: 8px; }
.footer-copy .icp-line { margin-top: 6px; }
.footer-copy .icp-line a { color: #94a3b8; text-decoration: none; }
.footer-copy .icp-line a:hover { color: #3b82f6; text-decoration: underline; }

/* ===== 登录/注册独立页 ===== */
.auth-wrap { width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 16px; padding: 36px 32px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); }
.auth-card .brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; font-size: 20px; font-weight: 700; color: #0f172a; text-decoration: none; }
.auth-card .brand i { color: #3b82f6; }
.auth-card .brand span { color: #60a5fa; }
.auth-card h2 { text-align: center; font-size: 20px; margin-bottom: 4px; color: #0f172a; }
.auth-card .sub { text-align: center; color: #64748b; font-size: 13px; margin-bottom: 22px; }
.auth-card .row { display: flex; gap: 8px; }
.auth-card .row .form-control { flex: 1; }
.auth-card .row .btn-ghost { flex-shrink: 0; background: #f1f5f9; color: #0f172a; border: 1px solid #e2e8f0; white-space: nowrap; }
.auth-card .alt { text-align: center; margin-top: 16px; font-size: 13px; color: #64748b; }
.auth-card .alt a { color: #3b82f6; text-decoration: none; }
.auth-card .note { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.auth-card .agree { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; }
.auth-card .agree input { width: 15px; height: 15px; }
.auth-card .error-msg { background: #fef2f2; color: #dc2626; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.auth-card .success-msg { background: #ecfdf5; color: #059669; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* ===== 消息提示 ===== */
.alert-msg { background: #eff6ff; color: #3b82f6; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-msg.error { background: #fef2f2; color: #dc2626; }
.alert-msg.success { background: #ecfdf5; color: #059669; }

/* ===== 响应式 ===== */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.3); z-index: 90; }
.overlay.show { display: block; }

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: #1e293b; }
.sidebar::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: #f1f5f9; }
.content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    body { display: block; }
    .sidebar { transform: translateX(-100%); position: fixed; width: 280px; height: 100vh; top: 0; left: 0; box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2); }
    .sidebar.open { transform: translateX(0); }
    .topbar-left .menu-toggle { display: block; }
    .topbar-left .page-title small { display: none; }
    .topbar-right .admin-profile .info { display: none; }
    .content { padding: 16px; }
    .welcome-banner { flex-direction: column; text-align: center; padding: 24px 20px; gap: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; gap: 12px; }
    .stat-card .icon-wrap { width: 44px; height: 44px; font-size: 18px; }
    .stat-card .info .number { font-size: 22px; }
    .card-body { padding: 12px 16px 16px 16px; }
    .card-header { padding: 14px 16px; }
    .profile-item { flex-direction: column; gap: 4px; }
    .profile-item .label { width: 100%; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
}
