:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d9dee7;
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --danger: #c2410c;
  --success: #15803d;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.public-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
}

.redeem-panel {
  max-width: 460px;
  padding: 28px;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e7f0ff;
  color: var(--primary-dark);
  font-weight: 700;
}

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

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

.form-stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

input,
button,
select {
  width: 100%;
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  border: 1px solid var(--border);
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

button {
  border: 0;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.message {
  min-height: 22px;
  margin: 0;
  font-size: 14px;
}

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

.message.success {
  color: var(--success);
}

.admin-shell {
  padding: 28px 0;
}

.admin-header,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-header {
  margin-bottom: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 18px;
  align-items: start;
}

.admin-panel {
  padding: 20px;
}

h2 {
  margin: 0;
  font-size: 18px;
}

textarea {
  width: 100%;
  min-height: 160px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  resize: vertical;
  font: 14px/1.5 Consolas, monospace;
}

.secondary-button,
.small-button {
  width: auto;
  min-height: 36px;
  background: #eef2f7;
  color: var(--text);
}

.secondary-button:hover,
.small-button:hover {
  background: #e2e8f0;
}

.small-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.link-cell {
  max-width: 280px;
  word-break: break-all;
}

@media (max-width: 760px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
