:root {
  color-scheme: light;
  --bg: #f4f7f3;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --ink: #1f2a27;
  --muted: #65736d;
  --line: #dce5df;
  --primary: #1f8f63;
  --primary-dark: #146147;
  --coral: #f06a4d;
  --amber: #e2a735;
  --sky: #4d8ec9;
  --rose: #bf5369;
  --shadow: 0 18px 45px rgba(38, 54, 47, 0.13);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 14% 10%, rgba(31, 143, 99, 0.12), transparent 24rem),
    linear-gradient(145deg, #f4f7f3 0%, #e9f0ed 52%, #f8f5ee 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(31, 143, 99, 0.24);
  outline-offset: 2px;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.phone {
  width: min(100%, 430px);
  height: min(900px, calc(100vh - 44px));
  min-height: 720px;
  background: var(--surface);
  border: 1px solid rgba(31, 42, 39, 0.08);
  border-radius: 30px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.app-header {
  padding: 24px 22px 15px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 23px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.35;
}

.app-content {
  overflow-y: auto;
  padding: 18px 18px 22px;
  background: linear-gradient(180deg, #fbfdfb 0%, #f3f7f4 100%);
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 9px 10px 13px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.tabbar__item {
  min-height: 44px;
  padding: 8px 4px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tabbar__item.is-active {
  color: var(--primary-dark);
  background: #e8f5ef;
}

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

.hero-card {
  min-height: 230px;
  padding: 20px;
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(19, 35, 30, 0.72) 0%, rgba(19, 35, 30, 0.36) 55%, rgba(19, 35, 30, 0.08) 100%),
    url("assets/travel-hero.png") center / cover;
  display: grid;
  align-content: end;
  gap: 12px;
  overflow: hidden;
}

.hero-card h2 {
  max-width: 310px;
  margin-bottom: 2px;
  color: #fff;
}

.hero-card p {
  max-width: 280px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-weight: 800;
  white-space: nowrap;
}

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

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  background: #fff3e7;
  color: #8f482e;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger-button {
  background: #fdecef;
  color: #9f344b;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel--soft {
  background: var(--surface-soft);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mini-link {
  color: var(--primary-dark);
  background: transparent;
  font-weight: 800;
  padding: 0;
}

.service-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 12px;
}

.service-strip span:nth-child(2) {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.stat {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.stat strong {
  display: block;
  margin-bottom: 4px;
  font-size: 21px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.progress-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-list li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #e8f5ef;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

.status-pill,
.chip,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.status-pill {
  background: #e8f5ef;
  color: var(--primary-dark);
}

.status-pill.is-warn {
  background: #fff4d8;
  color: #7b570f;
}

.status-pill.is-coral {
  background: #feece7;
  color: #a53e28;
}

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

.chip.is-on {
  border-color: rgba(31, 143, 99, 0.28);
  background: #e8f5ef;
  color: var(--primary-dark);
}

.tag {
  background: #eef3f7;
  color: #2c5f86;
}

.tag.is-amber {
  background: #fff4d8;
  color: #7b570f;
}

.tag.is-coral {
  background: #feece7;
  color: #a53e28;
}

.tag-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.field label,
.field legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

.field textarea {
  min-height: 108px;
  line-height: 1.55;
  resize: vertical;
}

.field input[type="range"] {
  min-height: 22px;
  padding: 0;
  accent-color: var(--primary);
}

.fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.fieldset .chip {
  cursor: pointer;
}

.fieldset input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

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

.parse-item,
.summary-item {
  padding: 12px;
  border-radius: var(--radius);
  background: #f7faf8;
  border: 1px solid var(--line);
}

.parse-item span,
.summary-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.parse-item strong,
.summary-item strong {
  font-size: 15px;
}

.member-list,
.plan-list,
.trip-list {
  display: grid;
  gap: 10px;
}

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

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

.destination-card p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.choice-chip {
  position: relative;
  cursor: pointer;
}

.choice-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.member-profile {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7faf8;
}

.member-profile strong,
.member-profile span {
  display: block;
}

.member-profile span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.member-card,
.plan-card,
.trip-card,
.day-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.member-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: start;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f5ef;
  color: var(--primary-dark);
  font-weight: 900;
}

.member-card p,
.plan-card p,
.trip-card p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.conflict-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.idea-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.idea-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.idea-list li:last-child {
  border-bottom: 0;
}

.idea-list strong {
  font-size: 14px;
}

.idea-list span {
  color: var(--muted);
  line-height: 1.5;
}

.conflict-list li {
  padding: 12px;
  border-left: 4px solid var(--coral);
  border-radius: var(--radius);
  background: #fff8f4;
  line-height: 1.55;
}

.plan-card {
  display: grid;
  gap: 10px;
}

.plan-card.is-selected {
  border-color: rgba(31, 143, 99, 0.58);
  box-shadow: 0 0 0 3px rgba(31, 143, 99, 0.11);
}

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

.plan-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.plan-meta span {
  padding: 9px;
  border-radius: var(--radius);
  background: #f7faf8;
  color: var(--muted);
  font-size: 12px;
}

.days-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.day-tab {
  min-width: 54px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.day-tab.is-active {
  border-color: rgba(31, 143, 99, 0.42);
  background: #e8f5ef;
  color: var(--primary-dark);
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
}

.timeline-item {
  position: relative;
  padding: 13px 13px 13px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--sky);
  border-radius: var(--radius);
  background: #fff;
}

.timeline-item:nth-child(2n) {
  border-left-color: var(--amber);
}

.timeline-item:nth-child(3n) {
  border-left-color: var(--coral);
}

.timeline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.time-block {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.timeline-item p {
  color: var(--muted);
  line-height: 1.55;
}

.mini-map {
  min-height: 180px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(30deg, rgba(77, 142, 201, 0.14) 0 18%, transparent 18% 100%),
    linear-gradient(120deg, transparent 0 50%, rgba(31, 143, 99, 0.14) 50% 62%, transparent 62% 100%),
    #f8fbf9;
}

.map-line {
  position: absolute;
  inset: 24px 36px;
  border-top: 2px dashed rgba(31, 42, 39, 0.22);
  transform: rotate(-14deg);
  transform-origin: center;
}

.map-point {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px rgba(31, 42, 39, 0.16);
}

.map-label {
  position: absolute;
  max-width: 120px;
  padding: 6px 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.modification-log {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.modification-log li {
  padding: 10px;
  border-radius: var(--radius);
  background: #f7faf8;
  color: var(--muted);
  line-height: 1.5;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 136px;
  gap: 8px;
}

.empty {
  padding: 26px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.fine-print {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.toast {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 84px;
  z-index: 4;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(31, 42, 39, 0.92);
  color: #fff;
  text-align: center;
  font-weight: 800;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.is-show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 520px) {
  .page-shell {
    padding: 0;
  }

  .phone {
    width: 100%;
    height: 100vh;
    min-height: 0;
    border-radius: 0;
    border: 0;
  }

  .app-header {
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .hero-card {
    min-height: 218px;
  }

  .parse-grid,
  .summary-grid,
  .stat-grid,
  .destination-grid {
    grid-template-columns: 1fr 1fr;
  }

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