/* ==========================================================
   短信群发系统 · 高端深色设计系统
   无外部依赖，兼容 PHP7.4 项目内所有页面
   ========================================================== */
:root {
  --bg: #070c16;
  --bg-soft: #0a1220;
  --panel: #0e192a;
  --panel-2: #121f34;
  --sidebar: #080f1c;
  --line: rgba(255,255,255,.085);
  --line-strong: rgba(217,180,92,.30);
  --text: #e9eef7;
  --muted: #8b9bb4;
  --dim: #5d6f8d;
  --gold: #d9b45c;
  --gold-light: #f2d793;
  --gold-deep: #9b7526;
  --teal: #3ddbc0;
  --red: #ff6b7a;
  --amber: #f0b429;
  --blue: #6aa9ff;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  color: var(--text);
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(217,180,92,.10), transparent 62%),
    radial-gradient(820px 520px at -12% 108%, rgba(61,219,192,.07), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--gold-light); text-decoration: none; }
::selection { background: rgba(217,180,92,.30); color: #fff; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 238px; flex: 0 0 238px; height: 100vh; position: sticky; top: 0;
  background: linear-gradient(180deg, #0a1220 0%, #070d19 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 30;
}
.brand {
  height: 78px; display: flex; align-items: center; gap: 12px; padding: 0 22px;
  border-bottom: 1px solid var(--line); flex: 0 0 78px;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 36px;
  background: linear-gradient(145deg, var(--gold-light), var(--gold-deep));
  color: #171106; font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 18px rgba(217,180,92,.20);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 9px; letter-spacing: .22em; color: var(--gold); text-transform: uppercase; margin-top: 3px; }
.side-nav { padding: 18px 12px; flex: 1; overflow-y: auto; }
.nav-group { margin-bottom: 18px; }
.nav-label { font-size: 10px; letter-spacing: .2em; color: var(--dim); padding: 0 12px 8px; text-transform: uppercase; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-bottom: 3px;
  border-radius: 9px; color: #9cacc4; font-size: 13px; position: relative;
}
.side-nav a:hover { background: rgba(255,255,255,.045); color: var(--text); }
.side-nav a.active {
  background: linear-gradient(90deg, rgba(217,180,92,.16), rgba(217,180,92,.03));
  color: var(--gold-light); font-weight: 600;
}
.side-nav a.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px;
  border-radius: 2px; background: var(--gold);
}
.side-nav a i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .6; flex: 0 0 5px; }
.side-foot { padding: 16px 20px; border-top: 1px solid var(--line); }
.side-note { font-size: 11px; color: var(--dim); display: flex; align-items: center; gap: 7px; }
.side-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); }

.main { flex: 1; min-width: 0; }
.topbar {
  height: 78px; position: sticky; top: 0; z-index: 20;
  background: rgba(8,15,28,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 34px;
}
.topbar-title { display: flex; flex-direction: column; }
.topbar-title strong { font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.topbar-title small { font-size: 11px; color: var(--dim); letter-spacing: .08em; margin-top: 2px; }
.topbar-user { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
  border: 1px solid rgba(61,219,192,.22); border-radius: 20px;
  background: rgba(61,219,192,.07); color: var(--teal); font-size: 11px;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.role-tag {
  padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 20px;
  color: var(--gold); background: rgba(217,180,92,.07); font-size: 11px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #223553, #15243b); border: 1px solid var(--line-strong);
  color: var(--gold-light); font-size: 13px; font-weight: 600;
}
.logout-link { padding: 5px 10px; border-left: 1px solid var(--line); }
.content { padding: 28px 34px 60px; max-width: 1560px; }
.footer-bar {
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); letter-spacing: .04em;
}

/* ---------- 卡片与表单 ---------- */
.panel {
  background: linear-gradient(180deg, rgba(18,31,52,.96), rgba(13,24,40,.96));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px 26px; margin-bottom: 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.035);
}
.panel h2 {
  margin: 0 0 18px; padding: 0 0 13px; font-size: 15px; font-weight: 600;
  letter-spacing: .03em; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
}
.panel h2::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(var(--gold-light), var(--gold-deep)); }
.row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
.row > .panel { margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: #bdc9dc; margin-bottom: 7px; letter-spacing: .02em; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px;
  background: rgba(6,12,22,.65); color: var(--text); font: 13px/1.55 inherit;
  font-family: inherit; transition: border-color .18s ease, box-shadow .18s ease;
}
input::placeholder, textarea::placeholder { color: #52627c; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,180,92,.12);
}
input[type=file]::file-selector-button {
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 10px; margin-right: 10px;
  background: rgba(217,180,92,.08); color: var(--gold-light); cursor: pointer; font-family: inherit;
}
select[multiple] { padding: 6px; }
textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.hint a { color: var(--gold); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px;
  background: rgba(255,255,255,.04); color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; line-height: 1.4; transition: all .18s ease;
}
.btn:hover { border-color: var(--line-strong); background: rgba(217,180,92,.08); color: var(--gold-light); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  border-color: transparent; color: #1a1407; font-weight: 700;
  box-shadow: 0 8px 20px rgba(217,180,92,.16);
}
.btn-primary:hover { filter: brightness(1.08); color: #1a1407; border-color: transparent; }
.btn-block { width: 100%; }
.form-actions { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form > input[type=text], .inline-form > input[type=number], .inline-form > input[type=file], .inline-form > select { width: auto; min-width: 150px; flex: 1 1 170px; }
.inline-form .hint { align-self: center; margin: 0; }
.filter-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filter-form > input, .filter-form > select { width: auto; min-width: 130px; }
.filter-form > input[type=text] { flex: 1 1 180px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; vertical-align: middle; }
.table th { background: rgba(255,255,255,.025); color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: rgba(217,180,92,.045); }
.table .empty { text-align: center; color: var(--dim); padding: 38px 0; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { white-space: nowrap; }
.actions form, .inline { display: inline; margin: 0; }
.link-btn, .link-danger { border: 0; background: none; padding: 0 8px 0 0; color: var(--gold); cursor: pointer; font-size: 12.5px; }
.link-danger { color: var(--red); }
.link-btn:hover, .link-danger:hover { text-decoration: underline; }
.text-success { color: var(--teal); }
.text-danger { color: var(--red); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: .02em; }
.badge-ok { background: rgba(61,219,192,.10); color: var(--teal); border: 1px solid rgba(61,219,192,.25); }
.badge-bad { background: rgba(255,107,122,.10); color: var(--red); border: 1px solid rgba(255,107,122,.25); }
.badge-wait { background: rgba(240,180,41,.10); color: var(--amber); border: 1px solid rgba(240,180,41,.25); }
.badge-info { background: rgba(106,169,255,.10); color: var(--blue); border: 1px solid rgba(106,169,255,.25); }

/* ---------- 提示 ---------- */
.alert { padding: 11px 15px; border-radius: 8px; margin-bottom: 14px; font-size: 12.5px; border: 1px solid; }
.alert-success { background: rgba(61,219,192,.07); border-color: rgba(61,219,192,.25); color: var(--teal); }
.alert-error { background: rgba(255,107,122,.07); border-color: rgba(255,107,122,.25); color: var(--red); }
.alert-warning { background: rgba(240,180,41,.07); border-color: rgba(240,180,41,.25); color: var(--amber); }
.alert-info { background: rgba(106,169,255,.07); border-color: rgba(106,169,255,.25); color: var(--blue); }

/* ---------- 仪表盘 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 20px; }
.stat-card {
  position: relative; overflow: hidden; padding: 20px 22px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(19,33,55,.96), rgba(12,22,38,.96));
  border: 1px solid var(--line); box-shadow: 0 16px 36px rgba(0,0,0,.22);
}
.stat-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--gold), transparent 70%); opacity: .8; }
.stat-label { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.stat-value { font-size: 32px; font-weight: 650; line-height: 1.35; margin: 5px 0 3px; letter-spacing: -.02em; }
.stat-value.success { color: var(--teal); }
.stat-value.danger { color: var(--red); }
.stat-foot { font-size: 11px; color: var(--dim); }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: 60%; max-width: 40px; background: linear-gradient(180deg, var(--gold-light), var(--gold-deep)); border-radius: 5px 5px 0 0; min-height: 3px; box-shadow: 0 -4px 18px rgba(217,180,92,.16); }
.chart-num { font-size: 11px; font-weight: 600; margin-top: 7px; color: var(--text); }
.chart-label { font-size: 10px; color: var(--dim); letter-spacing: .04em; }
.quick p { margin: 0 0 11px; }
.quick .btn { margin-right: 8px; margin-top: 8px; }

/* ---------- 进度 / 分页 ---------- */
.progress { height: 8px; background: rgba(255,255,255,.07); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); width: 0; transition: width .25s ease; box-shadow: 0 0 12px rgba(61,219,192,.3); }
.progress-stats { display: flex; flex-wrap: wrap; gap: 20px; font-size: 12px; margin-bottom: 10px; color: var(--muted); }
.progress-stats strong { color: var(--text); }
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 18px; font-size: 12px; }
.pager a, .pager span.current { display: inline-block; padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.03); }
.pager a:hover { border-color: var(--line-strong); color: var(--gold-light); }
.pager .current { background: linear-gradient(135deg, var(--gold-light), var(--gold-deep)); border-color: transparent; color: #1a1407; font-weight: 700; }
.pager-info { color: var(--dim); margin-right: 8px; }
.pager > span:not(.current):not(.pager-info) { padding: 0 3px; color: var(--dim); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(2,6,14,.76); backdrop-filter: blur(5px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-strong); border-radius: var(--radius); width: 100%; max-width: 520px; padding: 26px 28px; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.modal-box h2 { margin: 0 0 20px; font-size: 16px; color: var(--gold-light); }

/* ---------- 登录 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(760px 460px at 50% 0%, rgba(217,180,92,.12), transparent 65%),
              radial-gradient(720px 500px at 10% 100%, rgba(61,219,192,.08), transparent 62%), var(--bg);
  position: relative;
}
.login-page::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(circle at 50% 40%, #000, transparent 70%);
}
.login-box {
  width: 100%; max-width: 420px; position: relative; padding: 38px 40px 30px;
  background: linear-gradient(180deg, rgba(18,31,52,.94), rgba(10,19,33,.94));
  border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
}
.login-head { text-align: center; margin-bottom: 28px; }
.login-head .brand-mark { width: 52px; height: 52px; font-size: 24px; margin-bottom: 14px; border-radius: 13px; }
.login-head h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: .02em; }
.login-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.login-badge { display: inline-block; margin-top: 14px; padding: 3px 12px; border: 1px solid var(--line-strong); border-radius: 20px; color: var(--gold); font-size: 9px; letter-spacing: .22em; background: rgba(217,180,92,.06); }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; color: var(--dim); font-size: 11px; letter-spacing: .12em; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-box .field label { color: #b9c6d9; }
.login-foot { text-align: center; color: var(--dim); font-size: 11px; margin-top: 22px; letter-spacing: .03em; }

/* ---------- 文档 ---------- */
.doc-page { background: var(--bg); }
.doc-wrap { max-width: 940px; margin: 34px auto; padding: 0 18px; }
.doc-wrap h1 { margin-top: 0; font-size: 24px; color: var(--gold-light); font-weight: 600; }
.doc-wrap h2 { font-size: 16px; margin: 26px 0 10px; color: var(--text); }
.doc-wrap pre { background: #060c17; border: 1px solid var(--line); color: #cfe0f5; padding: 18px; border-radius: 10px; overflow-x: auto; font: 12.5px/1.65 Consolas, Monaco, monospace; }
.doc-wrap .table { background: transparent; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { width: 66px; flex-basis: 66px; }
  .brand { padding: 0 15px; }
  .brand-text, .nav-label, .side-foot { display: none; }
  .side-nav { padding: 14px 8px; }
  .side-nav a { justify-content: center; padding: 11px 0; }
  .side-nav a i { flex-basis: 6px; }
  .topbar { padding: 0 16px; height: 64px; }
  .topbar-title small, .status-pill, .role-tag { display: none; }
  .content { padding: 18px 16px 44px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 18px; }
}
