/* =========================================================================
   yingdavip — Apple-style design system
   Single accent: Action Blue #0066cc. One product shadow, no chrome shadows.
   ========================================================================= */
:root {
  --blue: #0066cc;
  --blue-focus: #0071e3;
  --blue-ondark: #2997ff;
  --ink: #1d1d1f;
  --ink-80: #333333;
  --muted: #6e6e73;
  --muted-48: #86868b;
  --parchment: #f5f5f7;
  --pearl: #fafafc;
  --tile-1: #272729;
  --tile-2: #2a2a2c;
  --tile-3: #252527;
  --black: #000000;
  --hairline: #e0e0e0;
  --divider-soft: #f0f0f0;
  --white: #ffffff;
  --on-dark: #ffffff;
  --chip: #d2d2d7;

  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC",
                  "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;

  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 18px;
  --r-pill: 9999px;

  --maxw: 980px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--parchment);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Global nav (black, 44px) ---------- */
.global-nav {
  position: sticky; top: 0; z-index: 100;
  height: 44px;
  background: var(--black);
  color: var(--on-dark);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto; height: 44px;
  padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.global-nav .brand {
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.2px;
  text-decoration: none;
}
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a {
  color: var(--on-dark);
  font-size: 12px; font-weight: 400; letter-spacing: -0.12px;
  text-decoration: none; opacity: 0.92;
}
.nav-links a:hover { opacity: 1; }
.nav-port { color: var(--on-dark); font-size: 12px; opacity: 0.5; }

/* ---------- Page container ---------- */
.page { display: block; }
.search-section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 22px 80px;
}

/* ---------- Hero tile (dark, full-bleed) ---------- */
.hero-tile {
  background: var(--tile-1);
  color: var(--on-dark);
  text-align: center;
  padding: 96px 22px;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-display {
  font-family: var(--font-display);
  font-size: 64px; font-weight: 600;
  line-height: 1.07; letter-spacing: -0.4px;
  margin: 0 0 14px;
}
.hero-tagline {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600;
  line-height: 1.19; letter-spacing: 0.2px;
  color: #d2d2d7;
  margin: 0 0 32px;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  font-family: var(--font-text);
  font-size: 17px; font-weight: 400;
  line-height: 1;
  border: 0; border-radius: var(--r-pill);
  padding: 11px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.2s ease;
}
.btn-primary:hover { background: var(--blue-focus); }
.btn-primary:active { transform: scale(0.95); }
.btn-primary:focus-visible { outline: 2px solid var(--blue-focus); outline-offset: 2px; }
.btn-hero { font-size: 18px; font-weight: 300; padding: 14px 28px; }

/* ---------- Section heads ---------- */
.section-head { text-align: center; margin: 0 0 36px; }
.display-md {
  font-family: var(--font-text);
  font-size: 34px; font-weight: 600;
  line-height: 1.47; letter-spacing: -0.374px;
  margin: 0 0 6px;
}
.caption {
  font-size: 14px; font-weight: 400;
  line-height: 1.43; letter-spacing: -0.224px;
  color: var(--muted);
  margin: 0;
}

/* ---------- Home route grid ---------- */
.grid-section { max-width: 1120px; margin: 0 auto; padding: 64px 22px 80px; }
.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 20px;
}
.route-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, border-color 0.2s ease;
}
.route-card:hover { transform: translateY(-2px); border-color: var(--chip); }
.route-id {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600; letter-spacing: 0;
  color: var(--blue);
}
.route-name {
  font-family: var(--font-text);
  font-size: 17px; font-weight: 600; line-height: 1.24; letter-spacing: -0.374px;
}
.route-type {
  font-size: 12px; color: var(--muted-48);
  align-self: flex-start;
  background: var(--parchment);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

/* ---------- Search head ---------- */
.search-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.search-head .display-md { margin: 0; }
.back-link {
  color: var(--blue); text-decoration: none;
  font-size: 14px; font-weight: 400;
}
.back-link:hover { text-decoration: underline; }
.route-tag {
  font-size: 13px; color: var(--muted-48);
  font-family: var(--font-display);
}

/* ---------- Search form ---------- */
.search-form {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.search-field {
  position: relative; flex: 1 1 360px; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 16px; color: var(--muted-48); pointer-events: none;
}
.search-field input[type="text"] {
  width: 100%;
  font-family: var(--font-text);
  font-size: 17px; font-weight: 400; color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--r-pill);
  padding: 12px 20px 12px 42px;
  height: 46px;
  line-height: 1.2;
}
.search-field input[type="text"]:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.18);
}
.dir-select {
  font-family: var(--font-text); font-size: 15px;
  color: var(--ink); background: var(--white);
  border: 1px solid rgba(0,0,0,0.08); border-radius: var(--r-pill);
  padding: 10px 18px; height: 46px; cursor: pointer;
}
.dir-select:focus { outline: none; border-color: var(--blue); }

/* ---------- Result count + hints ---------- */
.result-count {
  font-size: 14px; color: var(--muted); line-height: 1.43;
  margin: 0 0 18px; letter-spacing: -0.224px;
}
.result-count b { color: var(--ink); font-weight: 600; }
.hint { font-size: 14px; color: var(--muted); margin: 6px 0; }

/* ---------- Results list ---------- */
.results {
  list-style: none;
  margin: 0; padding: 0;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.results li {
  padding: 14px 24px;
  border-bottom: 1px solid var(--divider-soft);
  font-size: 17px; line-height: 1.47; letter-spacing: -0.374px;
  word-break: break-word;
}
.results li:last-child { border-bottom: 0; }
.results li a { color: var(--blue); text-decoration: none; }
.results li a:hover { text-decoration: underline; }
.results li a.text-link-ondark { color: var(--blue-ondark); }

/* keyword highlight */
mark {
  background: #fff3a8;
  color: var(--ink);
  font-weight: 600;
  padding: 0 2px;
  border-radius: 3px;
}

/* ---------- Pager (pill nav) ---------- */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 24px 0 0;
}
.pill-nav {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 14px;
  font-family: var(--font-text); font-size: 14px;
  color: var(--blue); text-decoration: none;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease;
}
.pill-nav:hover { background: var(--parchment); }
.pill-nav:active { transform: scale(0.95); }
.pill-nav.current {
  background: var(--blue); color: var(--white); border-color: var(--blue);
}

/* ---------- Lottery form ---------- */
.lottery-form {
  display: flex; flex-direction: column; gap: 18px;
  max-width: 460px;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 28px;
}
.field-row { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.224px; }
.field-note { font-size: 12px; color: var(--muted-48); }
.lottery-form input[type="text"],
.lottery-form input[type="number"],
.lottery-form input[type="file"] {
  font-family: var(--font-text); font-size: 15px; color: var(--ink);
  background: var(--pearl);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--r-sm);
  padding: 10px 14px;
}
.lottery-form input[type="file"] { padding: 8px 12px; }
.lottery-form .btn-primary { align-self: flex-start; margin-top: 4px; }

/* ---------- Text link ---------- */
.text-link { color: var(--blue); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--parchment);
  border-top: 1px solid var(--hairline);
  padding: 40px 22px;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.site-footer p {
  font-size: 12px; color: var(--ink-80); line-height: 1.4; margin: 0 0 6px;
  letter-spacing: -0.12px;
}
.site-footer .fine { color: var(--muted-48); }

/* ---------- Responsive ---------- */
@media (max-width: 833px) {
  .hero-display { font-size: 44px; }
  .display-md { font-size: 28px; }
  .hero-tile { padding: 72px 22px; }
}
@media (max-width: 640px) {
  .hero-display { font-size: 36px; }
  .route-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .search-section { padding: 36px 18px 64px; }
  .grid-section { padding: 48px 18px 64px; }
  .search-field { flex: 1 1 100%; }
}
@media (max-width: 419px) {
  .hero-display { font-size: 30px; }
  .display-md { font-size: 24px; }
}
