:root {
  --theme: #0F766E;
  --theme-dark: #0B5D57;
  --theme-light: #CCFBF1;
  --bg: #F1F5F9;
  --card: #FFFFFF;
  --ink: #1E293B;
  --muted: #64748B;
  --rule: #E2E8F0;
  --danger: #EF4444;
  --warn: #F59E0B;
  --ok: #10B981;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--theme); text-decoration: none; }

/* ===== 登录页 ===== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F766E, #115E59);
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .mark {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--theme);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.login-logo h1 { font-size: 22px; color: var(--ink); }
.login-logo p { font-size: 13px; color: var(--muted); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-group input {
  width: 100%; height: 44px;
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 0 14px; font-size: 14px; outline: none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--theme); }
.login-btn {
  width: 100%; height: 44px;
  background: var(--theme); color: #fff;
  border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-err { color: var(--danger); font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #0F172A; color: #CBD5E1;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0;
}
.sidebar .brand {
  padding: 20px 20px 16px;
  font-size: 18px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand span { color: var(--theme-light); }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 22px; color: #94A3B8; font-size: 14px;
  cursor: pointer; transition: all .15s; border-left: 3px solid transparent;
}
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar nav a.active { color: #fff; background: rgba(15,118,110,.3); border-left-color: var(--theme); }
.sidebar .sidebar-foot { padding: 16px 20px; font-size: 12px; color: #475569; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; margin-left: 220px; padding: 24px 28px 40px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; margin-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.topbar .title { font-size: 20px; font-weight: 700; }
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar .logout {
  color: var(--muted); background: none; border: 1px solid var(--rule);
  border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.topbar .logout:hover { color: var(--danger); border-color: var(--danger); }

/* ===== 卡片 / 统计 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
  padding: 20px;
}
.stat-card .num { font-size: 30px; font-weight: 700; color: var(--theme); }
.stat-card .label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-card.hot { border-color: var(--theme); }

.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.panel h3 { font-size: 16px; margin-bottom: 16px; }
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* 图表 */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 8px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bars .bar {
  width: 100%; max-width: 40px;
  background: linear-gradient(180deg, #14B8A6, #0F766E);
  border-radius: 4px 4px 0 0;
  transition: height .4s;
  min-height: 2px;
}
.bars .bar-col .date { font-size: 11px; color: var(--muted); margin-top: 6px; }
.bars .bar-col .val { font-size: 11px; color: var(--ink); font-weight: 600; }

/* ===== 表格 ===== */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.toolbar input[type="text"], .toolbar select {
  height: 36px; border: 1px solid var(--rule); border-radius: 6px; padding: 0 12px; font-size: 13px; outline: none;
}
.toolbar input[type="text"]:focus, .toolbar select:focus { border-color: var(--theme); }
.btn {
  height: 36px; padding: 0 18px; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--theme); color: #fff;
}
.btn:hover { background: var(--theme-dark); }
.btn.plain { background: #fff; color: var(--theme); border: 1px solid var(--theme); }
.btn.plain:hover { background: var(--theme-light); }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.btn.danger:hover { background: #FEF2F2; }
.btn.small { height: 30px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { background: #F8FAFC; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
tr:hover td { background: #FAFFFE; }
td .ellipsis { max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #D1FAE5; color: #047857; }
.badge.warn { background: #FEF3C7; color: #B45309; }
.badge.danger { background: #FEE2E2; color: #B91C1C; }
.badge.muted { background: #F1F5F9; color: #64748B; }
.badge.vip { background: #FEF3C7; color: #B45309; }

.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 16px; font-size: 13px; color: var(--muted); }
.pager button { height: 30px; padding: 0 14px; border: 1px solid var(--rule); background: #fff; border-radius: 6px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 模态框 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100;
  display: none; align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  width: 480px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 14px; padding: 24px;
}
.modal h3 { font-size: 17px; margin-bottom: 18px; }
.modal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal .form-group { margin-bottom: 14px; }
.modal .form-group.full { grid-column: 1 / -1; }
.modal textarea {
  width: 100%; border: 1px solid var(--rule); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; font-family: inherit; outline: none; resize: vertical; min-height: 80px;
}
.modal textarea:focus { border-color: var(--theme); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

/* 审核内容预览 */
.audit-item { border: 1px solid var(--rule); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.audit-item .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.audit-item .author { font-weight: 600; }
.audit-item .drama { font-size: 12px; color: var(--theme); }
.audit-item .content { font-size: 13px; color: #334155; margin-bottom: 10px; }
.audit-item .actions { display: flex; gap: 10px; }
.audit-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.audit-imgs img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #0F172A; color: #fff; padding: 10px 22px; border-radius: 8px;
  font-size: 13px; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--theme); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-row { grid-template-columns: 1fr; }
}
