:root {
  --bg: #fffbf6;
  --card: #ffffff;
  --ink: #1d2130;
  --muted: #6f7280;
  --line: #ece3d7;
  --accent: #f06054;
  --accent-2: #ff8a65;
  --accent-dark: #d8483d;
  --soft: #fff1ec;
  --green: #2f9e6e;
  --shadow: 0 12px 34px rgba(84, 46, 20, 0.07);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.wrap-narrow { width: min(760px, calc(100% - 40px)); margin: 0 auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 251, 246, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 6px;
}
.brand-mark i { background: #fff; border-radius: 2px; opacity: .92; }
.brand-mark i:nth-child(2n) { opacity: .55; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--ink); }
@media (max-width: 720px) { .nav { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .18s ease; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(84, 46, 20, .10); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 24px rgba(240, 96, 84, .28);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(240, 96, 84, .34); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- hero ---------- */
.hero { padding: 76px 0 40px; text-align: center; position: relative; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(10px); z-index: 0;
}
.hero::before { width: 420px; height: 420px; background: #ffe7de; top: -180px; left: -120px; opacity: .8; }
.hero::after { width: 360px; height: 360px; background: #fff0d8; top: -120px; right: -100px; opacity: .8; }
.hero > * { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--soft); color: var(--accent-dark);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
h1.hero-title {
  font-size: clamp(32px, 5vw, 56px); line-height: 1.18; margin: 20px 0 14px;
  letter-spacing: -0.5px; font-weight: 800;
}
h1.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { color: var(--muted); font-size: clamp(15px, 2vw, 18px); margin: 0 auto 30px; max-width: 640px; }
.redeem-box {
  display: flex; gap: 10px; max-width: 520px; margin: 0 auto;
  background: #fff; padding: 8px; border-radius: 999px; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.redeem-box input {
  flex: 1; border: 0; outline: 0; background: transparent; padding: 10px 18px;
  font-size: 16px; letter-spacing: 1px; text-transform: uppercase;
}
.redeem-box input::placeholder { text-transform: none; letter-spacing: 0; color: #aaa; }
.hero-note { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); margin: 0 0 8px; letter-spacing: -.3px; }
.section-head p { color: var(--muted); margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.gallery img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery figcaption { padding: 12px 16px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.step .num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--soft); color: var(--accent-dark); font-weight: 800; margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.feature b { display: block; margin-bottom: 4px; font-size: 15px; }
.feature span { color: var(--muted); font-size: 13.5px; }
.faq { display: grid; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { color: var(--muted); margin: 10px 0 0; font-size: 14.5px; }

/* ---------- app ---------- */
.app-main { padding: 30px 0 70px; }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-head .badge-num {
  width: 28px; height: 28px; border-radius: 9px; background: var(--soft); color: var(--accent-dark);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.panel-head h2 { font-size: 18px; margin: 0; }
.panel-head .hint { margin-left: auto; color: var(--muted); font-size: 13px; }

.drop {
  border: 2px dashed #e6d8c8; border-radius: 16px; background: #fffaf4;
  padding: 38px 20px; text-align: center; cursor: pointer; transition: .18s ease;
}
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--soft); }
.drop strong { display: block; font-size: 16px; margin-bottom: 6px; }
.drop span { color: var(--muted); font-size: 13.5px; }
.drop img { max-height: 260px; margin: 0 auto; border-radius: 12px; }

.field-row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px dashed var(--line); }
.field-row:first-of-type { border-top: 0; }
.field-label { color: var(--muted); font-size: 14px; }
.field-control { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
select, input[type="text"], input[type="number"] {
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none;
}
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240, 96, 84, .12); }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 15px; font-size: 13.5px; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: #d9c8b6; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.hint-text { color: var(--muted); font-size: 12.5px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: #e7ded3; transition: .18s; position: relative; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }

.result { display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; }
.result img { border-radius: 14px; border: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.stat { background: #fffaf4; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 18px; }
.stat span { color: var(--muted); font-size: 12.5px; }
.downloads { display: grid; gap: 8px; }
.dl {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 12px; font-size: 14px; transition: .15s;
}
.dl:hover { border-color: var(--accent); background: #fffaf7; }
.dl b { font-weight: 600; }
.dl span { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.textarea {
  width: 100%; min-height: 150px; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font-family: var(--font); font-size: 13.5px; line-height: 1.7; resize: vertical; background: #fffaf6;
}

/* ---------- admin ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { padding: 9px 16px; border-radius: 999px; font-size: 14px; cursor: pointer; color: var(--muted); border: 1px solid transparent; }
.tab.on { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: 0 4px 12px rgba(84, 46, 20, .05); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.kpi b { display: block; font-size: 24px; }
.kpi span { color: var(--muted); font-size: 12.5px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
tr:hover td { background: #fffaf6; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: #f3efe9; color: var(--muted); }
.pill.ok { background: #e8f6ee; color: var(--green); }
.pill.warn { background: #fff1e5; color: #c47b1f; }
.pill.off { background: #f2f2f4; color: #8b8b95; }
.code-list { display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.code-row { display: flex; gap: 10px; align-items: center; font-family: ui-monospace, Consolas, monospace; font-size: 14px; padding: 8px 12px; background: #fffaf6; border: 1px solid var(--line); border-radius: 10px; }
.code-row button { margin-left: auto; }
.copy-all { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- misc ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .22s; z-index: 100;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--muted); text-align: center; padding: 26px; font-size: 14px; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .gallery, .steps, .features { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 8px; }
  .hero { padding: 46px 0 26px; }
  .section { padding: 40px 0; }
}
