:root {
  --v2-orange: #ff6900;
  --v2-orange-dark: #f05e00;
  --v2-orange-soft: #fff3e9;
  --v2-ink: #181818;
  --v2-muted: #77797d;
  --v2-line: #e2e2e2;
  --v2-bg: #fafafa;
}

html,
body {
  background: #f2f2f2;
  color: var(--v2-ink);
}

body {
  padding: 0;
}

.app {
  width: min(430px, 100%);
  height: 100dvh;
  border-radius: 0;
  background: var(--v2-bg);
  box-shadow: 0 0 50px #00000010;
}

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

button:focus {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #ff8b3d;
  outline-offset: 2px;
}

.topbar {
  height: 72px;
  padding: 0 20px;
  border-bottom: 1px solid var(--v2-line);
  background: #fff;
}

.brand {
  gap: 8px;
  font-size: 18px;
  white-space: nowrap;
}

.brand svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #9b9da1;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-actions {
  gap: 8px;
  min-width: 0;
}

.group-pill {
  max-width: 145px;
  border: 0;
  border-radius: 999px;
  background: var(--v2-orange-soft);
  color: var(--v2-orange-dark);
  padding: 10px 13px;
  font-size: 12px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: #f5f5f5;
  color: #333;
  font-size: 16px;
}

.content {
  padding-bottom: 86px;
  background: var(--v2-bg);
}

.view {
  padding: 20px 15px 0;
}

.location-card {
  min-height: 58px;
  border: 1px solid var(--v2-line);
  border-radius: 15px;
  padding: 0 16px;
  box-shadow: none;
}

.location,
.weather {
  color: #3e3f41;
  font-size: 13px;
  font-weight: 500;
}

.location i {
  margin-right: 7px;
  color: var(--v2-orange);
  font-size: 19px;
  font-style: normal;
}

.weather strong {
  color: var(--v2-orange);
  font-size: 16px;
}

.weather small {
  margin-left: 6px;
  background: var(--v2-orange-soft);
  color: #976332;
}

.hero {
  min-height: 474px;
  margin-top: 20px;
  border: 1px solid var(--v2-line);
  border-radius: 18px;
  padding: 44px 30px 28px;
  box-shadow: none;
  justify-content: flex-start;
}

.dice {
  width: 78px;
  height: 78px;
  margin: 88px 0 28px;
  filter: drop-shadow(0 10px 8px #0002);
  transform: scale(1.12);
}

.result {
  min-height: auto;
  color: #111;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.8px;
}

.result.highlight {
  color: #111;
  font-size: 38px;
}

.hint {
  min-height: 28px;
  margin-top: 16px;
  color: #818181;
  font-size: 15px;
  line-height: 1.6;
}

.available-count {
  display: inline-block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e7e7e7;
  color: #777;
  font-size: 13px;
}

.available-count strong {
  color: var(--v2-orange);
}

.pick-main {
  margin-top: auto;
  min-height: 62px;
  border-radius: 12px;
  background: linear-gradient(105deg, #ff7900, #ff5d00);
  box-shadow: 0 12px 24px #ff690028;
  font-size: 16px;
}

.decision-actions {
  width: 100%;
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid #e8e8e8;
}

.decision-actions button {
  min-height: 60px;
  border-radius: 12px;
}

.decision-secondary {
  border-color: var(--v2-orange);
  color: var(--v2-orange);
}

.decision-primary {
  background: linear-gradient(105deg, #ff7900, #ff5d00);
}

.decision-helper {
  min-height: 0;
  margin-top: 10px;
}

.result-status-chip {
  top: 20px;
  left: 20px;
  right: auto;
  border-radius: 7px;
  background: var(--v2-orange-soft);
  color: #9a5c2a;
  font-size: 13px;
}

.hero.has-result .dice {
  display: none;
}

.hero.has-result {
  min-height: 360px;
  justify-content: center;
  padding-top: 76px;
}

.hero.has-result .hint {
  max-width: 290px;
}

.chat {
  width: 100%;
  min-height: 68px;
  margin-top: 22px;
  border: 1px solid var(--v2-line);
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 15px;
  color: #747474;
  text-align: left;
}

.chat b {
  margin: 0;
  padding: 0;
  background: transparent;
  color: #555;
}

.chat > i {
  margin-left: auto;
  color: #999;
  font-size: 28px;
  font-style: normal;
}

.canteen-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3f3f3;
  color: #222;
  font-size: 24px;
}

.section-head {
  margin: 0 0 15px;
}

.section-title {
  color: #202124;
  font-size: 24px;
  letter-spacing: -.4px;
}

[data-view="foods"] .section-title {
  font-size: 24px;
}

[data-view="foods"] .section-title span {
  margin-left: 8px;
  color: #888;
  font-size: 15px;
  font-weight: 500;
}

[data-view="foods"] .section-sub {
  display: none;
}

.section-sub {
  max-width: 140px;
  overflow: hidden;
  color: #858585;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  grid-template-columns: minmax(0, 1fr) 106px;
  gap: 10px;
}

.toolbar .search-btn {
  display: none;
}

.input,
.select {
  min-height: 48px;
  border-color: #dadada;
  border-radius: 12px;
  color: #2c2c2c;
}

.toolbar .input {
  padding-left: 42px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 14px center;
}

#showAddBtn {
  min-height: 50px;
  border-radius: 11px;
  background: linear-gradient(105deg, #ff7900, #ff5d00);
  font-size: 15px;
}

.import-box {
  margin-top: 12px;
  padding: 14px 2px;
  border-top: 1px solid var(--v2-line);
  border-bottom: 1px solid var(--v2-line);
}

.import-box summary {
  color: #4d4d4d;
  font-size: 13px;
}

#importStatus {
  color: #378d72;
}

.restaurant-list {
  gap: 12px;
}

.restaurant-card {
  border: 1px solid var(--v2-line);
  border-radius: 16px;
  padding: 17px 15px 12px;
  box-shadow: none;
}

.restaurant-name {
  font-size: 18px;
}

.restaurant-card .meta {
  margin-top: 8px;
  color: #737373;
}

.restaurant-card .tag {
  margin-top: 10px;
  background: #f2f2f2;
  color: #666;
}

.location-tag,
.featured {
  display: none;
}

.select-btn {
  min-height: 40px;
  border: 1px solid #ffd0ad;
  border-radius: 10px;
  background: #fff8f2;
  color: var(--v2-orange);
}

.card-menu summary {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.rating-row {
  margin-top: 13px;
  padding: 12px 0;
}

.rating-row::before {
  content: "我的评分";
  color: #777;
  font-size: 12px;
  white-space: nowrap;
}

.rating-row .rating-copy {
  display: none;
}

.star {
  font-size: 22px;
}

.card-foot {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.visit-stepper {
  grid-template-columns: 32px 28px 32px;
  border-color: #ffb26f;
}

#addPanel {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(430px, 100vw);
  max-height: 84dvh;
  margin: 0 !important;
  overflow: auto;
  transform: translateX(-50%);
  border-radius: 26px 26px 0 0;
  background: #fff;
  padding: 24px 22px max(25px, env(safe-area-inset-bottom));
  box-shadow: 0 0 0 100vmax #0007, 0 -14px 40px #0002;
}

#addPanel::before {
  content: "";
  width: 40px;
  height: 4px;
  margin: -14px auto 6px;
  border-radius: 99px;
  background: #d4d4d4;
}

#addPanel h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.restaurant-form-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.restaurant-field,
.restaurant-field.full {
  grid-column: 1;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 7px;
}

.restaurant-field label {
  color: #333;
  font-size: 13px;
}

.availability-row {
  min-height: 65px;
  padding: 10px 0;
  border-width: 1px 0 0;
  border-radius: 0;
}

#addPanel .form-actions {
  margin-top: 8px;
}

#addPanel .form-actions button {
  min-height: 52px;
}

.stats-page-title {
  margin: -7px 0 42px 3px;
  font-size: 24px;
  font-weight: 900;
}

[data-view="stats"] .section-title {
  font-size: 22px;
}

.chart-mark {
  color: var(--v2-orange);
}

.stats-grid {
  gap: 15px;
}

.stat-card {
  border: 1px solid var(--v2-line);
  border-radius: 16px;
  box-shadow: none;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 13px 0;
}

.stats-summary .big-stat {
  padding: 9px 4px;
  border-right: 1px solid var(--v2-line);
}

.stats-summary .big-stat:last-child {
  border-right: 0;
}

.big-stat strong {
  color: var(--v2-orange);
  font-size: 26px;
}

.ranking-card,
.distribution-card {
  padding: 19px 16px;
}

.stat-card h3 {
  border: 0;
  font-size: 17px;
}

.rank {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid #eee;
  border-radius: 0;
  background: #fff;
}

.rank-index {
  color: var(--v2-orange);
  font-size: 15px;
}

.rank-copy {
  min-width: 0;
}

.rank-copy strong {
  display: block;
  overflow: hidden;
  color: #272727;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-bar,
.distribution-bar {
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #eee;
}

.rank-bar i,
.distribution-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--v2-orange);
}

.rank-count {
  color: var(--v2-orange);
  font-size: 14px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 70px;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  color: #666;
  font-size: 13px;
}

.distribution-row > span:last-child {
  text-align: right;
}

[data-view="history"] .section-head {
  margin-bottom: 12px;
}

[data-view="history"] .section-title {
  font-size: 25px;
}

#clearHistoryBtn {
  min-height: 40px;
  font-size: 14px;
}

.history-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 8px 0 24px;
  overflow: hidden;
  border: 1px solid var(--v2-line);
  border-radius: 13px;
  background: #fff;
}

.history-summary > div {
  min-height: 85px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-right: 1px solid var(--v2-line);
}

.history-summary > div:last-child {
  border-right: 0;
}

.history-summary span {
  color: #777;
  font-size: 13px;
}

.history-summary strong {
  max-width: 145px;
  overflow: hidden;
  color: var(--v2-orange);
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-summary small {
  color: #444;
  font-size: 15px;
  font-weight: 500;
}

.history-day h3 {
  margin: 19px 4px 10px;
  font-size: 17px;
}

.history-day h3 small {
  margin-left: 8px;
  color: #777;
  font-size: 13px;
  font-weight: 500;
}

.history-day-card {
  overflow: hidden;
  border: 1px solid var(--v2-line);
  border-radius: 13px;
  background: #fff;
}

.history-item {
  min-height: 61px;
  margin: 0 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  border-radius: 0;
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item > div {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  align-items: center;
}

.history-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item .history-category {
  color: #777;
  font-size: 12px;
}

.history-item .history-time {
  margin-left: 8px;
  color: #777;
  font-size: 12px;
}

.history-item .history-state {
  margin-left: 8px;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 4px 6px;
  color: #777;
  font-size: 10px;
}

.history-empty {
  min-height: 440px;
  margin-top: 105px;
  border: 1px solid var(--v2-line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px;
  color: #777;
  text-align: center;
}

.history-empty .empty-art {
  color: #777;
  font-size: 64px;
}

.history-empty strong {
  margin: 20px 0 12px;
  color: #222;
  font-size: 22px;
}

.history-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
}

.history-empty button {
  width: 160px;
  min-height: 48px;
  margin-top: 28px;
}

.bottom-nav {
  height: 78px;
  border-top-color: var(--v2-line);
  padding: 5px 12px max(5px, env(safe-area-inset-bottom));
}

.nav-btn {
  gap: 2px;
  border-radius: 13px;
  color: #747474;
  font-size: 12px;
}

.nav-btn svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-btn.active {
  background: linear-gradient(135deg, #ff7900, #ff5d00);
  color: #fff;
}

.drawer-backdrop {
  background: #0006;
}

.drawer {
  max-height: 82%;
  border-radius: 26px 26px 0 0;
  padding: 24px 15px max(25px, env(safe-area-inset-bottom));
}

.drawer-head h2 {
  font-size: 22px;
}

.close {
  width: 38px;
  height: 38px;
  font-size: 24px;
}

.current-group-card {
  border-color: var(--v2-orange);
  border-radius: 14px;
  padding: 18px;
}

.current-group-card h3 {
  font-size: 25px;
}

.current-primary-actions button,
.group-entry-actions button {
  min-height: 52px;
}

.member-nav,
.group-option {
  min-height: 72px;
  border-radius: 14px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 92px;
  margin-bottom: 14px;
  border-color: var(--v2-line);
  background: #fff;
}

.account-avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #efeeee;
  color: #4b4b4b;
  font-size: 23px;
}

.account-card strong {
  font-size: 20px;
}

.account-card small {
  display: block;
  margin-top: 5px;
}

.account-links {
  overflow: hidden;
  border: 1px solid var(--v2-line);
  border-radius: 14px;
}

.account-links button {
  width: 100%;
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid var(--v2-line);
  background: #fff;
  display: grid;
  grid-template-columns: 42px 1fr auto 18px;
  align-items: center;
  gap: 6px;
  text-align: left;
}

.account-links button:last-child {
  border-bottom: 0;
}

.account-links button > span {
  color: #777;
  font-size: 28px;
}

.account-links button b {
  font-size: 15px;
}

.account-links button small {
  max-width: 140px;
  overflow: hidden;
  color: var(--v2-orange);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-links button i {
  color: #888;
  font-size: 24px;
  font-style: normal;
}

#logoutBtn {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  border-color: #ff4d3d;
  color: #f04436;
  font-size: 16px;
}

.help-drawer {
  padding-top: 14px;
}

.drawer-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 99px;
  background: #d3d3d3;
}

.help-drawer .drawer-head {
  justify-content: center;
  position: relative;
}

.help-drawer .close {
  position: absolute;
  right: 0;
}

.help-steps {
  display: grid;
  gap: 14px;
  margin: 24px 0 30px;
}

.help-steps article {
  min-height: 86px;
  border: 1px solid var(--v2-line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px;
}

.help-steps article > b {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--v2-orange);
  color: #fff;
  font-size: 18px;
}

.help-steps strong {
  font-size: 15px;
}

.help-steps p {
  margin: 6px 0 0;
  color: #777;
  font-size: 12px;
}

.help-drawer > .orange-btn {
  min-height: 54px;
  font-size: 16px;
}

.auth-gate {
  padding: 28px 15px;
  background: #fff;
  align-items: flex-start;
  overflow: auto;
}

.auth-card {
  max-width: 400px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.auth-brand {
  padding: 104px 0 40px;
  text-align: center;
}

.auth-logo {
  width: auto;
  height: auto;
  margin: 0 0 20px;
  background: transparent;
  font-size: 58px;
  filter: drop-shadow(0 10px 10px #0002);
}

.auth-card h1 {
  font-size: 43px;
  font-weight: 950;
  letter-spacing: -2px;
}

.auth-brand p {
  margin: 17px 0 0;
  color: #777;
  font-size: 17px;
  letter-spacing: 2px;
}

.auth-panel {
  overflow: hidden;
  border: 1px solid var(--v2-line);
  border-radius: 16px;
  background: #fff;
}

.auth-tabs {
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: #fff;
}

.auth-tab {
  min-height: 64px;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  color: #555;
  font-size: 18px;
}

.auth-tab.active {
  border-color: var(--v2-orange);
  color: var(--v2-orange);
  box-shadow: none;
}

.auth-form {
  gap: 14px;
  padding: 25px 12px 22px;
}

.auth-field {
  min-height: 64px;
  border: 1px solid #d7d7d7;
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 15px;
}

.field-icon {
  width: 34px;
  color: #222;
  font-size: 27px;
}

.auth-field .input {
  min-height: 62px;
  border: 0;
  padding: 0 8px;
  box-shadow: none;
  font-size: 16px;
}

.auth-options {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 12px;
  color: #555;
  font-size: 13px;
}

.auth-options input {
  accent-color: var(--v2-orange);
}

.auth-form .orange-btn {
  min-height: 62px;
  border-radius: 11px;
  background: linear-gradient(105deg, #ff7900, #ff5d00);
  font-size: 19px;
}

.auth-panel > .status {
  padding: 0 18px 12px;
  text-align: center;
}

.auth-note {
  margin-top: 26px;
  color: #555;
  font-size: 15px;
}

.auth-note button {
  border: 0;
  background: transparent;
  color: var(--v2-orange);
}

@media (max-height: 760px) {
  .auth-brand {
    padding-top: 45px;
  }

  .hero {
    min-height: 410px;
  }

  .dice {
    margin-top: 58px;
  }
}

@media (min-width: 451px) {
  body {
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 360px) {
  .topbar {
    padding: 0 12px;
  }

  .brand span {
    display: none;
  }

  .group-pill {
    max-width: 160px;
  }
}
