:root {
  --red: #e62319;
  --red-dark: #bd1710;
  --ink: #171717;
  --muted: #686868;
  --line: #e7e7e4;
  --paper: #f5f5f2;
  --white: #fff;
  --green: #16784c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  min-height: 74px;
  margin: 0 auto;
}
.brand { display: flex; align-items: baseline; gap: 6px; font-weight: 800; letter-spacing: 0; }
.brand span { color: var(--red); font-size: 19px; }
.brand b { font-size: 24px; }
nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
nav form { margin: 0; }
.nav-action { padding: 9px 16px; color: var(--white); background: var(--red); border-radius: 6px; }
.nav-user { color: var(--muted); }
.text-button { padding: 0; border: 0; color: var(--ink); background: transparent; cursor: pointer; }

main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
footer { width: min(1180px, calc(100% - 48px)); margin: 54px auto 0; padding: 26px 0 36px; border-top: 1px solid var(--line); color: #888; font-size: 12px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); align-items: center; min-height: 570px; gap: 80px; padding: 54px 0 70px; }
.eyebrow { margin: 0 0 16px; color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: 0; }
.hero h1, .auth-intro h1, .page-head h1 { margin: 0; font-size: 68px; line-height: 1.07; letter-spacing: 0; }
.hero-copy { max-width: 620px; margin: 26px 0 0; color: var(--muted); font-size: 17px; line-height: 1.9; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 34px; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 0 24px; border: 0; border-radius: 6px; color: var(--white); background: var(--red); font-weight: 700; cursor: pointer; box-shadow: 0 8px 22px rgba(230, 35, 25, .16); }
.button:hover { background: var(--red-dark); }
.text-link { font-weight: 700; }
.hero-visual { position: relative; min-height: 360px; display: grid; place-items: center; }
.hero-visual::before { content: ""; position: absolute; inset: 18px 3% 12px 12%; border-radius: 50%; background: #ededeb; }
.link-card { position: absolute; z-index: 2; width: min(390px, 80%); padding: 28px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.08); }
.link-card:first-child { top: 45px; left: 0; transform: rotate(-3deg); }
.link-card.active { right: 0; bottom: 38px; color: var(--white); background: var(--red); border-color: var(--red); transform: rotate(2deg); }
.link-card span { display: block; margin-bottom: 20px; color: #777; font-size: 12px; font-weight: 700; }
.link-card.active span { color: rgba(255,255,255,.74); }
.link-card i { display: block; width: 92%; height: 7px; margin: 10px 0; background: #dededb; }
.link-card i.short { width: 58%; }
.link-card strong { display: block; font-size: 38px; }
.flow-line { position: absolute; z-index: 1; width: 48%; height: 2px; background: var(--red); transform: rotate(-32deg); }
.feature-band { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-band article { min-height: 190px; padding: 36px; border-right: 1px solid var(--line); }
.feature-band article:last-child { border-right: 0; }
.feature-band b { color: var(--red); font-size: 12px; }
.feature-band h2 { margin: 28px 0 8px; font-size: 19px; }
.feature-band p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.035); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) 430px; align-items: center; gap: 100px; min-height: 620px; padding: 50px 7%; }
.auth-intro h1 { max-width: 680px; font-size: 64px; }
.auth-intro > p:last-child { max-width: 520px; margin: 24px 0 0; color: var(--muted); line-height: 1.8; }
.form-panel { padding: 34px; }
.form-panel label, .generator label { display: grid; gap: 9px; margin-bottom: 20px; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #d6d6d2; border-radius: 6px; outline: none; background: #fff; transition: border-color .2s, box-shadow .2s; }
input { height: 48px; padding: 0 14px; }
textarea { min-height: 108px; padding: 14px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(230,35,25,.09); }
.form-panel .button, .generator .button { width: 100%; }
.form-foot { margin: 22px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.form-foot a { color: var(--red); font-weight: 700; }
.notice { margin-bottom: 20px; padding: 13px 15px; border-radius: 6px; font-size: 13px; line-height: 1.6; }
.notice.success { color: var(--green); background: #edf8f2; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 72px 0 34px; }
.page-head h1 { font-size: 56px; }
.page-head > div > p:last-child { margin: 14px 0 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.small-button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border: 1px solid var(--red); border-radius: 5px; color: var(--white); background: var(--red); font-size: 12px; font-weight: 700; cursor: pointer; }
.small-button.ghost { color: var(--red); background: transparent; }
.generator { padding: 28px; }
.generator form { display: grid; grid-template-columns: 1fr 180px; align-items: end; gap: 18px; }
.generator label { margin: 0; }
.generator textarea { min-height: 86px; }
.generator .button { min-height: 86px; }
.result-card { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; margin-top: 24px; padding: 18px; border-left: 4px solid var(--red); background: #fafafa; }
.result-card span { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.result-card strong { align-self: center; word-break: break-all; }
.copy-button { padding: 8px 14px; border: 0; border-radius: 5px; color: var(--white); background: var(--ink); cursor: pointer; }
.table-panel { margin-top: 24px; overflow: hidden; }
.panel-title { padding: 22px 24px 0; }
.panel-title h2 { margin: 0; font-size: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 16px 20px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #777; background: #fafafa; font-size: 11px; }
tr:last-child td { border-bottom: 0; }
td form { display: flex; gap: 8px; }
.target-cell { max-width: 720px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-block; padding: 5px 10px; border-radius: 99px; font-size: 11px; }
.status.approved { color: var(--green); background: #edf8f2; }
.status.rejected { color: #8c342e; background: #fff0ef; }

.summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.summary-grid article { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 12px 32px rgba(0,0,0,.025); }
.summary-grid span { display: block; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.summary-grid strong { display: block; overflow: hidden; font-size: 30px; line-height: 1; text-overflow: ellipsis; }
.summary-grid article:first-child { color: var(--white); background: var(--red); border-color: var(--red); }
.summary-grid article:first-child span { color: rgba(255,255,255,.76); }
.analytics-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.analytics-panel { margin-top: 20px; }
.analytics-panel .panel-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 16px; }
.analytics-panel .panel-title p { margin: 0; color: var(--muted); font-size: 12px; }
.analytics-panel table { min-width: 570px; }
.analytics-panel th:not(:first-child), .analytics-panel td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.code-link { color: var(--red); font-weight: 800; }
.link-analytics table { min-width: 920px; }
.link-analytics .target-cell { max-width: 420px; }

.state-page { display: grid; min-height: 610px; place-items: center; align-content: center; padding: 60px 20px; text-align: center; }
.state-code { display: grid; width: 92px; height: 92px; margin-bottom: 24px; place-items: center; border-radius: 50%; color: var(--white); background: var(--ink); font-size: 25px; font-weight: 800; }
.pending-mark { background: var(--red); }
.error-mark { background: #8c342e; }
.state-page h1 { margin: 0; font-size: 32px; }
.state-page p { margin: 14px 0 28px; color: var(--muted); }

.wechat-page { min-height: 100vh; color: #fff; background: #111; }
.wechat-page::before { content: ""; position: fixed; inset: 0; background: radial-gradient(circle at 82% 5%, rgba(230,35,25,.26), transparent 32%); pointer-events: none; }
.wechat-guide { position: relative; width: min(560px, calc(100% - 40px)); min-height: 100vh; margin: 0 auto; padding: max(110px, calc(env(safe-area-inset-top) + 90px)) 0 54px; }
.browser-mark { display: grid; width: 58px; height: 58px; margin-bottom: 44px; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff; font-weight: 900; letter-spacing: 2px; }
.wechat-guide .eyebrow { color: #ff5a50; }
.wechat-guide h1 { margin: 0; font-size: 42px; line-height: 1.25; }
.guide-copy { margin: 24px 0 36px; color: #b9b9b9; font-size: 16px; line-height: 1.8; }
.guide-steps { display: grid; grid-template-columns: 34px 1fr; gap: 16px 12px; align-items: center; padding: 22px; border: 1px solid #333; border-radius: 8px; background: #191919; }
.guide-steps span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: var(--red); font-size: 13px; font-weight: 800; }
.guide-steps p { margin: 0; color: #ddd; }
.safe-note { margin-top: 28px; color: #777; font-size: 12px; text-align: center; }
.wechat-arrow { position: fixed; z-index: 2; top: 20px; right: 24px; width: 56px; height: 56px; border-top: 3px solid #fff; border-right: 3px solid #fff; border-radius: 0 14px 0 0; }
.wechat-arrow::after { content: ""; position: absolute; top: -4px; right: -4px; width: 15px; height: 15px; border-top: 3px solid #fff; border-right: 3px solid #fff; transform: rotate(10deg); }

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 32px, 620px); }
  .site-header { min-height: 62px; }
  nav { gap: 15px; }
  .nav-user { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 42px; padding: 54px 0 62px; }
  .hero h1 { font-size: 45px; }
  .hero-copy { margin-top: 20px; font-size: 15px; }
  .hero-visual { min-height: 300px; }
  .link-card { width: 86%; padding: 22px; }
  .link-card strong { font-size: 30px; }
  .feature-band { grid-template-columns: 1fr; }
  .feature-band article { min-height: 0; padding: 28px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .feature-band article:last-child { border-bottom: 0; }
  .feature-band h2 { margin-top: 12px; }
  .auth-shell { grid-template-columns: 1fr; gap: 32px; min-height: auto; padding: 48px 0 20px; }
  .auth-intro h1 { font-size: 42px; }
  .form-panel { padding: 24px; }
  .page-head { align-items: flex-start; padding-top: 48px; }
  .page-head h1 { font-size: 36px; }
  .generator { padding: 20px; }
  .generator form { grid-template-columns: 1fr; }
  .generator .button { min-height: 48px; }
  .result-card { grid-template-columns: 1fr; }
  .result-card span { grid-column: auto; }
  .copy-button { min-height: 42px; }
  .table-panel { width: calc(100vw - 32px); overflow-x: auto; }
  table { min-width: 610px; }
  th, td { padding: 14px; }
  .state-page { min-height: 520px; }
  footer { margin-top: 34px; }
  .page-head { flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid article { padding: 20px; }
  .summary-grid article:last-child { grid-column: 1 / -1; }
  .summary-grid strong { font-size: 27px; }
  .analytics-split { grid-template-columns: 1fr; gap: 0; }
  .analytics-panel { width: calc(100vw - 32px); }
  .analytics-panel .panel-title { align-items: flex-start; flex-direction: column; gap: 6px; }
}
