:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --ink: #16211f;
  --muted: #68736f;
  --line: #dce4df;
  --primary: #126b5f;
  --primary-strong: #0c5048;
  --accent: #b7462a;
  --amber: #b97912;
  --blue: #265f9f;
  --shadow: 0 16px 45px rgba(20, 39, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 48px);
  background: #0f332f;
  color: #fff;
}

.topbar h1,
.topbar p {
  margin: 0;
}

.eyebrow {
  color: #8cc8bd;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 20px auto 52px;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  margin-bottom: 18px;
  background: rgba(245, 247, 244, 0.92);
  backdrop-filter: blur(12px);
}

.tab,
.ghost,
.secondary,
.primary {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.tab.active,
.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

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

.secondary {
  border-color: #c5d5d0;
  color: var(--primary-strong);
}

.ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  min-height: 280px;
  padding: clamp(24px, 5vw, 56px);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(10, 45, 40, 0.88), rgba(10, 45, 40, 0.44)),
    url("/warehouse.svg");
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.hero h2 {
  max-width: 680px;
  margin: 8px 0 12px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  margin: 0;
  color: #eaf2ef;
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hero-actions button {
  min-width: 120px;
  padding: 0 18px;
}

.notice-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0 28px;
}

.notice-strip > div,
.panel,
.announcement,
.status-card,
.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(20, 39, 35, 0.06);
}

.notice-strip > div {
  padding: 16px;
}

.notice-strip strong {
  display: block;
  margin-bottom: 5px;
}

.notice-strip span,
.muted,
small {
  color: var(--muted);
}

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

.section-head h3 {
  margin: 0;
}

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

.announcement {
  padding: 18px;
}

.announcement h4 {
  margin: 8px 0;
  font-size: 19px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f2ef;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.badge.warn {
  background: #fff2d8;
  color: #835308;
}

.badge.danger {
  background: #ffe5df;
  color: #8a260f;
}

.panel {
  padding: clamp(18px, 4vw, 28px);
}

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

.form-title,
.full {
  grid-column: 1 / -1;
}

.form-title h2,
.lookup h2,
.admin-login h2 {
  margin: 0 0 8px;
}

.form-title p,
.lookup p,
.admin-login p {
  margin: 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd7d1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.result {
  min-height: 26px;
  margin: 0;
  font-weight: 800;
  color: var(--primary-strong);
}

.lookup {
  margin-bottom: 16px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 18px;
}

.status-card {
  padding: 22px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.timeline-item {
  border-left: 3px solid var(--primary);
  padding: 4px 0 4px 12px;
}

.hidden {
  display: none !important;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  padding: 18px;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  align-items: start;
}

.filters {
  margin-bottom: 12px;
}

.report-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.report-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
  text-align: left;
}

.report-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 107, 95, 0.12);
}

.report-item strong {
  display: block;
  margin-bottom: 7px;
}

.detail {
  min-height: 450px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.detail-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.detail-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.description {
  white-space: pre-wrap;
  line-height: 1.7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfb;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.attachments a,
.download {
  color: var(--primary-strong);
  font-weight: 800;
}

.note-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

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

.announcement-editor {
  margin-top: 16px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: none;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #13211f;
  color: #fff;
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
  }

  .hero,
  .notice-strip,
  .form-grid,
  .stats,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .inline-form,
  .admin-actions {
    grid-template-columns: 1fr;
    display: grid;
    width: 100%;
  }

  .tabs {
    gap: 6px;
  }

  .tab {
    min-height: 42px;
    font-size: 14px;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 18px 14px;
  }

  .topbar h1 {
    font-size: 23px;
  }

  .shell {
    width: calc(100% - 18px);
    margin-top: 10px;
  }

  .hero {
    min-height: 430px;
    align-content: end;
    background-position: center right;
  }

  .hero h2 {
    font-size: 34px;
  }

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