/* ==========================================================================
   eat.css —— 「今天吃什么」入口页 + 四个转盘
   --------------------------------------------------------------------------
   页面结构：
   - .hub-*      入口页：选择北洋园 / 卫津路、校内 / 附近
   - .wheel-*    转盘页：转盘、指针、中心按钮
   - .answer-*   结果卡片：只放菜名 + 简介
   ========================================================================== */

/* ==================== 1. 页面外壳 ==================== */
.eat-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: var(--bg);
}

.eat-page main {
  flex: 1 0 auto;
}

/* 站点的 toast 只有 left:50%，手机上长一点会换行，这里让它按内容撑开 */
.eat-page .toast {
  width: max-content;
}

.eat-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.eat-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
}

.eat-back {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
}

.eat-back:hover {
  color: var(--blue-dark);
}

.eat-footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .03em;
}

.eat-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ==================== 2. 入口页 ==================== */
.hub-hero {
  padding: 64px 0 34px;
}

.hub-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 17px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .15em;
  line-height: 1.4;
}

.hub-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.8rem, 5.8vw, 4.35rem);
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: 1.06;
}

.hub-lead {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-bottom: 80px;
}

.campus-card {
  padding: 26px 26px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.campus-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f4fa;
}

.campus-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.2;
}

.campus-head span {
  color: #b0bdcf;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .14em;
}

.campus-links {
  display: flex;
  flex-direction: column;
}

.campus-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 2px;
  border-bottom: 1px solid #f2f6fb;
  text-decoration: none;
  transition: color .2s ease;
}

.campus-link:last-child {
  padding-bottom: 4px;
  border-bottom: 0;
}

.campus-link-main {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
  transition: color .2s ease;
}

.campus-link-sub {
  color: var(--muted);
  font-size: 12px;
}

.campus-link-arrow {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 16px;
  line-height: 1;
  transition: color .2s ease, transform .25s var(--ease);
}

.campus-link:hover .campus-link-main {
  color: var(--blue-dark);
}

.campus-link:hover .campus-link-arrow {
  color: var(--blue);
  transform: translateX(4px);
}

/* ==================== 3. 转盘页：标题和切换 ==================== */
.wheel-hero {
  padding: 38px 0 22px;
}

.wheel-crumb {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
}

.wheel-crumb:hover {
  color: var(--blue-dark);
}

.wheel-title {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: clamp(2.3rem, 4.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: 1.12;
}

.wheel-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.wheel-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}

.wheel-nav a {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.wheel-nav a:hover {
  border-color: #c4d5f4;
  background: #fff;
  color: var(--blue-dark);
}

.wheel-nav a[aria-current="page"] {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 6px 14px rgba(37, 99, 235, .18);
  color: #fff;
}

/* ==================== 4. 转盘 ==================== */
.wheel-app {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, .7fr);
  align-items: center;
  gap: 24px;
  padding-bottom: 64px;
}

.wheel-card {
  width: 100%;
  max-width: 660px;
  justify-self: center;
  padding: 24px 24px 14px;
  border: 1px solid #f0e3d5;
  border-radius: 28px;
  background: #fffaf3;
  box-shadow: var(--shadow-sm);
}

.wheel-stage {
  position: relative;
  display: grid;
  width: min(100%, 480px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  place-items: center;
}

.wheel {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 26px rgba(143, 75, 34, .12));
  transition: opacity .15s ease;
}

.wheel.is-refreshing {
  opacity: 0;
}

.wheel-rotor {
  transform-box: view-box;
  transform-origin: 50% 50%;
  transition: transform 4.2s cubic-bezier(.12, .82, .1, 1);
  will-change: transform;
}

.wheel-sector {
  stroke: #fffaf3;
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.wheel-sector.is-winner {
  stroke: #382216;
  stroke-width: 4;
}

.wheel-label {
  fill: #3f2a1d;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -.015em;
  pointer-events: none;
  user-select: none;
  transition: opacity .18s ease;
}

.wheel.is-labels-hidden .wheel-label {
  opacity: 0;
}

.wheel-label.is-winner {
  font-weight: 800;
}

.wheel-highlight {
  pointer-events: none;
}

.wheel-pointer {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 4;
  width: 28px;
  height: 40px;
  background: linear-gradient(180deg, #4b2f1d 0%, #2a180d 100%);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 6px 8px rgba(56, 34, 22, .25));
  transform: translateX(-50%);
  transform-origin: 50% 0;
}

.wheel-stage.is-spinning .wheel-pointer {
  animation: wheel-tick .16s ease-in-out infinite;
}

@keyframes wheel-tick {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  35% { transform: translateX(-50%) rotate(-5deg); }
  70% { transform: translateX(-50%) rotate(2deg); }
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: grid;
  width: 96px;
  height: 96px;
  padding: 0;
  place-items: center;
  border: 1px solid #f0e3d5;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffffff 0%, #fffaf3 74%);
  box-shadow: 0 12px 26px rgba(143, 75, 34, .18), inset 0 1px 0 #fff;
  color: #382216;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}

.wheel-hub:hover {
  box-shadow: 0 18px 34px rgba(143, 75, 34, .24), inset 0 1px 0 #fff;
  transform: translate(-50%, -50%) scale(1.04);
}

.wheel-hub:disabled {
  cursor: not-allowed;
  opacity: .58;
  transform: translate(-50%, -50%);
}

.wheel-hub-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}

.wheel-stage.is-spinning .wheel-hub-text {
  animation: wheel-hub-pulse .8s ease-in-out infinite;
}

@keyframes wheel-hub-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

.wheel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 4px 2px;
}

.wheel-hint {
  color: #a5886f;
  font-size: 10.5px;
  line-height: 1.6;
}

.wheel-shuffle {
  flex: none;
  padding: 2px 0;
  border: 0;
  background: none;
  color: #8a6242;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color .2s ease;
}

.wheel-shuffle:hover {
  color: #5e3d22;
}

.wheel-shuffle:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ==================== 5. 结果卡片 ==================== */
.answer-card {
  display: flex;
  width: 100%;
  max-width: 380px;
  min-height: 300px;
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.answer-empty {
  text-align: center;
}

.answer-mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1.5px dashed #d9c6b2;
  border-radius: 50%;
  background: #fffaf3;
  color: #c9a98d;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

.answer-empty h2,
.answer-loading h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.35;
}

.answer-empty p,
.answer-loading p {
  max-width: 260px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.answer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.answer-spinner {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  place-items: center;
  border: 1.5px dashed #e6c9ad;
  border-radius: 50%;
  background: #fffaf3;
}

.answer-spinner::before {
  width: 28px;
  height: 28px;
  border: 2px solid #f6e2cc;
  border-top-color: #f97316;
  border-radius: 50%;
  content: "";
  animation: answer-spin .9s linear infinite;
}

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

.answer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.answer-name {
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 2.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1.2;
}

.answer-price {
  flex: none;
  color: #c2410c;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
  white-space: nowrap;
}

.answer-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.9;
}

.answer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.answer-actions .btn {
  padding: 11px 18px;
  font-size: 13px;
}

.answer-actions .btn:disabled {
  opacity: .6;
  cursor: default;
  transform: none;
}

.answer-again {
  padding: 8px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color .2s ease;
}

.answer-again:hover {
  color: var(--blue-dark);
}

/* ==================== 6. 平板 ==================== */
@media (max-width: 980px) {
  .wheel-app {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding-bottom: 48px;
  }

  .wheel-card {
    max-width: 620px;
  }

  .answer-card {
    max-width: 520px;
    min-height: 0;
  }
}

/* ==================== 7. 手机 ==================== */
@media (max-width: 760px) {
  .eat-header-inner {
    min-height: 64px;
    gap: 14px;
  }

  .eat-back {
    font-size: 12px;
  }

  .hub-hero {
    padding: 44px 0 26px;
  }

  .hub-kicker {
    margin-bottom: 14px;
    font-size: 9.5px;
    letter-spacing: .12em;
  }

  .hub-title {
    font-size: clamp(2.4rem, 10vw, 3.2rem);
  }

  .hub-lead {
    margin-top: 15px;
    font-size: 13.5px;
    line-height: 1.8;
  }

  .hub-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding-bottom: 48px;
  }

  .campus-card {
    padding: 22px 22px 16px;
    border-radius: 20px;
  }

  .campus-head h2 {
    font-size: 1.4rem;
  }

  .campus-link {
    padding: 14px 2px;
  }

  .wheel-hero {
    padding: 28px 0 18px;
  }

  .wheel-title {
    margin-top: 12px;
    font-size: clamp(2rem, 8.6vw, 2.7rem);
  }

  .wheel-lead {
    font-size: 13px;
  }

  .wheel-nav {
    gap: 5px;
    margin-top: 18px;
  }

  .wheel-nav a {
    padding: 6px 10px;
    font-size: 10.5px;
  }

  .wheel-card {
    padding: 16px 14px 10px;
    border-radius: 22px;
  }

  .wheel-pointer {
    top: 5px;
    width: 24px;
    height: 34px;
  }

  .wheel-hub {
    width: 84px;
    height: 84px;
  }

  .wheel-hub-text {
    font-size: 24px;
  }

  .wheel-foot {
    padding-top: 6px;
  }

  .wheel-hint {
    font-size: 9.5px;
  }

  .wheel-shuffle {
    font-size: 9.5px;
  }

  .answer-card {
    padding: 22px 20px;
    border-radius: 20px;
  }

  .answer-name {
    font-size: 1.8rem;
  }

  .answer-price {
    font-size: 16px;
  }

  .answer-note {
    font-size: 13px;
  }

  .answer-actions {
    margin-top: 22px;
  }

  .answer-actions .btn {
    flex: 1;
  }

  .eat-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 380px) {
  .wheel-nav a {
    padding: 5px 8px;
    font-size: 9.5px;
  }

  .wheel-hub {
    width: 76px;
    height: 76px;
  }

  .wheel-hub-text {
    font-size: 22px;
  }

  .hub-title {
    font-size: 2.2rem;
  }
}

/* ==================== 8. 降低动效 ==================== */
@media (prefers-reduced-motion: reduce) {
  .wheel-rotor {
    transition-duration: .5s !important;
  }

  .wheel-stage.is-spinning .wheel-pointer,
  .wheel-stage.is-spinning .wheel-hub-text,
  .answer-spinner::before {
    animation: none;
  }
}
