:root {
  color-scheme: dark;
  --ink: #f7edda;
  --ink-soft: #d8cbb5;
  --muted: #9b8e7c;
  --bg: #100d0c;
  --panel: #191411;
  --panel-raised: #211a16;
  --line: rgba(244, 218, 173, 0.16);
  --line-strong: rgba(244, 218, 173, 0.32);
  --amber: #dfa849;
  --amber-soft: #f1ce87;
  --wine: #8f3042;
  --wine-light: #c85d6f;
  --positive: #8ec7a5;
  --negative: #e9907f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 4%, rgba(143, 48, 66, 0.18), transparent 34rem),
    radial-gradient(circle at 8% 42%, rgba(223, 168, 73, 0.07), transparent 26rem),
    var(--bg);
}

body:has(dialog[open]) {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--amber-soft);
  outline-offset: 3px;
}

a {
  color: inherit;
}

.page-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(105deg, rgba(16, 13, 12, 0.22), rgba(16, 13, 12, 0.92)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 95px,
      rgba(247, 237, 218, 0.025) 96px
    );
}

.page-header::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 560px;
  right: clamp(30px, 11vw, 180px);
  bottom: -320px;
  border: 1px solid rgba(223, 168, 73, 0.2);
  border-radius: 46% 46% 12% 12%;
  box-shadow:
    inset 0 0 0 18px rgba(223, 168, 73, 0.015),
    0 0 120px rgba(143, 48, 66, 0.18);
  transform: rotate(8deg);
  pointer-events: none;
}

.top-nav,
.hero,
.page-main {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.top-nav {
  position: relative;
  z-index: 1;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-mark,
.back-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mark-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(223, 168, 73, 0.7);
}

.back-link {
  color: var(--ink-soft);
}

.back-link::before {
  content: "←";
  margin-right: 8px;
  color: var(--amber);
}

.hero {
  position: relative;
  z-index: 1;
  min-height: 500px;
  padding: clamp(70px, 10vw, 128px) 0 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(50px, 9vw, 130px);
}

.hero-copy {
  width: min(690px, 100%);
}

.kicker,
.section-kicker {
  margin: 0 0 13px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(70px, 10.6vw, 138px);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.07em;
}

.hero-description {
  width: min(600px, 100%);
  margin: 27px 0 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.75;
}

.primary-action,
.secondary-action,
.vote-submit {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 850;
}

.primary-action {
  margin-top: 32px;
  background: var(--amber);
  color: #211406;
  box-shadow: 0 12px 34px rgba(223, 168, 73, 0.18);
}

.primary-action:hover {
  background: var(--amber-soft);
}

.secondary-action {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.hero-stats {
  min-width: 165px;
  margin: 0;
  border-left: 1px solid var(--line-strong);
}

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

.hero-stats div + div {
  border-top: 1px solid var(--line);
}

.hero-stats dt {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--amber-soft);
  font-size: 42px;
  line-height: 1;
}

.hero-stats dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.page-main {
  padding-block: 74px 100px;
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-title-row h2,
.dialog-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.privacy-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.filter-panel {
  margin-top: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-field,
.sort-field {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(25, 20, 17, 0.82);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.search-field svg {
  width: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-field input::placeholder {
  color: #71665a;
}

.sort-field {
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

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

.sort-field select {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
}

.sort-field option {
  background: var(--panel);
}

.tag-filter {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subtag-filter {
  margin-top: 9px;
  border-left: 2px solid rgba(223, 168, 73, 0.32);
  padding-left: 12px;
}

.subtag-filter::before {
  content: "细分";
  align-self: center;
  margin-right: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.tag-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.tag-chip:hover,
.tag-chip.is-active {
  border-color: rgba(223, 168, 73, 0.64);
  background: rgba(223, 168, 73, 0.1);
  color: var(--amber-soft);
}

.result-meta {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--amber);
  font-size: 13px;
  font-weight: 800;
}

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

.drink-card {
  min-width: 0;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(150deg, rgba(143, 48, 66, 0.1), transparent 36%),
    rgba(25, 20, 17, 0.9);
  box-shadow: var(--shadow);
}

.drink-card:hover {
  border-color: rgba(223, 168, 73, 0.35);
  transform: translateY(-2px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-score {
  color: var(--amber-soft);
  font-weight: 900;
}

.card-title {
  margin: 24px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  overflow: hidden;
  background: #100c0a;
}

.card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 240ms ease;
}

a.card-media:hover img {
  transform: scale(1.025);
}

.card-tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tag {
  border: 0;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(223, 168, 73, 0.1);
  color: var(--amber-soft);
  font-size: 11px;
  font-weight: 800;
}

.card-tag.is-category {
  border: 1px solid rgba(223, 168, 73, 0.42);
  background: rgba(223, 168, 73, 0.18);
}

.card-note {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.72;
  white-space: pre-line;
}

.card-recommender {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.card-recommender strong {
  color: var(--ink-soft);
  font-weight: 800;
}

.card-external-link {
  width: fit-content;
  margin-top: 13px;
  color: var(--amber-soft);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.card-external-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.vote-area {
  margin-top: auto;
  padding-top: 22px;
}

.vote-names {
  min-height: 52px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  display: grid;
  gap: 7px;
}

.vote-name-row {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.vote-name-row strong {
  color: var(--positive);
}

.vote-name-row.is-negative strong {
  color: var(--negative);
}

.vote-name-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vote-buttons {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vote-button {
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 10, 9, 0.54);
  color: var(--ink-soft);
  font-weight: 850;
}

.vote-button:hover,
.vote-button.is-active {
  border-color: currentColor;
}

.vote-button.is-positive {
  color: var(--positive);
}

.vote-button.is-negative {
  color: var(--negative);
}

.vote-button.is-active {
  background: rgba(247, 237, 218, 0.07);
}

.skeleton-card {
  min-height: 420px;
  background:
    linear-gradient(
      105deg,
      rgba(247, 237, 218, 0.02) 38%,
      rgba(247, 237, 218, 0.07) 50%,
      rgba(247, 237, 218, 0.02) 62%
    ),
    var(--panel);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  padding: 56px 24px;
  text-align: center;
  background: rgba(25, 20, 17, 0.45);
}

.empty-mark {
  margin: 0;
  color: var(--amber);
  font: 50px/1 Georgia, serif;
}

.empty-state h3 {
  margin: 18px 0 0;
  font: 500 28px/1.2 Georgia, serif;
}

.empty-state p:not(.empty-mark) {
  margin: 10px auto 0;
  color: var(--muted);
}

.empty-state .secondary-action {
  margin-top: 24px;
}

.app-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 0;
  overflow: auto;
  background: var(--panel-raised);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72);
}

.app-dialog::backdrop {
  background: rgba(5, 4, 3, 0.8);
  backdrop-filter: blur(8px);
}

.dialog-card {
  padding: clamp(22px, 5vw, 36px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-head h2 {
  font-size: clamp(34px, 7vw, 48px);
}

.icon-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 25px;
  line-height: 1;
}

.form-stack {
  margin-top: 30px;
  display: grid;
  gap: 20px;
}

.field {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.field > span,
.field legend {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.field b {
  margin-left: 5px;
  color: var(--amber);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field em {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  outline: 0;
  background: rgba(11, 9, 8, 0.6);
  color: var(--ink);
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(223, 168, 73, 0.64);
}

.field select {
  min-height: 47px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field select option {
  background: var(--panel);
}

.tag-picker-field {
  margin: 0;
  border: 0;
  padding: 0;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-option {
  position: relative;
}

.tag-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tag-option span {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.tag-option input:checked + span {
  border-color: var(--amber);
  background: var(--amber);
  color: #211406;
}

.tag-option input:focus-visible + span {
  outline: 2px solid var(--amber-soft);
  outline-offset: 3px;
}

.thumbnail-drop {
  position: relative;
  min-height: 154px;
  border: 1px dashed rgba(223, 168, 73, 0.42);
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(223, 168, 73, 0.06), transparent 55%),
    rgba(11, 9, 8, 0.6);
  cursor: pointer;
}

.thumbnail-drop:hover {
  border-color: var(--amber);
}

.file-input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.thumbnail-drop img {
  width: 100%;
  height: 190px;
  display: block;
  object-fit: cover;
}

.thumbnail-prompt {
  padding: 26px;
  display: grid;
  gap: 6px;
  text-align: center;
}

.thumbnail-prompt strong {
  color: var(--amber-soft);
  font-size: 14px;
}

.thumbnail-prompt small,
.thumbnail-meta {
  color: var(--muted);
  font-size: 11px;
}

.thumbnail-meta {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trap-field {
  position: fixed;
  left: -10000px;
  opacity: 0;
  pointer-events: none;
}

.form-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.form-error {
  margin: 14px 0 0;
  border-left: 3px solid var(--negative);
  padding: 8px 12px;
  background: rgba(233, 144, 127, 0.08);
  color: #ffc3b8;
  font-size: 13px;
}

.dialog-actions {
  margin-top: 26px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions .primary-action {
  margin-top: 0;
}

.vote-target {
  margin: 26px 0 20px;
  border-left: 3px solid var(--amber);
  padding: 10px 14px;
  color: var(--amber-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.vote-submit {
  background: var(--positive);
  color: #102219;
}

.vote-submit.is-negative {
  background: var(--negative);
  color: #2b100b;
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 28px);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 12px 18px;
  transform: translateX(-50%);
  background: #2a211b;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 750;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@keyframes shimmer {
  to {
    background-position: -120% 0;
  }
}

@media (max-width: 940px) {
  .drink-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .top-nav,
  .hero,
  .page-main {
    width: min(100% - 28px, 1180px);
  }

  .top-nav {
    min-height: 64px;
  }

  .hero {
    min-height: 0;
    padding: 76px 0 56px;
    grid-template-columns: 1fr;
    gap: 50px;
  }

  h1 {
    font-size: clamp(64px, 23vw, 96px);
  }

  .hero-stats {
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-stats div {
    padding: 16px 8px 0;
    text-align: center;
  }

  .hero-stats div + div {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .hero-stats dt {
    font-size: 34px;
  }

  .page-main {
    padding-block: 54px 72px;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .sort-field {
    min-width: 0;
  }

  .drink-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .page-header::before {
    right: -190px;
  }

  .site-mark,
  .back-link {
    font-size: 11px;
  }

  .hero {
    padding-top: 60px;
  }

  .hero-description {
    font-size: 15px;
  }

  .section-title-row h2 {
    font-size: 40px;
  }

  .tag-filter {
    flex-wrap: nowrap;
    margin-inline: -14px;
    padding-inline: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tag-filter::-webkit-scrollbar {
    display: none;
  }

  .tag-chip {
    flex: 0 0 auto;
  }

  .drink-card {
    min-height: 0;
    padding: 19px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions > * {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
