:root {
  --ink: #18241f;
  --muted: #758078;
  --green: #164a3a;
  --green-2: #213f35;
  --gold: #b79a68;
  --ivory: #faf8f1;
  --line: rgba(28, 55, 45, 0.14);
  --glass: rgba(255, 255, 255, 0.68);
  --shadow: 0 18px 46px rgba(24, 47, 40, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: linear-gradient(145deg, #f8f5ed, #f1f5f1 46%, #fbf8f0);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html.modal-open,
body.modal-open {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.phone-shell {
  position: relative;
  width: 100vw;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.72)),
    var(--ivory);
  box-shadow: 0 0 90px rgba(12, 34, 28, 0.12);
}

.hero {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
  isolation: isolate;
}

.hero-slider,
.hero-img,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.045);
  transition: opacity 1800ms ease, transform 7200ms ease;
}

.hero-img.active {
  opacity: 1;
  transform: scale(1);
}

.hero-shade {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(13, 29, 24, 0.12), rgba(13, 29, 24, 0.18) 44%, rgba(13, 29, 24, 0.72)),
    linear-gradient(90deg, rgba(10, 26, 22, 0.38), rgba(10, 26, 22, 0.03) 74%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 54px 26px 110px;
  color: #fffdf7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 20px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  font-size: 11px;
  letter-spacing: 0.12em;
}

h1,
h2,
p {
  margin-top: 0;
}

.hero h1 {
  margin-bottom: 18px;
  font-size: clamp(32px, 9.4vw, 42px);
  line-height: 1.06;
  font-weight: 520;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 286px;
  margin-bottom: 26px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.95;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 540;
  line-height: 1;
  text-decoration: none;
}

.primary-action {
  background: linear-gradient(135deg, #f5dfb1, var(--gold));
  color: #20332c;
  box-shadow: 0 14px 32px rgba(72, 50, 20, 0.25);
}

.ghost-action {
  border: 1px solid rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  backdrop-filter: blur(18px);
}

.hero-meter {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(22px);
}

.hero-meter span {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fffef7;
  font-size: 12px;
  min-width: 0;
}

.content-panel {
  display: none;
  padding: 30px 16px 8px;
}

.content-panel.active {
  display: block;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 4px 14px;
}

.section-title span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 640;
}

.section-title strong {
  color: var(--green-2);
  font-size: 16px;
  line-height: 1.2;
  text-align: right;
}

.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.6));
  box-shadow: 0 14px 34px rgba(24, 47, 40, 0.08);
  backdrop-filter: blur(22px);
}

.feature-card {
  padding: 18px 18px 16px;
}

.feature-card p {
  color: #334942;
  line-height: 1.9;
  font-size: 14px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 16px;
}

.metric-row span {
  min-height: 54px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(22, 74, 58, 0.052);
  color: #53685f;
  font-size: 11px;
}

.metric-row b {
  display: block;
  color: var(--green);
  font-size: 15px;
  margin-bottom: 3px;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 26px;
}

.service-card,
.article-list a,
.article-list button,
.service-line {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.service-card {
  min-height: 96px;
  padding: 13px;
}

.service-label,
.mini-card span,
.service-line span,
.article-lead span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 640;
}

.service-card strong,
.service-line strong,
.article-list a strong,
.article-list strong {
  display: block;
  color: var(--green-2);
  line-height: 1.36;
  font-weight: 610;
}

.service-card small,
.article-list a small,
.article-list small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.scene-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.scene-strip article {
  overflow: hidden;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(31, 58, 49, 0.1);
}

.scene-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5.4;
  object-fit: cover;
}

.scene-strip strong {
  display: block;
  padding: 10px 8px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--green-2);
}

.article-lead {
  padding: 20px;
  margin-bottom: 12px;
}

.article-lead h2 {
  margin-bottom: 10px;
  color: var(--green-2);
  font-size: 22px;
  line-height: 1.35;
}

.article-lead p,
.mini-card p,
.notice {
  color: var(--muted);
  line-height: 1.7;
}

.article-list,
.service-stack,
.mini-grid {
  display: grid;
  gap: 12px;
}

.article-list a,
.article-list button {
  display: block;
  padding: 16px;
  text-decoration: none;
}

.mini-card {
  padding: 20px;
}

.mini-card h2 {
  margin-bottom: 10px;
  color: var(--green-2);
  font-size: 24px;
}

.mini-open {
  margin-top: 12px;
}

.notice {
  margin: 14px 4px 0;
  font-size: 13px;
}

.service-line {
  display: block;
  width: 100%;
  padding: 18px;
}

.submenu-layer {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 20;
  width: min(calc(100vw - 24px), 496px);
  transform: translateX(-50%);
  pointer-events: none;
}

.submenu {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 18px 48px rgba(17, 48, 39, 0.22);
  backdrop-filter: blur(22px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.submenu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.submenu button {
  min-height: 42px;
  min-width: 0;
  border: 0;
  border-right: 1px solid rgba(22, 74, 58, 0.12);
  border-radius: 12px;
  background: transparent;
  color: var(--green-2);
  font-size: 13px;
  font-weight: 600;
}

.submenu button:last-child {
  border-right: 0;
}

.submenu button:active {
  background: rgba(22, 74, 58, 0.1);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100vw;
  max-width: 520px;
  padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(31, 58, 49, 0.12);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 -14px 34px rgba(20, 45, 38, 0.09);
  transform: translateX(-50%);
  backdrop-filter: blur(22px);
}

.nav-btn {
  min-width: 0;
  min-height: 44px;
  padding: 0 3px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #5a6d65;
  font-size: 12px;
  font-weight: 540;
}

.nav-btn.active {
  background: linear-gradient(145deg, #0f513d, #1c6a52);
  color: #fffdf5;
  box-shadow: 0 12px 28px rgba(15, 81, 61, 0.25);
}

.ai-bubble {
  position: fixed;
  right: calc(50% - min(50vw, 260px) + 18px);
  top: 92px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  min-height: 62px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 0 rgba(211, 169, 87, 0.54), 0 14px 34px rgba(11, 47, 36, 0.2);
  backdrop-filter: blur(20px);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  animation: ai-gold-breathe 2.8s ease-in-out infinite;
}
.ai-bubble.dragging { animation: none; cursor: grabbing; }

@keyframes ai-gold-breathe {
  0%, 100% {
    border-color: rgba(255, 244, 207, 0.78);
    box-shadow: 0 0 0 0 rgba(211, 169, 87, 0.48), 0 14px 34px rgba(11, 47, 36, 0.18);
  }
  50% {
    border-color: rgba(224, 180, 91, 1);
    box-shadow: 0 0 0 9px rgba(211, 169, 87, 0), 0 0 22px rgba(224, 180, 91, 0.68), 0 16px 38px rgba(11, 47, 36, 0.24);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-bubble { animation: none; }
}

.ai-bubble img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(200, 164, 107, 0.38);
  -webkit-user-drag: none;
}

.counselor-bubble {
  position: fixed;
  right: calc(50% - min(50vw, 260px) + 18px);
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 31;
  display: block;
  width: 48px;
  height: 48px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none;
}
.counselor-bubble.dragging { cursor: grabbing; }
.counselor-bubble img { display: block; width: 48px; height: 48px; flex: 0 0 48px; aspect-ratio: 1; border: 2px solid #fff; border-radius: 50%; object-fit: cover; object-position: center 28%; box-shadow: 0 8px 28px rgba(24, 58, 43, .24), 0 0 0 2px rgba(194, 164, 105, .72); }
.counselor-bubble img { -webkit-user-drag: none; }

.ai-maintenance-badge {
  position: fixed;
  right: calc(50% - min(50vw, 260px) + 14px);
  top: 96px;
  z-index: 30;
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(249, 247, 240, 0.94);
  color: #41554e;
  box-shadow: 0 12px 32px rgba(11, 47, 36, 0.18);
  text-align: center;
  backdrop-filter: blur(18px);
}
.ai-maintenance-badge strong { font-size: 13px; }
.ai-maintenance-badge span { color: #7a8882; font-size: 11px; }

.ai-panel {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 31;
  width: min(calc(100vw - 12px), 508px);
  max-height: min(72vh, 620px);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(253, 250, 243, 0.94);
  box-shadow: 0 28px 90px rgba(15, 45, 36, 0.3);
  transform: translateX(-50%);
  backdrop-filter: blur(24px);
}

.ai-panel[hidden],
.modal[hidden] {
  display: none;
}

.ai-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  background: linear-gradient(135deg, rgba(15, 81, 61, 0.12), rgba(200, 164, 107, 0.18));
}

.ai-panel header span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 760;
}

.ai-panel header strong {
  color: var(--green-2);
  font-size: 18px;
}

#closeAi,
.modal-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  font-size: 22px;
}

.chat-body {
  min-height: 190px;
  overflow-y: auto;
  padding: 16px;
}

.chat-body p {
  width: fit-content;
  max-width: 86%;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 16px;
  line-height: 1.62;
  font-size: 14px;
}

.chat-body .bot {
  background: rgba(15, 81, 61, 0.1);
  color: #28433b;
}

.chat-body .user {
  margin-left: auto;
  background: var(--green);
  color: #fff;
}

.chat-input {
  display: flex;
  gap: 6px;
  padding: 12px 8px;
}

.chat-input input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
}

.chat-input button {
  min-width: 56px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 650;
}

.ai-warning {
  margin: 0;
  padding: 1px 16px 13px;
  color: #8d806d;
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
  opacity: 0.82;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
  background: rgba(8, 24, 19, 0.34);
  overscroll-behavior: none;
}

.modal-card {
  position: relative;
  width: min(100%, 500px);
  min-height: min-content;
  margin: max(72px, 12dvh) auto 0;
  overflow: visible;
  border-radius: 24px;
  padding: 26px 20px 22px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.25);
}

@supports not (height: 100dvh) {
  .modal-card { margin-top: max(72px, 12vh); }
}

.modal-card h2 {
  color: var(--green-2);
  font-size: 24px;
}

.modal-card p,
.modal-card li {
  color: #4b5f58;
  line-height: 1.8;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

@media (max-width: 390px) {
  .hero-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .split-grid {
    grid-template-columns: 1fr;
  }
}
