:root {
  --bg1: #08342e;
  --bg2: #147a62;
  --accent: #25d366;
  --card: #fff;
  --title: #10231f;
  --muted: #5d6f6a;
  --chat-bg: #efe7de;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--title);
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }

.steps { display: flex; gap: 8px; font-size: 12px; margin-bottom: 16px; }
.steps span { padding: 4px 8px; border-radius: 999px; background: rgba(0,0,0,.06); color: var(--muted); }
.steps .on { background: var(--accent); color: #06281a; font-weight: 700; }
.steps .done { background: #e7f8ee; color: #0d6b3c; }
.phone-form label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.phone-row { display: flex; gap: 8px; }
.phone-row select, .phone-row input, .phone-form button {
  border: 1px solid #d1d7db; border-radius: 12px; padding: 12px 14px; background: #fff;
  font-size: var(--input-size, 16px);
}
.phone-row select { width: 118px; }
.phone-row input { flex: 1; min-width: 0; }
.phone-form button {
  width: 100%; margin-top: 12px; border: 0; background: var(--accent); color: #fff;
  font-weight: 700; cursor: pointer; font-size: var(--btn-size, 16px);
  border-radius: var(--btn-radius, 24px); min-height: 48px;
}
.phone-form .err { color: #9f2d20; font-size: 13px; margin: 0 0 8px; }
.foot { margin: 14px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.logo {
  width: var(--logo, 56px); height: var(--logo, 56px); border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: calc(var(--logo, 56px) * .38);
}

.lay-card {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px 32px;
  background: #d1d7db linear-gradient(var(--bg1), var(--bg1)) top / 100% 222px no-repeat;
}
.lay-card .card {
  width: min(var(--card-width, 420px), 100%); background: var(--card); border-radius: var(--card-radius, 12px);
  padding: 28px 24px 22px; box-shadow: 0 2px 8px rgba(11, 20, 26, .12);
}
.lay-card .brand { margin: 14px 0 0; font-size: var(--brand-size, 13px); letter-spacing: .04em; color: var(--muted); }
.lay-card h1 { margin: 8px 0; font-size: var(--headline, 28px); line-height: 1.25; }
.lay-card .sub { margin: 0 0 18px; color: var(--muted); line-height: 1.6; font-size: var(--subhead, 15px); }

.lay-whatsapp { min-height: 100vh; background: #d1d7db linear-gradient(var(--bg1), var(--bg1)) top / 100% 127px no-repeat; display: grid; place-items: center; padding: 18px; }
.wa-shell { width: min(var(--card-width, 420px), 100%); min-height: min(760px, calc(100vh - 36px)); background: var(--card); border-radius: var(--card-radius, 12px); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(11, 20, 26, .16); }
.wa-top { background: var(--bg1); color: #fff; display: flex; gap: 12px; align-items: center; padding: 18px 16px; }
.wa-top .logo { width: 42px; height: 42px; border-radius: 50%; font-size: 16px; }
.wa-top strong { display: block; font-size: var(--brand-size, 16px); }
.wa-top span { font-size: 12px; opacity: .8; }
.wa-hero { padding: 28px 20px 10px; }
.wa-hero h1 { margin: 0 0 8px; font-size: var(--headline, 26px); }
.wa-hero p { margin: 0; color: var(--muted); line-height: 1.6; font-size: var(--subhead, 15px); }
.wa-sheet { margin-top: auto; padding: 8px 20px 22px; }

.lay-poster { min-height: 100vh; background: linear-gradient(145deg, var(--bg1), var(--bg2)); color: #f6f1e8; }
.poster-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.poster-copy { padding: 64px 48px; display: flex; flex-direction: column; justify-content: center; }
.poster-copy .logo { background: var(--accent); }
.poster-copy .brand { letter-spacing: .08em; font-size: var(--brand-size, 13px); opacity: .8; margin-top: 18px; }
.poster-copy h1 { font-size: var(--headline, 46px); line-height: 1.15; margin: 10px 0; max-width: 520px; }
.poster-copy .sub { font-size: var(--subhead, 16px); max-width: 460px; line-height: 1.7; opacity: .85; }
.poster-card { display: grid; place-items: center; padding: 32px; }
.poster-card form { width: min(var(--card-width, 400px), 100%); background: var(--card); color: var(--title); border-radius: var(--card-radius, 12px); padding: 26px 22px; }
@media (max-width: 800px) {
  .poster-wrap { grid-template-columns: 1fr; }
  .poster-copy { padding: 36px 22px 10px; }
  .poster-copy h1 { font-size: 32px; }
}

.chat-page { min-height: 100vh; background: #d8d1c7; display: grid; place-items: center; padding: 12px; }
.chat-app { width: min(480px, 100%); height: min(900px, calc(100vh - 24px)); background: var(--chat-bg); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 16px 40px rgba(0,0,0,.16); }
.chat-head { background: var(--chat-header, #075e54); color: var(--chat-header-text, #fff); padding: 12px 14px 10px; }
.chat-head .who { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chat-head strong { font-size: var(--chat-title, 16px); }
.chat-head .sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.chat-head .steps span { background: rgba(255,255,255,.16); color: #fff; }
.chat-head .steps .on { background: #25d366; color: #063; }
.msgs { flex: 1; overflow: auto; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 8px 10px 4px; border-radius: 10px; background: var(--chat-agent, #fff); box-shadow: 0 1px 0 rgba(0,0,0,.04); align-self: flex-start; font-size: var(--bubble, 15px); }
.bubble.agent { margin-right: auto; align-self: flex-start; }
.bubble.customer { margin-left: auto; align-self: flex-end; background: var(--chat-mine, #d9fdd3); }
.bubble .pic { display: block; max-width: 100%; border-radius: 8px; margin-top: 6px; }
.bubble.system { margin: 4px auto; background: #fff7d6; color: #6d5b28; font-size: 12px; text-align: center; }
.bubble .name { font-size: 12px; color: #0b7a62; font-weight: 700; }
.bubble .text { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.bubble .time { text-align: right; font-size: 11px; color: #7d8b86; margin-top: 2px; }
.quick { display: flex; flex-direction: column; gap: 8px; padding: 4px 12px 8px; }
.quick button { width: 100%; border: 0; background: #fff; color: #027eb5; border-radius: 10px; padding: 12px; cursor: pointer; font-weight: 600; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.composer { display: flex; gap: 8px; padding: 10px; background: var(--chat-composer, #f0f2f5); }
.composer textarea { flex: 1; resize: none; height: 44px; border: 0; border-radius: 12px; padding: 12px; }
.composer button { border: 0; background: var(--chat-send, #075e54); color: #fff; border-radius: 12px; padding: 0 16px; font-weight: 700; cursor: pointer; }

@media (max-width: 800px) {
  .chat-page { padding: 0; display: block; background: var(--chat-bg); }
  .chat-app { width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; }
  .lay-card { padding: 16px; }
  .lay-card .card { width: 100%; border-radius: 18px; }
  .lay-whatsapp { padding: 0; }
  .wa-shell { width: 100%; min-height: 100dvh; border-radius: 0; box-shadow: none; }
  .poster-copy { padding: 28px 18px 8px; }
  .poster-copy h1 { font-size: 30px; }
  .poster-card { padding: 16px; }
}
@media (min-width: 1100px) {
  .chat-app { width: min(720px, 92vw); height: calc(100dvh - 28px); }
  .wa-shell { width: min(520px, 92vw); min-height: calc(100dvh - 36px); }
  .lay-card .card { width: min(480px, 92vw); }
  .poster-copy h1 { font-size: clamp(40px, 4vw, 56px); }
}
.gate, .portal { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #13241f; color: #f4f7f4; }
.panel { width: min(520px, 100%); background: #1c332c; border-radius: 20px; padding: 28px 24px; }
.panel h1 { margin: 0 0 8px; }
.panel p { line-height: 1.6; color: #c9d7d1; }
.panel a.btn, .panel .btn { display: inline-block; margin: 8px 8px 0 0; background: #25d366; color: #06281a; text-decoration: none; font-weight: 700; padding: 10px 14px; border-radius: 12px; }
.links { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.links a { color: #d8ffe8; }
