@font-face {
  font-family: 'App Icons';
  src: url('./assets/icons.woff2') format('woff2');
  font-display: block;
}

:root {
  color-scheme: dark;
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
  color: #faf3f6;
  background: #17131e;
  --surface: #221c2a;
  --border: #362d40;
  --muted: #b9aebf;
  --pink: #ff98ac;
  --lime: #dbe993;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled { cursor: default; opacity: .55; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.icon {
  font-family: 'App Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 21px;
  line-height: 1;
  letter-spacing: normal;
  display: inline-block;
  white-space: nowrap;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  flex: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  white-space: nowrap;
  overflow: hidden;
}

.frame { width: min(1140px, calc(100% - 64px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid #2d2536; background: #191520; }
.header-inner { height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 19px; font-weight: 750; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; color: #261a24; background: var(--pink); }
.brand-dot { color: var(--pink); margin-left: 2px; }
.location-button, .filter, .secondary {
  color: #f4eaf2;
  background: #2a2233;
  border: 1px solid #3d3348;
  border-radius: 10px;
}
.location-button { min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; gap: 7px; min-width: 0; font-size: 13px; }
.location-label { max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-button .icon:first-child { color: var(--pink); font-size: 19px; }
.chevron { color: var(--muted); font-size: 19px; }
.location-button:hover, .secondary:hover, .filter:focus-within { background: #372b40; }

.intro { padding: 38px 0 27px; }
.intro h1 { font-size: clamp(42px, 5vw, 66px); font-weight: 850; letter-spacing: -.085em; line-height: 1.13; }
.intro h1 span { color: var(--pink); }
.intro p { margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.6; }

.filters { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin-bottom: 23px; }
.filter-title { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.filter-title .icon { color: var(--lime); }
.filter { position: relative; display: flex; align-items: center; min-height: 38px; font-size: 13px; }
.filter-symbol { color: var(--pink); font-size: 17px; }
.filter .currency { position: absolute; left: 11px; pointer-events: none; font-size: 16px; font-weight: 700; }
.filter .chevron { position: absolute; right: 8px; pointer-events: none; }
.filter select { appearance: none; padding: 8px 32px 8px 29px; border: none; color: inherit; background: transparent; border-radius: 9px; }
.range { padding: 0 11px; gap: 7px; white-space: nowrap; }
.total { margin-left: auto; color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.total strong { color: var(--lime); font-weight: 700; }

.featured { display: grid; grid-template-columns: 1.16fr 1fr; border-radius: 19px; overflow: hidden; min-height: 342px; border: 1px solid #413249; background: #271e30; }
.featured-cover {
  --cover-bg: #282137;
  --cover-edge: #493852;
  --cover-ink: #ffd4df;
  position: relative;
  isolation: isolate;
  min-height: 290px;
  padding: 30px clamp(24px, 4vw, 55px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 15px;
  color: var(--cover-ink);
  background: radial-gradient(ellipse at 88% 4%, var(--cover-edge), transparent 65%), var(--cover-bg);
}
.featured-cover::before, .featured-cover::after {
  content: '';
  position: absolute;
  z-index: -1;
  border: 1px solid color-mix(in srgb, var(--cover-ink) 23%, transparent);
  width: min(370px, 85%);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  right: -13%;
  bottom: -44%;
  box-shadow: 0 0 0 26px color-mix(in srgb, var(--cover-ink) 9%, transparent),
    0 0 0 62px color-mix(in srgb, var(--cover-ink) 5%, transparent);
}
.featured-cover::after { transform: scale(.65); box-shadow: none; right: -11%; bottom: -48%; }
.featured-cover .icon { font-size: 25px; }
.featured-cover > span:not(.icon, .photo-caption) { font-size: clamp(29px, 4.1vw, 56px); font-weight: 800; line-height: 1.12; letter-spacing: -.065em; overflow-wrap: anywhere; }
.featured-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-caption { position: absolute; bottom: 12px; left: 12px; padding: 4px 8px; border-radius: 5px; background: #17131edd; color: #faf3f6; font-size: 12px; }
.featured-photo[hidden] + .photo-caption { display: none; }
.cover-noodle { --cover-bg: #33222d; --cover-edge: #614054; --cover-ink: #ffd7b1; }
.cover-rice { --cover-bg: #222b24; --cover-edge: #48553a; --cover-ink: #e9efae; }
.cover-sandwich { --cover-bg: #332126; --cover-edge: #6c4140; --cover-ink: #ffccad; }
.cover-house { --cover-bg: #242638; --cover-edge: #45415e; --cover-ink: #eae0ff; }
.cover-dessert { --cover-bg: #382335; --cover-edge: #69465d; --cover-ink: #ffd6e7; }
.cover-ready { align-items: center; }
.cover-ready .icon { font-size: clamp(76px, 12vw, 154px); transform: rotate(-14deg); }
.featured-body { position: relative; isolation: isolate; display: flex; align-items: flex-start; flex-direction: column; justify-content: center; padding: 30px clamp(24px, 3.3vw, 45px); background: linear-gradient(125deg, #292131, #342536); }
.featured-body::after { position: absolute; z-index: -1; top: -120px; right: -120px; width: 265px; height: 265px; border: 1px solid #ffa7b627; border-radius: 50%; box-shadow: 0 0 0 26px #ffa7b610, 0 0 0 54px #ffa7b609; content: ''; pointer-events: none; }
.result-label { display: inline-flex; align-items: center; gap: 6px; color: var(--lime); background: #dbe99313; border: 1px solid #dbe99332; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 650; }
.result-label .icon { font-size: 16px; }
.featured h2 { margin-top: 14px; font-size: clamp(25px, 3.2vw, 42px); letter-spacing: -.063em; line-height: 1.18; overflow-wrap: anywhere; }
.featured:has(.result-label) h2 { font-size: clamp(24px, 2.6vw, 35px); letter-spacing: -.04em; }
.featured-address { margin-top: 10px; line-height: 1.55; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.details { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; }
.featured .details { margin-top: 19px; }
.detail { font-size: 13px; color: #e0d6e3; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.detail .icon { color: #c1b5c8; font-size: 16px; }
.detail.rating .icon { color: var(--lime); }
.price { color: var(--pink); font-weight: 700; }
.divider { width: 1px; height: 13px; background: #544357; }
.featured-actions { display: flex; gap: 10px; margin-top: 25px; flex-wrap: wrap; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; min-height: 43px; border-radius: 10px; font-size: 14px; font-weight: 720; }
.primary { color: #2b1825; border: 1px solid transparent; background: var(--pink); }
.primary:hover { background: #ffacbd; }
.primary:active { transform: translateY(1px); }
.featured-actions .primary { padding-inline: 20px; }
.secondary .icon, .primary .icon { font-size: 19px; }

.nearby { margin-top: 30px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 14px; }
.section-heading h2 { font-size: 24px; letter-spacing: -.045em; }
.text-button { border: none; padding: 4px 0 4px 8px; color: var(--pink); background: transparent; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.text-button .icon { font-size: 17px; }
.browse-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: min(255px, 53%);
  min-height: 40px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.browse-search:focus-within { border-color: var(--pink); }
.browse-search input { width: 100%; min-width: 0; padding: 6px 0; border: 0; color: inherit; background: transparent; font-size: 13px; }
.browse-search input:focus { outline: none; }
.browse-search input::placeholder { color: var(--muted); }
.restaurant-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.restaurant-list article { display: flex; flex-direction: column; align-items: start; min-width: 0; }
.candidate-menu { min-height: 36px; padding-inline: 10px; }
.restaurant-button { display: flex; align-items: center; color: inherit; width: 100%; height: 100%; text-align: left; padding: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; transition: border-color .18s, transform .18s; }
.restaurant-button:hover { border-color: #98677f; transform: translateY(-3px); }
.restaurant-button[aria-pressed="true"] { border-color: var(--pink); }
.restaurant-body { display: block; flex: 1; min-width: 0; padding: 13px 14px 15px; }
.thumbnail-cover { position: relative; display: grid; place-items: center; width: clamp(38px, 7vw, 66px); aspect-ratio: 1; flex: none; overflow: hidden; border-radius: 8px; background: radial-gradient(ellipse at 90% 5%, var(--cover-edge), var(--cover-bg)); color: var(--cover-ink); }
.thumbnail-cover .icon { font-size: 22px; }
.restaurant-thumbnail { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.restaurant-button .thumbnail-cover { margin-right: 10px; }
.restaurant-name { display: block; font-size: 16px; font-weight: 720; overflow-wrap: anywhere; }
.restaurant-body .details { margin-top: 8px; gap: 11px; }
.restaurant-body .detail { font-size: 12px; }
.restaurant-body .detail .icon { font-size: 14px; }
.restaurant-dish { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.list-message { grid-column: 1 / -1; border: 1px dashed var(--border); border-radius: 12px; padding: 20px; color: var(--muted); font-size: 14px; }

.footer { display: flex; align-items: center; gap: 7px; color: #a69aaf; font-size: 12px; margin-top: 27px; margin-bottom: 22px; border-top: 1px solid var(--border); padding-top: 17px; }
.footer .icon { font-size: 16px; color: var(--pink); }

.result-sources { margin-top: 13px; color: var(--muted); font-size: 12px; }
.result-sources a { text-decoration: underline; text-underline-offset: 3px; }
.result-sources a:hover { color: var(--pink); }
.retry { margin-top: 16px; }

.subsidy-switch { gap: 7px; padding: 0 10px; cursor: pointer; white-space: nowrap; }
.subsidy-switch:has(input:checked) { color: var(--lime); border-color: #879351; background: #33382c; }
.subsidy-switch input, .subsidy-choice input { margin: 0; width: 15px; height: 15px; accent-color: var(--lime); cursor: pointer; flex: none; }
.subsidy-manage { padding-inline: 4px; }
.subsidy-badge { color: var(--lime); background: #dbe99314; border: 1px solid #dbe99336; padding: 2px 6px; border-radius: 5px; font-size: 11px; white-space: nowrap; }
#subsidy-dialog { width: min(480px, calc(100% - 32px)); padding: 22px; border: 1px solid #4c3a54; border-radius: 17px; color: inherit; background: #282030; }
#subsidy-dialog::backdrop { background: #100c17bd; backdrop-filter: blur(3px); }
.subsidy-form h2 { font-size: 23px; }
.subsidy-form p { color: var(--muted); margin-top: 7px; font-size: 13px; line-height: 1.5; }
.subsidy-list { display: grid; gap: 5px; max-height: min(45vh, 360px); overflow: auto; margin: 16px 0; }
.subsidy-choice { display: flex; align-items: center; gap: 11px; cursor: pointer; padding: 9px 10px; min-height: 48px; border-radius: 8px; background: #33293b; }
.subsidy-choice:hover { background: #3a2e43; }
.subsidy-choice strong, .subsidy-choice span span { display: block; font-size: 13px; }
.subsidy-choice span span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.subsidy-form .primary { display: flex; margin-left: auto; }

@media (max-width: 790px) {
  .frame { width: calc(100% - 40px); }
  .featured { grid-template-columns: 1fr 1fr; }
  .featured-body { padding: 24px 19px; }
  .details { gap: 8px; }
  .restaurant-list { gap: 10px; }
  .restaurant-body { padding-inline: 10px; }
}

@media (max-width: 580px) {
  .frame { width: calc(100% - 32px); }
  .header-inner { height: 59px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .location-label { max-width: 110px; }
  .intro { padding-block: 27px 21px; }
  .intro p { font-size: 13px; }
  .filters { padding: 10px; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
  .filter-title { gap: 3px; margin-right: 1px; font-size: 12px; }
  .filter-title .icon { font-size: 17px; }
  .filter { min-height: 34px; font-size: 12px; }
  .total { font-size: 11px; }
  .featured { grid-template-columns: 1fr; }
  .featured-cover { min-height: 155px; gap: 9px; }
  .featured-cover:has(.featured-photo:not([hidden])) { min-height: 0; aspect-ratio: 16 / 10; }
  .featured-body { padding: 20px; }
  .featured h2 { font-size: 30px; }
  .featured-actions { margin-top: 20px; }
  .nearby { margin-top: 24px; }
  .section-heading h2 { font-size: 21px; }
  .restaurant-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

#open-catalog { margin-left: auto; white-space: nowrap; }
#catalog-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: clamp(14px, 4vw, 23px);
  border: 1px solid #4c3a54;
  border-radius: 17px;
  color: inherit;
  background: #282030;
}
#catalog-dialog[open] { display: flex; flex-direction: column; gap: 10px; }
#catalog-dialog::backdrop { background: #100c17bd; backdrop-filter: blur(3px); }
.catalog-heading, .catalog-filters, .catalog-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.catalog-heading h2 { font-size: 24px; }
.catalog-intro, #catalog-total, #catalog-page { color: var(--muted); font-size: 13px; line-height: 1.45; }
.catalog-filters .browse-search { flex: 1; max-width: none; }
.catalog-filters select, .catalog-price input {
  min-height: 40px;
  padding: 6px 8px;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
#catalog-list { min-height: 0; overflow-y: auto; }
.catalog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 3px;
  border-bottom: 1px solid var(--border);
}
.catalog-row-main { flex: 1; min-width: 0; }
.catalog-row a { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.catalog-row a:hover { text-decoration: underline; }
.catalog-row p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.catalog-row .catalog-unpriced { color: #f7c88d; }
.catalog-row-details { display: flex; align-items: center; flex-wrap: wrap; column-gap: 8px; }
.catalog-row-details .text-button { padding-inline: 0; min-height: 30px; }
.catalog-pick { min-width: 94px; white-space: nowrap; }
.catalog-pick[aria-pressed="true"] { border-color: #879351; color: var(--lime); }
.catalog-price { display: flex; gap: 5px; align-items: center; flex: none; }
.catalog-price input { width: 75px; }
.catalog-row .secondary, .catalog-row .primary { min-height: 40px; padding-inline: 10px; font-size: 13px; }

#menu-dialog {
  width: min(550px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: clamp(14px, 4vw, 23px);
  border: 1px solid #4c3a54;
  border-radius: 17px;
  color: inherit;
  background: #282030;
}
#menu-dialog::backdrop { background: #100c17bd; backdrop-filter: blur(3px); }
#menu-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#menu-content { overflow-y: auto; min-height: 0; padding-bottom: 8px; }
#menu-title { font-size: clamp(18px, 4vw, 23px); overflow-wrap: anywhere; }
#menu-dialog form { flex: none; }
#menu-content h3 { margin-top: 17px; font-size: 16px; }
.menu-address, .menu-empty { margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.menu-items { margin: 8px 0 0; padding: 0; list-style: none; }
.menu-items li { border-bottom: 1px solid var(--border); }
.menu-choice { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 6px; font-size: 14px; cursor: pointer; }
.menu-choice:has(input:checked) { background: #dbe99314; border-radius: 5px; }
.menu-choice input { accent-color: var(--lime); flex: none; }
.menu-choice span { flex: 1; }
.menu-items strong { color: var(--lime); white-space: nowrap; }
.menu-custom { display: grid; gap: 6px; margin-top: 12px; font-size: 14px; }
.menu-custom input { width: 100%; min-height: 40px; padding: 6px 9px; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.menu-footer { border-top: 1px solid var(--border); padding-top: 10px; }
#menu-selection { margin-bottom: 8px; font-size: 13px; color: var(--lime); max-height: 3em; overflow: auto; }
.chosen-dish { display: block; color: var(--lime); }
.chosen-dish:empty, #menu-selection:empty { display: none; }
.menu-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 580px) {
  .section-heading { flex-wrap: wrap; }
  .section-heading .browse-search { flex-basis: 100%; max-width: none; }
  .catalog-row { gap: 8px; }
  .catalog-row:has(.catalog-price) .thumbnail-cover { display: none; }
}
