* {
  box-sizing: border-box;
}

body.admin-body {
  margin: 0;
  min-height: 100vh;
  background: #f3f5f7;
  color: #15171d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.admin-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 14px;
}

.brand {
  display: flex;
  flex-direction: column;
  color: #111827;
  text-decoration: none;
  font-weight: 800;
}

.brand small,
.eyebrow {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel,
.login-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.login-panel {
  margin-top: 14vh;
}

.login-title {
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
}

.notice {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 14px;
}

.notice.error {
  background: #fff1f2;
  color: #be123c;
}

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

label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 13px 12px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 16px;
}

textarea {
  resize: vertical;
}

input[type="file"] {
  padding: 12px;
  background: #f9fafb;
}

.primary-button,
.primary-link,
.small-button,
.copy-button,
.danger-button,
.ghost-button,
.text-link {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
}

.primary-button {
  width: 100%;
  font-size: 17px;
}

.small-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
  color: #111827;
}

.danger-button {
  background: #fee2e2;
  color: #b91c1c;
}

.ghost-button,
.text-link {
  background: transparent;
  color: #334155;
}

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

.entry-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.thumb {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: #e5e7eb;
}

.card-main {
  min-width: 0;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-main p {
  margin: 6px 0 8px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}

.meta-line {
  margin: 0 0 8px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status.enabled {
  background: #dcfce7;
  color: #166534;
}

.status.disabled {
  background: #f3f4f6;
  color: #6b7280;
}

.link-box {
  overflow-wrap: anywhere;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
}

.link-group {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.link-label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.qr-panel {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfcfe;
}

.qr-code {
  width: 96px;
  height: 96px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.card-actions.secondary {
  margin-top: 8px;
}

.card-actions.single-action {
  grid-template-columns: 1fr;
}

.card-actions form,
.card-actions button,
.card-actions a {
  width: 100%;
}

.cover-preview {
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e5e7eb;
}

.empty {
  padding: 28px 12px;
  text-align: center;
  color: #6b7280;
}

.copied {
  background: #dcfce7;
  color: #166534;
}

@media (max-width: 420px) {
  .admin-shell {
    padding: 10px;
  }

  .entry-card {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .thumb {
    width: 80px;
    height: 80px;
  }

  .qr-panel {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .qr-code {
    width: 84px;
    height: 84px;
  }

  h1 {
    font-size: 22px;
  }
}
