body.auth-wait { visibility: hidden; }
header { position: relative; }
#accountBar { position: absolute; top: 22px; right: 0; z-index: 20; }
header.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
a.brand { color: inherit; text-decoration: none; cursor: pointer; }
a.brand:hover { color: inherit; }
header.topbar .top-actions { display: flex; align-items: center; gap: 10px; }
header.topbar #accountBar {
  position: relative;
  top: auto;
  right: auto;
  display: flex;
  align-items: center;
}
header.topbar .switch,
header.topbar .account-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin: 0;
  padding: 0 14px;
  line-height: 1;
  font-size: 14px;
  vertical-align: middle;
}
.account-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 0 14px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.06);
}
.account-button::before { content: "⚡"; font-size: 13px; }
.account-menu {
  position: absolute;
  right: 0;
  top: 46px;
  min-width: 168px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}
.account-menu a,
.account-menu button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  text-align: left;
  text-decoration: none;
  background: transparent;
  color: #0f172a;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}
.account-menu a:hover,
.account-menu button:hover { background: #f1f5f9; }
@media (max-width: 760px) {
  header:not(.topbar) #accountBar { position: static; margin-top: 12px; }
  header.topbar { flex-wrap: wrap; }
}
body.sub, body.sub * { box-sizing: border-box; }
body.sub {
  margin: 0;
  color: #0f172a;
  background: #f8fafc;
  font-family: "Microsoft YaHei", "微软雅黑", "Segoe UI", sans-serif;
}
body.sub h1 { margin: 0; font-size: 22px; font-weight: 700; font-family: "Microsoft YaHei", "微软雅黑", sans-serif; }
body.sub .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
body.sub .brand p { margin: 2px 0 0; color: #64748b; font-size: 12px; }
body.sub .mark {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: white; flex: none;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
}
body.sub .top-actions { display: flex; align-items: center; gap: 10px; }
body.sub .switch {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid #c7d2fe; background: white; color: #3730a3;
  text-decoration: none; font-size: 14px;
}
body.sub .switch:hover { background: #eef2ff; }
body.sub main { width: min(1040px, calc(100% - 32px)); margin: 20px auto 56px; }
body.sub.narrow main { width: min(720px, calc(100% - 32px)); }
body.sub section {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 8px 8px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); overflow-x: auto;
}
body.sub.narrow section { padding: 20px; }
body.sub table { width: 100%; border-collapse: collapse; }
body.sub th, body.sub td { text-align: left; padding: 14px 12px; border-bottom: 1px solid #e2e8f0; font-size: 14px; vertical-align: middle; }
body.sub tbody tr:hover td { background: rgba(238, 242, 255, 0.7); }
body.sub th { color: #475569; font-size: 12px; font-weight: 650; background: #f8fafc; }
body.sub td.when, body.sub td.num { color: #64748b; font-variant-numeric: tabular-nums; }
body.sub td.summary { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sub td.points { font-weight: 750; font-variant-numeric: tabular-nums; color: #b91c1c; }
body.sub .plus, body.sub .minus { font-weight: 750; font-variant-numeric: tabular-nums; }
body.sub .plus { color: #047857; }
body.sub .minus { color: #b91c1c; }
body.sub .tag, body.sub .state {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
}
body.sub .tag-outline { background: #eef2ff; color: #4338ca; }
body.sub .tag-storyboard { background: #eff6ff; color: #1d4ed8; }
body.sub .tag-prompt { background: #ecfeff; color: #0e7490; }
body.sub .tag-image { background: #fdf4ff; color: #a21caf; }
body.sub .tag-video { background: #f5f3ff; color: #6d28d9; }
body.sub .state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
body.sub .state.back { background: #ecfdf5; color: #047857; }
body.sub .state.bad { background: #fef2f2; color: #b91c1c; }
body.sub .state.wait { background: #fffbeb; color: #b45309; }
body.sub .state.wait::before { animation: subpulse 1.2s ease infinite; }
@keyframes subpulse { 50% { opacity: 0.35; } }
body.sub tr.empty td { text-align: center; color: #64748b; padding: 48px 16px; background: transparent; }
body.sub tr.empty td::before { content: "◌"; display: block; margin-bottom: 8px; color: #a5b4fc; font-size: 28px; }
body.sub.narrow label { display: block; margin: 14px 0 6px; font-size: 13px; color: #475569; }
body.sub.narrow label.check-row {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 4px;
  color: #0f172a; font-size: 14px; cursor: pointer;
}
body.sub.narrow label.check-row input {
  width: 18px; height: 18px; margin: 0; padding: 0; flex: none; accent-color: #4f46e5;
}
body.sub.narrow input, body.sub.narrow select, body.sub.narrow button { font: inherit; }
body.sub.narrow input, body.sub.narrow select {
  width: 100%; height: 44px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 0 12px; background: white; color: #0f172a;
}
body.sub.narrow input:focus, body.sub.narrow select:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16); }
body.sub .tag-h3 { background: #f5f3ff; color: #6d28d9; }
body.sub.narrow .code { display: flex; gap: 8px; align-items: center; }
body.sub.narrow .code input { flex: 1; }
body.sub .pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
body.sub .pager[hidden] { display: none !important; }
body.sub .pager button {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid #c7d2fe;
  background: white; color: #3730a3; box-shadow: none;
}
body.sub .pager button:disabled { opacity: 0.45; cursor: default; }
body.sub .pager span { color: #64748b; font-size: 13px; min-width: 9em; text-align: center; }
body.sub main button {
  height: 42px; border: 0; border-radius: 12px; padding: 0 16px; color: white; cursor: pointer;
  background: linear-gradient(90deg, #4f46e5, #2563eb);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}
body.sub .note, body.sub .hint { min-height: 1.2em; color: #b91c1c; font-size: 13px; line-height: 1.6; }
body.sub .note.ok { color: #047857; }
body.sub .hint { color: #64748b; }
body.sub h2 { margin: 22px 0 8px; font-size: 16px; }
body.sub h2:first-child { margin-top: 0; }
body.sub section p { margin: 0 0 10px; line-height: 1.7; color: #0f172a; }
body.sub section a { color: #4f46e5; }
