:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #172326;
  background: #f4f7f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f4f7f6;
}

button, input { font: inherit; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 880px) / 2));
  background: #fff;
  border-bottom: 1px solid #e0e7e4;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #172326;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 6px;
  background: #087e75;
  color: #fff;
  font-size: 15px;
}

.topbar-note { color: #657473; font-size: 14px; }

.page-shell {
  width: min(100% - 40px, 720px);
  margin: 48px auto 88px;
}

.intro { margin-bottom: 30px; }

.eyebrow {
  margin: 0 0 8px;
  color: #087e75;
  font-size: 13px;
  font-weight: 700;
}

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

.intro-copy, .section-copy, .channel-section p, .entry-copy {
  color: #657473;
  line-height: 1.6;
}

.intro-copy { margin: 10px 0 0; }

.wechat-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  max-width: 520px;
  margin: 28px 0 18px;
  padding: 20px 0;
  border-top: 1px solid #dce5e1;
  border-bottom: 1px solid #dce5e1;
}

.wechat-entry h2 { margin: 0; font-size: 17px; }
.entry-copy { margin: 7px 0 14px; font-size: 14px; }
.wechat-entry .button-primary { display: inline-flex; align-items: center; }
.wechat-qr-block { width: 128px; text-align: center; }
.wechat-qr-block img { display: block; width: 128px; aspect-ratio: 1; object-fit: contain; }
.wechat-qr-block p { margin: 6px 0 0; color: #657473; font-size: 12px; }

.email-fallback { max-width: 520px; }
.email-fallback summary { width: fit-content; color: #126b63; cursor: pointer; font-size: 14px; font-weight: 600; }
.email-fallback .login-form { margin-top: 16px; }
.login-unavailable { color: #657473; font-size: 14px; }

.login-form {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.login-form label {
  margin-top: 8px;
  color: #354644;
  font-size: 14px;
  font-weight: 600;
}

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

input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cbd7d3;
  border-radius: 4px;
  background: #fff;
  color: #172326;
}

input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid #89d8cb;
  outline-offset: 2px;
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.button:disabled { cursor: wait; opacity: .6; }
.button-primary { margin-top: 10px; background: #087e75; color: #fff; }
.button-primary:hover { background: #066c64; }
.button-secondary { border-color: #9bbab2; background: #fff; color: #126b63; }
.button-secondary:hover { background: #eaf5f2; }
.button-quiet { border-color: #d8e1de; background: transparent; color: #546561; }

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

.section-copy { margin: 12px 0 22px; }

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

.topic-row {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dce5e1;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.topic-row:has(input:checked) { border-color: #56a99d; background: #edf8f5; }
.topic-row input { width: 17px; height: 17px; accent-color: #087e75; }
.topic-row span { min-width: 0; font-size: 14px; line-height: 1.4; }

.channel-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid #dce5e1;
}

.channel-section h2 { margin: 0; font-size: 16px; }
.channel-section p { margin: 6px 0 0; font-size: 14px; }
.status { min-height: 24px; margin: 20px 0 0; color: #32665f; font-size: 14px; }
.status[data-error="true"] { color: #a33c2f; }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .topbar { height: 56px; padding: 0 18px; }
  .page-shell { width: min(100% - 36px, 720px); margin-top: 34px; }
  h1 { font-size: 24px; }
  .email-row { flex-direction: column; }
  .email-row .button { align-self: flex-start; }
  .wechat-entry { grid-template-columns: minmax(0, 1fr); }
  .topic-list { grid-template-columns: 1fr; }
  .channel-section { align-items: flex-start; flex-direction: column; }
}

.preference-form { display:grid; gap:12px; padding:16px 0; }
.preference-form label { display:grid; gap:6px; }
.preference-form input, .preference-form select { max-width:100%; padding:10px; }
.preference-section { margin-top: 30px; padding-top: 22px; border-top: 1px solid #dce5e1; }
.preference-section h2 { margin: 0 0 12px; font-size: 16px; }
.preference-section .section-copy { margin: 10px 0 16px; font-size: 14px; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; font-size: 14px; cursor: pointer; }
.consent-row input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: #087e75; }
.reward-topics { display: grid; gap: 10px; margin: 14px 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.entry-link { display: inline-flex; align-items: center; margin: 0 8px 12px 0; }
.preference-section .wechat-qr-block { margin: 12px 0; }
