:root {
  --bg: #020706;
  --panel: #071211;
  --panel-2: #0c1c1b;
  --line: rgba(16, 245, 235, 0.22);
  --text: #eaffff;
  --muted: #87acab;
  --brand: #10f5eb;
  --brand-2: #62fff7;
  --danger: #ff5d6c;
  --warn: #ffd166;
  --ok: #37f59b;
  --shadow: 0 18px 70px rgba(0, 255, 240, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(16, 245, 235, 0.12), transparent 32rem),
    linear-gradient(180deg, #010302 0%, var(--bg) 42%, #000 100%);
  color: var(--text);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(1, 7, 6, 0.88);
  backdrop-filter: blur(18px);
}

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

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(16, 245, 235, 0.32);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 4px solid var(--brand);
  border-radius: 8px;
  transform: rotate(45deg);
  position: relative;
  box-shadow: 0 0 28px rgba(16, 245, 235, 0.35);
  flex: 0 0 auto;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-right: 4px solid var(--brand);
  border-top: 4px solid var(--brand);
  border-radius: 3px;
}

.brand-title {
  display: grid;
  gap: 2px;
}

.brand-title strong {
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.brand-title span {
  color: var(--brand-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.nav button,
.ghost-btn,
.primary-btn,
.secondary-btn,
.danger-btn,
.icon-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 245, 235, 0.06);
  color: var(--text);
  min-height: 40px;
  padding: 0 14px;
}

.nav button.active,
.primary-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #001211;
  font-weight: 900;
  box-shadow: 0 0 26px rgba(16, 245, 235, 0.24);
}

.danger-btn {
  border-color: rgba(255, 93, 108, 0.46);
  color: #ffd8dd;
  background: rgba(255, 93, 108, 0.08);
}

.secondary-btn {
  border-color: rgba(16, 245, 235, 0.36);
  color: var(--brand);
  background: rgba(16, 245, 235, 0.08);
  font-weight: 800;
}

.account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 210px;
  color: var(--muted);
  font-size: 14px;
}

.main {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.hero {
  min-height: 360px;
  display: grid;
  align-items: center;
  gap: 30px;
  grid-template-columns: 1fr 0.9fr;
  padding: clamp(24px, 5vw, 58px) 0;
}

.hero h1 {
  margin: 0 0 16px;
  color: var(--brand);
  font-size: clamp(34px, 6vw, 76px);
  line-height: 0.98;
  font-weight: 950;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: #c7f5f3;
  font-size: 18px;
  line-height: 1.75;
}

.hero-logo {
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 18, 17, 0.82);
  padding: 16px;
}

.stat strong {
  display: block;
  color: var(--brand);
  font-size: 26px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

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

.section-head h2 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(26px, 4vw, 42px);
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.45fr);
  gap: 18px;
  align-items: start;
}

.card,
.form-panel,
.detail-panel,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 18, 17, 0.9);
  box-shadow: var(--shadow);
}

.card {
  overflow: hidden;
}

.card-media {
  aspect-ratio: 4 / 3;
  background: var(--panel-2);
  overflow: hidden;
}

.card-media img,
.photo-tile img,
.result-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 14px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(16, 245, 235, 0.24);
  border-radius: 999px;
  color: var(--brand);
  background: rgba(16, 245, 235, 0.06);
}

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

.form-panel h3,
.detail-panel h3,
.notice h3 {
  margin: 0 0 14px;
  color: var(--brand);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.field label {
  color: #c7f5f3;
  font-size: 14px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020a09;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16, 245, 235, 0.12);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.compact-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.code-text {
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.08em;
}

.empty {
  border: 1px dashed rgba(16, 245, 235, 0.32);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

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

.photo-tile,
.result-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #020a09;
}

.photo-tile .image,
.result-tile .image {
  aspect-ratio: 1 / 1;
  background: var(--panel-2);
}

.tile-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.topic,
.thread,
.reply,
.pending-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 18, 17, 0.72);
  padding: 14px;
  margin-bottom: 12px;
}

.topic h3,
.thread h3 {
  margin: 0 0 8px;
}

.topic p,
.thread p,
.reply p,
.pending-item p {
  color: #d6fffd;
  line-height: 1.7;
  margin: 0 0 10px;
  white-space: pre-wrap;
}

.auth {
  width: min(920px, calc(100% - 32px));
  margin: 8vh auto;
}

.auth .brand {
  margin-bottom: 20px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.auth-grid form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(2, 10, 9, 0.55);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100% - 36px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #041110;
  color: var(--text);
  box-shadow: var(--shadow);
}

.warn {
  color: var(--warn);
}

.ok {
  color: var(--ok);
}

.danger {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

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

  .brand,
  .account {
    min-width: 0;
  }

  .hero,
  .two-col,
  .auth-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .grid,
  .stats,
  .photo-grid,
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .main {
    width: min(100% - 20px, 1220px);
    padding-top: 18px;
  }

  .nav {
    justify-content: flex-start;
  }

  .nav button {
    flex: 1 1 auto;
  }

  .grid,
  .stats,
  .photo-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 38px;
  }
}
