:root {
  --ink: #142a43;
  --muted: #6d7d8f;
  --paper: #f7f6f1;
  --panel: rgba(255, 255, 255, 0.88);
  --line: #dfe5e5;
  --blue: #28518a;
  --blue-dark: #173f70;
  --orange: #e97855;
  --shadow: 0 28px 70px rgba(36, 56, 74, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(109, 169, 162, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 16%, rgba(232, 168, 92, 0.15), transparent 24rem),
    linear-gradient(155deg, #f7f6f1 0%, #f4f6f3 50%, #f8f5ef 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.home-shell {
  min-height: 100vh;
  padding: 22px clamp(20px, 4vw, 62px);
  position: relative;
}

.home-shell::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(37, 77, 105, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 77, 105, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.home-brand__mark {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, var(--blue), #4b80b4);
  box-shadow: 0 9px 24px rgba(38, 80, 125, 0.2);
}

.home-brand__mark svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-brand strong,
.home-brand small {
  display: block;
}

.home-brand strong {
  font-size: 19px;
  letter-spacing: 0.08em;
}

.home-brand small {
  margin-top: 2px;
  color: #869099;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.26em;
}

.home-logout {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.7fr);
  gap: clamp(48px, 8vw, 130px);
  align-items: center;
  width: min(1160px, 100%);
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 50px 0;
}

.auth-hero h1,
.dashboard-heading h1 {
  margin: 12px 0 18px;
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 1.08;
}

.auth-hero > p:not(.home-eyebrow),
.dashboard-heading > div > p:not(.home-eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.home-eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 30px;
}

.auth-feature-row span {
  padding: 9px 13px;
  border: 1px solid rgba(41, 82, 118, 0.12);
  border-radius: 999px;
  color: #607283;
  background: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 800;
}

.auth-card {
  padding: clamp(25px, 3vw, 38px);
  border: 1px solid rgba(219, 225, 224, 0.9);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.auth-card h2 {
  margin: 11px 0 10px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.auth-copy,
.auth-footnote {
  margin: 0;
  color: #7e8995;
  font-size: 11px;
  line-height: 1.75;
}

.auth-form {
  display: grid;
  gap: 15px;
  margin: 25px 0 16px;
}

.auth-form label,
.home-modal__card label {
  display: grid;
  gap: 7px;
  color: #5c6f82;
  font-size: 11px;
  font-weight: 800;
}

.auth-form input,
.home-modal__card input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #dce2e3;
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fbfcfb;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus,
.home-modal__card input:focus {
  border-color: #7ba0c2;
  box-shadow: 0 0 0 3px rgba(61, 112, 157, 0.12);
}

.auth-message {
  min-height: 18px;
  margin: 0;
  color: #be624e;
  font-size: 11px;
  line-height: 1.55;
}

.home-primary,
.home-secondary {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 13px;
  font-weight: 800;
  cursor: pointer;
}

.home-primary {
  border: 0;
  color: white;
  background: linear-gradient(145deg, #1d4b7d, #315f92);
  box-shadow: 0 9px 20px rgba(35, 79, 123, 0.18);
}

.home-secondary {
  border: 1px solid var(--line);
  color: #52677c;
  background: #fff;
}

.home-primary:disabled,
.home-secondary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.dashboard {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 66px 0 40px;
}

.dashboard-heading {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
}

.dashboard-heading h1 {
  margin: 10px 0 13px;
  font-size: clamp(40px, 5vw, 62px);
}

.dashboard-heading .home-primary {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.trip-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 34px 0 24px;
}

.trip-stats article {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 17px 20px;
  border: 1px solid rgba(219, 225, 224, 0.9);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.66);
}

.trip-stats strong {
  color: var(--blue);
  font-size: 25px;
}

.trip-stats span {
  color: #85909a;
  font-size: 10px;
}

.trip-list {
  display: grid;
  gap: 12px;
}

.trip-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(219, 225, 224, 0.92);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.76);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.trip-card:hover {
  border-color: #ccd8df;
  box-shadow: 0 15px 34px rgba(37, 64, 84, 0.08);
  transform: translateY(-1px);
}

.trip-card__date {
  display: grid;
  width: 66px;
  min-height: 66px;
  place-items: center;
  padding: 8px;
  border-radius: 17px;
  color: var(--blue);
  background: #edf3f8;
  text-align: center;
}

.trip-card__date strong {
  font-size: 20px;
  line-height: 1;
}

.trip-card__date small {
  color: #7e94a8;
  font-size: 9px;
  font-weight: 800;
}

.trip-card__body {
  min-width: 0;
}

.trip-card__body h2 {
  overflow: hidden;
  margin: 0 0 6px;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  color: #82909c;
  font-size: 10px;
}

.trip-card__meta span + span::before {
  margin-right: 13px;
  color: #c2c9ce;
  content: "·";
}

.trip-card__actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.trip-card__actions button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #dde4e5;
  border-radius: 11px;
  color: #5d7185;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.trip-card__actions .open-trip {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.trip-card__actions .delete-trip {
  color: #bd6655;
  border-color: #edd8d3;
  background: #fff7f5;
}

.trip-empty {
  display: grid;
  justify-items: center;
  padding: 70px 20px;
  border: 1px dashed #ccd7da;
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.42);
}

.trip-empty__mark {
  display: grid;
  width: 57px;
  height: 57px;
  place-items: center;
  border-radius: 19px;
  color: var(--blue);
  background: #eaf1f6;
  font-size: 27px;
}

.trip-empty h2 {
  margin: 17px 0 5px;
}

.trip-empty p {
  margin: 0 0 20px;
  color: #7f8c97;
  font-size: 12px;
}

.home-footer {
  display: flex;
  justify-content: space-between;
  width: min(1180px, 100%);
  margin: 40px auto 0;
  padding: 19px 0 8px;
  border-top: 1px solid rgba(193, 203, 205, 0.5);
  color: #96a0a8;
  font-size: 9px;
}

.home-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.home-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(19, 38, 56, 0.28);
  backdrop-filter: blur(6px);
}

.home-modal__card {
  position: relative;
  display: grid;
  width: min(430px, 100%);
  gap: 17px;
  padding: 30px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(18, 41, 60, 0.22);
}

.home-modal__card h2 {
  margin: -6px 0 3px;
  font-size: 25px;
}

.home-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: #87929d;
  background: #f3f5f5;
  cursor: pointer;
}

.home-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  max-width: min(500px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(23, 43, 61, 0.94);
  box-shadow: 0 10px 30px rgba(10, 25, 38, 0.18);
  font-size: 11px;
  transform: translateX(-50%);
}

@media (max-width: 780px) {
  .home-shell {
    padding: 17px 16px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    gap: 38px;
    min-height: auto;
    padding: 65px 0 40px;
  }

  .auth-hero h1 {
    font-size: clamp(42px, 12vw, 58px);
  }

  .dashboard {
    padding-top: 45px;
  }

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

  .trip-stats {
    gap: 7px;
  }

  .trip-stats article {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding: 13px;
  }

  .trip-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 13px;
    padding: 15px;
  }

  .trip-card__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    border-top: 1px solid #eef1f1;
    padding-top: 10px;
  }

  .trip-card__actions button {
    flex: 1;
  }
}
