/* 管理后台样式 —— 深色控制台主题（V1.12） */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #0b1220;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: 232px;
  min-height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0d1526, #0a0f1d);
  border-right: 1px solid rgba(148, 163, 184, .12);
  position: sticky; top: 0; height: 100vh;
}

.side-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .1);
}
.brand-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(59, 130, 246, .35);
}
.side-title { font-size: 14px; font-weight: 600; color: #f1f5f9; }
.side-sub { font-size: 12px; color: #64748b; }

.side-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; }

.side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px;
  color: #94a3b8; font-size: 14px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: all .18s ease;
  border: 1px solid transparent;
}
.side-item i { width: 18px; text-align: center; font-size: 15px; }
.side-item:hover { color: #e2e8f0; background: rgba(148, 163, 184, .08); }
.side-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(59, 130, 246, .22), rgba(99, 102, 241, .18));
  border-color: rgba(96, 165, 250, .35);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .12);
}

.side-user { padding: 14px 12px; border-top: 1px solid rgba(148, 163, 184, .1); display: flex; flex-direction: column; gap: 8px; }
.side-admin { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #cbd5e1; padding: 2px 8px; }
.side-admin i { color: #f59e0b; }
.side-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px;
  font-size: 13px; color: #94a3b8;
  background: none; border: none; cursor: pointer;
  border-radius: 8px; text-decoration: none; text-align: left;
  transition: all .15s;
}
.side-link:hover { color: #fff; background: rgba(148, 163, 184, .1); }

/* ===== 主区 ===== */
.main { flex: 1; min-width: 0; padding: 0 22px 40px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .1);
  margin-bottom: 18px;
}
.page-title { font-size: 20px; font-weight: 600; color: #f8fafc; }
.page-sub { margin-top: 3px; font-size: 13px; color: #64748b; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.badge-soft {
  font-size: 12px; color: #93c5fd;
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(96, 165, 250, .25);
  padding: 5px 11px; border-radius: 999px;
}
.btn-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 14px;
  background: rgba(148, 163, 184, .08);
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 9px; cursor: pointer;
  transition: all .15s;
}
.btn-icon:hover { color: #fff; background: rgba(96, 165, 250, .2); border-color: rgba(96, 165, 250, .4); }

/* ===== 页面切换 ===== */
.page { display: none; }
.page.active { display: block; animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== 面板/卡片 ===== */
.panel {
  background: #101a30;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 14px;
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 18px;
  font-size: 14px; font-weight: 600; color: #e2e8f0;
  border-bottom: 1px solid rgba(148, 163, 184, .1);
  background: rgba(148, 163, 184, .04);
}
.panel-body { padding: 16px 18px; }

.stat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  background: #101a30;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 14px;
  transition: transform .18s, border-color .18s;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(96, 165, 250, .35); }
.stat-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; border-radius: 12px;
}
.stat-card[data-accent="warning"] .stat-icon { color: #f59e0b; background: rgba(245, 158, 11, .13); }
.stat-card[data-accent="primary"] .stat-icon { color: #60a5fa; background: rgba(59, 130, 246, .13); }
.stat-card[data-accent="success"] .stat-icon { color: #34d399; background: rgba(16, 185, 129, .13); }
.stat-card[data-accent="info"] .stat-icon { color: #22d3ee; background: rgba(34, 211, 238, .13); }
.stat-label { font-size: 12.5px; color: #64748b; }
.stat-value { font-size: 24px; font-weight: 700; color: #f8fafc; margin-top: 2px; }

.chart { height: 340px; }
.chart-lg { height: 280px; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
.admin-table { margin: 0; --bs-table-bg: transparent; color: #cbd5e1; font-size: 13.5px; }
.admin-table thead th {
  background: #141f38;
  color: #94a3b8; font-weight: 600; font-size: 12.5px;
  padding: 11px 14px; white-space: nowrap;
  border-bottom: 1px solid rgba(148, 163, 184, .15);
}
.admin-table tbody td { padding: 11px 14px; border-color: rgba(148, 163, 184, .08); vertical-align: middle; }
.admin-table tbody tr { transition: background .12s; }
.admin-table tbody tr:hover { background: rgba(96, 165, 250, .05); }

.type-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.type-badge.weekly { color: #93c5fd; background: rgba(59, 130, 246, .14); }
.type-badge.daily { color: #6ee7b7; background: rgba(16, 185, 129, .14); }
.type-badge.monthly { color: #fcd34d; background: rgba(245, 158, 11, .14); }
.status-tag { font-size: 12px; color: #f87171; background: rgba(248, 113, 113, .12); padding: 3px 8px; border-radius: 6px; }

.empty-tip { text-align: center; color: #475569; padding: 46px 0 40px; }
.empty-tip p { margin-top: 10px; font-size: 14px; }

/* ===== 筛选/分页 ===== */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .1);
}
.filter-sep { color: #475569; font-size: 13px; }
.trash-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #94a3b8; cursor: pointer; user-select: none; }
.trash-toggle input { accent-color: #3b82f6; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; }
.pager .pg-info { font-size: 12.5px; color: #64748b; margin-right: 10px; }
.pager button {
  min-width: 32px; height: 32px;
  color: #94a3b8; font-size: 13px;
  background: rgba(148, 163, 184, .07);
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 8px; cursor: pointer;
  transition: all .15s;
}
.pager button:hover:not(:disabled) { color: #fff; border-color: rgba(96, 165, 250, .45); }
.pager button.active { color: #fff; background: linear-gradient(135deg, #3b82f6, #6366f1); border-color: transparent; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 表单控件（深色） ===== */
.inp {
  width: 100%;
  padding: 9px 13px;
  font-size: 13.5px; color: #e2e8f0;
  background: #0d1626;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 9px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96, 165, 250, .15); }
.inp::placeholder { color: #475569; }
select.inp { appearance: auto; }
.mini-label { display: block; font-size: 12px; color: #94a3b8; margin-bottom: 6px; }
.help-text { font-size: 12px; color: #475569; margin-top: 6px; }

/* ===== 按钮 ===== */
.btn { border-radius: 9px; font-size: 13.5px; padding: 9px 16px; border: none; transition: all .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary-soft { color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 6px 16px rgba(29, 78, 216, .3); }
.btn-primary-soft:hover { color: #fff; filter: brightness(1.08); box-shadow: 0 8px 20px rgba(29, 78, 216, .4); }
.btn-success-soft { color: #fff; background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 6px 16px rgba(5, 150, 105, .3); }
.btn-success-soft:hover { color: #fff; filter: brightness(1.08); }
.btn-danger-soft { color: #fff; background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 6px 16px rgba(220, 38, 38, .3); }
.btn-danger-soft:hover { color: #fff; filter: brightness(1.08); }
.btn-ghost { color: #94a3b8; background: rgba(148, 163, 184, .08); border: 1px solid rgba(148, 163, 184, .18); }
.btn-ghost:hover { color: #fff; background: rgba(148, 163, 184, .16); }
.btn-soft { color: #e2e8f0; background: rgba(96, 165, 250, .12); border: 1px solid rgba(96, 165, 250, .3); }
.btn-soft:hover { color: #fff; background: rgba(96, 165, 250, .2); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }

.page-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar-hint { font-size: 13px; color: #64748b; }

/* ===== 模板卡片 ===== */
.tpl-card {
  background: #101a30;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 14px;
  padding: 16px;
  transition: transform .18s, border-color .18s;
  height: 100%;
}
.tpl-card:hover { transform: translateY(-3px); border-color: rgba(96, 165, 250, .4); box-shadow: 0 12px 26px rgba(2, 6, 23, .5); }
.tpl-name { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: #f1f5f9; }
.tpl-name i { color: #f59e0b; }
.tpl-meta { margin-top: 10px; font-size: 12.5px; color: #64748b; line-height: 1.9; }
.tpl-meta .tpl-intro { color: #94a3b8; white-space: pre-wrap; overflow-wrap: anywhere; }
.tpl-actions { margin-top: 12px; display: flex; gap: 8px; }

/* ===== 开关 ===== */
.switch-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 13.5px; color: #cbd5e1; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #1e293b; border: 1px solid rgba(148, 163, 184, .3);
  border-radius: 999px; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; width: 18px; height: 18px;
  left: 2px; top: 2px; border-radius: 50%;
  background: #94a3b8; transition: .2s;
}
.switch input:checked + .slider { background: linear-gradient(135deg, #3b82f6, #6366f1); border-color: transparent; }
.switch input:checked + .slider::before { transform: translateX(20px); background: #fff; }

/* ===== 信息行 ===== */
.info-row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; font-size: 13.5px; border-bottom: 1px dashed rgba(148, 163, 184, .1); }
.info-row:last-child { border-bottom: none; }
.info-row span { color: #94a3b8; }
.info-row b { color: #e2e8f0; font-weight: 600; text-align: right; }
.text-success-soft { color: #34d399; }
.text-warning-soft { color: #fbbf24; }

/* ===== 文件详情渲染 ===== */
.file-detail { padding: 6px 4px; }
.file-detail .doc-title { font-size: 17px; font-weight: 700; text-align: center; color: #f8fafc; margin-bottom: 12px; }
.file-detail .doc-header { font-size: 14px; font-weight: 600; color: #60a5fa; margin: 12px 0 6px; }
.file-detail .doc-body { font-size: 13.5px; color: #cbd5e1; line-height: 1.8; padding-left: 2px; white-space: pre-wrap; }
.file-detail .doc-empty { color: #475569; }
.file-detail .doc-date { text-align: right; margin-top: 14px; color: #94a3b8; font-size: 13px; }
.file-detail img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.summary-editor { min-height: 360px; resize: vertical; line-height: 1.8; white-space: pre-wrap; }
#summaryMeta { min-height: 32px; display: flex; align-items: center; }

/* ===== 模态框（深色） ===== */
.admin-modal { background: #101a30; color: #e2e8f0; border: 1px solid rgba(148, 163, 184, .18); }
.admin-modal .modal-header { border-color: rgba(148, 163, 184, .12); }
.admin-modal .modal-footer { border-color: rgba(148, 163, 184, .12); }
.modal-backdrop.show { opacity: .7; }

/* ===== 响应式 ===== */
@media (max-width: 992px) {
  .sidebar { width: 74px; }
  .side-title, .side-sub, .side-item span, .side-admin span, .side-link span { display: none; }
  .side-item, .side-link { justify-content: center; }
  .side-brand { justify-content: center; }
}

@media (max-width: 576px) {
  .sidebar { width: 58px; }
  .side-brand { padding: 14px 8px; }
  .brand-icon { width: 36px; height: 36px; border-radius: 8px; }
  .side-nav { padding: 10px 6px; }
  .side-item { padding: 10px 8px; }
  .side-user { padding: 10px 6px; }
  .side-admin, .side-link { padding: 8px; justify-content: center; }
  .main { padding: 0 10px 28px; }
  .topbar { padding: 14px 0 12px; margin-bottom: 14px; }
  .page-title { font-size: 17px; }
  .page-sub { font-size: 11px; }
  .topbar-right { gap: 6px; }
  .badge-soft { padding: 4px 7px; }
  .stat-card { gap: 8px; padding: 10px; min-height: 66px; }
  .stat-icon { width: 32px; height: 32px; font-size: 15px; border-radius: 8px; }
  .stat-card > div:last-child { min-width: 0; }
  .stat-label { font-size: 11px; white-space: normal; }
  .stat-value { font-size: 18px; white-space: nowrap; }
  .panel-head { padding: 11px 12px; }
  .panel-body { padding: 12px; }
}
