/* =========================================================================
   视频下载 · 后台管理（Web）
   与 App 共用同一套设计 token（app/lib/ui/tokens/tokens.dart）：
   L0 光斑背景 / L1 新拟态卡片 / L2 液态玻璃浮层
   ========================================================================= */

:root {
  --bg: #eef1f5;
  --surface: #eef1f5;
  --sh-light: rgba(255, 255, 255, 0.9);
  --sh-dark: rgba(0, 0, 0, 0.15);
  --text-1: #2b3440;
  --text-2: #6b7787;
  --text-3: #9ea8b5;
  --accent: #4c7df0;
  --accent-soft: rgba(76, 125, 240, 0.2);
  --danger: #e05b5b;
  --success: #3fa76b;
  --warn: #d08a2c;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --raise: -4px -4px 8px var(--sh-light), 4px 4px 8px var(--sh-dark);
  --raise-sm: -2px -2px 5px var(--sh-light), 2px 2px 5px var(--sh-dark);
  --press: inset -2px -2px 5px var(--sh-light), inset 2px 2px 5px var(--sh-dark);
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- L0：光斑层，给玻璃提供可折射的内容 ---------- */
.blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.blob-a {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  top: -12vw; left: -10vw;
  background: radial-gradient(circle at 35% 35%, rgba(185, 201, 255, 0.85), rgba(185, 201, 255, 0) 70%);
}

.blob-b {
  width: 40vw; height: 40vw; max-width: 540px; max-height: 540px;
  top: 18vh; right: -12vw;
  background: radial-gradient(circle at 50% 50%, rgba(255, 217, 194, 0.75), rgba(255, 217, 194, 0) 70%);
}

.blob-c {
  width: 44vw; height: 44vw; max-width: 580px; max-height: 580px;
  bottom: -18vw; left: 22vw;
  background: radial-gradient(circle at 50% 50%, rgba(201, 240, 228, 0.7), rgba(201, 240, 228, 0) 70%);
}

/* ---------- 布局 ---------- */
.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #6d95ff, #3d68d8);
  box-shadow: var(--raise-sm);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  flex: none;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.brand p {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--text-2);
}

/* ---------- L1：新拟态卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--raise);
  padding: 24px;
  margin-bottom: 20px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card .sub {
  margin: 4px 0 16px;
  font-size: 12.5px;
  color: var(--text-2);
}

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex: none;
  background: var(--text-3);
}
.dot.on { background: var(--success); box-shadow: 0 0 0 3px rgba(63, 167, 107, 0.16); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px rgba(224, 91, 91, 0.14); }

/* ---------- 表单：内凹输入框 ---------- */
.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}

input[type="email"],
input[type="password"],
input[type="text"],
textarea {
  width: 100%;
  border: none;
  outline: none;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--press);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-1);
  font-family: inherit;
  transition: box-shadow 0.18s ease;
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

input:focus, textarea:focus {
  box-shadow: var(--press), 0 0 0 2px var(--accent-soft);
}

textarea {
  resize: vertical;
  min-height: 92px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 11px 20px;
  box-shadow: var(--raise-sm);
  transition: box-shadow 0.16s ease, transform 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { box-shadow: var(--press); transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, #6d95ff, #3d68d8);
  box-shadow: -3px -3px 7px var(--sh-light), 4px 4px 10px rgba(61, 104, 216, 0.34);
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
  padding: 8px 12px;
}
.btn-ghost:hover:not(:disabled) { color: var(--text-1); box-shadow: var(--raise-sm); }

.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }

/* ---------- L2：液态玻璃（浮层 / 徽章） ---------- */
.glass {
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 22px rgba(43, 52, 64, 0.09);
  border-radius: var(--r-pill);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  max-width: 100%;
}

.chip .email {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 提示条 ---------- */
.notice {
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 14px;
  border-left: 3px solid var(--text-3);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-2);
}
.notice.warn { border-left-color: var(--warn); background: rgba(208, 138, 44, 0.09); }
.notice.err { border-left-color: var(--danger); background: rgba(224, 91, 91, 0.08); }
.notice.ok { border-left-color: var(--success); background: rgba(63, 167, 107, 0.09); }
.notice code { font-size: 12px; }

/* ---------- 二维码区 ---------- */
.qr-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.qr-box {
  width: 196px; height: 196px;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--press);
  display: grid;
  place-items: center;
  padding: 10px;
  flex: none;
  overflow: hidden;
}

.qr-box img, .qr-box svg, .qr-box canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.qr-box .placeholder {
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
  padding: 0 12px;
}

.qr-side { flex: 1; min-width: 220px; }

.qr-status {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  flex: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 账号状态表 ---------- */
.acct {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--raise-sm);
  margin-bottom: 12px;
}

.acct:last-child { margin-bottom: 0; }

.acct .name {
  font-weight: 650;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.acct .meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  word-break: break-all;
}

.grow { flex: 1; min-width: 0; }

.empty {
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 22px 0;
}

/* ---------- 折叠说明 ---------- */
details.howto {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-2);
}

details.howto summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
  outline: none;
}
details.howto summary::-webkit-details-marker { display: none; }
details.howto[open] summary { margin-bottom: 8px; }
details.howto ol { margin: 6px 0 0; padding-left: 20px; }
details.howto li { margin-bottom: 4px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  max-width: min(90vw, 460px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { color: var(--danger); }
#toast.ok { color: var(--success); }

/* ---------- 工具 ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.small { font-size: 12px; color: var(--text-2); }

@media (max-width: 560px) {
  .shell { padding: 20px 14px 56px; }
  .card { padding: 18px; border-radius: var(--r-lg); }
  .qr-wrap { justify-content: center; }
  .qr-side { min-width: 100%; text-align: left; }
  .chip .email { max-width: 120px; }
}
