/* ========== PDF漫画阅读器 - 管理后台样式 ========== */
:root {
    --admin-bg: #f5f5f5;
    --sidebar-bg: #111;
    --sidebar-text: #999;
    --sidebar-active: #fff;
    --card-bg: #fff;
    --border: #e5e5e5;
    --primary: #000;
    --primary-hover: #333;
    --success: #000;
    --danger: #000;
    --warning: #000;
    --text: #222;
    --text-secondary: #888;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.02);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--admin-bg); color: var(--text); min-height: 100vh; }

/* Login page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #111; }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card { background: #fff; border-radius: 0; box-shadow: 0 20px 60px rgba(0,0,0,.2); padding: 40px 32px; }
.login-header { text-align: center; margin-bottom: 28px; }
.login-icon { width: 64px; height: 64px; margin: 0 auto 16px; background: #000; border-radius: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.login-header h1 { font-size: 22px; font-weight: 700; color: #000; letter-spacing: 2px; }
.login-header p { font-size: 13px; color: #999; margin-top: 4px; letter-spacing: 1px; }
.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 6px; letter-spacing: .5px; }
.login-form input { width: 100%; padding: 12px 16px; border: 1.5px solid #e5e5e5; border-radius: 0; font-size: 15px; outline: none; transition: all .2s; }
.login-form input:focus { border-color: #000; }
.login-footer { text-align: center; margin-top: 20px; }
.login-footer a { color: #999; font-size: 13px; text-decoration: none; }
.login-footer a:hover { color: #000; }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--sidebar-bg); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 50; }
.sidebar-header { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-header h2 { color: #fff; font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.sidebar-header .badge { display: inline-block; background: rgba(255,255,255,.06); color: #888; font-size: 10px; padding: 2px 10px; margin-top: 4px; letter-spacing: 1px; }
.sidebar-nav { padding: 12px 12px; flex: 1; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 2px 0; border-radius: 4px; color: var(--sidebar-text); text-decoration: none; font-size: 13px; font-weight: 400; transition: all .2s; }
.sidebar-nav a:hover { background: rgba(255,255,255,.04); color: #ccc; }
.sidebar-nav a.active { background: rgba(255,255,255,.08); color: #fff; }

.admin-main { flex: 1; margin-left: 240px; padding: 28px 32px; max-width: 1200px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-header h1 { font-size: 22px; font-weight: 600; }
.header-info span { font-size: 13px; color: var(--text-secondary); }
.header-subtitle { font-size: 13px; color: var(--text-secondary); }

/* Dashboard Stats */
.dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 0; padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #f5f5f5; border-radius: 0; color: #000; }
.stat-number { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 400; }

/* Cards */
.content-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 0; padding: 20px; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-actions { display: flex; gap: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 0; font-size: 13px; font-weight: 500; border: none; cursor: pointer; transition: all .2s; text-decoration: none; letter-spacing: .5px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: #000; color: #fff; }
.btn-success:hover { background: #333; }
.btn-danger { background: #000; color: #fff; }
.btn-danger:hover { background: #333; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: #000; color: #000; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-link { background: none; border: none; color: #000; cursor: pointer; font-size: 13px; padding: 2px 4px; }

/* Alerts */
.alert { padding: 12px 16px; font-size: 13px; margin-bottom: 16px; border-radius: 0; }
.alert-success { background: #f5f5f5; color: #000; border: 1px solid #ddd; }
.alert-error { background: #f5f5f5; color: #000; border: 1px solid #ddd; }

/* Table */
.comic-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.comic-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.comic-table th { text-align: left; padding: 10px 12px; font-weight: 600; font-size: 11px; text-transform: none; color: var(--text-secondary); border-bottom: 2px solid var(--border); white-space: nowrap; letter-spacing: .5px; }
.comic-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.comic-table tbody tr:hover { background: #fafafa; }
.sort-input { width: 54px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 0; text-align: center; font-size: 13px; }
.sort-input:focus { border-color: #000; outline: none; }
.thumb-box { display: flex; align-items: center; justify-content: center; }
.comic-title { display: flex; align-items: center; gap: 4px; max-width: 200px; }
.comic-title .title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-cell { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.action-cell { white-space: nowrap; }
.action-cell .btn { margin-right: 4px; }

.status-badge { display: inline-block; padding: 2px 10px; font-size: 11px; font-weight: 500; text-decoration: none; letter-spacing: .5px; }
.status-badge.active { background: #000; color: #fff; }
.status-badge.draft { background: #eee; color: #888; }

/* Upload Area */
.upload-area { border: 2px dashed #ddd; padding: 40px 20px; text-align: center; transition: all .3s; }
.upload-area.dragover { border-color: #000; background: #fafafa; }
.upload-icon { margin-bottom: 16px; }
.upload-area h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.upload-area p { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.upload-hint { font-size: 12px !important; color: #bbb !important; margin-bottom: 20px !important; }
.file-list { margin-top: 16px; text-align: left; }
.file-list h4 { font-size: 13px; margin-bottom: 8px; color: var(--text-secondary); }
.file-list ul { list-style: none; }
.file-list li { padding: 6px 12px; background: #fafafa; margin: 4px 0; font-size: 13px; }

/* Empty State */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state p { font-size: 14px; color: var(--text-secondary); margin: 16px 0 20px; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal-content { background: #fff; padding: 24px; width: 90%; max-width: 400px; border-radius: 0; }
.modal-content h3 { font-size: 16px; margin-bottom: 16px; }
.form-input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 0; font-size: 15px; outline: none; }
.form-input:focus { border-color: #000; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.empty-text { text-align: center; padding: 20px; color: var(--text-secondary); font-size: 13px; }

/* Responsive */
@media (max-width: 900px) {
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .admin-main { padding: 20px 16px; }
}
@media (max-width: 768px) {
    .admin-sidebar { width: 60px; }
    .sidebar-header h2, .sidebar-header .badge, .sidebar-nav a span { display: none; }
    .sidebar-nav a { justify-content: center; padding: 12px; }
    .admin-main { margin-left: 60px; padding: 16px 12px; }
    .dashboard-stats { grid-template-columns: 1fr; }
}
