:root {
  --bg: #f4f8f9;
  --surface: #ffffff;
  --surface-soft: #eef7f6;
  --text: #17313a;
  --muted: #65757c;
  --line: #d8e4e7;
  --primary: #0f7891;
  --primary-dark: #0a5f73;
  --teal: #25a68f;
  --green: #168a62;
  --orange: #c66a11;
  --red: #c23b3b;
  --cream: #fff9ee;
  --shadow: 0 14px 34px rgba(28, 68, 78, 0.10);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero {
  min-height: 260px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 46%);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1 {
  margin: 6px 0 12px;
  max-width: 720px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-image {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  border-left: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.trip-panel,
.summary-card,
.add-card,
.actions-card,
.category-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.trip-panel {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px;
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.2;
}

.section-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.trip-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 14px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #36515a;
  font-weight: 700;
  font-size: 0.92rem;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd9dd;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fbfdfd;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 120, 145, 0.14);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.section-heading,
.summary-top {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.list-column {
  min-width: 0;
}

.count-pill,
.status-badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.84rem;
  font-weight: 800;
}

.count-pill {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.category-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.category-card {
  overflow: hidden;
}

.category-header {
  width: 100%;
  min-height: 58px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: #fbfdfd;
  color: var(--text);
  text-align: left;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.category-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
}

.category-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.item-list {
  display: grid;
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.item-row {
  display: grid;
  grid-template-columns: 42px minmax(120px, 1fr) 92px 92px 42px;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 14px;
  background: var(--surface);
}

.item-row.packed {
  background: #f6fbfa;
}

.item-check {
  width: 22px;
  height: 22px;
  accent-color: var(--teal);
}

.item-name {
  min-width: 0;
}

.item-name strong {
  display: block;
  overflow-wrap: anywhere;
}

.item-row.packed .item-name strong {
  color: #7d8c91;
  text-decoration: line-through;
}

.packed-label {
  display: none;
  width: max-content;
  margin-top: 3px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.item-row.packed .packed-label {
  display: block;
}

.mini-field span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.mini-field input {
  min-height: 38px;
  padding: 7px 8px;
}

.delete-button {
  width: 38px;
  height: 38px;
  border: 1px solid #f0c4c4;
  border-radius: var(--radius);
  background: #fff7f7;
  color: var(--red);
  font-weight: 900;
}

.delete-button:hover {
  background: #ffecec;
}

.side-column {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
}

.summary-card,
.add-card,
.actions-card {
  padding: 18px;
}

.status-badge.ok {
  background: #e6f6ef;
  color: var(--green);
}

.status-badge.warn {
  background: #fff0d8;
  color: var(--orange);
}

.status-badge.danger {
  background: #ffe7e7;
  color: var(--red);
}

.weight-number {
  margin: 18px 0;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--cream);
}

.weight-number span {
  display: block;
  font-size: 3rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.weight-number small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.summary-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: #fbfdfd;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.alert-message {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: var(--radius);
  background: #eaf7fa;
  color: var(--primary-dark);
  font-weight: 700;
}

.summary-card.warn .alert-message {
  background: #fff2df;
  color: var(--orange);
}

.summary-card.danger .alert-message {
  background: #ffe8e8;
  color: var(--red);
}

.add-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.field-error {
  min-height: 18px;
  margin: 4px 0 0;
  color: var(--red);
  font-size: 0.84rem;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  border-radius: var(--radius);
  padding: 10px 13px;
  border: 1px solid transparent;
  font-weight: 800;
}

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

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

.secondary-button {
  background: #eef6f6;
  color: var(--primary-dark);
  border-color: #cfe3e6;
}

.secondary-button:hover {
  background: #e2f1f1;
}

.danger-button {
  background: #fff5f5;
  color: var(--red);
  border-color: #f0c4c4;
}

.danger-button:hover {
  background: #ffecec;
}

.action-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.toast {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--green);
  font-weight: 800;
}

.empty-state {
  margin: 16px 0 0;
  padding: 20px;
  border: 1px dashed #bdd3d8;
  border-radius: var(--radius);
  background: #fbfdfd;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

@media (max-width: 940px) {
  .hero,
  .trip-panel,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .hero-image {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .side-column {
    position: static;
  }

  .trip-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 14px 0 28px;
  }

  .hero-copy,
  .trip-panel,
  .summary-card,
  .add-card,
  .actions-card {
    padding: 16px;
  }

  .hero {
    min-height: auto;
  }

  .hero-image {
    min-height: 150px;
  }

  .trip-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .item-row {
    grid-template-columns: 34px minmax(0, 1fr) 40px;
    grid-template-areas:
      "check name del"
      ". weight weight"
      ". qty qty";
    gap: 8px;
    padding: 12px;
  }

  .item-check {
    grid-area: check;
  }

  .item-name {
    grid-area: name;
  }

  .item-row .mini-field:nth-of-type(1) {
    grid-area: weight;
  }

  .item-row .mini-field:nth-of-type(2) {
    grid-area: qty;
  }

  .delete-button {
    grid-area: del;
  }

  .weight-number span {
    font-size: 2.35rem;
  }
}
