:root {
  --page-bg: #dfeef6;
  --surface: #ffffff;
  --surface-soft: #f4f8fb;
  --ink: #17212b;
  --muted: #637488;
  --line: #d8e4ec;
  --brand: #157f8f;
  --brand-dark: #0c5f72;
  --accent: #f0b44c;
  --good: #40a36d;
  --shadow: 0 22px 50px rgba(28, 73, 95, 0.18);
  --tabbar-h: 78px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(21, 127, 143, 0.2), transparent 28%),
    linear-gradient(160deg, #eef7ff 0%, var(--page-bg) 44%, #f8efe0 100%);
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.phone-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  background: rgba(239, 248, 255, 0.9);
  border-bottom: 1px solid rgba(216, 228, 236, 0.75);
  backdrop-filter: blur(16px);
}

.topbar-back {
  position: relative;
  width: 38px;
  height: 38px;
  margin-right: 10px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(24, 84, 103, 0.12);
}

.topbar-back::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 12px;
  width: 11px;
  height: 11px;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

.topbar-back.is-hidden {
  display: none;
}

.topbar-copy {
  flex: 1;
  min-width: 0;
}

.topbar-kicker {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.app-topbar h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar-action {
  position: relative;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(24, 84, 103, 0.12);
}

.topbar-action::before {
  content: "";
  position: absolute;
  inset: 10px 12px 13px;
  border: 2px solid var(--brand);
  border-radius: 12px 12px 9px 9px;
}

.topbar-action::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 9px;
  width: 8px;
  height: 8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #e85d4f;
}

.topbar-action span {
  position: absolute;
  left: 17px;
  bottom: 10px;
  width: 5px;
  height: 5px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg);
}

.app-view {
  overflow-y: auto;
  min-height: calc(100vh - 154px);
  padding: 16px 14px calc(var(--tabbar-h) + 42px + env(safe-area-inset-bottom));
  outline: none;
}

.hero-panel {
  position: relative;
  padding: 22px;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(10, 92, 111, 0.95), rgba(21, 127, 143, 0.88)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 12px);
  border-radius: 8px;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -56px;
  width: 156px;
  height: 156px;
  border: 28px solid rgba(240, 180, 76, 0.35);
  border-radius: 50%;
}

.hero-panel h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero-panel p {
  position: relative;
  z-index: 1;
  max-width: 260px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.7;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.quick-card,
.placeholder-card,
.status-card {
  display: block;
  min-width: 0;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid rgba(216, 228, 236, 0.86);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(28, 73, 95, 0.08);
}

.quick-card strong,
.placeholder-card strong,
.status-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.quick-card p,
.placeholder-card p,
.status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.quick-card:hover,
.quick-card:focus-visible {
  border-color: rgba(21, 127, 143, 0.48);
  transform: translateY(-1px);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 2px 10px;
}

.section-title h3 {
  margin: 0;
  font-size: 17px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.section-title a {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.route-stack {
  display: grid;
  gap: 12px;
}

.placeholder-card {
  position: relative;
  overflow: hidden;
}

.placeholder-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--brand);
}

.status-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
}

.status-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  background: var(--brand);
  border-radius: 8px;
}

.status-card:nth-child(2) .status-mark {
  background: var(--accent);
}

.status-card:nth-child(3) .status-mark {
  background: var(--good);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 430px);
  min-height: var(--tabbar-h);
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(216, 228, 236, 0.92);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.tab-item {
  display: grid;
  min-height: 54px;
  place-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}

.tab-item[aria-current="page"] {
  color: var(--brand-dark);
  background: #e8f5f7;
}

.tab-icon {
  position: relative;
  display: block;
  width: 23px;
  height: 23px;
}

.tab-icon::before,
.tab-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.icon-home::before {
  left: 4px;
  top: 9px;
  width: 15px;
  height: 11px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px;
}

.icon-home::after {
  left: 5px;
  top: 4px;
  width: 13px;
  height: 13px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.icon-ai::before {
  inset: 4px;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.icon-ai::after {
  left: 10px;
  top: 0;
  width: 3px;
  height: 6px;
  border-radius: 4px;
  background: currentColor;
  box-shadow: 0 17px 0 currentColor, -8px 9px 0 currentColor, 8px 9px 0 currentColor;
}

.icon-volunteer::before {
  inset: 4px 5px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-volunteer::after {
  left: 9px;
  top: 8px;
  width: 7px;
  height: 11px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(38deg);
}

.icon-assessment::before {
  left: 5px;
  top: 4px;
  width: 13px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 8px 8px;
}

.icon-assessment::after {
  left: 8px;
  bottom: 2px;
  width: 8px;
  height: 4px;
  border-radius: 6px;
  background: currentColor;
}

.icon-me::before {
  left: 8px;
  top: 4px;
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-me::after {
  left: 4px;
  bottom: 3px;
  width: 15px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 12px 12px 3px 3px;
}

.empty-state {
  display: grid;
  gap: 14px;
}

.loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 18px;
  text-align: center;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dbeafe;
  border-top-color: #1687f7;
  border-radius: 50%;
  animation: lf-spin 0.8s linear infinite;
}

@keyframes lf-spin {
  to {
    transform: rotate(360deg);
  }
}

.card,
.data-notice,
.school-card,
.report-card,
.report-section,
.test-card,
.article-card,
.share-card {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid rgba(216, 228, 236, 0.86);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(28, 73, 95, 0.08);
}

.card + .card,
.data-notice + .card,
.school-list + .data-notice,
.report-list + .fixed-actions {
  margin-top: 12px;
}

.card h2,
.card h3,
.article-card h2,
.report-section h3 {
  margin: 0 0 10px;
}

.card p,
.article-card p,
.report-section p,
.data-notice p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.home-hero,
.report-hero {
  padding: 16px;
  color: #0c4d68;
  background: linear-gradient(135deg, #65c7ee, #e8fbef);
  border-radius: 8px;
}

.countdown {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #106f91;
}

.countdown strong {
  color: #ff7c34;
  font-size: 30px;
}

.search-box,
.input-like {
  display: block;
  margin: 14px 0;
  padding: 14px 18px;
  color: #8b98a8;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
}

.brand-row,
.assistant-head,
.me-head,
.school-main,
.list-card {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-logo,
.avatar {
  display: grid;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  place-items: center;
  color: #7b612d;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, #fffaf0, #ffffff);
  border: 1px solid #eadfc7;
  border-radius: 14px;
}

.image-logo {
  display: block;
  object-fit: contain;
  padding: 7px;
}

.image-avatar {
  border-radius: 50%;
}

.small-logo {
  width: 50px;
  height: 50px;
  font-size: 22px;
}

.brand-row h2,
.me-head h2,
.assistant-head h2 {
  margin: 0 0 5px;
}

.brand-row p,
.me-head p,
.assistant-head p {
  margin: 0;
  color: var(--muted);
}

.ask-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 12px 14px;
  color: var(--muted);
  text-decoration: none;
  background: #ffffff;
  border: 2px solid #ff8b42;
  border-radius: 8px;
}

.ask-strip strong {
  color: #ffffff;
  padding: 8px 10px;
  background: #ff8b42;
  border-radius: 8px;
}

.profile-strip,
.badge-line {
  margin: 12px 0;
  padding: 12px;
  color: #176fa6;
  background: #eaf5ff;
  border-radius: 8px;
}

.profile-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.stats-grid div {
  padding: 11px 6px;
  text-align: center;
  background: #ffffff;
  border-radius: 8px;
}

.stats-grid strong {
  display: block;
  color: #1489f5;
  font-size: 22px;
}

.stats-grid span {
  color: var(--muted);
  font-size: 12px;
}

.compact strong {
  font-size: 22px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.entry-grid a {
  display: grid;
  min-height: 78px;
  justify-items: center;
  gap: 4px;
  padding: 12px 10px;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid rgba(216, 228, 236, 0.86);
  border-radius: 8px;
}

.entry-grid span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.mini-icon {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1689f5, #19b6af);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 8px 18px rgba(21, 127, 143, 0.18);
}

.mini-icon::before,
.mini-icon::after {
  content: "";
  position: absolute;
  display: block;
  border-color: #ffffff;
}

.mini-university { background: linear-gradient(135deg, #167df5, #13b5d1); }
.mini-major { background: linear-gradient(135deg, #5c6df7, #22b8cf); }
.mini-flag { background: linear-gradient(135deg, #ff7841, #f0b44c); }
.mini-subject { background: linear-gradient(135deg, #13a36f, #22c1a6); }
.mini-line { background: linear-gradient(135deg, #2978ff, #38bdf8); }
.mini-rank { background: linear-gradient(135deg, #7c4dff, #1689f5); }
.mini-route { background: linear-gradient(135deg, #0f9b7a, #62c370); }
.mini-assessment { background: linear-gradient(135deg, #1689f5, #7c4dff); }
.mini-expert { background: linear-gradient(135deg, #0ea5a8, #42c785); }
.mini-more { background: linear-gradient(135deg, #4f6b84, #1689f5); }
.mini-article { background: linear-gradient(135deg, #176fa6, #18b6d1); }

.mini-university::before { left: 8px; right: 8px; bottom: 9px; height: 12px; border: 2px solid #fff; border-top: 0; }
.mini-university::after { left: 9px; top: 8px; width: 18px; height: 8px; background: #fff; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mini-major::before { left: 10px; top: 8px; width: 16px; height: 20px; border: 2px solid #fff; border-radius: 3px; }
.mini-major::after { left: 14px; top: 14px; width: 8px; height: 2px; background: #fff; box-shadow: 0 5px 0 #fff; }
.mini-flag::before { left: 10px; top: 8px; width: 3px; height: 21px; background: #fff; }
.mini-flag::after { left: 13px; top: 8px; width: 13px; height: 10px; background: #fff; border-radius: 0 5px 5px 0; }
.mini-subject::before { left: 8px; top: 11px; width: 20px; height: 14px; border: 2px solid #fff; border-radius: 3px; transform: skewY(-8deg); }
.mini-subject::after { left: 17px; top: 9px; width: 2px; height: 18px; background: rgba(255,255,255,.9); transform: rotate(14deg); }
.mini-line::before { left: 9px; bottom: 9px; width: 18px; height: 14px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; }
.mini-line::after { left: 13px; bottom: 13px; width: 14px; height: 10px; border-left: 2px solid #fff; border-top: 2px solid #fff; transform: skew(-18deg); }
.mini-rank::before { left: 10px; top: 8px; width: 16px; height: 21px; border: 2px solid #fff; border-radius: 3px; }
.mini-rank::after { left: 14px; top: 13px; width: 8px; height: 2px; background: #fff; box-shadow: 0 5px 0 #fff, 0 10px 0 #fff; }
.mini-route::before { left: 9px; top: 9px; width: 18px; height: 18px; border: 2px dashed #fff; border-radius: 50%; }
.mini-route::after { left: 23px; top: 11px; width: 5px; height: 5px; background: #fff; border-radius: 50%; box-shadow: -11px 10px 0 #fff; }
.mini-assessment::before { left: 9px; top: 8px; width: 18px; height: 20px; border: 2px solid #fff; border-radius: 5px; }
.mini-assessment::after { left: 14px; top: 13px; width: 8px; height: 2px; background: #fff; box-shadow: 0 5px 0 #fff; }
.mini-expert::before { left: 9px; top: 9px; width: 18px; height: 15px; border: 2px solid #fff; border-radius: 8px; }
.mini-expert::after { left: 15px; top: 22px; width: 7px; height: 7px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: skew(-20deg); }
.mini-more::before { left: 9px; top: 16px; width: 5px; height: 5px; background: #fff; border-radius: 50%; box-shadow: 7px 0 0 #fff, 14px 0 0 #fff; }
.mini-article::before { left: 10px; top: 8px; width: 16px; height: 20px; border: 2px solid #fff; border-radius: 2px; }
.mini-article::after { left: 14px; top: 14px; width: 8px; height: 2px; background: #fff; box-shadow: 0 5px 0 #fff; }

.btn,
.mini-btn,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #286cf5, #20bfae);
}

.mini-btn,
.small-btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.ghost {
  color: #1766c2;
  background: #eef6ff;
}

.btn-blue { background: #188bf3; }
.btn-orange { background: linear-gradient(135deg, #ff7841, #ff4c43); }
.full { width: 100%; }

.action-pair,
.fixed-actions,
.inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fixed-actions {
  position: sticky;
  bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
  z-index: 8;
  margin-top: 14px;
  padding: 8px;
  background: rgba(244, 248, 251, 0.92);
  border: 1px solid rgba(216, 228, 236, 0.76);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(28, 73, 95, 0.12);
}

.data-notice {
  margin: 10px 0;
  padding: 12px 14px;
  border-left: 3px solid #13b5d1;
}

.data-notice.warn {
  border-left-color: #ff8a35;
  background: #fff7ed;
}

.data-notice.warn div {
  color: #b45309;
}

.data-notice div {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  color: #176fa6;
}

.data-notice details {
  margin-top: 6px;
}

.data-notice summary {
  cursor: pointer;
  color: #176fa6;
  font-size: 13px;
  font-weight: 800;
}

.data-notice details p {
  margin-top: 6px;
}

.data-notice span,
.small {
  color: #8492a3;
  font-size: 12px;
}

.question-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.question-list button,
.chip-row button,
.chip-row a,
.chip-grid button,
.chip-grid a {
  min-height: 40px;
  padding: 12px 14px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  background: #ffffff;
  border: 0;
  border-radius: 8px;
}

.chip-grid button {
  width: 100%;
  border: 1px solid var(--line);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.chip-grid button.active {
  color: #ffffff;
  background: linear-gradient(135deg, #1689f5, #15b9ae);
  border-color: transparent;
}

.chat-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.bubble {
  max-width: 86%;
  padding: 12px 14px;
  line-height: 1.65;
  border-radius: 8px;
}

.rich-text {
  display: grid;
  gap: 8px;
}

.rich-text h4 {
  margin: 8px 0 0;
  color: #17233b;
  font-size: 15px;
  line-height: 1.45;
}

.rich-text h4:first-child {
  margin-top: 0;
}

.rich-text p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.rich-text strong {
  color: #12213a;
  font-weight: 900;
}

.rich-text ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.rich-text li {
  margin: 0;
}

.rich-text code {
  padding: 1px 5px;
  color: #1766c2;
  background: #edf6ff;
  border-radius: 5px;
}

.bubble.bot {
  justify-self: start;
  color: #37475d;
  background: #ffffff;
}

.bubble.user {
  justify-self: end;
  color: #ffffff;
  background: #188bf3;
}

.composer {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
  position: fixed;
  left: 50%;
  z-index: 16;
  width: min(calc(100vw - 28px), 402px);
  bottom: calc(74px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(28, 73, 95, 0.12);
}

.composer textarea,
.form-card textarea,
.field input,
.field select,
.form-card input,
.form-card select {
  width: 100%;
  border: 0;
  background: #f3f7fb;
  border-radius: 8px;
}

.composer textarea {
  min-height: 44px;
  max-height: 128px;
  padding: 12px;
  resize: vertical;
}

.composer button {
  color: #ffffff;
  font-weight: 800;
  border: 0;
  border-radius: 8px;
  background: #147df5;
}

.school-list,
.report-list,
.test-list,
.form-stack,
.menu-list {
  display: grid;
  gap: 12px;
}

.school-card {
  position: relative;
  padding-right: 78px;
  padding-bottom: 52px;
}

.school-main {
  color: inherit;
  text-decoration: none;
  align-items: flex-start;
}

.school-logo {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  color: #167bd8;
  font-size: 23px;
  font-weight: 900;
  background: #eff8ff;
  border: 1px solid #d8eaf8;
  border-radius: 50%;
}

.school-logo-composite {
  position: relative;
  overflow: hidden;
}

.school-logo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.school-logo-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
  background: #ffffff;
  border-radius: 50%;
}

.school-card h3 {
  margin: 0 0 4px;
}

.school-card p {
  margin: 4px 0;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.tag-row span,
.risk {
  padding: 4px 8px;
  color: #1477cf;
  font-size: 12px;
  font-weight: 800;
  background: #eaf5ff;
  border-radius: 999px;
}

.risk {
  position: absolute;
  right: 14px;
  top: 14px;
}

.risk-rush { color: #ed5a3d; background: #fff0e9; }
.risk-safe { color: #1b9f6c; background: #e8fbf2; }

.small-action {
  position: absolute;
  right: 12px;
  bottom: 12px;
  min-height: 30px;
}

.compare-action {
  cursor: pointer;
}

.compare-action.active {
  color: #ffffff;
  background: #20bfae;
}

.compare-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  padding: 12px;
  background: #ffffff;
  border: 1px solid rgba(216, 228, 236, 0.86);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(28, 73, 95, 0.08);
}

.compare-bar div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.compare-bar span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seg-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px;
  background: #ffffff;
  border-radius: 999px;
}

.seg-tabs-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chip-row {
  display: flex;
  gap: 8px;
  margin: 10px -16px 0;
  padding: 0 16px 4px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip-row a {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background: #edf4fa;
  border-radius: 999px;
}

.chip-row a.active {
  color: #ffffff;
  background: #167df5;
}

.seg-tabs a {
  padding: 11px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 800;
}

.seg-tabs .active {
  color: #ffffff;
  background: linear-gradient(135deg, #286cf5, #7b49f6);
}

.report-hero h2 {
  margin: 8px 0 0;
  color: #0977d8;
  font-size: 34px;
}

.report-card h3,
.report-section h3 {
  color: #137ad8;
}

.stars {
  color: #ffb72c;
  letter-spacing: 1px;
}

.test-card {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.test-card > span {
  width: 5px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(#35d0bd, #3e6bff);
}

.test-card h3 {
  margin: 0 0 6px;
}

.test-card p {
  margin: 0 0 6px;
  color: var(--muted);
}

.test-card em {
  padding: 4px 8px;
  color: #176fa6;
  font-style: normal;
  font-size: 12px;
  background: #eaf5ff;
  border-radius: 999px;
}

.chip-grid,
.chip-row,
.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chip-row {
  display: flex;
  overflow-x: auto;
  margin: 8px 0;
  padding-bottom: 4px;
}

.chip-row button {
  flex: 0 0 auto;
  padding: 9px 13px;
}

.chip-row a {
  flex: 0 0 auto;
  padding: 9px 13px;
}

.chip-row .active,
.chip-grid .active {
  color: #ffffff;
  background: #147df5;
}

.search-form,
.tool-form {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  background: #ffffff;
  border: 1px solid rgba(216, 228, 236, 0.86);
  border-radius: 8px;
}

.search-form {
  grid-template-columns: 1fr 72px;
}

.search-form input,
.tool-form input,
.tool-form select {
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  border: 0;
  background: #f3f7fb;
  border-radius: 8px;
}

.search-form button {
  color: #ffffff;
  font-weight: 800;
  border: 0;
  border-radius: 8px;
  background: #147df5;
}

.tool-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.result-line {
  margin: 12px 2px;
  color: var(--muted);
  font-size: 13px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.meta-grid div {
  padding: 12px 8px;
  text-align: center;
  background: #ffffff;
  border-radius: 8px;
}

.meta-grid b {
  display: block;
  color: #147df5;
  font-size: 17px;
  word-break: break-word;
}

.meta-grid span {
  color: var(--muted);
  font-size: 12px;
}

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.source-list div {
  padding: 12px;
  background: #ffffff;
  border-radius: 8px;
}

.source-list strong,
.source-list span {
  display: block;
}

.source-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.source-list a,
.table-card a {
  display: block;
  margin-top: 4px;
  color: #1766c2;
  font-size: 12px;
  text-decoration: none;
  word-break: break-all;
}

.question {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.field,
.form-card label {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
  font-weight: 700;
}

.field input,
.field select,
.form-card input,
.form-card select {
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
}

.form-card textarea {
  min-height: 140px;
  padding: 12px;
  font: inherit;
  resize: vertical;
}

.option-grid label {
  margin: 0;
  padding: 12px;
  color: #3e4c60;
  text-align: center;
  background: #f3f7fb;
  border-radius: 8px;
}

.option-grid input {
  display: none;
}

.option-grid label:has(input:checked) {
  color: #ffffff;
  background: linear-gradient(135deg, #1c8ef6, #1ec8ad);
}

.form-card .small {
  margin: -2px 0 10px;
  color: #8b99aa;
  font-size: 12px;
  line-height: 1.45;
}

.qr-card {
  text-align: center;
}

.qr-box {
  display: grid;
  width: 230px;
  height: 230px;
  margin: 0 auto 14px;
  place-items: center;
  color: #9aa6b4;
  background:
    linear-gradient(90deg, #111 10px, transparent 10px) 0 0 / 32px 32px,
    linear-gradient(#111 10px, transparent 10px) 0 0 / 32px 32px,
    #ffffff;
  border: 12px solid #f5f7fa;
}

.wecom-image {
  display: block;
  width: min(100%, 286px);
  max-height: 420px;
  margin: 0 auto 14px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(28, 73, 95, 0.12);
}

.menu-list a,
.share-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  color: var(--ink);
  text-decoration: none;
  background: #ffffff;
  border-radius: 8px;
}

.menu-list span {
  color: #a3afbd;
}

.me-head {
  margin-bottom: 14px;
}

.status-pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.status-pair div {
  padding: 16px;
  border-radius: 8px;
  background: #ffe8b6;
}

.status-pair div:nth-child(2) {
  background: #e0e9ff;
}

.status-pair strong,
.status-pair span {
  display: block;
}

.status-pair span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.share-button {
  justify-content: center;
  gap: 12px;
  margin: 14px 0;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff3d3d, #ff9837);
}

.share-button span {
  padding: 6px 10px;
  color: #9b4a00;
  font-size: 13px;
  background: #fff1d4;
  border-radius: 999px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compare-grid article {
  padding: 12px;
  text-align: center;
  background: #ffffff;
  border-radius: 8px;
}

.compare-grid .school-logo {
  margin: 0 auto 10px;
}

.table-card {
  display: grid;
  gap: 8px;
}

.table-card div {
  padding: 14px;
  background: #ffffff;
  border-radius: 8px;
}

.major-layout,
.ency-layout {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
}

.major-layout aside,
.ency-layout aside {
  display: grid;
  align-content: start;
  gap: 4px;
}

.major-layout aside a,
.ency-layout aside a {
  padding: 12px 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  background: #eef3f7;
}

.major-layout aside .active,
.ency-layout aside .active {
  color: #147df5;
  background: #ffffff;
}

.major-layout main,
.ency-layout main {
  display: grid;
  gap: 14px;
}

.major-tile {
  display: block;
  margin: 8px 0;
  padding: 12px;
  color: var(--ink);
  text-decoration: none;
  background: #ffffff;
  border-radius: 8px;
}

.major-tile span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.major-tile em {
  display: block;
  margin-top: 6px;
  color: #516171;
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.share-card {
  min-height: 560px;
  text-align: center;
  background: linear-gradient(#ffffff, #eef7ff);
}

.poster {
  display: grid;
  min-height: 260px;
  margin: 22px 0;
  place-items: center;
  color: #ffffff;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, #147df5, #1ec8ad);
  border-radius: 8px;
}

.poster span {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
}

.toc {
  display: grid;
  gap: 8px;
}

.toc a,
.toc button {
  padding: 10px 12px;
  color: #31506a;
  text-align: left;
  text-decoration: none;
  background: #f1f7fc;
  border: 0;
  border-radius: 8px;
}

.page-title h2 {
  margin: 0 0 4px;
  color: #147df5;
  font-size: 26px;
}

/* Final mobile overrides for migrated H5 routes. */
.chip-row {
  display: flex;
  grid-template-columns: none;
  gap: 8px;
  margin: 10px -16px 0;
  padding: 0 16px 4px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chip-row a,
.chip-row button {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background: #edf4fa;
  border-radius: 999px;
}

.chip-row a.active,
.chip-row button.active {
  color: #ffffff;
  background: #167df5;
}

.menu-list em {
  display: block;
  margin-top: 6px;
  color: #8492a3;
  font-size: 12px;
  font-style: normal;
}

.download-card {
  margin-bottom: 20px;
}

.page-title p {
  margin: 0 0 12px;
  color: var(--muted);
}

.profile-card dl {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px 12px;
  margin: 0 0 14px;
}

.profile-card dt {
  color: var(--muted);
}

.profile-card dd {
  margin: 0;
  text-align: right;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  padding: 7px 10px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  background: #e8f5f7;
  border-radius: 999px;
}

@media (max-width: 559px) {
  :root {
    --tabbar-h: 64px;
    --shadow: 0 10px 26px rgba(28, 73, 95, 0.12);
  }

  body {
    font-size: 14px;
    background: var(--surface-soft);
  }

  .phone-shell {
    width: 100%;
    box-shadow: none;
  }

  .app-topbar {
    min-height: 66px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  }

  .topbar-back,
  .topbar-action {
    width: 32px;
    height: 32px;
    margin-right: 6px;
  }

  .topbar-back::before {
    left: 13px;
    top: 10px;
    width: 9px;
    height: 9px;
  }

  .topbar-action::before {
    inset: 8px 10px 11px;
  }

  .topbar-action::after {
    right: 8px;
    top: 7px;
    width: 7px;
    height: 7px;
  }

  .topbar-action span {
    left: 14px;
    bottom: 8px;
  }

  .topbar-kicker {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .app-topbar h1 {
    font-size: 16px;
    line-height: 1.22;
  }

  .app-view {
    min-height: calc(100vh - 130px);
    padding: 10px 10px calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom));
  }

  .tabbar {
    min-height: var(--tabbar-h);
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
  }

  .tab-item {
    min-height: 46px;
    gap: 2px;
    font-size: 10px;
  }

  .tab-icon {
    width: 20px;
    height: 20px;
  }

  .hero-panel,
  .home-hero,
  .report-hero {
    padding: 14px;
  }

  .hero-panel h2 {
    margin-bottom: 5px;
    font-size: 22px;
  }

  .hero-panel p {
    font-size: 12px;
    line-height: 1.48;
  }

  .quick-grid,
  .route-stack,
  .school-list,
  .report-list,
  .test-list,
  .form-stack,
  .menu-list {
    gap: 8px;
  }

  .quick-card,
  .placeholder-card,
  .status-card,
  .card,
  .data-notice,
  .school-card,
  .report-card,
  .report-section,
  .test-card,
  .article-card,
  .share-card {
    padding: 11px;
    box-shadow: 0 6px 16px rgba(28, 73, 95, 0.07);
  }

  .card + .card,
  .data-notice + .card,
  .school-list + .data-notice,
  .report-list + .fixed-actions {
    margin-top: 8px;
  }

  .card h2,
  .card h3,
  .article-card h2,
  .report-section h3 {
    margin-bottom: 7px;
    font-size: 16px;
    line-height: 1.3;
  }

  .card p,
  .article-card p,
  .report-section p,
  .data-notice p,
  .quick-card p,
  .placeholder-card p,
  .status-card p {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.42;
  }

  .section-title {
    margin: 14px 2px 7px;
  }

  .section-title h3 {
    font-size: 15px;
  }

  .brand-row,
  .assistant-head,
  .me-head,
  .school-main,
  .list-card,
  .test-card {
    gap: 9px;
  }

  .brand-logo,
  .avatar {
    width: 50px;
    height: 50px;
    font-size: 22px;
    border-radius: 10px;
  }

  .small-logo {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .brand-row h2,
  .me-head h2,
  .assistant-head h2 {
    margin-bottom: 3px;
    font-size: 17px;
  }

  .brand-row p,
  .me-head p,
  .assistant-head p {
    font-size: 12px;
    line-height: 1.35;
  }

  .countdown strong {
    font-size: 24px;
  }

  .search-box,
  .input-like {
    margin: 9px 0;
    padding: 11px 14px;
    font-size: 13px;
  }

  .ask-strip,
  .profile-strip,
  .badge-line {
    margin: 8px 0;
    padding: 9px 10px;
    font-size: 13px;
  }

  .ask-strip strong {
    padding: 6px 8px;
  }

  .stats-grid,
  .entry-grid,
  .status-pair,
  .meta-grid,
  .action-pair,
  .fixed-actions,
  .inline-actions,
  .chip-grid,
  .option-grid {
    gap: 6px;
    margin: 8px 0;
  }

  .stats-grid div,
  .meta-grid div {
    padding: 8px 4px;
  }

  .stats-grid strong,
  .compact strong {
    font-size: 18px;
  }

  .entry-grid a {
    min-height: 62px;
    gap: 2px;
    padding: 8px 6px;
    font-size: 12px;
  }

  .mini-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    transform: scale(0.86);
  }

  .btn,
  .mini-btn,
  .ghost {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .mini-btn,
  .small-btn {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .fixed-actions {
    bottom: calc(var(--tabbar-h) + 7px + env(safe-area-inset-bottom));
    margin-top: 8px;
    padding: 6px;
  }

  .download-card {
    margin-bottom: calc(var(--tabbar-h) + 64px + env(safe-area-inset-bottom));
  }

  .data-notice {
    margin: 7px 0;
    padding: 9px 10px;
  }

  .data-notice div {
    gap: 6px;
    font-size: 12px;
  }

  .data-notice summary,
  .chip-row a,
  .chip-row button {
    font-size: 12px;
  }

  .question-list {
    gap: 7px;
    margin: 8px 0;
  }

  .question-list button,
  .chip-row button,
  .chip-row a,
  .chip-grid button,
  .chip-grid a {
    min-height: 34px;
    padding: 9px 10px;
  }

  .chat-stack {
    gap: 8px;
    margin-bottom: 8px;
  }

  .bubble {
    max-width: 90%;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.48;
  }

  .composer {
    grid-template-columns: 1fr 58px;
    gap: 6px;
    width: min(calc(100vw - 20px), 410px);
    bottom: calc(var(--tabbar-h) + 6px + env(safe-area-inset-bottom));
    padding: 6px;
  }

  .composer textarea {
    min-height: 38px;
    max-height: 104px;
    padding: 9px;
    font-size: 13px;
  }

  .school-card {
    padding-right: 62px;
    padding-bottom: 40px;
  }

  .school-logo {
    width: 48px;
    height: 48px;
    font-size: 19px;
  }

  .school-card h3 {
    font-size: 16px;
  }

  .school-card p,
  .result-line,
  .menu-list em,
  .status-pair span {
    font-size: 12px;
  }

  .tag-row {
    gap: 4px;
    margin: 5px 0;
  }

  .tag-row span,
  .risk {
    padding: 3px 6px;
    font-size: 11px;
  }

  .risk {
    right: 10px;
    top: 10px;
  }

  .small-action {
    right: 10px;
    bottom: 10px;
    min-height: 28px;
  }

  .compare-bar,
  .search-form,
  .tool-form {
    gap: 6px;
    margin: 8px 0;
    padding: 8px;
  }

  .search-form {
    grid-template-columns: 1fr 58px;
  }

  .search-form input,
  .tool-form input,
  .tool-form select,
  .field input,
  .field select,
  .form-card input,
  .form-card select {
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  .field,
  .form-card label {
    gap: 5px;
    margin: 8px 0;
    font-size: 13px;
  }

  .form-card textarea {
    min-height: 104px;
    padding: 10px;
    font-size: 13px;
  }

  .option-grid label {
    padding: 9px;
    font-size: 13px;
  }

  .seg-tabs {
    gap: 5px;
    margin-bottom: 8px;
    padding: 4px;
  }

  .seg-tabs a {
    padding: 8px 6px;
    font-size: 13px;
  }

  .report-hero h2 {
    font-size: 26px;
  }

  .test-card > span {
    height: 44px;
  }

  .major-layout,
  .ency-layout {
    grid-template-columns: 74px 1fr;
    gap: 7px;
  }

  .major-layout aside a,
  .ency-layout aside a {
    padding: 9px 5px;
    font-size: 12px;
  }

  .major-layout main,
  .ency-layout main {
    gap: 8px;
  }

  .major-tile,
  .table-card div,
  .source-list div,
  .compare-grid article,
  .menu-list a,
  .share-button,
  .toc a,
  .toc button {
    padding: 10px;
  }

  .major-tile {
    margin: 6px 0;
    font-size: 13px;
  }

  .share-card {
    min-height: 460px;
  }

  .poster {
    min-height: 210px;
    margin: 14px 0;
    font-size: 23px;
  }

  .page-title h2 {
    font-size: 21px;
  }

  .profile-card dl {
    grid-template-columns: 88px 1fr;
    gap: 10px 8px;
  }
}

@media (min-width: 560px) {
  body {
    padding: 28px 0;
  }

  .phone-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    min-height: 720px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 28px;
  }

  .app-view {
    flex: 1;
    min-height: 0;
  }

  .tabbar {
    bottom: 28px;
    border-radius: 0 0 28px 28px;
  }
}
