/* ==========================================================
   青禾直播 · 管理后台样式
   ========================================================== */

:root {
  --ink: #0C1524;
  --ink-2: #16263B;
  --paper: #F5F7FA;
  --card: #FFFFFF;
  --line: #E6ECF5;
  --line-soft: #EFF3F9;
  --text: #101A2B;
  --muted: #6B7A90;
  --brand: #12A67E;
  --brand-dark: #0B7A5C;
  --brand-soft: #E8F6F1;
  --live: #F2455B;
  --warn: #B45309;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 26, 43, .04), 0 8px 24px rgba(16, 26, 43, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

/* 侧栏 */
.side {
  background: var(--ink);
  color: #fff;
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.side .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: rgba(127, 227, 196, .14);
  border: 1px solid rgba(127, 227, 196, .25);
  display: grid; place-items: center;
}
.side .name { font-size: 14px; font-weight: 600; }
.side .sub { font-size: 10.5px; color: rgba(255, 255, 255, .4); letter-spacing: .08em; }

.side .group { font-size: 10.5px; color: rgba(255, 255, 255, .3); padding: 14px 10px 6px; letter-spacing: .08em; }

.side a.item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  font-size: 13px; color: rgba(255, 255, 255, .66);
  transition: .15s;
}
.side a.item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side a.item.active { background: rgba(127, 227, 196, .12); color: #B7F0DF; }
.side a.item svg { opacity: .8; }

.side .bottom { margin-top: auto; padding: 12px 10px 4px; font-size: 11.5px; color: rgba(255, 255, 255, .35); }
.side .bottom a { color: rgba(255, 255, 255, .6); }

/* 主区 */
.main { padding: 24px 28px 48px; max-width: 1240px; width: 100%; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.page-head h1 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 3px; }
.page-head p { margin: 0; font-size: 12.5px; color: var(--muted); }

.who { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.who .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-size: 12px; font-weight: 500;
}

/* 卡片 / 统计 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.card-head .muted { font-size: 12px; color: var(--muted); }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat { padding: 18px; }
.stat .k { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.stat .trend { font-size: 11.5px; color: var(--brand-dark); margin-top: 6px; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted);
  padding: 11px 16px; background: #FAFCFE; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #FCFDFE; }
.tbl .title-cell { font-weight: 500; }
.tbl .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tbl .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tbl .empty-row { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 13px; }

/* 标签 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: #F1F4F9; color: #4F5E73;
  white-space: nowrap;
}
.badge.live { background: #FDECEF; color: #C02A40; }
.badge.off { background: #F1F4F9; color: #6B7A90; }
.badge.ok { background: var(--brand-soft); color: var(--brand-dark); }
.badge.warn { background: #FFF4E5; color: var(--warn); }
.badge.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 12.5px; padding: 7px 12px; border-radius: 8px;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #CFE9E0; background: #FBFDFC; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost-danger { color: #B42318; border-color: #F3D6D3; }
.btn.ghost-danger:hover { background: #FEF4F3; }
.btn.sm { padding: 5px 9px; font-size: 11.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 表单 */
.form-card { padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field-row { margin-bottom: 16px; }
.field-row:last-child { margin-bottom: 0; }
.field-row label { display: block; font-size: 12.5px; color: #43536A; margin-bottom: 6px; }
.field-row .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.6; }

.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: 13.5px; color: var(--text);
  background: #fff; outline: 0; transition: .15s;
}
.input:focus { border-color: #A9E0D0; box-shadow: 0 0 0 3px rgba(18, 166, 126, .09); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.6; }

.switch { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.switch input { width: 16px; height: 16px; accent-color: var(--brand); }

.form-actions {
  display: flex; gap: 10px; align-items: center;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft);
}

/* 提示 */
.flash {
  padding: 11px 14px; border-radius: 10px; font-size: 13px;
  margin-bottom: 16px; border: 1px solid;
}
.flash.ok { background: var(--brand-soft); border-color: #CFEDE3; color: var(--brand-dark); }
.flash.err { background: #FEF3F2; border-color: #F5D5D2; color: #B42318; }

.notice-box {
  background: #FBFDFC; border: 1px solid var(--line-soft);
  border-left: 3px solid var(--brand);
  border-radius: 10px; padding: 12px 14px;
  font-size: 12.5px; color: #43536A; line-height: 1.7;
  margin-bottom: 18px;
}
.notice-box code {
  background: #EEF5F2; padding: 1px 5px; border-radius: 4px;
  font-size: 11.5px; color: var(--brand-dark);
}

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(90% 70% at 50% 0%, #E9F3F0 0%, #F5F7FA 60%);
}
.login-card {
  width: 100%; max-width: 390px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 28px;
  box-shadow: 0 20px 50px rgba(16, 26, 43, .08);
}
.login-card .mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--ink); display: grid; place-items: center; margin-bottom: 18px;
}
.login-card h1 { font-size: 19px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.01em; }
.login-card p.sub { margin: 0 0 22px; font-size: 12.5px; color: var(--muted); }
.login-card .btn.primary { width: 100%; padding: 11px; font-size: 14px; margin-top: 6px; }
.login-foot { margin-top: 16px; font-size: 11.5px; color: var(--muted); text-align: center; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F3F6FA; border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 8px; font-size: 12px; color: #43536A;
}
.chip form { display: inline; }
.chip button { border: 0; background: none; cursor: pointer; color: #98A5B6; font-size: 13px; line-height: 1; padding: 0 0 0 2px; }
.chip button:hover { color: #B42318; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .side .brand { padding: 0 8px 0 4px; }
  .side .group { display: none; }
  .side a.item { padding: 7px 10px; }
  .side .bottom { margin: 0 0 0 auto; padding: 0; }
  .main { padding: 18px 16px 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
