/* =========================================================
   液态玻璃（Liquid Glass）样式
   ========================================================= */
:root {
  --glass-bg: rgba(255, 255, 255, 0.10);
  --glass-border: rgba(255, 255, 255, 0.22);
  --text: #f4f6ff;
  --muted: rgba(255, 255, 255, 0.62);
  --accent1: #8ec5ff;
  --accent2: #b39bff;
  --accent3: #4ee0c8;
  --danger: #ff6b81;
  --success: #4ade80;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--text);
  background: #070b18;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(122, 168, 255, 0.35); color: #fff; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }
::-webkit-scrollbar-track { background: transparent; }

/* 背景光斑 */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 800px at 15% 8%, #111a33 0%, transparent 62%),
    radial-gradient(1000px 700px at 88% 92%, #1b1230 0%, transparent 62%),
    linear-gradient(160deg, #06080f 0%, #0a0d18 55%, #0d0a18 100%);
}
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.48;
  z-index: -1;
  animation: drift 20s ease-in-out infinite alternate;
  will-change: transform;
}
.b1 { width: 520px; height: 520px; background: #3b6bff; top: -170px; left: -130px; }
.b2 { width: 480px; height: 480px; background: #a855f7; bottom: -190px; right: -130px; animation-delay: -5s; }
.b3 { width: 420px; height: 420px; background: #0ea5a4; top: 32%; left: 58%; opacity: 0.38; animation-delay: -9s; }
.b4 { width: 300px; height: 300px; background: #ff5ea8; top: 70%; left: 12%; opacity: 0.25; animation-delay: -13s; }
.b5 { width: 360px; height: 360px; background: #4f8cff; top: 6%; left: 66%; opacity: 0.26; animation-delay: -11s; }

/* 细微噪点纹理，增强玻璃质感 */
.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(70px, 50px, 0) scale(1.18); }
}

/* ---------------- 玻璃面板 ---------------- */
.glass {
  position: relative;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0.05) 45%,
      rgba(255, 255, 255, 0.11) 100%);
  backdrop-filter: blur(44px) saturate(200%);
  -webkit-backdrop-filter: blur(44px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 34px;
  box-shadow:
    0 42px 90px -32px rgba(0, 0, 0, 0.85),
    0 14px 34px -18px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 0 44px rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transition: box-shadow 0.4s cubic-bezier(0.2, 0.9, 0.25, 1);
}
/* Apple 式玻璃顶部高光 */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 26%, transparent 42%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.10) 0%, transparent 32%);
  opacity: 0.9;
}
/* 斜向光泽扫过 */
.glass::after {
  content: "";
  position: absolute;
  top: -70%;
  left: -35%;
  width: 42%;
  height: 240%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.14) 45%, transparent);
  transform: rotate(14deg);
  pointer-events: none;
  opacity: 0.9;
}

/* ---------------- 布局 ---------------- */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 18px 60px;
}

.topbar {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-radius: 999px;
  margin-bottom: 34px;
  animation: fadeDown 0.7s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.topbar .logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.topbar .logo-dot {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 4px 14px rgba(120, 150, 255, 0.5);
  color: #06122c;
}
.topbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: 0.25s;
}
.topbar a:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.view { width: 100%; max-width: 480px; }

/* ---------------- 卡片内容 ---------------- */
.card {
  padding: 34px 30px 30px;
  animation: rise 0.75s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.card h1 {
  margin: 6px 0 6px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(120deg, #ffffff, #cfe0ff 40%, #d8c8ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.card .sub {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.4px;
}

.field { position: relative; margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px 4px;
  letter-spacing: 0.6px;
}
.field input {
  width: 100%;
  padding: 16px 18px;
  font-size: 16px;
  color: var(--text);
  letter-spacing: 2px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  outline: none;
  transition: border-color 0.28s, box-shadow 0.28s, background 0.28s;
}
.field input::placeholder { color: rgba(255, 255, 255, 0.32); letter-spacing: 1px; }
.field input:focus {
  border-color: rgba(142, 197, 255, 0.75);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(90, 140, 255, 0.16), inset 0 0 22px rgba(120, 160, 255, 0.12);
}

/* ---------------- 按钮 ---------------- */
.btn-primary {
  width: 100%;
  padding: 16px;
  margin-top: 6px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #05122b;
  background: linear-gradient(180deg, #a9d4ff 0%, #7fa8ff 48%, #b49bff 100%);
  box-shadow:
    0 16px 34px -10px rgba(110, 150, 255, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(10, 20, 60, 0.18);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.25, 1), box-shadow 0.28s, filter 0.28s;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s ease;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-primary:hover::after { left: 130%; }
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: none; }

.btn-ghost {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(10px);
  transition: 0.22s;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}
.btn-ghost:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------------- 公告栏 ---------------- */
.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  margin-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #e9efff;
}
.notice-bar .notice-icon {
  font-size: 17px;
  line-height: 1.5;
  flex: none;
  animation: noticePulse 2.4s ease-in-out infinite;
}
.notice-bar .notice-text { flex: 1; word-break: break-word; }
@keyframes noticePulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 1; }
}

/* ---------------- 消息 ---------------- */
.msg {
  display: none;
  margin: 4px 0 14px;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  backdrop-filter: blur(8px);
}
.msg.show { display: block; animation: fadeIn 0.3s both; }
.msg.err {
  color: #ffd7dd;
  background: rgba(255, 60, 90, 0.16);
  border: 1px solid rgba(255, 90, 120, 0.35);
}
.msg.ok {
  color: #c9f7d8;
  background: rgba(40, 200, 110, 0.16);
  border: 1px solid rgba(80, 230, 150, 0.35);
}

.hint {
  margin: 22px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

/* ---------------- 成功页 ---------------- */
.success-orb {
  width: 74px;
  height: 74px;
  margin: 2px auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 34px;
  color: #06231a;
  background: radial-gradient(circle at 32% 28%, #d6ffe9, #6ff0b8 45%, #34d38e 100%);
  box-shadow:
    0 16px 40px -8px rgba(60, 220, 150, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.85),
    inset 0 -4px 10px rgba(20, 140, 90, 0.4);
  animation: pop 0.6s cubic-bezier(0.2, 1.2, 0.3, 1) both;
}

.info-list {
  margin: 8px 0 22px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  font-size: 14.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--muted); flex: none; }
.info-row b {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
  letter-spacing: 0.5px;
}
.info-row b.small { font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* ---------------- 管理后台 ---------------- */
.admin-wrap {
  width: 100%;
  max-width: 960px;
}
.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px 24px;
}
.admin-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}
.admin-head .who { color: var(--muted); font-size: 13px; }
.admin-panel { padding: 24px; margin-bottom: 22px; }
.admin-panel h2 {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.6px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.form-grid label { display: block; }

.row-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.table-scroll { overflow-x: auto; border-radius: 16px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.04);
}
tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
tbody tr:last-child td { border-bottom: none; }
td .key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 1px; }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tag.on { color: #baf7cf; background: rgba(50, 210, 130, 0.18); border: 1px solid rgba(80, 230, 150, 0.35); }
.tag.off { color: var(--muted); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); }
.tag.exp { color: #ffd0d6; background: rgba(255, 70, 100, 0.16); border: 1px solid rgba(255, 90, 120, 0.35); }

.btn-mini {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: 0.2s;
}
.btn-mini:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.35); }
.btn-mini.danger { color: #ffd0d6; border-color: rgba(255, 90, 120, 0.4); }
.btn-mini.danger:hover { background: rgba(255, 60, 90, 0.2); }

.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.login-card { max-width: 400px; margin: 8vh auto 0; padding: 34px 30px; }

/* ---------------- 动画 ---------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(26px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  0%   { opacity: 0; transform: scale(0.4); }
  70%  { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.hidden { display: none !important; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 520px) {
  .stage { padding: 18px 14px 44px; }
  .card { padding: 28px 22px 24px; border-radius: 24px; }
  .card h1 { font-size: 23px; }
  .admin-panel { padding: 18px; }
  .topbar { margin-bottom: 24px; }
}

/* ---------------- 后台统计与工具栏 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card { padding: 18px 20px; border-radius: 20px; }
.stat-card .num { font-size: 27px; font-weight: 800; line-height: 1.1; letter-spacing: .5px; }
.stat-card .label { font-size: 12px; color: var(--muted); margin-top: 6px; letter-spacing: .5px; }
.stat-card.ok .num { color: #4ade80; }
.stat-card.err .num { color: #ff6b81; }

.toolbar {
  padding: 14px 18px;
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.toolbar input[type="text"] { flex: 1; min-width: 150px; }
.toolbar input[type="text"],
.toolbar select {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.toolbar input[type="text"]:focus,
.toolbar select:focus { border-color: rgba(142, 197, 255, 0.75); }
.toolbar select option { background: #0b1024; color: var(--text); }

.batch-bar { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a,
.pager span {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: 0.2s;
}
.pager a:hover { background: rgba(255, 255, 255, 0.14); }
.pager .cur {
  background: linear-gradient(135deg, #9fd0ff, #b39bff);
  color: #05122b;
  font-weight: 700;
  border: none;
}

.checkbox-col { width: 34px; text-align: center; }
input[type="checkbox"] { accent-color: #7aa8ff; cursor: pointer; }

/* ---------------- 页脚 ---------------- */
.page-footer {
  margin-top: auto;
  padding: 28px 0 10px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.38);
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .blob, .card, .topbar, .success-orb { animation: none !important; }
  * { transition: none !important; }
}
