:root {
  --blue: #2c80f4;
  --blue-deep: #1e6fff;
  --header-blue: #4f90f3;
  --page-bg: #ebf0f8;
  --ink: #191e26;
  --muted: #7a8798;
  --white: #fff;
  --app-max: 750px;
  --header-h: calc(13.003115% + var(--app-safe-top, 0px));
  --nav-h: 54px;
  --safe-bottom: max(8px, env(safe-area-inset-bottom));
  --shadow-soft: 0 10px 30px rgba(51, 93, 155, .12);
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  background: #dfe8f5;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
button { color: inherit; }
button, a { touch-action: manipulation; }
img { -webkit-user-drag: none; }

.desktop-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 15%, rgba(79, 144, 243, .2), transparent 28%),
    radial-gradient(circle at 86% 75%, rgba(82, 172, 255, .14), transparent 30%),
    linear-gradient(135deg, #eef4fc 0%, #dce8f6 55%, #e9f0fa 100%);
}
.desktop-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .3;
  background-image: linear-gradient(rgba(54, 103, 168, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(54, 103, 168, .055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}

.app-shell {
  position: relative;
  width: min(100%, var(--app-max));
  min-height: 100vh;
  margin: 0 auto;
  background: var(--page-bg);
  box-shadow: 0 0 70px rgba(48, 86, 139, .2);
}

.search-bar-wrapper {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 999;
  width: min(100%, var(--app-max));
  transform: translateX(-50%);
  background: var(--header-blue) url('../assets/home/apk-home-header-bg.png') top center / 100% auto no-repeat;
  overflow: hidden;
}
.search-bar-image {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -1px;
  pointer-events: none;
}
.header-hit {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.header-hit:focus-visible { outline: 3px solid rgba(255,255,255,.85); outline-offset: -4px; border-radius: 16px; }
.search-hit { top: 14%; left: 4%; right: 8.5%; bottom: 15%; }
.scan-hit { top: 22%; right: 2.2%; width: 9%; aspect-ratio: 1; border-radius: 11px; }
.home-page {
  padding-top: calc(13.003115% + var(--app-safe-top, 0px) + 1px);
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 28px);
  background: var(--page-bg);
}

.notice-card,
.visual-card {
  position: relative;
  width: 100%;
  margin-top: -1px;
  line-height: 0;
}
.notice-card { margin-top: -2px; background: var(--blue); z-index: 1; }
.notice-card > img,
.visual-card > img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: top;
  pointer-events: none;
  user-select: none;
}
.notice-marquee {
  --notice-gap: clamp(36px, 6vw, 64px);
  position: absolute;
  top: 50%;
  left: calc(150 / 1284 * 100%);
  right: calc(30 / 1284 * 100%);
  z-index: 3;
  display: flex;
  align-items: center;
  overflow: hidden;
  transform: translateY(-50%);
  white-space: nowrap;
  color: #b27a39;
  font-size: clamp(12px, 2.45vw, 16px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  pointer-events: none;
}
.notice-track {
  display: flex;
  flex: none;
  gap: var(--notice-gap);
  width: max-content;
  animation: notice-scroll 22s linear infinite;
}
.notice-track span { display: block; flex: none; }
.home-page:active .notice-track { animation-play-state: paused; }
@keyframes notice-scroll {
  0%, 16% { transform: translate3d(0, 0, 0); }
  82%, 100% { transform: translate3d(calc(-50% - var(--notice-gap) / 2), 0, 0); }
}

.image-hit {
  position: absolute;
  z-index: 10;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.image-hit:focus-visible { outline: 3px solid rgba(30, 111, 255, .65); outline-offset: -4px; border-radius: 16px; }
.annual-main-hit { top: 0; right: 3%; width: 29%; height: 12%; }
.annual-record-hit { top: 43.5%; right: 30.5%; width: 44%; height: 14.5%; }
.policy-hit { top: 15%; left: 39%; width: 20%; height: 9%; }
.fill-hit { top: 39.5%; left: 7.5%; width: 51%; height: 12%; }
.news-hit, .footer-hit { inset: 0; }
.footer-hit { height: 13%; }

.quick-services {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: -1px;
  padding: 2px 12px 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  background: var(--page-bg);
}
.quick-services::-webkit-scrollbar { display: none; }
.quick-card {
  flex: 0 0 max(100px, calc((100% - 16px) / 3.2));
  aspect-ratio: 374 / 491;
  scroll-snap-align: start;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: transform .22s var(--ease), filter .22s ease;
}
.quick-card img { display: block; width: 100%; height: 100%; object-fit: fill; }
@media (hover:hover) {
  .quick-card:hover { transform: translateY(-3px); filter: drop-shadow(0 8px 12px rgba(31, 82, 147, .15)); }
}

@media (min-width: 520px) {
  .quick-card { flex-basis: calc((min(100%, 430px) - 16px) / 3.2); }
}

.hero-carousel {
  position: relative;
  width: 93%;
  margin: 2px auto 8px;
  border-radius: 15px;
  overflow: hidden;
  background: var(--page-bg);
  isolation: isolate;
}
.carousel-track {
  display: flex;
  width: 100%;
  transition: transform .42s var(--ease);
  will-change: transform;
  cursor: grab;
}
.carousel-track.is-dragging { cursor: grabbing; transition: none; }
.carousel-slide {
  flex: 0 0 100%;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 1px;
  object-fit: cover;
  pointer-events: none;
}
.carousel-dots {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}
.carousel-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: rgba(0, 0, 0, .2);
  transition: width .25s var(--ease), background .25s ease;
}
.carousel-dots i.is-active { width: 12px; background: var(--blue); }

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

.bottom-nav {
  position: fixed;
  z-index: 10050;
  left: 50%;
  bottom: var(--safe-bottom);
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: min(calc(100% - 32px), calc(var(--app-max) - 32px));
  height: var(--nav-h);
  padding: 8px 0;
  border: 1px solid rgba(0, 0, 0, .04);
  border-radius: 32px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #999;
  font-size: 11px;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}
.nav-item:active { opacity: .72; }
.nav-icon { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-bottom: 2px; }
.nav-icon img { display: block; width: 19px; height: 19px; object-fit: contain; }
.nav-text { display: block; color: inherit; font-size: 11px; line-height: 12px; height: 12px; white-space: nowrap; }
.nav-item.active, .nav-item.active .nav-text { color: var(--blue-deep); }

.toast {
  position: fixed;
  z-index: 12050;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 22px);
  max-width: min(86vw, 420px);
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(20, 32, 51, .92);
  color: #fff;
  box-shadow: 0 8px 30px rgba(22, 40, 66, .24);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .28s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.search-panel {
  position: fixed;
  z-index: 11000;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, var(--app-max));
  padding: max(14px, env(safe-area-inset-top)) 16px calc(var(--nav-h) + var(--safe-bottom) + 20px);
  background: #f6f8fb;
  transform: translate(-50%, 102%);
  transition: transform .38s var(--ease);
  overflow-y: auto;
}
.search-panel.is-open { transform: translate(-50%, 0); }
.search-panel-head { display: flex; gap: 10px; align-items: center; }
.round-icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(32, 65, 110, .08);
  cursor: pointer;
}
.round-icon-button svg { width: 22px; height: 22px; fill: none; stroke: #26374f; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fake-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e7ecf3;
}
.fake-search svg { flex: 0 0 19px; width: 19px; height: 19px; fill: none; stroke: #8a96a7; stroke-width: 1.7; stroke-linecap: round; }
.fake-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.fake-search input::placeholder { color: #9aa5b5; }
.search-panel-body { padding: 24px 2px 40px; }
.panel-eyebrow { margin: 0 0 14px; color: #7c8899; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.search-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 30px; }
.search-tags button {
  padding: 9px 13px;
  border: 1px solid #dfe6f0;
  border-radius: 999px;
  background: #fff;
  color: #42536a;
  font-size: 13px;
  cursor: pointer;
}
.search-tags button:hover { border-color: #a9c8f7; background: #f2f7ff; color: var(--blue-deep); }
.results-title { margin-bottom: 10px; }
.search-results { overflow: hidden; border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(43, 78, 124, .07); }
.search-results button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.search-results button:last-child { border-bottom: 0; }
.search-results button:hover { background: #f8fbff; }
.search-results span { color: #26364b; font-size: 14px; font-weight: 600; }
.search-results small { color: #98a3b2; font-size: 11px; white-space: nowrap; }
.empty-state { display: none; padding: 40px 0; color: #8a96a6; font-size: 14px; text-align: center; }
.search-panel.is-empty .search-results { display: none; }
.search-panel.is-empty .empty-state { display: block; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11500;
  background: rgba(15, 23, 42, .44);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.sheet-backdrop.is-visible { opacity: 1; pointer-events: auto; }
.bottom-sheet {
  position: fixed;
  z-index: 11600;
  left: 50%;
  bottom: 0;
  width: min(100%, var(--app-max));
  padding: 10px 22px calc(18px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: #fff;
  box-shadow: 0 -20px 50px rgba(22, 40, 66, .2);
  transform: translate(-50%, 105%);
  transition: transform .42s var(--ease);
}
.bottom-sheet.is-open { transform: translate(-50%, 0); }
.sheet-grabber { width: 42px; height: 4px; margin: 0 auto 18px; border-radius: 99px; background: #dbe1ea; }
.sheet-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #7d8a9c; font-size: 12px; font-weight: 600; letter-spacing: .03em; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: #39a1ff; box-shadow: 0 0 0 4px rgba(57, 161, 255, .13); }
.bottom-sheet h2 { margin: 0 0 9px; color: #152237; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.bottom-sheet p { margin: 0 0 22px; color: #66768b; font-size: 14px; line-height: 1.75; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-actions button, .sheet-close {
  min-height: 46px;
  border: 0;
  border-radius: 13px;
  background: var(--blue-deep);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.sheet-actions .secondary { background: #eef5ff; color: var(--blue-deep); }
.sheet-close { width: 100%; margin-top: 10px; background: #f4f6f9; color: #7b8797; }
.sheet-actions button:active, .sheet-close:active { transform: scale(.985); }

@media (min-width: 760px) {
  .app-shell { margin-top: 18px; margin-bottom: 18px; min-height: calc(100vh - 36px); border-radius: 22px; overflow: hidden; }
  .search-bar-wrapper { top: 18px; border-radius: 22px 22px 0 0; }
  .bottom-nav { bottom: calc(var(--safe-bottom) + 18px); }
}
@media (max-width: 360px) {
  :root { --nav-h: 54px; }
  .bottom-nav { width: calc(100% - 24px); }
  .quick-services { padding-inline: 10px; gap: 7px; }
  .sheet-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
