:root {
  --canvas: #f3f6fb;
  --surface: #ffffff;
  --ink: #24364a;
  --muted: #76879a;
  --border: #e6edf5;
  --cyan: #42cce9;
  --blue: #4f99d6;
  --green: #5dcc75;
  --focus: #165dff;
  --scroll-track: #edf2f8;
  --scroll-thumb: #b8c8d9;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--scroll-track); }
*::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 2px solid var(--scroll-track); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #94abc0; }

body {
  margin: 0;
  background: var(--canvas);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
.redeem-shell { min-height: 100svh; padding: 10px 12px 40px; }
.redeem-page { width: min(100%, 430px); margin: 0 auto; padding: 0 10px 28px; background: rgba(255,255,255,.42); border-left: 1px solid rgba(221,229,239,.75); border-right: 1px solid rgba(221,229,239,.75); box-shadow: 0 16px 42px rgba(52,80,110,.05); }
.hero-card { position: relative; overflow: hidden; min-height: 116px; padding: 23px 24px 20px; border-radius: 14px; color: #fff; text-align: center; background: linear-gradient(118deg, #52aff3 0%, #48cfea 56%, #4ce5df 100%); box-shadow: 0 10px 24px rgba(65,184,224,.18); }
.hero-card::before, .hero-card::after { content: ''; position: absolute; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); }
.hero-card::before { width: 132px; height: 132px; right: -62px; top: -60px; }
.hero-card::after { width: 70px; height: 70px; left: -34px; bottom: -36px; }
.hero-spark { position: absolute; inset: 0; background: linear-gradient(120deg, transparent 32%, rgba(255,255,255,.13) 48%, transparent 64%); transform: translateX(-70%); animation: hero-sweep 4.8s ease-in-out infinite; }
.hero-card h1 { position: relative; margin: 0 0 9px; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: .06em; }
.hero-card p { position: relative; margin: 0 auto; max-width: 310px; font-size: 13px; line-height: 1.65; color: rgba(255,255,255,.92); }
.brand-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin: 22px 1px 18px; }
.brand-tile { aspect-ratio: 1; overflow: hidden; border: 1px solid #edf1f5; border-radius: 4px; background: #fff; box-shadow: 0 2px 5px rgba(37,62,86,.07); }
.brand-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.notice-strip { margin: 0 0 14px; padding: 13px 16px; border: 7px solid #fff; border-radius: 7px; color: #5b9fd2; background: #f2f8fd; box-shadow: 0 4px 15px rgba(36,59,84,.08); text-align: center; font-size: 11px; line-height: 1.45; }
.contact-card { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 13px; align-items: center; padding: 18px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); box-shadow: 0 7px 18px rgba(36,59,84,.09); }
.contact-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: #edf8ff; color: var(--blue); font-size: 23px; font-weight: 700; }
.contact-copy { min-width: 0; }
.contact-kicker { display: block; margin-bottom: 4px; color: var(--blue); font-size: 11px; font-weight: 700; }
.contact-copy h2 { margin: 0; color: #304359; font-size: 15px; line-height: 1.35; font-weight: 700; }
.contact-copy p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.contact-button { grid-column: 1 / -1; display: flex; min-height: 46px; align-items: center; justify-content: center; border-radius: 5px; background: linear-gradient(180deg, #62d17a, #55c96d); color: #fff; box-shadow: 0 5px 12px rgba(71,183,95,.2); text-decoration: none; font-size: 14px; font-weight: 700; transition: transform .16s ease, box-shadow .16s ease, filter .16s ease; cursor: pointer; }
.contact-button:hover { filter: brightness(1.035); box-shadow: 0 7px 16px rgba(71,183,95,.28); transform: translateY(-1px); }
.contact-button:active { transform: translateY(0); }
.contact-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 3px; }
.service-note { margin: 18px 0 0; color: #8b99a9; text-align: center; font-size: 10px; }
.service-note span { color: var(--green); font-weight: 800; }

.admin-shell { min-height: 100svh; padding: 42px clamp(20px, 5vw, 72px) 64px; background: #f5f8fc; }
.admin-centered { display: grid; place-items: center; }
.admin-header { display: flex; max-width: 1160px; margin: 0 auto 30px; align-items: flex-start; justify-content: space-between; gap: 24px; }
.admin-header h1 { margin: 4px 0 8px; color: var(--ink); font-size: clamp(28px, 4vw, 44px); line-height: 1.08; letter-spacing: -.04em; }
.admin-header > div > p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.admin-eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.admin-header nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-header nav a, .form-actions > a { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid #d6e0eb; border-radius: 8px; background: #fff; color: #51667d; text-decoration: none; font-size: 13px; font-weight: 600; transition: border-color .16s ease, background .16s ease, color .16s ease; cursor: pointer; }
.admin-header nav a:hover, .form-actions > a:hover { border-color: #aebfd0; color: #2c4055; background: #fbfdff; }
.admin-header nav a:focus-visible, .form-actions > a:focus-visible, .settings-form button:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .admin-denied a:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 30%, transparent); outline-offset: 2px; }
.admin-content { display: grid; max-width: 1160px; margin: 0 auto; grid-template-columns: minmax(230px, 320px) minmax(0, 1fr); gap: 22px; align-items: start; }
.admin-summary, .settings-form, .admin-denied { border: 1px solid #e1e9f1; border-radius: 16px; background: #fff; box-shadow: 0 12px 34px rgba(37,61,86,.07); }
.admin-summary { position: sticky; top: 24px; padding: 27px; }
.summary-mark { display: grid; width: 48px; height: 48px; margin-bottom: 26px; place-items: center; border-radius: 14px; background: linear-gradient(135deg, #54b9ef, #4bdcd9); color: #fff; font-size: 23px; font-weight: 700; box-shadow: 0 8px 18px rgba(74,191,221,.2); }
.admin-summary h2 { margin: 0 0 9px; color: var(--ink); font-size: 21px; }
.admin-summary > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.admin-summary dl { margin: 0; border-top: 1px solid var(--border); }
.admin-summary dl div { display: grid; gap: 5px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.admin-summary dt { color: #93a0af; font-size: 11px; }
.admin-summary dd { overflow-wrap: anywhere; margin: 0; color: #41566e; font-size: 13px; font-weight: 600; }
.settings-form { overflow: hidden; }
.form-heading { display: flex; min-height: 94px; padding: 24px 28px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); }
.form-heading h2 { margin: 5px 0 0; color: var(--ink); font-size: 20px; }
.save-status { min-height: 20px; max-width: 280px; color: var(--muted); text-align: right; font-size: 12px; line-height: 1.5; }
.save-status-saved { color: #269748; }
.save-status-error { color: #b53942; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; padding: 28px; }
.field { min-width: 0; }
.field:nth-child(2), .field:nth-child(3), .field:nth-child(6), .field:nth-child(8) { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 8px; color: #344a61; font-size: 13px; font-weight: 700; }
.field input, .field textarea { display: block; width: 100%; border: 1px solid #d7e1eb; border-radius: 8px; background: #fbfdff; color: var(--ink); font: inherit; font-size: 14px; line-height: 1.55; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.field input { min-height: 44px; padding: 0 13px; }
.field textarea { min-height: 94px; padding: 11px 13px; resize: none; }
.field input:hover, .field textarea:hover { border-color: #b7c6d5; background: #fff; }
.field input:focus, .field textarea:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(79,153,214,.12); outline: none; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #cf5a63; background: #fffafa; }
.field-hint, .field-error { margin: 7px 2px 0; font-size: 11px; line-height: 1.5; }
.field-hint { color: #8b99a8; }
.field-error { color: #b53942; font-weight: 600; }
.form-actions { display: flex; padding: 22px 28px 28px; align-items: center; gap: 10px; border-top: 1px solid var(--border); }
.settings-form button { position: relative; display: inline-flex; width: 130px; min-height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(79,153,214,.2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
.settings-form button:hover:not(:disabled) { background: #438bc7; box-shadow: 0 8px 18px rgba(79,153,214,.28); transform: translateY(-1px); }
.settings-form button:disabled { opacity: .66; cursor: wait; }
.admin-denied { width: min(100%, 460px); padding: 42px; text-align: center; }
.admin-denied > span { display: grid; width: 54px; height: 54px; margin: 0 auto 22px; place-items: center; border-radius: 50%; background: #eef6fc; color: var(--blue); font-size: 28px; }
.admin-denied h1 { margin: 0 0 10px; color: var(--ink); font-size: 24px; }
.admin-denied p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.admin-denied a { color: var(--blue); font-size: 13px; font-weight: 700; }
.admin-login { width: min(100%, 430px); margin: 8vh auto 0; padding: 32px; border: 1px solid #e1e9f1; border-radius: 16px; background: #fff; box-shadow: 0 12px 34px rgba(37,61,86,.08); }
.admin-login h1 { margin: 7px 0 9px; color: var(--ink); font-size: 27px; }
.admin-login > p:not(.admin-eyebrow) { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.admin-login form button, .secondary-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.admin-login form button { width: 100%; margin-top: 16px; border: 0; background: var(--blue); color: #fff; }
.secondary-button { padding: 0 15px; border: 1px solid #d6e0eb; background: #fff; color: #51667d; }
.secondary-button:hover { border-color: #aebfd0; color: #2c4055; }
[hidden] { display: none !important; }

@keyframes hero-sweep { 0%, 55% { transform: translateX(-75%); } 82%, 100% { transform: translateX(75%); } }
@media (max-width: 380px) { .redeem-shell { padding-inline: 4px; } .redeem-page { padding-inline: 8px; } .brand-grid { gap: 3px; } }
@media (max-width: 820px) {
  .admin-shell { padding: 26px 16px 48px; }
  .admin-header { display: grid; }
  .admin-header nav { justify-content: flex-start; }
  .admin-content { grid-template-columns: 1fr; }
  .admin-summary { position: static; }
}
@media (max-width: 560px) {
  .form-heading { align-items: flex-start; padding: 21px 19px; flex-direction: column; }
  .save-status { text-align: left; }
  .form-fields { grid-template-columns: 1fr; padding: 22px 19px; }
  .field:nth-child(n) { grid-column: auto; }
  .form-actions { padding: 19px; flex-direction: column; align-items: stretch; }
  .settings-form button, .form-actions > a { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (forced-colors: active) { * { scrollbar-color: auto; } .contact-button { border: 1px solid ButtonText; } }
