:root {
  color-scheme: light;
  --ink: #152735;
  --muted: #68757d;
  --paper: #f2efe7;
  --card: #fffdf7;
  --orange: #ee6a3a;
  --blue: #236c84;
  --line: #c9c8c1;
  --shadow: 0 24px 70px rgba(19, 35, 48, 0.13);
  font-family: "Arial Narrow", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(21, 39, 53, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 28px;
  min-width: 320px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.masthead {
  height: 70px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f8f5ed;
  background: var(--ink);
  border-bottom: 4px solid var(--orange);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-size: 22px; font-weight: 800; letter-spacing: .12em; }
.brand-mark { display: flex; gap: 3px; transform: skewX(-9deg); }
.brand-mark i { display: block; width: 5px; height: 22px; background: var(--orange); }
.brand-mark i:nth-child(2) { height: 15px; margin-top: 7px; }
.brand-mark i:nth-child(3) { height: 9px; margin-top: 13px; }
.masthead p { margin: 0; color: #aab7bd; font: 700 11px/1 Arial, sans-serif; letter-spacing: .18em; }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 56px) 80px; }
.hero { min-height: 520px; padding: 72px 0 66px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 470px); align-items: center; gap: clamp(50px, 8vw, 110px); }
.eyebrow { margin: 0 0 10px; color: var(--orange); font: 800 11px/1.4 Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(48px, 6vw, 82px); line-height: 1.04; letter-spacing: -.055em; }
h1 em { color: var(--blue); font-style: normal; }
.lede { max-width: 520px; margin: 28px 0 0; color: var(--muted); font-size: 17px; line-height: 1.9; }

.ticket { position: relative; padding: 24px 30px 20px; background: var(--card); box-shadow: var(--shadow); border: 1px solid #d8d5cc; }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 70%; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); }
.ticket::before { left: -13px; box-shadow: inset -1px 0 #d8d5cc; }
.ticket::after { right: -13px; box-shadow: inset 1px 0 #d8d5cc; }
.ticket-topline { display: flex; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--muted); font: 800 10px/1 Arial, sans-serif; letter-spacing: .15em; }
.seat-code { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; padding: 25px 0 20px; }
.seat-code label span, .layout-label { display: block; margin-bottom: 8px; color: var(--muted); font: 800 10px/1.2 Arial, sans-serif; letter-spacing: .1em; }
.seat-code input { width: 100%; height: 64px; padding: 0 8px; color: var(--ink); background: transparent; border: 0; border-bottom: 3px solid var(--ink); border-radius: 0; outline: none; font: 800 44px/1 Arial, sans-serif; text-transform: uppercase; }
.seat-code input:focus { border-color: var(--orange); }
.seat-code input::placeholder { color: #c7c4ba; }
.seat-code b { padding-bottom: 18px; color: #aaa79f; }
.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; right: 16px; top: 12px; pointer-events: none; color: var(--orange); font-weight: 800; }
select { width: 100%; height: 44px; padding: 0 40px 0 14px; appearance: none; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: #f8f6f0; outline: none; }
select:focus { border-color: var(--blue); }
.form-message { min-height: 19px; margin: 8px 0 0; color: #b43f27; font-size: 13px; }
.search-button { width: 100%; height: 52px; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; border: 0; color: white; background: var(--ink); font-weight: 800; letter-spacing: .08em; transition: transform .18s, background .18s; }
.search-button:hover { background: var(--blue); transform: translateY(-2px); }
.search-button:active { transform: translateY(0); }
.ticket-cut { margin: 19px -30px 14px; border-top: 2px dashed #cbc8bf; }
.ticket-note { margin: 0; color: var(--muted); font-size: 11px; text-align: center; }

.results-section { padding: 56px 0 30px; border-top: 1px solid var(--line); }
.section-heading, .favorites-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
h2 { margin: 0; font: 800 clamp(28px, 4vw, 40px)/1.1 Georgia, "Songti SC", serif; }
.section-heading > p { max-width: 460px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; text-align: right; }
.result-list { display: grid; gap: 14px; }
.empty-state { min-height: 220px; display: grid; place-content: center; justify-items: center; border: 1px dashed #aaa9a3; color: var(--muted); background: rgba(255,255,255,.3); text-align: center; }
.empty-state p { margin: 18px 0 4px; color: var(--ink); font: 700 20px/1.2 Georgia, serif; }
.empty-state span { font-size: 13px; }
.mini-cabin { display: flex; align-items: center; gap: 5px; padding: 8px 12px; border: 2px solid var(--blue); border-radius: 28px; }
.mini-cabin i { width: 14px; height: 18px; border: 1px solid var(--blue); }
.mini-cabin span { width: 12px; }

.result-card { position: relative; display: grid; grid-template-columns: 135px minmax(180px, .7fr) minmax(250px, 1fr) auto; gap: 24px; align-items: center; padding: 22px 24px; overflow: hidden; border: 1px solid #d2d0c8; background: var(--card); }
.result-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--state-color, var(--blue)); }
.vehicle-type { color: var(--muted); font: 800 10px/1.4 Arial, sans-serif; letter-spacing: .13em; }
.vehicle-name { margin-top: 5px; font-weight: 800; font-size: 18px; }
.position { display: flex; align-items: center; gap: 12px; }
.position-badge { min-width: 62px; padding: 8px 10px; color: white; background: var(--state-color); text-align: center; font-size: 13px; font-weight: 800; }
.seat-number { font: 800 30px/1 Arial, sans-serif; }
.details strong { display: block; margin-bottom: 5px; font-size: 14px; }
.details p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.layout-map { display: flex; align-items: center; gap: 5px; }
.layout-map .seat { width: 28px; height: 32px; display: grid; place-items: center; border: 1px solid #a4a9aa; color: #667078; background: #f3f1ea; font: 800 11px/1 Arial, sans-serif; }
.layout-map .seat.active { color: white; border-color: var(--state-color); background: var(--state-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--state-color) 18%, transparent); }
.layout-map .gap { width: 13px; color: #aaa; text-align: center; }
.favorite-button { width: 42px; height: 42px; padding: 0; border: 1px solid #cbc9c1; background: transparent; color: #8d918f; font-size: 21px; line-height: 1; transition: .15s; }
.favorite-button:hover { border-color: var(--orange); color: var(--orange); }
.favorite-button.active { border-color: var(--orange); color: white; background: var(--orange); }
.no-match { padding: 22px; border-left: 5px solid #8f9797; color: var(--muted); background: var(--card); }
.no-match b { color: var(--ink); }

.favorites { margin-top: 54px; padding: 34px; color: #f7f4ec; background: var(--ink); }
.favorites h2 { color: #fff; }
.text-button { padding: 7px 0; border: 0; border-bottom: 1px solid #71808a; color: #c7d0d4; background: transparent; font-size: 12px; }
.text-button:hover { color: white; border-color: var(--orange); }
.favorite-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.favorite-empty { grid-column: 1 / -1; margin: 0; padding: 24px; border: 1px dashed #53626b; color: #aeb9bf; text-align: center; font-size: 13px; }
.favorite-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border: 1px solid #42535d; background: #1c303e; }
.favorite-item b { display: block; margin-bottom: 4px; font-size: 14px; }
.favorite-item span { color: #aab5bb; font-size: 12px; }
.favorite-item button { flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid #52646e; color: #b4bec3; background: transparent; font-size: 17px; }

.legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 30px; background: var(--line); border: 1px solid var(--line); }
.legend > div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 18px; background: var(--paper); }
.legend small { grid-column: 2; margin-top: 3px; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.window { background: #287b97; }.dot.aisle { background: #e26739; }.dot.middle { background: #806f9c; }
footer { padding: 24px; color: #9aa5aa; background: var(--ink); text-align: center; font-size: 11px; letter-spacing: .08em; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding: 52px 0; gap: 40px; }
  .result-card { grid-template-columns: 120px 1fr auto; }
  .details { grid-column: 1 / 3; grid-row: 2; }
  .layout-map { grid-column: 2; grid-row: 1; justify-self: end; }
  .position { grid-column: 1; grid-row: 1; }
  .vehicle { display: none; }
  .favorite-button { grid-column: 3; grid-row: 1 / 3; }
}

@media (max-width: 560px) {
  .masthead { height: 62px; }.masthead p { display: none; }
  main { padding-inline: 14px; }
  .hero { padding-top: 38px; }
  h1 { font-size: 48px; }
  .lede { margin-top: 20px; font-size: 15px; }
  .ticket { padding: 20px 19px 18px; }
  .ticket-cut { margin-inline: -19px; }
  .seat-code { gap: 10px; }
  .seat-code input { font-size: 36px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .result-card { grid-template-columns: 1fr auto; gap: 16px; padding: 18px; }
  .position { grid-column: 1; }
  .layout-map { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .details { grid-column: 1 / -1; grid-row: 3; }
  .favorite-button { grid-column: 2; grid-row: 1; }
  .favorites { margin-inline: -14px; padding: 28px 18px; }
  .favorite-list { grid-template-columns: 1fr; }
  .legend { grid-template-columns: 1fr; }
}

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