:root {
  --bg: #eef6fb;
  --bg-spot: #cfe8f6;
  --card: #ffffff;
  --text: #1d3a4f;
  --muted: #5d7a90;
  --line: #d5e8f4;
  --primary: #3b9fd0;
  --primary-hover: #2d88b8;
  --primary-soft: #e7f5fb;
  --ink: #16324a;
  --danger: #c23d4a;
  --ok: #1a9a78;
  --warn: #c47a12;
  --star: #f0c45c;
  --shadow: 0 1px 2px rgba(29, 58, 79, .05), 0 14px 36px -18px rgba(59, 159, 208, .38);
  --radius: 18px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; }
html { color-scheme: light; font-size: 15px; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", system-ui, sans-serif;
  background-color: var(--bg);
  background-image: url(/static/img/bg-sky.jpg);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

header.appbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: .42rem 1rem;
  display: flex; gap: .55rem; align-items: center;
}
header.appbar .brand {
  display: flex; align-items: center; gap: .45rem;
  color: var(--ink); text-decoration: none;
}
header.appbar .brand:hover { text-decoration: none; }
.brand-mark {
  width: 1.85rem; height: 1.85rem; border-radius: 50%; overflow: hidden;
  border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--line);
  flex: 0 0 auto;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text strong { font-size: .88rem; letter-spacing: .01em; font-weight: 700; }
.brand-text span { font-size: .62rem; color: var(--muted); font-weight: 500; }
header.appbar nav { display: flex; gap: .12rem; flex-wrap: wrap; }
header.appbar nav a {
  color: var(--muted); padding: .2rem .55rem; border-radius: 999px; font-size: .8rem;
}
header.appbar nav a:hover { background: var(--primary-soft); text-decoration: none; color: var(--ink); }
header.appbar nav a.active {
  background: var(--primary); color: #fff; font-weight: 650;
}
header.appbar .spacer { flex: 1; }
.nav-toggle {
  display: none; margin-left: auto;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: .22rem .5rem; font: inherit; font-size: .8rem; cursor: pointer;
}
.who { color: var(--muted); font-size: .8rem; }

main { max-width: 920px; margin: 1.1rem auto 0; padding: 0 1rem 2.2rem; flex: 1; width: 100%; }
.site-foot {
  text-align: center; color: var(--muted); font-size: .72rem;
  padding: 0 1rem 1.2rem;
}

.card {
  background: color-mix(in srgb, var(--card) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .95rem 1.05rem;
  margin-bottom: .85rem;
}
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem;
}
.page-head > div { flex: 1 1 14rem; min-width: 0; }
.page-head h1 { margin: 0; }
.page-head .lede { margin: .2rem 0 0; }
h1 { font-size: 1.16rem; letter-spacing: -.02em; margin: 0 0 .4rem; color: var(--ink); font-weight: 720; }
h2 { font-size: .92rem; margin: 0 0 .35rem; color: var(--ink); }
.muted { color: var(--muted); font-size: .8rem; }
.lede { color: var(--muted); font-size: .8rem; margin: 0 0 .65rem; }
.row { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: .2rem; margin: 0 0 .55rem; font-size: .8rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .2rem;
  border: 1px solid var(--line); background: #fff;
  padding: .26rem .68rem; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .78rem; color: var(--ink); line-height: 1.2;
}
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f3c9ce; }
.btn.danger:hover { background: #fff5f5; }
.btn:hover { background: var(--primary-soft); text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; }

input, select, textarea {
  width: 100%; max-width: 28rem; padding: .38rem .6rem;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: .84rem; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 45%, white);
  border-color: var(--primary);
}
input.narrow, select.narrow { max-width: 10rem; }
textarea.mono { max-width: 100%; font-family: ui-monospace, "Cascadia Code", monospace; font-size: 12px; }
label { display: block; font-size: .8rem; margin: .45rem 0 .15rem; color: var(--ink); }
label.inline-check { display: flex; align-items: center; gap: .45rem; margin: .4rem 0; }
label.inline-check input { width: auto; max-width: none; }

.table-wrap { overflow-x: auto; margin: 0 -.25rem; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th, td { text-align: left; padding: .42rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .72rem; }

.flash-ok, .flash-err {
  padding: .6rem .8rem; border-radius: var(--radius-sm); margin: 0 0 .8rem;
}
.flash-ok { color: var(--ok); background: #e9f9f3; }
.flash-err { color: var(--danger); background: #fdeeee; }

.badge {
  display: inline-flex; align-items: center; padding: .06rem .4rem; border-radius: 999px;
  font-size: .68rem; font-weight: 650; background: var(--primary-soft); color: #1e648a;
}
.badge.warn { background: #fff6e5; color: var(--warn); }
.badge.bad { background: #fdeeee; color: var(--danger); }
.badge.ok { background: #e9f9f3; color: var(--ok); }
.badge.sky { background: #e7f5fb; color: #2d88b8; }
form.inline { display: inline; }
.stack > * + * { margin-top: .65rem; }

.auth-shell { max-width: 24rem; margin: 1.2rem auto 0; text-align: center; }
.auth-shell .mascot { width: 7.6rem; height: 7.6rem; margin: 0 auto .1rem; }
.auth-card { max-width: 24rem; margin: .35rem auto 0; text-align: left; }

.mascot {
  width: 6.8rem; height: 6.8rem; border-radius: 50%; object-fit: cover;
  background: #c9e6f5; display: block;
  box-shadow: 0 8px 24px -12px rgba(59, 159, 208, .55);
}
.mascot.sm { width: 3.4rem; height: 3.4rem; }
.mascot.md { width: 5rem; height: 5rem; }
.hero-mascot { flex: 0 0 auto; width: 5rem; text-align: center; }
.cheer-caption {
  margin: .3rem 0 0; font-size: .68rem; color: #b8862a; font-weight: 650; line-height: 1.3;
}

.qr-box {
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
  width: 200px; height: 200px; object-fit: contain;
}
.seg, .method-grid { display: grid; gap: .6rem; margin: 1rem 0 1.1rem; }
.method-grid { grid-template-columns: repeat(auto-fit, minmax(9.2rem, 1fr)); }
.method-card {
  margin: 0; cursor: pointer; position: relative;
}
.method-card input { position: absolute; opacity: 0; pointer-events: none; }
.method-card span {
  display: block; text-align: left; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); min-height: 3.4rem; font-size: .82rem;
}
.method-card small { display: block; color: var(--muted); font-size: .7rem; margin-top: .12rem; font-weight: 400; }
.method-card input:checked + span {
  border-color: var(--primary); background: var(--primary-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.method-card input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.empty { text-align: center; padding: 1.6rem 1rem 1.3rem; color: var(--muted); }
.empty .mascot { margin: 0 auto .7rem; }
code { font-size: .85em; background: var(--primary-soft); padding: .05em .35em; border-radius: 5px; }

.account-list { display: grid; gap: .65rem; }
.account-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center;
  text-decoration: none; color: inherit;
  padding: .8rem .9rem;
}
.account-card:hover { text-decoration: none; border-color: var(--primary); }
.account-card h2 { margin: 0; font-size: .95rem; }
.account-card h2 a { color: var(--ink); }
.account-card h2 a:hover { color: var(--primary); }
.account-card .meta { margin: .12rem 0 0; }
.account-card .today { margin-top: .3rem; font-size: .78rem; }
.account-actions { display: flex; flex-direction: column; gap: .3rem; align-items: flex-end; }
.avatar {
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff;
  background: linear-gradient(160deg, #7ec8e8, var(--primary));
  box-shadow: 0 6px 14px -8px rgba(59, 159, 208, .8);
}
.avatar-img {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; object-fit: cover;
  box-shadow: 0 6px 14px -8px rgba(59, 159, 208, .8);
}

.hero {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
}
.hero .grow { flex: 1; min-width: 12rem; }
.more { margin-top: .7rem; }
.more > summary {
  cursor: pointer; color: var(--muted); font-size: .9rem; list-style: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: " ▾"; }
.more[open] > summary::after { content: " ▴"; }
.more .row { margin-top: .55rem; }

.stat-pills { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0 .55rem; }
.stat-pill {
  background: var(--primary-soft); color: #1e648a; border-radius: 999px;
  padding: .12rem .5rem; font-size: .72rem; font-weight: 650;
}
.stat-pill strong { color: var(--ink); }
.progress {
  height: .45rem; background: #e3eef5; border-radius: 999px; overflow: hidden; margin: .4rem 0 .7rem;
}
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #7ec8e8, var(--primary)); }

.topic-list { display: grid; gap: .4rem; }
.topic-row {
  display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center;
  padding: .38rem .1rem; border-bottom: 1px solid var(--line); font-size: .84rem;
}
.topic-row:last-child { border-bottom: 0; }
.zs-star {
  width: .95rem; height: .95rem; border-radius: 50%; object-fit: cover;
  vertical-align: -2px; margin-left: .2rem;
  box-shadow: 0 0 0 1px rgba(240, 196, 92, .4);
}
.chip-list { display: grid; gap: .35rem; }
.chip {
  display: flex; align-items: flex-start; gap: .45rem;
  padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: .84rem;
}
.chip input { width: auto; max-width: none; margin-top: .2rem; }
.chip .id { font-size: .75rem; word-break: break-all; }
.chip:has(input:checked) {
  border-color: var(--primary); background: var(--primary-soft);
}

.subnav { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; }
.subnav a {
  padding: .18rem .55rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: .76rem;
}
.subnav a:hover { text-decoration: none; background: var(--primary-soft); }
.subnav a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.user-block { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.user-block:last-child { border-bottom: 0; }
.user-block .ops { margin-top: .45rem; }

.time-field { max-width: 9rem; }

.log-pre {
  white-space: pre-wrap; word-break: break-word;
  background: #16324a; color: #e7f3fa; padding: 1rem;
  border-radius: 12px; max-height: 70vh; overflow: auto;
  font-size: 12px; line-height: 1.45;
}

form .row > input, form .row > select { max-width: 16rem; flex: 1 1 9rem; width: auto; }

@media (max-width: 720px) {
  body { background-attachment: scroll; background-position: center top; }
  header.appbar { flex-wrap: wrap; padding: .4rem .75rem; justify-content: space-between; }
  .brand-text span { display: none; }
  .nav-toggle { display: inline-flex; margin-left: 0; }
  header.appbar nav, header.appbar .who, header.appbar .logout {
    display: none;
  }
  header.appbar.is-open nav {
    display: flex; width: 100%; order: 5; padding: .2rem 0 .35rem;
  }
  header.appbar.is-open .who, header.appbar.is-open .logout {
    display: flex; order: 6;
  }
  main { margin-top: 1rem; }
  .card { padding: 1rem; }
  .account-card { grid-template-columns: auto 1fr; }
  .account-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  th, td { white-space: nowrap; }
  .auth-shell { margin-top: 1rem; }
}
