:root {
  --text: #333;
  --muted: #555;
  --soft: #666;
  --accent: #66b1ff;
  --ink: #24324a;
  --glass: rgba(255, 255, 255, .82);
  --line: rgba(255, 255, 255, .55);
  --shadow: 0 8px 32px rgba(31, 38, 135, .15);
  --radius: 14px;
  --grad: linear-gradient(105deg, #3d8bfd 0%, #7a5cff 46%, #ee6bb0 100%);
  --max: 1180px;
  --nav-h: 74px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", "Microsoft YaHei", "Droid Sans Fallback", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  background: #e7f1fb;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
a { color: #2d62c4; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #1d4e9e; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
p + p { margin-top: 10px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 300;
  background: #fff;
  color: #222;
  padding: 8px 12px;
  border-radius: 10px;
}
.skip-link:focus { top: 10px; }
:focus-visible { outline: 2px solid #3a7bff; outline-offset: 3px; }

.bg, .bg-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.bg {
  z-index: 0;
  background: #d7e7f8 url("opt/bg-room.webp") center 22% / cover no-repeat;
}
html[data-bg="soft"] .bg { background-image: url("opt/bg-soft.webp"); }
html[data-bg="plain"] .bg {
  background-image: none;
  background: linear-gradient(165deg, #e7f3ff 0%, #f8e9f5 50%, #e8f6ff 100%);
}
.bg-veil {
  z-index: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.2) 36%, rgba(232, 240, 252, .28));
}
html[data-bg="plain"] .bg-veil { background: transparent; }

.bubbles { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.bubbles i {
  position: absolute;
  bottom: -70px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.16);
  animation: rise linear infinite;
}
.bubbles i:nth-child(1) { left: 6%; width: 16px; height: 16px; animation-duration: 18s; }
.bubbles i:nth-child(2) { left: 14%; width: 28px; height: 28px; animation-duration: 22s; animation-delay: -6s; }
.bubbles i:nth-child(3) { left: 24%; width: 12px; height: 12px; animation-duration: 15s; animation-delay: -3s; }
.bubbles i:nth-child(4) { left: 36%; width: 22px; height: 22px; animation-duration: 26s; animation-delay: -11s; }
.bubbles i:nth-child(5) { left: 48%; width: 14px; height: 14px; animation-duration: 19s; animation-delay: -8s; }
.bubbles i:nth-child(6) { left: 58%; width: 34px; height: 34px; animation-duration: 28s; animation-delay: -4s; }
.bubbles i:nth-child(7) { left: 70%; width: 18px; height: 18px; animation-duration: 17s; animation-delay: -9s; }
.bubbles i:nth-child(8) { left: 80%; width: 12px; height: 12px; animation-duration: 21s; animation-delay: -2s; }
.bubbles i:nth-child(9) { left: 88%; width: 26px; height: 26px; animation-duration: 24s; animation-delay: -13s; }
.bubbles i:nth-child(10) { left: 94%; width: 10px; height: 10px; animation-duration: 16s; animation-delay: -7s; }
@keyframes rise {
  0% { transform: translateY(0) scale(.9); opacity: 0; }
  12% { opacity: .7; }
  100% { transform: translateY(-115vh) scale(1.05); opacity: 0; }
}

#fx { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; pointer-events: none; }

#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(244, 248, 255, .94);
  backdrop-filter: blur(8px);
}
#loader p { color: #445; letter-spacing: .08em; font-size: 16px; }
#loader .bar {
  width: 140px;
  height: 4px;
  border-radius: 99px;
  background: rgba(102, 177, 255, .25);
  overflow: hidden;
}
#loader .bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #66b1ff, #ee6bb0);
  animation: loadbar 1.1s ease-in-out infinite;
}
@keyframes loadbar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .4s ease; }
html[data-anim="off"] #loader { display: none; }

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .46);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  border-bottom: 1px solid rgba(255, 255, 255, .45);
}
.nav.scrolled { background: rgba(255, 255, 255, .72); }
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 64px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px 16px;
}
.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
  font-size: 22px;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.wordmark span { color: #7a5cff; padding-left: 2px; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: var(--text);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.72); color: #2d62c4; }
.search { margin-left: auto; }
.search input {
  width: 168px;
  border: 1px solid rgba(255,255,255,.75);
  background: rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text);
}
.search input::placeholder { color: #667; }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.nav-github {
  text-decoration: none;
  color: var(--ink);
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 650;
}
.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  display: block;
  flex: none;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.7);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
}
.icon-btn svg { width: 16px; height: 16px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 18px; position: relative; z-index: 2; }
main { position: relative; z-index: 2; }
footer { position: relative; z-index: 2; }

.hero { padding: 28px 0 10px; }
.hero-layout {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.numerals { display: flex; flex-direction: column; gap: 2px; }
.numerals a {
  text-decoration: none;
  color: rgba(255,255,255,.88);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-shadow: 0 6px 18px rgba(40, 60, 110, .28);
}
.numerals b {
  font-size: 84px;
  line-height: .86;
  letter-spacing: -.06em;
  font-weight: 800;
}
.numerals small {
  margin: 0 0 8px 4px;
  font-size: 12px;
  letter-spacing: .08em;
  color: #2c3a52;
  text-shadow: none;
  background: rgba(255,255,255,.82);
  border-radius: 999px;
  padding: 1px 8px;
}
.numerals a.current b {
  background: linear-gradient(120deg, #f7c3e4, #d9c6ff 55%, #c5e4ff);
  color: #fff;
  border-radius: 16px;
  padding: 4px 10px 8px;
  text-shadow: none;
  box-shadow: 0 10px 28px rgba(170, 140, 210, .35);
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-panel { padding: 28px 28px 24px; }
.hero-id { display: flex; align-items: center; gap: 14px; }
.hero-avatar {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  background: #111;
  border: 2px solid rgba(255,255,255,.9);
}
.hero-id .kicker { margin-bottom: 2px; }
.hero-id .aka { margin-top: 2px; }
.kicker {
  font-size: 12px;
  letter-spacing: .14em;
  color: #5c6f92;
  margin-bottom: 8px;
}
.gradient-title, .hero-panel h1 {
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: #2a4f9a;
}
.hero-panel h1 { font-size: clamp(40px, 5vw, 64px); }
.hero-panel h1 span, .gradient-title {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.aka { margin-top: 8px; color: var(--muted); font-size: 15px; }
.hero-panel .lede { margin-top: 14px; max-width: 62ch; }
.quote {
  margin-top: 14px;
  font-size: 18px;
  color: #3a3158;
}
.hero-actions, .link-row, .contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn, .submit-btn, .msg-empty button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.72);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.btn-primary, .submit-btn, .msg-empty button {
  background: linear-gradient(100deg, #e7f2ff, #fde8f6);
}
a.btn:hover { color: var(--ink); }
.email-copy.copied { outline: 2px solid #7a5cff; }

.bento {
  margin: 18px 0 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.bento .glass, .card-grid .glass, .pair .glass, .feature .glass, .honor-grid .glass, .interest-grid .glass, .companion-grid .glass {
  padding: 16px;
}
.clock-card p, .gh-card p, .metric-card p { color: var(--muted); font-size: 14px; }
.clock-time {
  font-variant-numeric: tabular-nums;
  font-size: clamp(32px, 3vw, 44px);
  font-weight: 720;
  letter-spacing: -.04em;
  color: var(--ink);
  line-height: 1.1;
  margin: 8px 0;
}
.metric-line { display: flex; align-items: flex-start; flex-wrap: nowrap; gap: 2px; line-height: .95; }
.metric-num {
  font-size: clamp(36px, 3.2vw, 56px);
  font-weight: 780;
  letter-spacing: -.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.metric-unit {
  font-size: 22px;
  font-weight: 750;
  color: #6a4fd8;
  margin-top: 6px;
}

.section { padding: 34px 0 10px; }
.section-head {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 16px;
}
.giant {
  font-size: 84px;
  font-weight: 800;
  line-height: .8;
  letter-spacing: -.06em;
  width: 112px;
  text-align: center;
  color: rgba(255,255,255,.9);
  text-shadow: 0 8px 22px rgba(50, 70, 130, .28);
}
.head-copy { padding: 18px 20px; background: rgba(255,255,255,.94); }
.head-copy h2, .gradient-title { font-size: clamp(28px, 3.4vw, 46px); }
.head-copy p { margin-top: 8px; }
.group-title {
  display: inline-block;
  margin: 22px 0 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(255,255,255,.6);
  color: #2c3a52;
  font-size: 16px;
}
.feature, .pair, .learn-layout { display: grid; gap: 14px; margin-bottom: 14px; }
.feature { grid-template-columns: 1.12fr .88fr; }
.feature.flip { grid-template-columns: .92fr 1.08fr; }
.pair { grid-template-columns: 1fr 1fr; }
.learn-layout { grid-template-columns: 1.4fr .8fr; align-items: stretch; }
.feature .glass { padding: 20px; }
.feature figure.glass { display: flex; flex-direction: column; }
.feature figure.glass .pcb-shot { flex: 1; height: auto; }
.pcb-shot {
  width: 100%;
  height: 100%;
  min-height: 440px;
  max-height: 680px;
  object-fit: cover;
  object-position: center 32%;
  border-radius: 12px;
  background: #12141c;
}
.chart {
  width: 100%;
  border-radius: 12px;
  background: rgba(255,255,255,.55);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tags span, .pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.75);
  color: #445;
  font-size: 12px;
  letter-spacing: .03em;
}
.result { margin-top: 12px; }
.result strong {
  display: block;
  font-size: 28px;
  color: #2a4f9a;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.result span, .fine { color: var(--muted); font-size: 13.5px; }
.fine { margin-top: 10px; }
.link-row a { font-weight: 650; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.card-grid h3, .pair h3, .feature h3, .honor-grid h3, .interest-grid h3, .companion-grid h3 {
  margin: 4px 0 8px;
  font-size: 20px;
  color: var(--ink);
  line-height: 1.35;
}
.mono { font-family: "WenQuanYi Micro Hei Mono", ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; color: #444; }

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.step span {
  display: block;
  font-size: 22px;
  font-weight: 750;
  color: #7a5cff;
  letter-spacing: -.04em;
}
.step h3 { font-size: 16px; margin: 2px 0 4px; color: var(--ink); }
.step p, .step small { color: var(--muted); font-size: 13px; }
.donut-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.donut-row { display: flex; gap: 14px; align-items: center; }
.donut {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  flex: none;
  background: conic-gradient(#66b1ff 0 110.77deg, #8b6cff 110.77deg 249.23deg, #ee7ab5 249.23deg 332.31deg, #6ec8a0 332.31deg 360deg);
  display: grid;
  place-items: center;
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
}
.donut strong { position: relative; z-index: 1; font-size: 22px; color: var(--ink); }
.legend { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #444; }
.legend li { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sw.a { background: #66b1ff; }
.sw.b { background: #8b6cff; }
.sw.c { background: #ee7ab5; }
.sw.d { background: #6ec8a0; }
.course-card { padding: 16px 18px; margin-bottom: 14px; }
.course-list { margin: 8px 0 0; padding-left: 1.2em; columns: 2; }
.course-list li { break-inside: avoid; margin: 0 0 4px; }
.course-list .now { color: #2a4f9a; font-weight: 700; }
.note-list { display: grid; gap: 10px; }
.note-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}
.note-list a:hover { color: inherit; }
.note-list strong { color: var(--ink); display: block; }
.note-list p { color: var(--muted); font-size: 14px; }
.note-no { font-weight: 750; color: #7a5cff; }

.honor-grid, .interest-grid, .companion-grid { display: grid; gap: 14px; }
.honor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.interest-grid { grid-template-columns: 300px minmax(0, 1fr); }
.interest-stack { display: grid; gap: 14px; }
.ice-shot { width: 100%; border-radius: 12px; margin-bottom: 10px; }
.letter {
  float: right;
  width: 78px;
  margin: 0 0 8px 10px;
  border-radius: 8px;
  transform: rotate(-6deg);
  box-shadow: 0 8px 18px rgba(40, 50, 80, .18);
  background: #f4efe4;
}
.timeline-wrap { position: relative; margin-top: 8px; }
.tl-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; overflow: visible; }
.study-line {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.study-line li { position: relative; width: calc(50% - 42px); }
.study-line li:nth-child(even) { margin-left: auto; }
.study-line article { padding: 16px 16px 14px; }
.study-line h3 { margin: 2px 0 6px; color: var(--ink); font-size: 18px; }
.study-line time { color: #6a5ac8; font-size: 13px; }
.study-line li::before {
  content: "";
  position: absolute;
  top: 28px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #7d6cff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.55);
  z-index: 2;
}
.study-line li:nth-child(odd)::before { right: -49px; }
.study-line li:nth-child(even)::before { left: -49px; }

.companion-grid { grid-template-columns: 1.15fr .85fr .85fr; }
.mascot-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #1b1830;
  margin-bottom: 10px;
}
.group-shot { width: 100%; border-radius: 12px; margin-bottom: 12px; background: #1b1830; max-height: 420px; object-fit: cover; object-position: center 30%; }
.model-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  margin-top: 12px;
  color: #444;
  font-size: 14px;
}
.model-row span { display: inline-flex; align-items: center; gap: 6px; }
.model-row img { width: 22px; height: 22px; }

.chat-shell { display: grid; grid-template-columns: minmax(240px, .78fr) minmax(0, 1.25fr); min-height: 540px; overflow: hidden; }
.chat-mascot {
  padding: 18px;
  border-right: 1px solid rgba(255,255,255,.45);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.55));
}
.chat-mascot img {
  width: min(100%, 320px);
  margin: 0 auto 12px;
  border-radius: 16px;
  background: #1b1830;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255,255,255,.7);
  font-size: 12px;
  color: #445;
}
.status-chip i { width: 7px; height: 7px; border-radius: 50%; background: #3cba8b; display: inline-block; }
.chat-console { display: flex; flex-direction: column; padding: 16px; min-width: 0; }
.chat-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(90, 110, 150, .15);
}
.chat-topbar strong { display: block; color: var(--ink); }
.chat-topbar span, .quota { font-size: 13px; color: var(--soft); }
.quota {
  flex: none;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255,255,255,.7);
  color: #2a4f9a;
}
.chat-messages {
  flex: 1;
  min-height: 240px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(236, 243, 252, .72);
}
.chat-bubble { max-width: min(86%, 560px); }
.chat-bubble span { display: block; font-size: 12px; color: #666; margin: 0 0 4px 4px; }
.chat-bubble p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px 16px 16px 16px;
  background: #fff;
  border: 1px solid rgba(170, 190, 220, .45);
  color: var(--text);
  overflow-wrap: anywhere;
}
.chat-bubble.user { align-self: flex-end; }
.chat-bubble.user span { text-align: right; }
.chat-bubble.user p {
  background: linear-gradient(135deg, #d9e8ff, #f3d9ef);
  border-radius: 16px 6px 16px 16px;
}
.chat-form textarea, .guestbook-form textarea, .guestbook-form input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.85);
  background: rgba(255,255,255,.78);
  color: var(--text);
  padding: 12px 14px;
}
.chat-form textarea { min-height: 74px; resize: vertical; }
.guestbook-form textarea { min-height: 120px; resize: vertical; }
.chat-form-footer, .form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.chat-form-footer span, .char-count { color: var(--soft); font-size: 13px; }
.guestbook-form { padding: 18px; margin-top: 8px; }
.form-row { max-width: 320px; margin-bottom: 10px; }
#msgList {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px 20px;
  margin-top: 18px;
  min-height: 80px;
}
.msg-card {
  width: min(100%, 340px);
  padding: 14px 16px;
  border-radius: 18px 18px 18px 6px;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: var(--shadow);
}
.msg-card:nth-child(3n+1) { background: rgba(223, 236, 255, .72); }
.msg-card:nth-child(3n+2) { background: rgba(255, 232, 244, .72); margin-top: 22px; border-radius: 18px 18px 6px 18px; }
.msg-card:nth-child(3n) { background: rgba(236, 248, 255, .74); }
.msg-header { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.msg-author { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.avatar-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
}
.msg-time { color: var(--soft); font-size: 12px; white-space: nowrap; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-empty {
  width: 100%;
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,.8);
  border-radius: 16px;
  background: rgba(255,255,255,.45);
}
.empty-icon { display: block; font-size: 26px; margin-bottom: 6px; }
.greet {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 14px;
  padding: 10px 12px;
}
.greet img { width: 52px; height: 52px; border-radius: 16px; object-fit: cover; background: #1b1830; }

.contact-banner {
  padding: 22px;
  border: 1.5px dashed rgba(255,255,255,.85);
  position: relative;
}
.hearts { position: absolute; right: 16px; top: 12px; letter-spacing: 4px; color: #ee7ab5; }
.contact-banner h2 { font-size: clamp(26px, 3vw, 36px); }
.site-footer {
  max-width: var(--max);
  margin: 28px auto 0;
  padding: 18px 18px 96px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.site-footer .glass { padding: 14px 16px; width: 100%; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: #2d62c4; }

.email-toast {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translate(-50%, -8px);
  background: rgba(255,255,255,.94);
  color: #222;
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  border-radius: 12px;
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  max-width: min(92vw, 420px);
}
.email-toast.show { opacity: 1; transform: translate(-50%, 0); }

.pet { position: fixed; right: 16px; bottom: 16px; z-index: 70; }
.pet-btn {
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pet-btn img { width: 100%; height: 100%; object-fit: cover; }
.pet-menu a {
  position: absolute;
  right: 8px;
  bottom: 8px;
  text-decoration: none;
  background: rgba(255,255,255,.88);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.pet-menu a:nth-child(1) { transform: translate(-92px, 4px); }
.pet-menu a:nth-child(2) { transform: translate(-104px, -46px); }
.pet-menu a:nth-child(3) { transform: translate(-70px, -94px); }
.pet-menu a:nth-child(4) { transform: translate(-8px, -128px); }
.pet.is-quiet { opacity: 0; pointer-events: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(40, 50, 80, .28);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal[hidden] { display: none; }
.modal-card { width: min(480px, 100%); padding: 18px; max-height: min(86vh, 640px); overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { font-size: 22px; color: var(--ink); }
.switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-weight: 650;
}
.bg-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.bg-choices button {
  padding: 6px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: rgba(255,255,255,.55);
  color: var(--ink);
}
.bg-choices button.is-on { border-color: #7a5cff; }
.bg-choices img, .bg-choices .plain-swatch {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 4px;
}
.plain-swatch { display: block; background: linear-gradient(165deg, #e7f3ff, #f8e9f5 55%, #e8f6ff); }

.is-filtered { display: none !important; }
#searchEmpty { padding: 16px; margin-bottom: 12px; }

html[data-anim="on"] .reveal:not(.visible) { opacity: 0; transform: translateY(18px); }
html[data-anim="on"] .reveal.visible { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s ease; }
html[data-anim="on"] .lift { transition: transform .2s ease; }
html[data-anim="on"] .lift:hover { transform: scale(1.05); }
html[data-anim="on"] .msg-card { animation: bob 6.5s ease-in-out infinite; }
html[data-anim="on"] .msg-card:nth-child(2n) { animation-delay: -2s; }
html[data-anim="on"] .msg-card:hover { animation: none; transform: scale(1.05); }
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}
html[data-anim="on"] .pet-btn { animation: hop 3.4s ease-in-out infinite; }
html[data-anim="on"] .pet.is-open .pet-btn { animation: none; }
@keyframes hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
html[data-anim="off"] .bubbles { display: none; }
html[data-anim="off"] .reveal { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .card-grid, .honor-grid { grid-template-columns: 1fr 1fr; }
  .companion-grid { grid-template-columns: 1fr 1fr; }
  .companion-grid .wide { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .hero-layout, .feature, .feature.flip, .pair, .learn-layout, .interest-grid, .chat-shell { grid-template-columns: 1fr; }
  .hero-layout { min-height: 0; }
  .numerals { flex-direction: row; justify-content: space-between; gap: 4px; }
  .numerals a { min-width: 0; }
  .numerals b { font-size: 40px; }
  .numerals small { margin-left: 2px; letter-spacing: .06em; }
  .numerals a.current b { padding: 2px 6px 4px; border-radius: 12px; }
  .steps { grid-template-columns: 1fr; }
  .pcb-shot { min-height: 280px; max-height: 420px; height: 320px; }
  .chat-mascot { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.45); }
  .nav-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo tools"
      "links links"
      "search search";
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
  }
  .wordmark { grid-area: logo; }
  .nav-tools { grid-area: tools; margin-left: 0; justify-self: end; }
  .nav-links {
    grid-area: links;
    width: auto;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .search { grid-area: search; width: 100%; margin: 0; }
  .search input { width: 100%; }
  .section-head { grid-template-columns: 1fr; }
  .giant { font-size: 64px; width: auto; text-align: left; }
  .course-list { columns: 1; }
}
@media (max-width: 560px) {
  .bento, .card-grid, .honor-grid, .companion-grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 12px; }
  .hero-panel, .head-copy, .feature .glass { padding: 16px; }
  .hero-panel h1 { font-size: 36px; }
  .msg-card, .msg-card:nth-child(3n+2) { width: 100%; margin-top: 0; }
  .pet-btn { width: 60px; height: 60px; border-radius: 18px; }
  .study-line li, .study-line li:nth-child(even) { width: auto; margin-left: 0; }
  .tl-svg { display: none; }
  .study-line {
    border-left: 2px solid rgba(125, 108, 255, .55);
    margin-left: 10px;
    padding-left: 18px;
  }
  .study-line li::before, .study-line li:nth-child(odd)::before, .study-line li:nth-child(even)::before {
    left: -26px;
    right: auto;
  }
  .bg-choices { grid-template-columns: 1fr; }
  .note-list a { grid-template-columns: auto minmax(0, 1fr); }
  .note-list a span:last-child { display: none; }
  .chat-form-footer, .form-footer { align-items: stretch; flex-direction: column; }
  .submit-btn, .chat-form .submit-btn { width: calc(100% - 64px); align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (scripting: none) {
  .reveal { opacity: 1 !important; transform: none !important; }
  #loader { display: none; }
}

.kicker.uestc { font-size: 15px; letter-spacing: .04em; }
.kicker.uestc strong { font-size: 18px; font-weight: 800; background: linear-gradient(90deg,#1f4fbf,#7a3cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
