:root {
  --bg: #0b0c10;
  --bg2: #14151c;
  --card: #171821;
  --line: rgba(255,255,255,.08);
  --line2: rgba(255,255,255,.14);
  --text: #eeeef2;
  --muted: #8b8d98;
  --muted2: #6a6c76;
  --accent: #3b5be0;
  --accent2: #6ea2ff;
  --good: #34a854;
  --warn: #f0a34c;
  --bad: #e05656;
  --nav-h: 64px;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); min-height: 100dvh; }
button, input, textarea, select { font-family: inherit; }
a { color: var(--accent2); }
.page { display: none; max-width: 452px; margin: 0 auto; padding: 12px 16px 28px; }
.page.show { display: block; }

#boot-splash {
  position: fixed; inset: 0; z-index: 12000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: #0a0b0e;
  transition: opacity .4s ease;
}
#boot-splash.done { opacity: 0; pointer-events: none; }
.bs-mark { width: 88px; height: 88px; }
.bs-word { margin-top: 16px; font-size: 20px; font-weight: 700; letter-spacing: .12em; }
.bs-bar { margin-top: 24px; width: 72px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; }
.bs-bar i { display: block; width: 40%; height: 100%; background: var(--accent); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(320%); } }

.hero {
  position: relative; border-radius: 20px; overflow: hidden;
  background: linear-gradient(160deg, #1b2550, #12141c 55%, #0e1016);
  padding: 22px 18px 16px; min-height: 132px;
}
.hero h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 13px; }
.search {
  display: flex; gap: 8px; align-items: center; margin-top: 16px;
  background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px;
}
.search input {
  flex: 1; border: 0; background: transparent; color: var(--text); font-size: 14px; outline: none;
}
.search span { color: var(--muted); }

.tag-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.tag-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--bg2); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.chip.on { background: rgba(59,91,224,.22); color: #c9d4ff; border-color: rgba(59,91,224,.5); }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer;
}
.card .cover { aspect-ratio: 3/4; background: #111; position: relative; }
.card .cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: 1;
}
.card .cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted2); font-size: 28px; }
.card .meta { padding: 8px 10px 10px; }
.card .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 36px 12px; font-size: 14px; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(12,13,18,.92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-items { max-width: 452px; margin: 0 auto; display: flex; }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 10px; color: var(--muted2); font-size: 11px; cursor: pointer;
}
.nav-item.active { color: var(--accent2); }
.nav-item .ic { font-size: 18px; line-height: 1; }

.page-title { font-size: 20px; font-weight: 700; padding: 8px 0 12px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; gap: 12px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer;
}
.row .av { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: #111; flex: none; }
.row .av img { width: 100%; height: 100%; object-fit: cover; }
.row .t { font-weight: 700; font-size: 14px; }
.row .s { color: var(--muted); font-size: 12px; margin-top: 3px; }
.row .go { margin-left: auto; color: var(--muted2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 11px 16px; font-weight: 700; font-size: 14px; cursor: pointer;
  background: linear-gradient(135deg, #3b5be0, #5b7cff); color: #fff;
}
.btn.ghost { background: transparent; border: 1px solid var(--line2); color: var(--text); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }

.pts-card {
  background: linear-gradient(160deg, #1c2550, #14151c);
  border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px;
}
.pts-card .bal { font-size: 36px; font-weight: 800; letter-spacing: -.03em; }
.pts-card .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }

.product {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.product .nm { font-weight: 700; }
.product .ds { color: var(--muted); font-size: 12px; margin-top: 4px; }

.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 80; display: none;
}
.drawer-overlay.show { display: block; }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; max-height: 92dvh;
  background: #12131a; border-radius: 20px 20px 0 0; display: none; overflow: auto;
  padding: 10px 16px 28px;
}
.drawer.show { display: block; }
.drawer-handle { width: 42px; height: 4px; border-radius: 4px; background: var(--line2); margin: 6px auto 12px; }
.d-cover { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.d-cover img, .d-cover video {
  width: 72%; max-height: 360px; object-fit: cover; border-radius: 14px; scroll-snap-align: start; flex: none; background: #000;
}
.d-name { font-size: 22px; font-weight: 800; margin: 12px 0 4px; }
.d-sub { color: var(--muted); font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tags span { font-size: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted); }
.d-acts { display: flex; gap: 8px; margin: 16px 0 8px; }
.d-acts .btn { flex: 1; }
.note { white-space: pre-wrap; color: #c9cad3; font-size: 14px; line-height: 1.65; }

#rpt-modal, #toast {
  position: fixed; z-index: 90;
}
#rpt-modal {
  inset: 0; background: #0e0f14; display: none; flex-direction: column; max-width: 452px; margin: 0 auto;
}
#rpt-modal.show { display: flex; }
.rpt-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.rpt-head .x { background: none; border: 0; color: var(--text); font-size: 20px; cursor: pointer; }
.rpt-body { flex: 1; overflow: auto; padding: 16px; }
.rpt-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 10px 12px; font-size: 15px;
}
.field textarea { min-height: 110px; resize: vertical; }
.score-row { display: flex; flex-wrap: wrap; gap: 6px; }
.score-row b {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: 13px;
}
.score-row b.on { background: var(--accent); color: #fff; border-color: var(--accent); }

#toast {
  left: 50%; bottom: 88px; transform: translateX(-50%); background: #1e1f28; color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 13px; display: none; white-space: nowrap;
  border: 1px solid var(--line); max-width: 86vw; overflow: hidden; text-overflow: ellipsis;
}
#toast.show { display: block; }

.login-box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; text-align: center; }
.login-box p { color: var(--muted); font-size: 13px; line-height: 1.6; }

.rpt-item .sum { font-size: 14px; line-height: 1.5; }
.muted { color: var(--muted); font-size: 12px; }
.rpt-sec { margin: 18px 0 8px; }
.rpt-hd { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.teacher-rpt {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 8px;
}
.teacher-rpt .sum { font-size: 14px; line-height: 1.55; }
.teacher-rpt .s { color: var(--muted); font-size: 12px; margin-top: 6px; }
.rpt-fields { margin-top: 8px; }
.rpt-f { font-size: 13px; color: #c9cad3; line-height: 1.55; }
.rpt-f span { color: var(--muted); }
.rpt-photos { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; }
.rpt-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex: none; }
#btn-more-rpts { margin-top: 8px; }
