:root {
  color-scheme: dark;
  --bg: #0b0d0c;
  --bg-2: #101412;
  --surface: #161a18;
  --surface-2: #1d2320;
  --surface-3: #26302a;
  --ink: #eef3ef;
  --ink-soft: #c8d2cc;
  --ink-dim: #8b9891;
  --ink-faint: #55615b;
  --line: #29322e;
  --line-soft: #202823;
  --accent: #5ee28d;
  --accent-strong: #27bd5d;
  --accent-ink: #062510;
  --warn: #f2c458;
  --danger: #ee6a6a;
  --font-ui: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 78% 4%, rgba(94, 226, 141, 0.08), transparent 62%),
    linear-gradient(180deg, #0b0d0c 0%, #0e1210 48%, #0b0d0c 100%);
  font-family: var(--font-ui);
}

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

button {
  border: 0;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 13, 12, 0.86);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-ink);
  background: var(--accent);
  font-family: var(--font-mono);
  font-weight: 800;
}

.brand-name {
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-sub {
  margin-top: 3px;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav button,
.mobile-tab button {
  color: var(--ink-dim);
  background: transparent;
  cursor: pointer;
}

.nav button {
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
}

.nav button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.nav button.active {
  color: var(--accent);
  background: rgba(94, 226, 141, 0.1);
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.avatar {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 800;
}

.page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 40px 0 96px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: clamp(28px, 6vw, 76px);
  align-items: center;
  min-height: calc(100vh - 144px);
}

.eyebrow {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 20px;
  font-size: clamp(50px, 8vw, 102px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.lead {
  max-width: 640px;
  color: var(--ink-dim);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.85;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 750;
}

.button:hover {
  background: var(--surface-2);
}

.button.primary {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
}

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

.button.ghost {
  background: transparent;
}

.button.danger {
  border-color: rgba(238, 106, 106, 0.45);
  color: var(--danger);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hero-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  height: min(62vh, 620px);
  min-height: 420px;
}

.hero-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-column.offset {
  padding-top: 42px;
}

.art-card {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.art-card.large {
  flex: 1.35;
}

.art-card.small {
  flex: 1;
}

.art-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0 2px, transparent 2px 9px),
    linear-gradient(135deg, rgba(94, 226, 141, 0.18), rgba(84, 91, 190, 0.18));
}

.art-card.v2::before {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 8px),
    linear-gradient(135deg, rgba(232, 83, 138, 0.22), rgba(94, 226, 141, 0.12));
}

.art-card.v3::before {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 3px, transparent 3px 10px),
    linear-gradient(135deg, rgba(242, 196, 88, 0.19), rgba(58, 113, 214, 0.2));
}

.art-card.v4::before {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 7px),
    linear-gradient(135deg, rgba(73, 210, 202, 0.18), rgba(190, 84, 168, 0.2));
}

.art-label {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1;
}

.art-label b {
  display: block;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

.art-label span {
  display: block;
  margin-top: 4px;
  color: rgba(238, 243, 239, 0.72);
  font-size: 12px;
}

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

.section-head p {
  margin: 7px 0 0;
  color: var(--ink-dim);
  line-height: 1.7;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
}

.field,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.field,
.select {
  height: 44px;
  padding: 0 13px;
}

.textarea {
  min-height: 112px;
  padding: 13px;
  resize: vertical;
  line-height: 1.7;
}

.field:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
}

.search {
  flex: 1 1 280px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(94, 226, 141, 0.09);
}

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

.submission-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.submission-card .art-card {
  min-height: 210px;
  border: 0;
  border-radius: 0;
}

.card-body {
  padding: 15px;
}

.card-title {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 800;
}

.muted {
  color: var(--ink-dim);
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--ink-dim);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status.approved {
  color: var(--accent-ink);
  background: var(--accent);
}

.status.reviewing {
  color: #3b2c08;
  background: var(--warn);
}

.status.draft {
  color: var(--ink-soft);
  background: var(--surface-3);
}

.status.rejected {
  color: #351010;
  background: var(--danger);
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 26, 24, 0.9);
}

.panel-head,
.panel-body,
.panel-foot {
  padding: 18px;
}

.panel-head {
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h3 {
  margin-bottom: 5px;
}

.panel-head p {
  margin-bottom: 0;
  color: var(--ink-dim);
  line-height: 1.6;
}

.panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.upload-box {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  cursor: pointer;
}

.upload-box.ready {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(94, 226, 141, 0.08);
}

.stepper {
  display: grid;
  gap: 10px;
}

.step-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 8px;
  color: var(--ink-dim);
}

.step-row.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.step-row.done {
  color: var(--accent);
}

.step-num {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.preview-stack {
  display: grid;
  gap: 12px;
}

.progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  transition: width 0.2s ease;
}

.empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--ink-dim);
  text-align: center;
}

.notice {
  padding: 12px 14px;
  border: 1px solid rgba(242, 196, 88, 0.3);
  border-radius: 8px;
  color: #f2d48c;
  background: rgba(242, 196, 88, 0.08);
  line-height: 1.65;
  font-size: 13px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.admin-tabs button {
  padding: 12px 14px;
  border-bottom: 2px solid transparent;
  color: var(--ink-dim);
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.admin-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-panel-head h3,
.phase-card h4 {
  margin: 0 0 5px;
}

.admin-actions,
.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-row-actions button {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.admin-row-actions button:hover {
  color: var(--ink);
  background: var(--surface-3);
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.admin-table th {
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table code {
  color: var(--accent);
  font-family: var(--font-mono);
}

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

.phase-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-card span {
  color: var(--ink-dim);
  font-size: 12px;
}

.stat-card b {
  display: block;
  margin-top: 6px;
  font-size: 32px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(22, 26, 24, 0.96);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

.mobile-tab {
  position: fixed;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 25;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 13, 12, 0.9);
  backdrop-filter: blur(12px);
}

.mobile-tab button {
  min-height: 42px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
}

.mobile-tab button.active {
  color: var(--accent);
  background: rgba(94, 226, 141, 0.1);
}

@media (max-width: 920px) {
  .topbar {
    min-height: 64px;
  }

  .nav {
    display: none;
  }

  .account-pill {
    margin-left: auto;
  }

  .page {
    width: min(100% - 28px, 680px);
    padding-top: 28px;
  }

  .hero,
  .create-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-board {
    height: 430px;
    min-height: 360px;
  }

  .grid,
  .admin-grid,
  .phase-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel-head {
    display: block;
  }

  .admin-actions {
    margin-top: 12px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .mobile-tab {
    display: grid;
  }
}

@media (max-width: 520px) {
  .brand-sub,
  .account-pill span {
    display: none;
  }

  .topbar {
    padding-inline: 14px;
  }

  h1 {
    font-size: 48px;
  }

  .hero-board {
    grid-template-columns: 1fr;
    height: auto;
  }

  .hero-column,
  .hero-column.offset {
    padding-top: 0;
  }

  .art-card {
    min-height: 220px;
  }

  .section-head {
    display: block;
  }

  .panel-foot {
    flex-direction: column-reverse;
  }

  .panel-foot .button {
    width: 100%;
  }
}
