:root {
  color-scheme: light;
  --bg: #f5efe4;
  --ink: #221a14;
  --muted: #76685c;
  --line: rgba(34, 26, 20, 0.12);
  --card: rgba(255, 252, 246, 0.9);
  --accent: #d85c27;
  --accent-dark: #9d3719;
  --green: #1f7a4c;
  --danger: #b02a2a;
  --shadow: 0 24px 80px rgba(71, 45, 22, 0.16);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(216, 92, 39, 0.22), transparent 30rem),
    radial-gradient(circle at 90% 0%, rgba(31, 122, 76, 0.14), transparent 28rem),
    linear-gradient(135deg, #f9f0df 0%, #efe1ce 100%);
}

button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  color: white;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(216, 92, 39, 0.24);
}

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

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}

.danger-button {
  background: transparent;
  border: 1px solid rgba(176, 42, 42, 0.35);
  color: var(--danger);
  margin-top: 1rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
}

code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.45rem;
  background: rgba(34, 26, 20, 0.08);
}

.attendee-shell {
  width: min(94vw, 560px);
  margin: 0 auto;
  padding: 8vh 0;
}

.hero-card,
.form-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: 2rem;
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -3rem;
  bottom: -3rem;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  background: rgba(216, 92, 39, 0.16);
}

.hero-card h1,
.admin-header h1,
.login-panel h1 {
  margin: 0.2rem 0 0.7rem;
  font-size: clamp(2rem, 7vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: -0.08em;
}

.form-card {
  margin-top: 1rem;
  padding: 1.4rem;
}

.form-card h2,
.panel h2 {
  margin: 0 0 1rem;
}

.form-card form,
.stack-form {
  display: grid;
  gap: 1rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.small {
  font-size: 0.9rem;
}

.stats-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-top: 1.2rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: rgba(31, 122, 76, 0.12);
  color: var(--green);
  font-weight: 800;
}

.stats-pill span:first-child {
  font-size: 1.8rem;
}

.message {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: rgba(31, 122, 76, 0.12);
  color: var(--green);
  font-weight: 700;
}

.message[data-type="error"] {
  background: rgba(176, 42, 42, 0.1);
  color: var(--danger);
}

.wechat-panel {
  margin-bottom: 1rem;
}

.wechat-login {
  display: block;
  width: 100%;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  background: var(--green);
  color: white;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.wechat-profile,
.person-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wechat-profile {
  padding: 0.85rem;
  border-radius: 20px;
  background: rgba(31, 122, 76, 0.1);
}

.wechat-profile img,
.person-cell img,
.winner-card img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.wechat-profile span,
.person-cell span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-shell {
  width: min(96vw, 1180px);
  margin: 0 auto;
  padding: 4vh 0;
}

.login-panel {
  width: min(94vw, 620px);
  margin: 12vh auto;
  padding: 2rem;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.admin-header h1 {
  font-size: clamp(2.2rem, 5vw, 4.8rem);
}

.header-actions,
.inline-form {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

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

.panel {
  padding: 1.4rem;
  margin-bottom: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-row input {
  width: auto;
}

.copy-box {
  overflow-wrap: anywhere;
  padding: 1rem;
  margin: 0.8rem 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--line);
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-top: 1rem;
}

.stats-grid div {
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(34, 26, 20, 0.06);
}

.stats-grid strong {
  display: block;
  font-size: 1.8rem;
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.85rem;
}

.winner-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.winner-card {
  padding: 0.8rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(216, 92, 39, 0.16), rgba(31, 122, 76, 0.1));
}

.winner-card strong,
.winner-card span {
  display: block;
}

.winner-card span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.table-header input {
  max-width: 320px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 0.85rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.85rem;
}

.tag {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(34, 26, 20, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.tag.winner {
  color: var(--green);
  background: rgba(31, 122, 76, 0.12);
}

@media (max-width: 900px) {
  .grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .table-header {
    display: grid;
  }

  .inline-form {
    align-items: stretch;
  }

  .inline-form input,
  .inline-form button {
    width: 100%;
  }
}
