:root {
  --ink: #1d2528;
  --muted: #687276;
  --line: #d9e3e1;
  --paper: #fbfcfa;
  --surface: #ffffff;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --coral: #df654d;
  --mustard: #bd8a1f;
  --mint: #d7eee8;
  --rose: #fae0dc;
  --shadow: 0 20px 60px rgba(26, 41, 44, 0.14);
  --radius: 8px;
  color-scheme: light;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Hiragino Sans GB",
    "Noto Sans CJK SC",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

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

button,
select {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.gate {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
}

.gate__photo,
.hero__image {
  background-image: url("assets/travel-hero.png");
  background-size: cover;
  background-position: center;
}

.gate__photo {
  position: absolute;
  inset: 0;
  transform: scale(1.02);
}

.gate__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 30, 31, 0.7), rgba(10, 30, 31, 0.14) 55%, rgba(255, 255, 255, 0.16)),
    linear-gradient(0deg, rgba(10, 30, 31, 0.4), rgba(10, 30, 31, 0.06));
}

.gate__panel {
  position: relative;
  width: min(440px, 100%);
  margin-right: min(48vw, 680px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  padding: 32px;
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.25rem, 8vw, 4.5rem);
  line-height: 0.98;
  font-weight: 900;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 3vw, 2.7rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.1rem;
}

.gate__copy {
  margin-bottom: 28px;
  color: #435052;
  line-height: 1.7;
}

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

.field span {
  color: #435052;
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.search input,
.toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: 0;
  min-height: 46px;
  padding: 11px 13px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus,
.search input:focus,
.toolbar select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.gate__actions,
.form-actions,
.utility-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.button,
.icon-button,
.tab {
  border: 0;
  border-radius: var(--radius);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease;
}

.button {
  padding: 0 16px;
}

.button:hover,
.icon-button:hover,
.tab:hover {
  transform: translateY(-1px);
}

.button__icon {
  width: 19px;
  height: 19px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.83rem;
  line-height: 1;
}

.button--primary {
  background: var(--teal);
  color: white;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.24);
}

.button--primary .button__icon {
  background: rgba(255, 255, 255, 0.18);
}

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

.button--secondary {
  background: var(--coral);
  color: white;
  box-shadow: 0 12px 28px rgba(223, 101, 77, 0.2);
}

.button--secondary .button__icon {
  background: rgba(255, 255, 255, 0.18);
}

.button--ghost {
  background: #edf4f2;
  color: var(--teal-dark);
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--coral);
  font-weight: 700;
}

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(160px, 0.6fr);
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid rgba(217, 227, 225, 0.9);
  background: rgba(251, 252, 250, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--teal) 0 50%, transparent 50%),
    linear-gradient(45deg, var(--coral) 0 48%, var(--mustard) 48%);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.2);
}

.brand strong,
.brand span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  padding: 5px;
  border-radius: var(--radius);
  background: #eef4f3;
}

.tab {
  min-width: 70px;
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  color: #4d5d60;
}

.tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(29, 37, 40, 0.08);
}

.session {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.session span {
  min-width: 0;
  max-width: 170px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  background: #e8efed;
  color: var(--ink);
}

.workspace {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 54px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.overview {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(520px, 1.15fr);
  gap: 36px;
  align-items: end;
  padding: 28px 0 26px;
  border-bottom: 1px solid var(--line);
}

.overview__copy h2 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.overview__copy > p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.overview__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  align-items: stretch;
}

.overview__stats span {
  min-height: 76px;
  display: grid;
  align-content: center;
  padding: 8px 20px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.overview__stats strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 1.9rem;
  line-height: 1;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) minmax(150px, 210px) auto;
  gap: 10px;
  align-items: center;
  margin: 20px 0;
}

.toolbar--compact {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px);
  margin: 0 0 14px;
}

.search {
  position: relative;
  display: block;
}

.search input {
  padding-left: 40px;
}

.search__icon {
  position: absolute;
  z-index: 1;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid var(--teal);
  border-radius: 999px;
  transform: translateY(-55%);
}

.search__icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -6px;
  bottom: -4px;
  border-radius: 999px;
  background: var(--teal);
  transform: rotate(45deg);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.media-card,
.record-card,
.member-card,
.panel-form,
.utility-panel,
.dropzone,
.empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(29, 37, 40, 0.06);
}

.media-card {
  overflow: hidden;
}

.media-card__preview {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e7eeee;
}

.media-card__preview img,
.media-card__preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.file-preview {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 42px 22px 20px;
  background: #eef4f3;
  color: var(--ink);
}

.file-preview > span {
  width: fit-content;
  min-width: 58px;
  padding: 7px 10px;
  border: 1px solid #b9cfca;
  border-radius: 6px;
  background: var(--surface);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.file-preview strong {
  align-self: end;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.file-preview small {
  color: var(--muted);
}

.media-loading {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #eef4f3;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.media-card__kind,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.media-card__kind {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.media-card__body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

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

.media-card__title strong {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.meta {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f4;
  color: #526164;
  font-size: 0.78rem;
  font-weight: 800;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfa;
  color: var(--ink);
  font-weight: 800;
}

.small-button--danger {
  color: #b04434;
  border-color: #f1c8c0;
  background: #fff7f5;
}

.section-heading {
  margin: 6px 0 18px;
}

.section-heading h2 {
  margin-bottom: 8px;
}

.section-heading > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.upload-layout,
.records-layout,
.members-layout,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.records-layout {
  grid-template-columns: minmax(340px, 0.72fr) minmax(420px, 1.28fr);
}

.settings-layout {
  grid-template-columns: minmax(360px, 1fr) minmax(280px, 0.7fr);
}

.dropzone {
  position: relative;
  min-height: 310px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  border-style: dashed;
  background: #f1f7f5;
  text-align: center;
}

.dropzone.is-dragging {
  border-color: var(--teal);
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.12);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone__icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 2.2rem;
  font-weight: 800;
}

.dropzone span {
  color: var(--muted);
  line-height: 1.6;
}

.panel-form,
.utility-panel {
  padding: 18px;
}

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

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

.pending {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.pending-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.pending-item img,
.pending-item video {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #e7eeee;
}

.pending-item__file {
  min-height: 143px;
  display: grid;
  place-items: center;
  background: #edf4f2;
}

.pending-item__file span {
  min-width: 60px;
  padding: 8px 10px;
  border: 1px solid #b9cfca;
  border-radius: 6px;
  background: white;
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
}

.pending-item div {
  padding: 10px;
}

.pending-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

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

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

.record-card,
.member-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.record-card__head,
.member-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.record-card__head strong,
.member-card__head strong {
  overflow-wrap: anywhere;
}

.record-card pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: #f5f8f7;
  color: #2e393b;
  white-space: pre-wrap;
  line-height: 1.55;
  font-family: inherit;
}

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

.avatar {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  font-weight: 900;
}

.member-card__person {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.member-card__person span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.utility-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.import-button {
  position: relative;
  overflow: hidden;
}

.import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.empty {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.empty strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.toast {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 16px;
  border-radius: var(--radius);
  background: #192629;
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

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

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .tabs {
    grid-column: 1 / -1;
    justify-self: stretch;
    overflow-x: auto;
  }

  .tab {
    min-width: 92px;
  }

  .toolbar,
  .overview,
  .upload-layout,
  .records-layout,
  .members-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .gate {
    align-items: end;
    padding: 16px;
  }

  .gate__shade {
    background:
      linear-gradient(0deg, rgba(10, 30, 31, 0.78), rgba(10, 30, 31, 0.16) 70%),
      linear-gradient(90deg, rgba(10, 30, 31, 0.44), rgba(10, 30, 31, 0.08));
  }

  .gate__panel {
    margin: 0;
    padding: 24px;
  }

  .topbar {
    padding: 12px 14px;
    gap: 12px;
  }

  .brand span {
    display: none;
  }

  .session span {
    max-width: 110px;
  }

  .workspace {
    width: min(100% - 20px, 1360px);
    padding-top: 14px;
  }

  .overview {
    gap: 22px;
    padding-top: 14px;
  }

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

  .overview__stats span:nth-child(3) {
    border-top: 1px solid var(--line);
  }

  .overview__stats span:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .toolbar,
  .toolbar--compact,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .button,
  .gate__actions,
  .form-actions,
  .utility-actions {
    width: 100%;
  }

  .button {
    justify-content: center;
  }

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