:root {
  color-scheme: light;
  --paper: #f6f2ec;
  --surface: #fffdf8;
  --panel: #ffffff;
  --ink: #1d2522;
  --muted: #66736f;
  --line: #ded8cf;
  --teal: #0e7c73;
  --teal-dark: #085b55;
  --coral: #c65a3e;
  --gold: #b78321;
  --green-soft: #e6f3ef;
  --coral-soft: #f8e7df;
  --shadow: 0 18px 50px rgba(29, 37, 34, 0.09);
  font-family:
    Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(14, 124, 115, 0.08), transparent 34%),
    linear-gradient(45deg, rgba(198, 90, 62, 0.08), transparent 38%),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: var(--teal-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 22px;
  width: min(1480px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
}

.control-panel,
.workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.control-panel {
  align-self: start;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 22px;
}

.brand-bar,
.workspace-toolbar,
.day-header,
.action-row,
.toolbar-actions,
.destination-entry {
  display: flex;
  align-items: center;
}

.brand-bar,
.workspace-toolbar,
.day-header {
  justify-content: space-between;
  gap: 16px;
}

.brand-bar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

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

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.25;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 70px;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.trip-form {
  display: grid;
  gap: 17px;
}

.history-panel {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.history-head h2 {
  font-size: 16px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid #dcd4ca;
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.history-item:hover {
  border-color: var(--teal);
}

.history-item strong {
  overflow-wrap: anywhere;
}

.history-item span,
.history-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field > span {
  color: #34413d;
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbc4bb;
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 124, 115, 0.16);
  background: #ffffff;
}

.destination-entry {
  gap: 8px;
}

.destination-entry input {
  min-width: 0;
}

.destination-entry button {
  flex: 0 0 auto;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid rgba(14, 124, 115, 0.24);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--teal-dark);
  padding: 6px 8px 6px 12px;
  font-size: 14px;
  font-weight: 800;
}

.chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 91, 85, 0.1);
  color: var(--teal-dark);
  font-size: 17px;
  line-height: 1;
}

.action-row {
  gap: 10px;
  padding-top: 4px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 850;
  white-space: nowrap;
}

.primary-button {
  flex: 1;
  background: var(--teal);
  color: white;
}

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

.secondary-button {
  background: #fffefa;
  border-color: #cfc7bd;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.ghost-button {
  background: transparent;
  border-color: transparent;
  color: var(--coral);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.workspace-toolbar {
  margin-bottom: 18px;
}

.toolbar-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.message-area {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 750;
}

.message-area[data-kind="info"] {
  background: #eef4f3;
  color: var(--teal-dark);
}

.message-area[data-kind="success"] {
  background: var(--green-soft);
  color: var(--teal-dark);
}

.message-area[data-kind="error"] {
  background: var(--coral-soft);
  color: #8f331f;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 62vh;
  border: 1px dashed #cfc7bd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  padding: 32px;
  text-align: center;
}

.empty-state h3 {
  margin: 20px 0 8px;
  font-size: 24px;
}

.empty-state p {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
}

.route-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(360px, 80%);
  height: 112px;
}

.route-visual::before {
  content: "";
  position: absolute;
  right: 30px;
  left: 30px;
  top: 50%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral));
}

.route-visual span {
  position: relative;
  width: 34px;
  height: 34px;
  border: 6px solid var(--panel);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 10px 24px rgba(29, 37, 34, 0.16);
}

.route-visual span:nth-child(2) {
  width: 42px;
  height: 42px;
  background: var(--gold);
}

.route-visual span:nth-child(3) {
  background: var(--coral);
}

.plan-output {
  display: grid;
  gap: 18px;
}

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

.summary-card,
.ai-brief,
.assumptions,
.source-panel,
.rental-panel,
.day-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-card {
  display: grid;
  gap: 6px;
  min-height: 108px;
  padding: 14px;
}

.summary-card span,
.day-index,
.hotel-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: 19px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.summary-card small,
.hotel-meta small,
.attraction-item span,
.route-badge span {
  color: var(--muted);
  line-height: 1.4;
}

.ai-brief,
.assumptions,
.source-panel,
.rental-panel {
  padding: 16px;
}

.ai-brief {
  border-color: rgba(14, 124, 115, 0.25);
  background: #f5fbf9;
}

.ai-brief h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.ai-brief p,
.assumptions p {
  margin-bottom: 0;
  color: #35433f;
  line-height: 1.65;
}

.assumptions {
  display: grid;
  gap: 6px;
  background: #fffaf0;
}

.source-panel {
  display: grid;
  gap: 12px;
}

.source-panel h3,
.rental-panel h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.source-panel div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-panel a {
  border: 1px solid rgba(14, 124, 115, 0.22);
  border-radius: 8px;
  background: var(--green-soft);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.rental-panel {
  display: grid;
  gap: 12px;
  border-color: rgba(183, 131, 33, 0.32);
  background: #fffbf1;
}

.rental-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.rental-route {
  border-radius: 8px;
  background: rgba(183, 131, 33, 0.13);
  color: #71500f;
  padding: 10px 12px;
  font-weight: 900;
}

.rental-options {
  display: grid;
  gap: 10px;
}

.rental-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  border: 1px solid #e6dac7;
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.rental-option span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.rental-option p {
  grid-column: 1 / -1;
  margin: 0;
}

.day-list {
  display: grid;
  gap: 16px;
}

.day-card {
  padding: 18px;
}

.day-header {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.day-header h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.25;
}

.route-badge {
  display: grid;
  gap: 4px;
  min-width: 190px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--teal-dark);
  padding: 10px 12px;
  text-align: right;
}

.route-badge strong {
  font-size: 14px;
}

.route-badge a {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
}

.daily-focus {
  margin: 14px 0;
  color: #35433f;
  line-height: 1.6;
}

.day-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.92fr);
  gap: 14px;
  align-items: start;
}

.day-section {
  min-width: 0;
}

.day-section h4 {
  margin-bottom: 10px;
  font-size: 16px;
}

.attraction-list,
.hotel-list {
  display: grid;
  gap: 10px;
}

.attraction-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e5ded4;
  border-radius: 8px;
  background: #fffefa;
  padding: 12px;
}

.attraction-item strong,
.hotel-meta strong {
  display: block;
  line-height: 1.35;
}

.price-stack {
  display: grid;
  gap: 4px;
  text-align: right;
  white-space: nowrap;
}

.price-stack span {
  color: var(--coral);
  font-weight: 900;
}

.ticket-total {
  margin: 10px 0 0;
  color: var(--coral);
  font-weight: 850;
}

.hotel-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  border: 1px solid #e5ded4;
  border-radius: 8px;
  background: #fffefa;
  padding: 12px;
}

.hotel-price {
  color: var(--teal-dark);
  font-weight: 900;
  text-align: right;
}

.booking-links {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
}

.booking-links a {
  min-height: 32px;
  border: 1px solid rgba(14, 124, 115, 0.22);
  border-radius: 8px;
  background: var(--green-soft);
  padding: 6px 10px;
  font-weight: 850;
}

.hint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hint-row span {
  border-radius: 999px;
  background: var(--coral-soft);
  color: #8f331f;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    margin: 10px auto;
  }

  .control-panel,
  .workspace {
    padding: 16px;
  }

  .brand-bar,
  .workspace-toolbar,
  .day-header,
  .action-row,
  .destination-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    justify-content: stretch;
  }

  .toolbar-actions button,
  .action-row button,
  .destination-entry button {
    width: 100%;
  }

  .field-grid.two,
  .summary-grid,
  .day-columns,
  .rental-option,
  .hotel-option,
  .attraction-item {
    grid-template-columns: 1fr;
  }

  .route-badge,
  .hotel-price,
  .price-stack {
    text-align: left;
  }

  h1 {
    font-size: 23px;
  }

  h2,
  .empty-state h3,
  .day-header h3 {
    font-size: 21px;
  }
}
