/* ============================================================
   图床系统 - 共享设计系统（被 user/* 与 admin/* 页面引用）
   页面独有样式（upload-area / lightbox / sidebar / stat-card 等）
   仍保留在各页面自身的 <style> 中。
   ============================================================ */

:root {
    --primary: #1a2332;
    --primary-light: #243447;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg: #f1f5f9;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text-dark); }

/* 移动端体验基线：去掉点按高亮、双击缩放延迟、iOS 字号自动调整 */
* { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, [role="button"], .thumb-img, .copy-md-btn { touch-action: manipulation; }

/* 顶栏 */
.topbar {
    background: var(--primary); color: #fff; padding: 0; box-shadow: 0 2px 10px rgba(0,0,0,.1);
    min-height: 56px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.topbar-brand { padding: 13px 20px; font-size: 18px; font-weight: 700; color: #fff; text-decoration:none; white-space:nowrap; }
.topbar-brand:hover { color: #fff; text-decoration: none; opacity: .9; }
.topbar-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex-wrap: wrap; }
.topbar-menu li { }
.topbar-menu li > a {
    display: block; padding: 15px 14px; color: rgba(255,255,255,.75); font-size: 14px; text-decoration: none; transition: all .2s; white-space: nowrap;
}
.topbar-menu li > a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar-menu li > a.btn-link { padding: 11px 14px; margin: 4px 8px 4px 4px; border-radius: 6px; }

.btn-accent {
    background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 8px 18px; font-weight: 500;
    transition: background .2s; cursor: pointer;
}
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 8px 18px; }
.btn-ghost:hover { background: rgba(255,255,255,.18); color: #fff; }

.main-content { padding: 32px 0; max-width: 1100px; margin: 0 auto; }
.card {
    background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border: 1px solid var(--border); overflow: hidden; margin-bottom: 24px;
}
.card-header-custom {
    background: #fafbfc; padding: 16px 24px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 15px; color: var(--primary);
}
.card-body-custom { padding: 24px; }

/* 文件表格 */
.file-table { width: 100%; border-collapse: collapse; }
.file-table th {
    background: #fafbfc; padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); border-bottom: 2px solid var(--border);
}
.file-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 14px; }
.file-table tbody tr:hover { background: #f8fafc; }
.thumb-img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; transition: transform .2s; }
.thumb-img:hover { transform: scale(1.1); }
.url-input-box {
    display: flex; align-items: center; background: #f1f5f9; border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.url-input-box input { flex: 1; border: none; background: transparent; padding: 8px 12px; font-size: 12px; font-family: monospace; outline: none; color: var(--text-muted); }
.url-copy-btn { padding: 8px 12px; background: transparent; border: none; cursor: pointer; color: var(--text-muted); transition: color .2s; }
.url-copy-btn:hover { color: var(--accent); }
.md-line { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.md-line code { background: #f1f5f9; padding: 2px 6px; border-radius: 3px; font-size: 11px; }
.copy-md-btn { color: var(--accent); cursor: pointer; text-decoration: underline; }
.copy-md-btn:hover { color: var(--accent-hover); }

.btn-delete {
    background: transparent; color: var(--danger); border: 1px solid #fecaca; border-radius: 6px;
    padding: 5px 12px; font-size: 13px; cursor: pointer; transition: all .2s;
}
.btn-delete:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.empty-state { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.empty-state i { font-size: 52px; margin-bottom: 14px; opacity: .35; }
.empty-state p { font-size: 15px; }

/* ---------- 分页（user/files.php 等） ---------- */
.pagination-custom {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 12px 18px; padding: 16px 24px;
    border-top: 1px solid var(--border); background: #fafbfc;
}
/* 关键：清掉 Bootstrap 残留的项目符号与左缩进 */
.pagination-custom ul {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
}
.pagination-custom li { list-style: none; margin: 0; padding: 0; }
.pagination-custom li > a,
.pagination-custom li > span {
    display: inline-flex; align-items: center; justify-content: center;
    box-sizing: border-box; min-width: 36px; height: 36px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
    font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
    color: var(--text-dark); text-decoration: none;
    transition: color .18s, background .18s, border-color .18s, transform .18s, box-shadow .18s;
}
.pagination-custom li > a:hover {
    border-color: var(--accent); color: var(--accent); background: #eff6ff; transform: translateY(-1px);
}
.pagination-custom li > a:active { transform: translateY(0); }
.pagination-custom li.active > span {
    border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700;
    box-shadow: 0 3px 10px rgba(59, 130, 246, .35);
}
.pagination-custom li.pager-dots > span {
    min-width: 24px; padding: 0 2px; border-color: transparent; background: transparent;
    color: var(--text-muted); letter-spacing: 1px; cursor: default;
}
.pagination-custom li.pager-nav > a { min-width: 40px; padding: 0 12px; color: var(--text-muted); }
.pagination-custom li.pager-nav > span { min-width: 40px; padding: 0 12px; color: #cbd5e1; background: #f8fafc; cursor: not-allowed; }
.pager-label { margin: 0 2px; }
.pager-info { font-size: 13px; color: var(--text-muted); }
.pager-info strong { color: var(--accent); font-weight: 700; }
.pager-jump { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.pager-jump input {
    width: 58px; height: 36px; padding: 0 4px; text-align: center; box-sizing: border-box;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
    font-size: 13px; color: var(--text-dark); outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.pager-jump input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.pager-jump input::-webkit-outer-spin-button,
.pager-jump input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pager-jump button {
    height: 36px; padding: 0 15px; border: none; border-radius: 8px;
    background: var(--accent); color: #fff; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: background .18s;
}
.pager-jump button:hover { background: var(--accent-hover); }

/* 响应式（仅布局相关，列隐藏规则保留在各页面） */
@media (max-width: 768px) {
    /* 顶栏改为「品牌一行 + 菜单一行」，菜单行横向滑动，不再挤压字号 */
    .topbar { min-height: 0; flex-direction: column; align-items: stretch; justify-content: flex-start; }
    .topbar-brand { padding: 12px 14px; font-size: 16px; display: flex; align-items: center; }
    .topbar-menu {
        flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
        justify-content: flex-start; scrollbar-width: none;
        border-top: 1px solid rgba(255, 255, 255, .08);
    }
    .topbar-menu::-webkit-scrollbar { display: none; }
    .topbar-menu li { flex-shrink: 0; }
    .topbar-menu li > a { padding: 13px 14px; font-size: 13px; line-height: 1; }
    .topbar-menu li > a.btn-link { margin: 6px 8px; padding: 8px 12px; }
    .main-content { padding: 16px 12px; max-width: 100%; }
    .card-body-custom { padding: 16px; }
    .card-header-custom { padding: 12px 16px; font-size: 14px; }
    .file-table th, .file-table td { padding: 10px 10px; font-size: 13px; }
    .thumb-img { width: 42px; height: 42px; }
    .pagination-custom { padding: 12px; gap: 10px 12px; }
    .pagination-custom ul { gap: 5px; }
    .pagination-custom li > a, .pagination-custom li > span { min-width: 32px; height: 32px; padding: 0 8px; font-size: 12px; }
    .pagination-custom li.pager-nav > a, .pagination-custom li.pager-nav > span { min-width: 34px; padding: 0 9px; }
    .pager-label { display: none; }
    .pager-jump { width: 100%; justify-content: center; }
    .pager-jump input { width: 54px; height: 32px; }
    .pager-jump button { height: 32px; padding: 0 13px; }
}
@media (max-width: 480px) {
    body { font-size: 14px; }
    .topbar-brand { padding: 10px 12px; font-size: 15px; }
    .topbar-menu li > a { padding: 12px 12px; font-size: 12px; }
    .topbar-menu li > a.btn-link { margin: 5px 6px; padding: 7px 10px; font-size: 12px; }
    .main-content { padding: 8px 8px; }
    .card { border-radius: 8px; margin-bottom: 16px; overflow-x: auto; }
    .card-body-custom { padding: 14px 12px; }
    .card-header-custom { padding: 10px 12px; font-size: 13px; }
    .url-input-box input { font-size: 12px; min-width: 0; flex: 1; }
    .file-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .file-table th, .file-table td { padding: 8px 8px; white-space: nowrap; }
    .thumb-img { width: 36px; height: 36px; }
    .btn-delete { padding: 5px 10px; font-size: 12px; }
    .pagination-custom { padding: 12px 8px; }
    .pagination-custom li > a, .pagination-custom li > span { min-width: 30px; height: 30px; padding: 0 6px; font-size: 12px; border-radius: 7px; }
    .pagination-custom li.pager-nav > a, .pagination-custom li.pager-nav > span { min-width: 32px; padding: 0 8px; }
    .pagination-custom li.pager-first, .pagination-custom li.pager-last { display: none; }
    .pager-info { width: 100%; text-align: center; font-size: 12px; }
}

/* ============ 后台管理共享样式（admin/* 通用） ============ */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 15px; }
.page-header { margin-top: 0; border-bottom: 2px solid #3b82f6; padding-bottom: 10px; }
.page-header small { color: #64748b; font-size: 14px; }
.sidebar { background: #fff; border-radius: 8px; padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden; }
.sidebar .nav-sidebar { list-style: none; margin: 0; padding: 8px 0; }
.sidebar .nav-sidebar li a { display: block; padding: 12px 20px; color: #475569; text-decoration: none; border-left: 3px solid transparent; font-size: 14px; font-weight: 500; transition: all .15s; }
.sidebar .nav-sidebar li a:hover { background: #f1f5f9; border-left-color: #3b82f6; color: #1e293b; }
.sidebar .nav-sidebar li.active a { background: #eff6ff; border-left-color: #3b82f6; color: #3b82f6; font-weight: 600; }
.sidebar .nav-sidebar i { margin-right: 8px; width: 16px; text-align: center; }

.card-header { background: #fafbfc; padding: 14px 20px; border-bottom: 1px solid #e2e8f0; font-weight: 600; font-size: 15px; color: #1a2332; border-radius: 10px 10px 0 0; }
.card-body { padding: 16px; }

.stat-card { background: #fff; border-radius: 12px; padding: 22px 18px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.04); border: 1px solid #e2e8f0; margin-bottom: 16px; transition: transform .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; margin-bottom: 10px; }
.stat-num { font-size: 28px; font-weight: 800; color: #1a2332; }
.stat-label { font-size: 13px; color: #64748b; margin-top: 2px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #fafbfc; padding: 10px 14px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #64748b; border-bottom: 1px solid #e2e8f0; text-align: left; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }

.badge-admin { background: #fef2f2; color: #dc2626; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-user { background: #f1f5f9; color: #64748b; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-disabled { background: #fef2f2; color: #dc2626; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }

.btn-sm-action { padding: 3px 8px; font-size: 12px; border-radius: 5px; cursor: pointer; transition: all .15s; }
.btn-del { background: transparent; color: #ef4444; border: 1px solid #fecaca; }
.btn-del:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

.pagination-wrap ul { display: inline-flex; gap: 4px; }
.pagination-wrap li a, .pagination-wrap li span { padding: 7px 13px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; color: #475569; text-decoration: none; transition: all .15s; }
.pagination-wrap li a:hover { border-color: #3b82f6; color: #3b82f6; }
.pagination-wrap li.active span { background: #3b82f6; color: #fff; border-color: #3b82f6; }
