/* 微光联盟 —— 全局样式（移动优先，暗色） */
:root {
  --bg: #14151b;
  --bg2: #191b23;
  --card: #1e212b;
  --card2: #242836;
  --line: #2c3040;
  --txt: #e9edf5;
  --muted: #8b93a7;
  --brand: #e0443b;
  --brand-d: #c2352c;
  --ok: #23b57e;
  --warn: #e0a83b;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(900px 420px at 50% -180px, rgba(224, 68, 59, .13), transparent 70%), var(--bg);
  color: var(--txt);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  min-height: 100vh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
.wrap { max-width: 620px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: .2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }

/* 顶部品牌 */
.brandbar { display: flex; align-items: center; gap: 10px; padding: 18px 0 10px; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, #e0443b, #a8281f); color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 6px 18px rgba(224, 68, 59, .3);
}
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }

/* 卡片 */
.card {
  background: linear-gradient(180deg, var(--card), #1b1e27);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-t { font-size: 15px; font-weight: 650; }
.card-s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 11px; padding: 12px 18px; font-size: 15px; font-weight: 650;
  background: var(--card2); color: var(--txt); cursor: pointer; transition: .18s;
  font-family: inherit;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.985); }
.btn-primary { background: linear-gradient(140deg, #e0443b, #bf3a31); color: #fff; box-shadow: 0 8px 22px rgba(224, 68, 59, .28); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* 输入 */
.field { margin-bottom: 12px; }
.label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.input, textarea, select {
  width: 100%; background: #12141a; color: var(--txt); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 13px; font-size: 15px; font-family: inherit; outline: none;
  transition: .16s;
}
.input:focus, textarea:focus, select:focus { border-color: #4a5068; background: #0f1117; }
textarea { min-height: 150px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi-k { font-size: 11.5px; color: var(--muted); }
.kpi-v { font-size: 19px; font-weight: 700; margin-top: 3px; }
.kpi-v small { font-size: 11px; color: var(--muted); font-weight: 500; }

/* 底部分类 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: rgba(20, 21, 27, .92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tab { flex: 1; text-align: center; padding: 6px 0; color: var(--muted); font-size: 11.5px; cursor: pointer; border-radius: 10px; }
.tab i { display: block; font-size: 18px; font-style: normal; line-height: 1.3; }
.tab.on { color: var(--brand); background: rgba(224, 68, 59, .1); }

/* 列表项 */
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-size: 14px; }
.item .s { font-size: 11.5px; color: var(--muted); }
.item .amt { font-weight: 700; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 7px; font-size: 11px; font-weight: 600; }
.badge-ok { background: rgba(35, 181, 126, .16); color: #4dd6a0; }
.badge-warn { background: rgba(224, 168, 59, .16); color: #f0bd62; }
.badge-err { background: rgba(224, 68, 59, .16); color: #ff8a80; }
.badge-gray { background: rgba(255,255,255,.07); color: var(--muted); }

.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(6, 7, 10, .78); backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center; z-index: 60; padding: 0;
}
.modal-mask.on { display: flex; }
.modal {
  width: 100%; max-width: 620px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  max-height: 92vh; overflow: auto;
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(18px); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-t { font-weight: 700; font-size: 16px; }
.x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }

/* 广告播放区 */
.adstage { position: relative; background: #0c0e13; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.adstage iframe { width: 100%; border: 0; display: block; background: #fff; }
.ad-frame { height: 300px; }
.ad-overlay {
  position: absolute; right: 10px; top: 10px; background: rgba(10, 12, 18, .86);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12px; color: #fff;
  font-variant-numeric: tabular-nums;
}
.ad-empty { padding: 46px 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; }

/* 进度条 */
.bar { height: 6px; border-radius: 999px; background: #2a2e3c; overflow: hidden; margin: 10px 0 4px; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e0443b, #f2735d); transition: width .3s linear; }

/* 提示条 */
.note { background: rgba(224, 168, 59, .1); border: 1px solid rgba(224, 168, 59, .25); color: #f0c878; border-radius: 11px; padding: 10px 12px; font-size: 12.5px; line-height: 1.7; }
.note-err { background: rgba(224, 68, 59, .1); border-color: rgba(224, 68, 59, .28); color: #ff9d94; }
.note-ok { background: rgba(35, 181, 126, .1); border-color: rgba(35, 181, 126, .28); color: #6fdcb0; }

.toast {
  position: fixed; left: 50%; top: 16%; transform: translate(-50%, -8px);
  background: #262a38; border: 1px solid var(--line); color: #fff; padding: 11px 18px;
  border-radius: 12px; font-size: 13.5px; z-index: 90; opacity: 0; pointer-events: none;
  transition: .22s; max-width: 86vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 复制框 */
.copyrow { display: flex; gap: 8px; }
.copyrow .input { font-size: 13px; }

/* 落地页 */
.hero { padding: 34px 0 20px; text-align: center; }
.hero h1 { font-size: 25px; line-height: 1.35; }
.hero h1 b { color: var(--brand); }
.hero p { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
.feats { display: grid; gap: 10px; margin: 18px 0; }
.feat { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; }
.feat i { font-style: normal; font-size: 18px; }
.feat .t { font-size: 14px; font-weight: 650; }
.feat .s { font-size: 12px; color: var(--muted); }

.foot { text-align: center; color: #5f6678; font-size: 11.5px; padding: 26px 0 40px; line-height: 1.9; }

/* 后台 */
.admin-wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.admin-tab { white-space: nowrap; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; cursor: pointer; }
.admin-tab.on { color: #fff; border-color: rgba(224,68,59,.5); background: rgba(224,68,59,.12); }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.tb td { text-align: left; padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
table.tb th { color: var(--muted); font-weight: 600; font-size: 12px; }
.table-scroll { overflow-x: auto; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
