:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-2: #eef4f6;
  --text: #182327;
  --muted: #687a80;
  --line: #dbe5e8;
  --primary: #0b7984;
  --primary-2: #1299a6;
  --primary-soft: #e6f6f7;
  --secondary: #7257d3;
  --success: #168a4a;
  --warning: #a66505;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(27, 55, 61, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(18, 153, 166, 0.12), transparent 34rem),
    linear-gradient(180deg, #ffffff 0, var(--bg) 30rem);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(219, 229, 232, 0.7);
}

.topbar {
  width: min(100%, 1536px);
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.nav-links,
.top-actions,
.mobile-menu {
  display: flex;
  align-items: center;
}

.brand {
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.brand img {
  display: block;
}

.nav-links {
  flex: 1;
  gap: 24px;
  color: var(--text);
}

.nav-links a,
.mobile-menu a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.nav-links a.active,
.mobile-menu a.active {
  color: var(--primary);
  font-weight: 700;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.pill {
  color: var(--primary);
  background: var(--primary-soft);
}

.top-actions {
  gap: 12px;
}

.language-select,
.field input,
.field select {
  height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.language-select {
  width: 148px;
  background: var(--surface-2);
}

.field input:focus,
.field select:focus,
.language-select:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(18, 153, 166, 0.16);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-button span {
  width: 18px;
  height: 2px;
  background: var(--text);
}

.mobile-menu {
  display: none;
  padding: 0 24px 16px;
  gap: 18px;
}

main {
  width: min(100%, 1536px);
  margin: 0 auto;
  padding: 64px 24px 24px;
}

.page {
  display: none;
}

.page-active {
  display: block;
}

.hero-grid {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
  gap: 36px;
  align-items: center;
}

.hero-copy {
  text-align: center;
}

.hero-copy h1,
.page-heading h1 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
}

.hero-copy h1 {
  font-size: clamp(42px, 6vw, 64px);
}

.hero-copy h1 span:first-child {
  color: var(--primary);
}

.hero-copy p,
.page-heading p,
.guide p {
  color: var(--muted);
  font-size: 18px;
}

.mobile-note {
  display: none;
  color: var(--primary);
}

.route-visual {
  position: relative;
  overflow: hidden;
  height: 250px;
  border-radius: 8px;
  border: 1px solid rgba(18, 153, 166, 0.18);
  background:
    linear-gradient(135deg, rgba(8, 43, 51, 0.9), rgba(18, 153, 166, 0.72)),
    #0f4650;
  box-shadow: var(--shadow);
}

.route-visual canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.route-overlay {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

#routeSummary {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.tool-panel,
.chart-panel,
.availability,
.guide,
.usage-panel {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.segment-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) 48px minmax(180px, 1.5fr) minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 18px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.field span {
  font-weight: 700;
}

.compact-field {
  width: min(100%, 260px);
}

hr {
  height: 1px;
  margin: 24px 0;
  border: 0;
  background: var(--line);
}

.icon-button,
.primary-button,
.secondary-button,
.bookmark-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.icon-button {
  width: 48px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--primary);
  font-weight: 800;
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover,
.bookmark-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  box-shadow: 0 10px 22px rgba(11, 121, 132, 0.18);
  font-weight: 800;
}

.secondary-button,
.bookmark-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.bookmark-button {
  border-color: rgba(114, 87, 211, 0.35);
  color: var(--secondary);
  background: rgba(114, 87, 211, 0.08);
}

.danger {
  color: var(--danger);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.notice {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #f0d49c;
  color: var(--warning);
  background: #fff8e8;
}

.hidden {
  display: none !important;
}

.results-area {
  margin-top: 30px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
}

th {
  background: #f1f6f8;
  color: #4f6268;
  font-weight: 800;
}

tbody tr:hover {
  background: #f8fbfc;
}

tbody tr.total-row {
  font-weight: 800;
  background: #fbfdfe;
}

.empty-row td {
  color: var(--muted);
  text-align: center;
  white-space: normal;
}

.chip-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.airline-chip,
.cabin-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
}

.airline-chip {
  border: 1px solid var(--line);
  color: #536870;
  background: #fff;
}

.cabin-chip.economy {
  color: #45515a;
  background: #eef2f5;
}

.cabin-chip.premium {
  color: #116a40;
  background: #e6f6ed;
}

.cabin-chip.business {
  color: #5a3eb8;
  background: #eee9ff;
}

.cabin-chip.first {
  color: #0b6872;
  background: #e4f7f9;
}

.status-chip.available {
  color: var(--success);
  background: #e6f6ed;
}

.status-chip.waitlist {
  color: var(--warning);
  background: #fff3dc;
}

.status-chip.none {
  color: var(--muted);
  background: #eef2f5;
}

.muted {
  color: var(--muted);
}

.fee {
  color: var(--primary);
  font-weight: 800;
}

.swipe-note {
  display: none;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title-row h2,
.guide h2,
.usage-panel h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.day-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.day-card strong {
  display: block;
  margin-bottom: 10px;
}

.day-card .chip-list {
  min-height: 28px;
}

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

.mini-chart {
  overflow-x: auto;
}

.mini-chart table {
  min-width: 620px;
}

.guide {
  margin-bottom: 32px;
}

.faq {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.faq summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
}

.faq p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 15px;
}

.award-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading h1 {
  margin-top: 12px;
  font-size: clamp(34px, 5vw, 52px);
}

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

.filters-row,
.award-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.check-pill,
.toggle {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

.award-controls {
  justify-content: flex-end;
}

.award-results {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.award-result-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(27, 55, 61, 0.05);
}

.award-result-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.award-result-card p {
  margin: 0;
  color: var(--muted);
}

.usage-panel {
  position: sticky;
  top: 88px;
  margin-top: 0;
}

.usage-panel ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.usage-panel li + li {
  margin-top: 12px;
}

.floating-actions {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
}

.float-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(11, 121, 132, 0.35);
  border-radius: 8px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  font-weight: 800;
}

footer {
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1020px) {
  main {
    padding-top: 32px;
  }

  .nav-links {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .mobile-menu.open {
    display: flex;
  }

  .hero-grid,
  .award-layout,
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .route-visual {
    height: 230px;
  }

  .usage-panel {
    position: static;
  }

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

  .icon-button {
    width: 100%;
  }
}

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

  .brand span {
    display: none;
  }

  .language-select {
    width: 128px;
  }

  main {
    padding: 24px 16px;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .mobile-note,
  .swipe-note {
    display: block;
  }

  .route-visual {
    display: none;
  }

  .tool-panel,
  .chart-panel,
  .availability,
  .guide,
  .usage-panel {
    padding: 18px;
  }

  .form-actions,
  .award-controls {
    justify-content: stretch;
  }

  .primary-button,
  .secondary-button,
  .bookmark-button {
    width: 100%;
  }

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

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

  .floating-actions {
    display: none;
  }
}
