/* 微信读书挂号器 - 简洁响应式样式 */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1f2329;
  --muted: #8a919e;
  --line: #e5e8ee;
  --brand: #2b6df6;
  --brand-dark: #1f56d1;
  --danger: #d64545;
  --ok: #2f9e44;
  --warn: #d97800;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar nav a { margin-left: 14px; color: var(--muted); text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: var(--brand); }

h1 { font-size: 20px; margin: 18px 0 6px; }
h2 { font-size: 16px; margin: 18px 0 6px; }
.sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type="text"], input[type="password"], input[type="number"], input[type="time"], input[type="time"], textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.small { padding: 4px 12px; font-size: 12.5px; }
.btn.ghost:hover { background: #eef4ff; }

/* ---- 分步区块: 「方法一（推荐）」/「方法二」 ---- */
.method {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fcfdff;
}
.method.primary {
  border-color: #bfd5ff;
  background: #f4f8ff;
}
.method-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.method-tag {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand);
  background: #e7f0ff;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.method.primary .method-tag { background: var(--brand); color: #fff; }
.method-sub { color: var(--muted); font-size: 12.5px; }
/* 说明按钮固定贴到该行最右侧 */
.method-help { margin-left: auto; }
/* 卡片标题下的状态行 (Cookie 有效/账号名/校验时间, SPT 已配置) */
.status-line {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
/* 左半区撑开剩余宽度, 右侧按钮才能和状态徽章同行, 而不是被挤到下一行。
   basis 必须是 0 不能是 auto: 状态行那段文字很长时, basis:auto 会按整段文
   本的假设宽度算, 装了换行判断 -> 按钮直接被挤到第二行。 */
.status-line > div { flex: 1 1 0; min-width: 0; }
/* 只给 margin-left:auto 会让 <p> 的默认 1em 上下外边距生效, 按钮比徽章低 15px; 上下必须显式归零 */
.status-line .row { margin: 0 0 0 auto; }
/* 「上次有效」是最关键的一项: 稍微加重, 失效时也不会被状态行其他信息淹没 */
.cred-valid { color: var(--ink); font-weight: 600; }
/* 其余时间/细节收成更浅的第二行, 避免一条长行挤在一起看不清 */
.cred-others { margin-top: 2px; font-size: 12px; opacity: .85; }

/* 「非必须」这类弱提示: 用虚线徽章, 避免看起来像必填项 */
.badge.optional { background: #f4f6fa; color: var(--muted); border: 1px dashed var(--line); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: #eef1f6; color: var(--muted); }
.badge.succeeded, .badge.sent, .badge.done { background: #e6f6ec; color: var(--ok); }
.badge.partial, .badge.interrupted { background: #fff3e0; color: var(--warn); }
.badge.failed, .badge.cancelled, .badge.missed { background: #fdeaea; color: var(--danger); }
.badge.running, .badge.queued, .badge.scheduled { background: #e7f0ff; color: var(--brand); }

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 99;
  max-width: 90vw;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
.toast.warn { background: var(--warn); }

/* ---- 扫码登录模态框 ---- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 36, .55);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 18px 60px rgba(15, 22, 36, .28);
}
.modal h3 { margin: 0 0 6px; font-size: 16px; }
/* 教程类模态框: 内容较长, 放宽并允许内部滚动 */
.modal.wide { max-width: 620px; max-height: 84vh; overflow-y: auto; }
.help h4 { font-size: 14px; margin: 16px 0 6px; }
.help h4:first-of-type { margin-top: 8px; }
.help ol, .help ul { margin: 6px 0; padding-left: 20px; }
.help li { margin-bottom: 6px; }
.help p { margin: 6px 0; }
.help code, .help pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: #f2f4f8;
  border-radius: 6px;
}
.help code { padding: 1px 5px; word-break: break-all; }
.help pre { padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.help pre code { background: transparent; padding: 0; }
.help .note {
  background: #fff8e8;
  border-left: 3px solid var(--warn);
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}
.qr-box {
  margin: 12px auto;
  width: 280px;
  max-width: 100%;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fafbfc;
}
.qr-box img { width: 100%; height: auto; display: block; }
.qr-loading { color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }

/* 扫码成功: 二维码位置换成明确的对勾提示 */
.qr-success { text-align: center; padding: 34px 16px; }
.qr-success-icon {
  width: 64px; height: 64px; line-height: 64px; margin: 0 auto 14px;
  border-radius: 50%; background: #16a34a; color: #fff;
  font-size: 34px; font-weight: 700; letter-spacing: 0;
}
.qr-success-title { font-size: 18px; font-weight: 600; color: #15803d; margin-bottom: 6px; }
.qr-success-sub { font-size: 13px; color: var(--muted); }

.auth-card { max-width: 400px; margin: 60px auto; }
.auth-card h1 { text-align: center; }
.muted-link { color: var(--muted); font-size: 13px; }
code { background: #f0f2f5; border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }

@media (max-width: 640px) {
  .row { flex-direction: column; align-items: stretch; }
  .topbar .wrap { flex-direction: column; gap: 6px; }
  .topbar nav a:first-child { margin-left: 0; }
}

/* ========== 科技感登录/注册页 ========== */
body.auth-page {
  background: var(--auth-bg, #070b16);
  background-attachment: fixed;
  color: #e8ecf6;
  min-height: 100vh;
}
body.auth-page .topbar { display: none; } /* 登录/注册页不需要顶栏 */
body.auth-page .wrap { max-width: 440px; }

/* 动态渐变背景层 (固定铺满) */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 15% -8%, rgba(43, 109, 246, .35), transparent 60%),
    radial-gradient(1000px 700px at 110% 20%, rgba(34, 211, 238, .22), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(124, 58, 237, .28), transparent 60%),
    linear-gradient(160deg, #070b16 0%, #0b1226 45%, #0a0e1f 100%);
  animation: auth-hue 18s ease-in-out infinite alternate;
}
@keyframes auth-hue {
  0%   { filter: hue-rotate(0deg) saturate(1); }
  50%  { filter: hue-rotate(18deg) saturate(1.15); }
  100% { filter: hue-rotate(0deg) saturate(1); }
}
/* 粒子画布 */
.auth-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .9;
}
/* 扫描线细闪 */
.auth-bg::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -30%;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(120, 200, 255, .06), transparent);
  animation: auth-scan 9s linear infinite;
  pointer-events: none;
}
@keyframes auth-scan {
  from { top: -30%; }
  to   { top: 110%; }
}

/* 玻璃拟态卡片 */
.auth-card.glass-card {
  position: relative;
  z-index: 1;
  margin: 9vh auto;
  padding: 34px 34px 26px;
  border-radius: 18px;
  background: rgba(16, 24, 48, .55);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(140, 180, 255, .18);
  box-shadow:
    0 24px 60px rgba(2, 6, 18, .6),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 0 0 1px rgba(43, 109, 246, .06);
  animation: auth-rise .6s ease both;
}
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(22px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

/* 品牌区 */
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px; height: 62px;
  font-size: 30px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(43,109,246,.28), rgba(124,58,237,.22));
  border: 1px solid rgba(140,180,255,.28);
  box-shadow: 0 0 26px rgba(43, 109, 246, .45), inset 0 0 14px rgba(120,200,255,.12);
  animation: auth-float 4s ease-in-out infinite;
}
@keyframes auth-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
.auth-brand h1 {
  margin: 16px 0 4px;
  font-size: 23px;
  letter-spacing: 3px;
  font-weight: 800;
  background: linear-gradient(92deg, #8fc1ff, #58e6ff 55%, #a48aff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(88, 190, 255, .35));
}
.auth-brand .sub { color: rgba(180, 200, 235, .72); font-size: 13px; letter-spacing: 1px; }

/* 表单 */
.auth-form .label {
  display: block;
  margin: 14px 0 7px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(160, 185, 230, .65);
}
.auth-form .label:first-child { margin-top: 0; }

/* 输入组件: 图标 + 底部分隔线 + 聚焦光条 */
.auth-form .field {
  position: relative;
}
.auth-form .field-ico {
  position: absolute;
  left: 2px;
  top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  color: rgba(150, 175, 220, .5);
  pointer-events: none;
  transition: color .25s;
}
.auth-form .field input {
  width: 100%;
  height: 50px;
  padding: 0 4px 0 30px;
  font-size: 15px;
  letter-spacing: .3px;
  color: #eaf1ff;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(140, 175, 230, .28);
  border-radius: 0;
  transition: border-color .25s;
}
.auth-form .field input::placeholder { color: rgba(150, 175, 215, .45); }
.auth-form .field input:focus {
  outline: none;
  border-bottom-color: rgba(88, 190, 255, .8);
}
/* 聚焦时图标变亮 */
.auth-form .field:focus-within .field-ico { color: #6fc3ff; }
/* 聚焦光条 (左右展开) */
.auth-form .field .field-glow {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, #2b6df6, #58e6ff, #8a4dff);
  background-size: 200% 100%;
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition: transform .35s ease, opacity .25s ease;
}
.auth-form .field:focus-within .field-glow {
  transform: scaleX(1);
  opacity: 1;
}
.auth-form .muted-link, .auth-card .muted-link { color: rgba(180, 200, 235, .78); }
.auth-card .muted-link a { color: #7cc4ff; text-decoration: none; font-weight: 600; }
.auth-card .muted-link a:hover { text-decoration: underline; text-shadow: 0 0 12px rgba(120, 200, 255, .6); }

/* 发光按钮 (与输入框等高对齐) */
.btn-glow {
  position: relative;
  overflow: hidden;
  height: 48px;
  line-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2b6df6, #5b3df5 60%, #8a4dff);
  box-shadow: 0 6px 24px rgba(43, 109, 246, .5), 0 0 0 1px rgba(255,255,255,.08) inset;
  font-size: 15px;
  letter-spacing: 6px;
  transition: transform .15s, box-shadow .2s;
}
.btn-glow::after {
  content: "";
  position: absolute;
  top: -40%; left: -60%;
  width: 50%; height: 180%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-25deg);
  transition: left .55s ease;
}
.btn-glow:hover { transform: translateY(-1px); box-shadow: 0 10px 34px rgba(43, 109, 246, .7), 0 0 0 1px rgba(180,210,255,.14) inset; }
.btn-glow:hover::after { left: 130%; }
.btn-glow:active { transform: translateY(0); }

/* 动效降级: 用户偏好减少动画 */
@media (prefers-reduced-motion: reduce) {
  .auth-bg, .auth-bg::after, .auth-logo, .auth-card { animation: none; }
  .auth-card { opacity: 1; transform: none; filter: none; }
}

@media (max-width: 640px) {
  .auth-card.glass-card { margin: 6vh 14px; padding: 28px 22px 20px; }
}
