:root {
  --ink: #12384a;
  --blue: #2d5f84;
  --deep: #17485c;
  --aqua: #6fb8bd;
  --paper: #f5f7f7;
  --white: #ffffff;
  --muted: #6d7c82;
  --line: rgba(18, 56, 74, 0.14);
  --shadow: 0 18px 55px rgba(18, 56, 74, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans TC", "Segoe UI", Arial, sans-serif;
}

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

button,
a {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  background: var(--white);
  border-right: 1px solid var(--line);
}

.brand img {
  width: 190px;
  display: block;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.side-nav button,
.front-link,
.diagram-link {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  font-weight: 900;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.side-nav button.active,
.side-nav button:hover,
.front-link:hover,
.diagram-link:hover {
  border-color: var(--line);
  background: #eef3f2;
  color: var(--blue);
}

.front-link,
.diagram-link {
  margin-top: auto;
}

.diagram-link {
  margin-top: 0;
}

.admin-shell {
  margin-left: 280px;
  min-height: 100vh;
  padding: 34px clamp(22px, 4vw, 58px);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--aqua);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 42px);
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(111, 184, 189, 0.18);
  color: var(--deep);
  padding: 0 14px;
  font-weight: 900;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.metric-grid,
.form-grid,
.review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-grid article,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(18, 56, 74, 0.06);
}

.metric-grid article {
  padding: 22px;
}

.metric-grid strong {
  display: block;
  color: var(--blue);
  font-size: 38px;
}

.metric-grid span,
.admin-header p,
label,
.upload-box span,
.preview-card p {
  color: var(--muted);
  font-weight: 800;
}

.help-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.workbench {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  margin-top: 18px;
}

.card {
  padding: 22px;
}

.timeline {
  display: grid;
  gap: 12px;
  padding-left: 22px;
  font-weight: 900;
}

.timeline .done {
  color: var(--aqua);
}

.timeline .current {
  color: var(--blue);
}

.diagram-preview {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: #eef3f2;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

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

label {
  display: grid;
  gap: 8px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 13px 14px;
  font-weight: 800;
}

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

.primary-btn,
.ghost-btn,
.ghost-link {
  min-height: 44px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 900;
}

.primary-btn {
  border: 0;
  color: var(--white);
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(45, 95, 132, 0.22);
}

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
  text-decoration: none;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.media-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
}

.upload-box {
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px dashed rgba(45, 95, 132, 0.28);
  border-radius: 8px;
  background: #eef3f2;
}

.upload-box input {
  display: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
}

.check-row {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}

.check-row input {
  width: 20px;
  height: 20px;
}

.action-row {
  display: flex;
  gap: 10px;
}

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

.preview-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: center;
}

.preview-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.preview-card h3 {
  font-size: 28px;
}

.preview-card strong {
  color: var(--blue);
  font-size: 28px;
}

.review-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.review-list li {
  padding: 12px;
  border-radius: 6px;
  background: #eef3f2;
  font-weight: 900;
}

.review-list .warn {
  background: #fff3de;
  color: #8a5a00;
}

.toast-modal {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 28px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.toast-modal::backdrop {
  background: rgba(8, 28, 38, 0.58);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #eef3f2;
  color: var(--ink);
  font-size: 24px;
}

@media (max-width: 960px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .admin-shell {
    margin-left: 0;
  }

  .metric-grid,
  .workbench,
  .media-layout,
  .review-grid,
  .preview-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .admin-header,
  .section-head,
  .action-row {
    display: grid;
  }

  .panel-actions {
    display: grid;
  }

  .metric-grid,
  .form-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  .sidebar {
    gap: 12px;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand img {
    width: 150px;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .side-nav button,
  .front-link,
  .diagram-link {
    min-height: 44px;
    padding: 0 10px;
    font-size: 15px;
    justify-content: center;
    text-align: center;
  }

  .front-link,
  .diagram-link {
    margin-top: 0;
  }

  .admin-shell {
    padding: 24px 14px 48px;
  }

  .admin-header {
    display: grid;
    gap: 14px;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 30px;
  }

  .status-pill {
    justify-self: start;
  }

  .metric-grid article,
  .card {
    padding: 16px;
  }

  .section-head {
    display: grid;
    align-items: start;
  }

  .primary-btn,
  .ghost-btn,
  .ghost-link {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }

  input,
  select,
  textarea {
    min-height: 46px;
    padding: 12px;
  }

  .upload-box {
    min-height: 140px;
    padding: 16px;
  }

  .preview-card {
    gap: 14px;
  }

  .toast-modal {
    padding: 22px;
  }
}
