:root {
  color-scheme: light;
  --bg: #eff4f1;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --ink: #17231f;
  --muted: #607069;
  --line: #dce6e1;
  --green: #177a58;
  --green-dark: #0d513e;
  --blue: #256b86;
  --amber: #b86e18;
  --red: #a53a2f;
  --shadow: 0 14px 40px rgba(22, 46, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(37, 107, 134, 0.1), rgba(239, 244, 241, 0) 220px),
    var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

button {
  border: 0;
}

.app-shell {
  width: min(100%, 430px);
  max-width: 100vw;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  overflow-x: hidden;
  box-shadow: 0 0 0 1px rgba(20, 54, 43, 0.04);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 10px 10px 12px;
  padding: max(14px, env(safe-area-inset-top)) 14px 14px;
  border: 1px solid rgba(23, 35, 31, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(22, 46, 38, 0.09);
}

.topbar > div:first-child,
.verdict-row > div,
.section-head > div,
.card-top > div,
.field {
  min-width: 0;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.privacy-pill {
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #e6f2ec;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(23, 122, 88, 0.18);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.privacy-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-button {
  min-height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 0 8px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.app-main {
  padding: 0 14px 92px;
}

.screen {
  display: grid;
  gap: 12px;
}

.auth-screen {
  min-height: calc(100vh - 112px);
  align-content: center;
}

.panel,
.recommend-card,
.spot-card,
.model-card,
.trip-card,
.form-panel,
.auth-panel {
  background: var(--surface);
  border: 1px solid rgba(23, 35, 31, 0.07);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.auth-heading h2 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-switch button {
  min-width: 0;
  min-height: 40px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.auth-switch button.active {
  color: var(--green-dark);
  background: #e6f2ec;
}

.hero-panel {
  background: linear-gradient(135deg, #0e5a45 0%, #1e6d80 62%, #8d6a24 100%);
  color: white;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 58px;
  background: repeating-linear-gradient(
    -8deg,
    rgba(255, 255, 255, 0.14) 0,
    rgba(255, 255, 255, 0.14) 1px,
    transparent 1px,
    transparent 18px
  );
  opacity: 0.55;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 18px;
}

.verdict-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.verdict {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.score-ring {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #123f35 0 54%, transparent 55%),
    conic-gradient(#f4d06f var(--score-angle), rgba(255, 255, 255, 0.3) 0);
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: 0 8px 22px rgba(4, 26, 21, 0.22);
}

.score-ring strong {
  color: #ffffff;
  font-size: 23px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.hero-detail {
  margin: 0;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.5;
  font-size: 14px;
}

.private-map {
  width: 100%;
  max-width: 100%;
  height: 118px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 2px 0;
}

.section-head h2,
.panel h2,
.form-panel h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.section-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
  font-size: 16px;
}

.field select {
  text-overflow: ellipsis;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.weather-inline {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.weather-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.weather-status {
  min-height: 38px;
  display: grid;
  align-items: center;
  padding: 9px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.spot-map {
  width: 100%;
  height: 240px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface-soft);
}

.region-grid,
.map-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.region-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.map-search-results {
  display: grid;
  gap: 7px;
  max-height: 196px;
  overflow: auto;
}

.map-result {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.map-result strong,
.map-result span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.map-result strong {
  font-size: 13px;
  line-height: 1.3;
}

.map-result span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.map-link {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: #e8f2f4;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 122, 88, 0.12);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 46px;
  min-width: 0;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.secondary-button {
  color: var(--green-dark);
  background: #e6f2ec;
}

.danger-button {
  color: var(--red);
  background: #f7e8e6;
}

.recommend-list,
.spot-list,
.model-list,
.trip-list,
.share-list {
  display: grid;
  gap: 10px;
}

.recommend-card,
.spot-card,
.model-card,
.trip-card,
.panel,
.form-panel {
  padding: 14px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.card-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.score-badge {
  min-width: 58px;
  height: 48px;
  max-width: 96px;
  padding: 0 10px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8f2f4;
  color: var(--blue);
  font-weight: 900;
  flex: 0 0 auto;
  text-align: center;
  line-height: 1.1;
}

.tag-row,
.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tag,
.metric {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef4f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
}

.metric.strong {
  background: #e5f2ec;
  color: var(--green-dark);
}

.metric.warn {
  background: #fbefdc;
  color: var(--amber);
}

.metric.danger {
  background: #f7e8e6;
  color: var(--red);
}

.reason-list {
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
  list-style: none;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.reason-list li {
  padding-left: 14px;
  position: relative;
  min-width: 0;
}

.reason-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 14px 14px;
}

.form-actions button {
  flex: 1;
}

.spot-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.summary-box {
  margin-top: 12px;
  padding: 12px;
  background: #f5f1e8;
  border: 1px solid #eadfca;
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 13px;
}

.topbar h1,
.verdict,
.hero-detail,
.section-note,
.card-title,
.card-subtitle,
.tag,
.metric,
.reason-list li,
.summary-box {
  overflow-wrap: anywhere;
}

.loading-panel,
.empty-panel {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}

.empty-panel.compact {
  min-height: 86px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #d7e4df;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(100%, 430px);
  max-width: 100vw;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.93);
  border-top: 1px solid rgba(20, 54, 43, 0.1);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.tabbar.is-hidden {
  display: none;
}

.tab-button {
  min-width: 0;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.tab-button.active {
  color: var(--green-dark);
  background: #e6f2ec;
  font-weight: 800;
}

.tab-icon {
  font-size: 18px;
  line-height: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  width: min(360px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  transform: translateX(-50%);
  padding: 12px 14px;
  border-radius: 8px;
  background: #17231f;
  color: white;
  box-shadow: var(--shadow);
  z-index: 20;
  font-size: 14px;
  overflow-wrap: anywhere;
}

@media (max-width: 390px) {
  .topbar {
    gap: 10px;
    margin: 8px 8px 10px;
    padding: max(12px, env(safe-area-inset-top)) 12px 12px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .privacy-pill {
    padding: 7px 9px;
    max-width: 50%;
  }

  .app-main {
    padding: 0 12px 92px;
  }

  .screen {
    gap: 10px;
  }

  .hero-content {
    gap: 9px;
    padding: 14px;
  }

  .verdict-row {
    gap: 10px;
  }

  .verdict {
    font-size: 26px;
  }

  .score-ring {
    width: 66px;
    height: 66px;
  }

  .score-ring strong {
    font-size: 20px;
  }

  .private-map {
    height: 104px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px;
  }

  .form-panel .filter-grid {
    padding: 12px 0 0;
  }

  .recommend-card,
  .spot-card,
  .model-card,
  .trip-card,
  .panel,
  .form-panel,
  .auth-panel {
    padding: 12px;
  }

  .card-top {
    gap: 10px;
  }

  .score-badge {
    min-width: 52px;
    height: 44px;
  }

  .form-actions {
    padding: 12px 0 0;
  }

  .weather-row {
    grid-template-columns: 1fr;
  }

  .region-grid,
  .map-search {
    grid-template-columns: 1fr;
  }

  .spot-map {
    height: 210px;
  }

  .tabbar {
    gap: 3px;
    padding-right: 8px;
    padding-left: 8px;
  }
}

@media (max-width: 360px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .verdict {
    font-size: 25px;
  }
}
