/* ===== 后台管理系统 · 控制台设计版 [UI升级] =====
   设计语言：墨色主色 + 中性灰阶的专业控制台。去掉品牌红与渐变堆砌，
   高级感来自排版层级、留白、发丝线边框与克制的圆角/阴影。 */
:root {
  --brand: #1B2735;
  --brand-dark: #0E1620;
  --brand-soft: #EDF0F3;
  --bg: #F4F4F1;
  --card: #FFFFFF;
  --text: #1A2027;
  --text-2: #5B6570;
  --text-3: #98A1AB;
  --border: #E7E8E4;
  --border-2: #D9DCD6;
  --green: #2E7D4F;
  --green-soft: #EBF4EE;
  --red: #B3402F;
  --red-soft: #FAEFED;
  --shadow-xs: 0 1px 2px rgba(26,32,39,.05);
  --shadow-sm: 0 1px 3px rgba(26,32,39,.05), 0 1px 2px rgba(26,32,39,.03);
  --shadow-md: 0 6px 16px rgba(26,32,39,.06), 0 2px 4px rgba(26,32,39,.03);
  --shadow-lg: 0 16px 36px rgba(26,32,39,.10), 0 4px 10px rgba(26,32,39,.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: .01em;
}
a { color: inherit; text-decoration: none; }

/* ===== 顶栏 ===== */
.topbar {
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 22px;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; letter-spacing: -.2px; flex-shrink: 0; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.topbar-right { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: all .16s ease; white-space: nowrap;
  line-height: 1.4;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(26,32,39,.18);
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 2px 6px rgba(26,32,39,.20); }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border-color: var(--border-2);
}
.btn-ghost:hover { background: #F3F4F6; color: var(--text); border-color: var(--text-3); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.btn-danger {
  background: var(--red); color: #fff;
  box-shadow: 0 1px 2px rgba(179,64,47,.20);
}
.btn-danger:hover { background: #97352A; }
.btn-success {
  background: var(--green); color: #fff;
  box-shadow: 0 1px 2px rgba(46,125,79,.20);
}
.btn-success:hover { background: #276B43; }

/* ===== 统计卡片 ===== */
.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-xs); border: 1px solid var(--border);
  position: relative; overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat .num { font-size: 30px; font-weight: 750; letter-spacing: -.6px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 12px; color: var(--text-2); margin-top: 3px; font-weight: 500; }
.stat.s1 .num { color: var(--text); }
.stat.s2 .num { color: var(--text); }
.stat.s3 .num { color: var(--green); }
/* [UI升级] 去掉旧版统计卡右上角的装饰圆（廉价装饰），改为顶部发丝线层级 */

/* ===== 卡片/表格 ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); border: 1px solid var(--border);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
th {
  background: #F8F8F6; color: var(--text-3);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .8px;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #F8F8F6; }

/* ===== 标签 ===== */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
}
.tag.on { background: var(--green-soft); color: var(--green); }
.tag.off { background: #F2F3F5; color: var(--text-2); }
.tag.expired { background: var(--red-soft); color: var(--red); }
.tag.brand { background: var(--brand-soft); color: var(--brand); }

/* ===== 操作链接 ===== */
.ops { display: flex; gap: 2px; flex-wrap: wrap; }
.ops a {
  font-size: 12px; color: var(--text-2); cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  transition: all .13s ease; font-weight: 500;
}
.ops a:hover { background: #F2F3F5; color: var(--text); }
.ops a.danger { color: var(--red); }
.ops a.danger:hover { background: var(--red-soft); }
.ops a.hl { color: var(--brand); font-weight: 600; }
.ops a.hl:hover { background: var(--brand-soft); }

/* ===== 表单 ===== */
.form-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); border: 1px solid var(--border);
  padding: 24px; margin-bottom: 16px;
}
.form-card h2 {
  font-size: 15px; font-weight: 700; margin: 0 0 18px;
  padding-left: 11px; border-left: 3px solid var(--brand);
  line-height: 1.3;
}
.group { margin-bottom: 16px; }
.group label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--text);
}
.hint {
  font-size: 12px; color: var(--text-3); font-weight: 400;
  margin-top: 5px; line-height: 1.6;
}
input[type=text], input[type=password], input[type=datetime-local],
input[type=file], input[type=number], input[type=email],
textarea, select {
  width: 100%; padding: 9px 13px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; font-family: inherit;
  background: #fff; color: var(--text);
  transition: border .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27,39,53,.10);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { min-height: 100px; line-height: 1.7; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ===== 账号行 ===== */
.acc-row {
  display: flex; gap: 12px; align-items: center;
  padding: 11px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 9px;
  background: #fff; transition: border-color .15s;
}
.acc-row:hover { border-color: var(--border-2); }
.acc-row .qr-mini {
  width: 50px; height: 50px; border-radius: 8px;
  border: 1px solid var(--border); object-fit: cover;
  flex-shrink: 0; background: #FAFAFA;
}
.acc-row .mid { flex: 1; display: grid; gap: 4px; min-width: 0; }
.acc-row .del {
  color: var(--red); font-size: 12px; cursor: pointer;
  background: none; border: none; white-space: nowrap;
  padding: 5px 9px; border-radius: 6px;
  transition: background .13s;
}
.acc-row .del:hover { background: var(--red-soft); }
.add-acc {
  width: 100%; padding: 10px;
  border: 1.5px dashed var(--border-2);
  background: #FAFBFC; color: var(--text-3);
  border-radius: var(--radius-sm); font-size: 13px;
  font-weight: 500; cursor: pointer;
  transition: all .15s;
}
.add-acc:hover {
  border-color: var(--brand); background: var(--brand-soft);
  color: var(--brand);
}
.code-box {
  background: #F7F9FC; padding: 10px 13px;
  border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--border);
}
.code-box b { color: var(--brand); font-family: "SF Mono", "Fira Code", monospace; }

/* ===== 提示条 ===== */
.tip-ok {
  background: var(--green-soft); color: var(--green);
  padding: 10px 15px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px; font-weight: 500;
  border: 1px solid #CBDFD2;
}
.tip-err {
  background: var(--red-soft); color: var(--red);
  padding: 10px 15px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px; font-weight: 500;
  border: 1px solid #EBCFC9;
}
.empty {
  text-align: center; color: var(--text-3);
  padding: 48px 0; font-size: 14px;
}

/* ===== 登录页 ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--bg);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--card); border-radius: var(--radius-lg);
  padding: 38px 32px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.login-card .logo-big {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--brand);
  color: #fff; display: grid; place-items: center;
  font-size: 24px; font-weight: 700; margin: 0 auto 18px;
}
.login-card h1 { text-align: center; font-size: 20px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.3px; }
.login-card .sub { text-align: center; color: var(--text-2); font-size: 13px; margin-bottom: 28px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.38); backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .18s ease;
}
.modal-box {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 480px; max-height: 85vh;
  overflow: auto; padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .22s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ===== [UI升级] 列表操作列里的 POST 表单按钮（复制/删除）与链接同款 ===== */
.ops form { display: inline; }
.ops button {
  font: inherit; font-size: 12px; color: var(--text-2); cursor: pointer;
  padding: 4px 8px; border-radius: 6px; background: none; border: none; font-weight: 500;
  transition: all .13s ease;
}
.ops button:hover { background: #F2F3F0; color: var(--text); }
.ops button.danger { color: var(--red); }
.ops button.danger:hover { background: var(--red-soft); }

/* ===== 页面标题 ===== */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 20px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.4px; }
.page-head p { margin: 0; color: var(--text-2); font-size: 13px; }

/* ===== 复选框 ===== */
.check-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; cursor: pointer; }
.check-row input[type=checkbox], .check-row input[type=radio] {
  width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; }
  .row2, .row3 { grid-template-columns: 1fr; }
  th, td { padding: 10px 10px; font-size: 13px; }
  .topbar-right { gap: 3px; }
  .topbar-inner { padding: 0 14px; height: 52px; }
  .wrap { padding: 20px 14px 50px; }
  .form-card { padding: 20px; }
  .brand { font-size: 15px; }
  .brand .logo { width: 27px; height: 27px; font-size: 14px; }
  .ops { gap: 1px; }
  .ops a { padding: 3px 6px; font-size: 11px; }
}
