/* ===== 艺学堂运营后台 · 样式 ===== */
:root {
  --brand: #f5c518;
  --brand-dark: #d9ae00;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e5e7eb;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --green: #17b26a;
  --red: #e5484d;
  --orange: #f79009;
  --blue: #2f6fed;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1f2329 0%, #3a3f47 60%, #4a4f57 100%);
}
.login-card {
  width: 380px; padding: 36px 32px 32px;
  background: var(--panel); border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #1f2329;
  font-size: 26px; font-weight: 700; border-radius: 14px;
}
.login-brand h1 { font-size: 19px; margin: 0 0 4px; }
.login-sub { font-size: 12px; color: var(--text-3); margin: 0; }
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, .18);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.btn-primary {
  width: 100%; padding: 10px 16px; margin-top: 4px;
  background: var(--brand); color: #1f2329;
  border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; margin: 10px 0 0; text-align: center; }

/* ---------- 主框架 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; flex: 0 0 210px;
  background: #1f2329; color: #c9ccd1;
  display: flex; flex-direction: column;
}
.sidebar-brand {
  padding: 18px 18px 16px;
  font-size: 15px; font-weight: 600; color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  display: flex; align-items: center; gap: 9px;
}
.sidebar-brand .dot {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--brand); color: #1f2329;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.nav { padding: 10px 0; flex: 1; }
.nav-group { padding: 12px 18px 6px; font-size: 11px; color: #6b7076; letter-spacing: .06em; }
.nav a {
  display: block; padding: 9px 18px; color: #c9ccd1; font-size: 14px;
  border-left: 3px solid transparent; transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(245, 197, 24, .12); color: var(--brand); border-left-color: var(--brand); }
.nav .badge {
  float: right; background: var(--red); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 9px;
}
.sidebar-foot {
  padding: 12px 18px; border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px; color: #8a8f95;
}
.sidebar-foot button {
  width: 100%; margin-top: 8px; padding: 7px;
  background: rgba(255, 255, 255, .08); color: #c9ccd1;
  border: none; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.sidebar-foot button:hover { background: rgba(255, 255, 255, .15); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
}
.topbar h2 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .who { font-size: 13px; color: var(--text-2); }
.content { padding: 20px 22px 40px; }

/* ---------- 卡片 / 表格 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden;
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.card-head h3 { font-size: 14px; margin: 0; font-weight: 600; }
.card-head .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12px; color: var(--text-3); margin-bottom: 7px; }
.stat .v { font-size: 25px; font-weight: 650; line-height: 1.15; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.stat.warn .v { color: var(--orange); }
.stat.ok .v { color: var(--green); }
.stat.bad .v { color: var(--red); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #fafbfc; font-weight: 600; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
td.nowrap, th.nowrap { white-space: nowrap; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
.tag.pending { background: #fff4e5; color: #b25e09; }
.tag.approved, .tag.used, .tag.on { background: #e6f7ee; color: #0f7b45; }
.tag.rejected, .tag.cancelled, .tag.off { background: #fdeced; color: #b3252a; }
.tag.info { background: #eaf1fe; color: #1f4fb8; }
.tag.gray { background: #f2f3f5; color: #646a73; }

.btn {
  display: inline-block; padding: 6px 13px; border-radius: 7px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: 13px; cursor: pointer; transition: all .12s; white-space: nowrap;
}
.btn:hover { border-color: #c9ccd1; background: #fafbfc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #1f2329; font-weight: 600; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--red); border-color: #f5c2c4; }
.btn.danger:hover { background: #fdeced; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; font-size: 13px; color: var(--text-2); }
.pager button { padding: 5px 11px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

.empty { padding: 44px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty .icon { font-size: 30px; display: block; margin-bottom: 10px; opacity: .5; }
.loading { padding: 40px; text-align: center; color: var(--text-3); }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 18, 22, .5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow: auto; box-shadow: 0 20px 48px rgba(0, 0, 0, .3);
}
.modal.wide { max-width: 760px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-head .x { cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; background: none; border: none; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-row .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

video.review-video { width: 100%; max-height: 380px; background: #000; border-radius: 8px; }
.reject-list { display: flex; flex-wrap: wrap; gap: 8px; }
.reject-list label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer; font-size: 13px; background: #fff;
}
.reject-list label:hover { border-color: var(--brand-dark); }
.reject-list input { width: auto; margin: 0; }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #1f2329; color: #fff; padding: 11px 20px; border-radius: 8px;
  font-size: 13.5px; z-index: 999; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(4px); }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

.cfg-row { display: grid; grid-template-columns: 260px 1fr 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f1f3; }
.cfg-row:last-child { border-bottom: none; }
.cfg-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: #b3252a; word-break: break-all; }
.cfg-desc { font-size: 12.5px; color: var(--text-2); }
.cfg-row input, .cfg-row textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.cfg-row textarea { min-height: 60px; }
.cfg-group-title { font-weight: 600; font-size: 13px; color: var(--text-2); padding: 16px 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.right { text-align: right; }
