/* Telegram Group Manager · 黑色高级风 */
:root {
  --bg: #0a0d13;
  --bg2: #0e131c;
  --panel: #121824;
  --panel2: #161e2e;
  --line: #232c40;
  --text: #e9edf4;
  --muted: #8b95a9;
  --gold: #d9a441;
  --gold-dim: #8a6a2c;
  --green: #3ecf8e;
  --red: #e5484d;
  --blue: #4c9aff;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #141b2c 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
code { background: #1b2334; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* 登录 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 380px;
  max-width: 100%;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.brand { text-align: center; margin-bottom: 24px; }
.brand-mark {
  width: 52px; height: 52px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #0a0d13;
  background: linear-gradient(135deg, #f0c96a, var(--gold));
  border-radius: 14px;
}
.brand h1 { margin: 0; font-size: 20px; letter-spacing: .5px; }
.brand p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

/* 表单 */
label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%;
  margin-top: 6px;
  background: #0d1220;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold-dim); }
textarea { resize: vertical; font-family: inherit; }
.form-error { color: var(--red); font-size: 13px; margin: 8px 0 0; }
.form .form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.count { float: right; color: var(--muted); font-size: 12px; }

/* 按钮 */
.btn {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, #f0c96a, var(--gold));
  border: none;
  color: #14100a;
  font-weight: 600;
}
.btn-danger { background: #3a1620; border-color: #5c2330; color: #ff8a8e; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 布局 */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: rgba(14, 19, 28, .9);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand-sm { display: flex; gap: 10px; align-items: center; text-align: left; margin-bottom: 20px; }
.brand-sm .brand-mark { width: 38px; height: 38px; font-size: 18px; margin: 0; border-radius: 10px; }
.brand-sm h1 { font-size: 15px; margin: 0; }
.brand-sm p { font-size: 10px; margin: 2px 0 0; letter-spacing: 2px; }
#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  background: transparent;
  border: none;
  color: var(--muted);
  text-align: left;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.nav-item:hover { background: var(--panel2); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(217,164,65,.18), rgba(217,164,65,.05));
  color: var(--gold);
  font-weight: 600;
}
.sidebar-foot { display: flex; gap: 6px; align-items: center; }
.me { flex: 1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; padding: 28px 32px; max-width: 1280px; }
.view-title { margin: 0 0 18px; font-size: 20px; font-weight: 600; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.view-head .view-title { margin: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; }
.toolbar input[type=search] { width: 240px; margin: 0; }
.toolbar select { width: auto; margin: 0; }

/* 面板与表格 */
.panel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 15px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; background: rgba(0,0,0,.2); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.table td.wrap { white-space: normal; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 6px; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; border: 1px solid var(--line); }
.badge.green { color: var(--green); border-color: #1d4a35; background: rgba(62,207,142,.08); }
.badge.red { color: #ff8a8e; border-color: #5c2330; background: rgba(229,72,77,.08); }
.badge.gold { color: var(--gold); border-color: var(--gold-dim); background: rgba(217,164,65,.08); }
.badge.gray { color: var(--muted); }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.stat .num { font-size: 30px; font-weight: 700; color: var(--gold); }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* 发送页 */
.send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .send-grid { grid-template-columns: 1fr; } }
.form { padding: 18px; }
.preview-box { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; margin: 12px 0; background: #0d1220; }
.preview-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.preview-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; min-height: 40px; }
.hint { color: var(--muted); font-size: 12px; }

/* 弹窗 */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 6, 10, .7);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
}
.modal {
  width: 520px; max-width: 100%; max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.check-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; margin: 0; }
.check-item:last-child { border-bottom: none; }
.check-item:hover { background: rgba(255,255,255,.03); }
.check-item input { width: auto; margin: 0; }
.danger-text { color: #ff8a8e; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; }

/* 提示 */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  max-width: 340px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  animation: slidein .2s ease-out;
}
.toast.error { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.progress { height: 6px; background: #0d1220; border-radius: 3px; overflow: hidden; min-width: 120px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width .3s; }

@media (max-width: 760px) {
  .sidebar { display: none; }
  .main { padding: 16px; }
  #app.mobile-nav .sidebar { display: flex; position: fixed; z-index: 40; }
}
