:root {
  --ink: #15313b;
  --muted: #61747b;
  --teal: #087f8c;
  --teal-dark: #05616b;
  --coral: #e66a4e;
  --sand: #f7f3ec;
  --white: #fff;
  --line: #dce5e5;
  --success: #237a57;
  --danger: #b43b35;
  --shadow: 0 12px 35px rgba(21, 49, 59, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fbfcfc; font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--teal-dark); }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
img { max-width: 100%; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px; z-index: 20; }
.skip-link:focus { left: 8px; }

.site-header { min-height: 74px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 21px; font-weight: 800; text-decoration: none; letter-spacing: -.5px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--teal); color: #fff; font-size: 13px; letter-spacing: 0; }
.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 650; }
.main-nav a:hover, .main-nav a.active { color: var(--teal); }
.menu-toggle { display: none; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 7px 12px; }
.demo-bar { background: #e9f5f4; color: var(--teal-dark); padding: 7px 5vw; text-align: center; font-size: 12px; }

#app { min-height: calc(100vh - 210px); }
.container { width: min(1160px, 90vw); margin: 0 auto; padding: 48px 0; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; min-height: 520px; }
.eyebrow { color: var(--teal); text-transform: uppercase; letter-spacing: 1.8px; font-size: 12px; font-weight: 800; margin: 0 0 12px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.5px; }
h1 { font-size: clamp(38px, 5vw, 64px); margin: 0 0 20px; }
h2 { font-size: clamp(26px, 3vw, 36px); margin: 0 0 12px; }
h3 { font-size: 19px; margin: 0 0 8px; }
p { margin: 0 0 16px; }
.lead { color: var(--muted); font-size: 18px; max-width: 650px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; background: var(--teal); color: #fff; text-decoration: none; font-weight: 700; }
.btn:hover { background: var(--teal-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--sand); }
.btn-danger { background: var(--danger); }
.btn-small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.link-btn { border: 0; padding: 0; background: none; color: var(--teal); font-weight: 700; }

.hero-card { padding: 30px; background: var(--ink); color: #fff; border-radius: 26px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.hero-card-top { display: flex; justify-content: space-between; color: #b9e3e2; font-size: 13px; }
.hero-pass { margin: 44px 0 28px; padding: 24px; border: 1px dashed #85c8c6; border-radius: 18px; background: rgba(255,255,255,.07); }
.hero-pass strong { display: block; font-size: 30px; color: #fff; }
.hero-pass span { color: #b9e3e2; }
.hero-stats { display: flex; gap: 28px; }
.hero-stats strong { display: block; font-size: 24px; }
.hero-stats span { color: #b9e3e2; font-size: 12px; }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.section-head p { margin: 0; color: var(--muted); }
.feature-grid, .card-grid, .guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.feature-grid { margin-top: 28px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 3px 12px rgba(21,49,59,.03); }
.card-link { color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-card { border-top: 3px solid var(--teal); }
.feature-number { color: var(--coral); font-size: 13px; font-weight: 800; }
.tag-row { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.tag { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #e9f5f4; color: var(--teal-dark); font-size: 12px; font-weight: 650; }
.tag-warm { background: #fff0e9; color: #a34731; }
.tag-gray { background: #eef1f2; color: var(--muted); }
.discount { color: var(--coral); font-size: 32px; font-weight: 850; letter-spacing: -1px; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }

.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; background: #d9eceb; color: var(--teal-dark); font-weight: 800; }
.avatar-large { width: 88px; height: 88px; font-size: 24px; }
.guide-head { display: flex; gap: 14px; align-items: center; }
.rating { color: #9b6417; font-size: 13px; font-weight: 700; }
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px; margin-bottom: 24px; background: var(--sand); border-radius: 14px; }
.filter-bar label { flex: 1; min-width: 160px; font-size: 12px; font-weight: 700; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; border: 1px solid #bdcccc; border-radius: 9px; padding: 11px 12px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(8,127,140,.22); outline-offset: 2px; }
textarea { resize: vertical; min-height: 110px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-card { max-width: 820px; margin: 0 auto; }
.form-card .btn { margin-top: 22px; }
.form-note { padding: 12px 14px; background: var(--sand); border-radius: 10px; color: var(--muted); font-size: 13px; }

.detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: start; }
.detail-panel { padding: 30px; }
.terms { padding-left: 20px; color: var(--muted); }
.status { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: #e6f4ed; color: var(--success); font-size: 12px; font-weight: 750; }
.status-used { background: #eef1f2; color: var(--muted); }
.status-expired { background: #fff0e9; color: var(--danger); }
.pass-code { padding: 18px; border: 1px dashed var(--teal); border-radius: 12px; text-align: center; background: #f1faf9; }
.pass-code strong { display: block; font-size: 22px; letter-spacing: 1px; }
.qr-demo { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; width: 162px; height: 162px; padding: 8px; margin: 16px auto; background: #fff; border: 1px solid var(--line); }
.qr-demo span { background: #fff; }
.qr-demo span.on { background: var(--ink); }
.empty { padding: 50px 24px; text-align: center; border: 1px dashed #bdcccc; border-radius: 16px; background: var(--sand); }

.merchant-tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.merchant-tabs button { border: 0; border-bottom: 3px solid transparent; padding: 12px 16px; background: none; color: var(--muted); font-weight: 700; }
.merchant-tabs button.active { border-bottom-color: var(--teal); color: var(--teal); }
.redeem-result { margin-top: 20px; }
.alert { padding: 12px 14px; border-radius: 10px; margin: 12px 0; background: #e9f5f4; color: var(--teal-dark); }
.alert-error { background: #fff0ed; color: var(--danger); }

.chat-layout { display: grid; grid-template-columns: 280px 1fr; min-height: 560px; overflow: hidden; padding: 0; }
.chat-list { border-right: 1px solid var(--line); background: var(--sand); }
.chat-contact { display: flex; align-items: center; gap: 10px; width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: var(--ink); }
.chat-contact.active { background: #fff; border-left: 3px solid var(--teal); }
.chat-contact small { display: block; color: var(--muted); }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-title { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 750; }
.messages { flex: 1; padding: 20px; overflow-y: auto; max-height: 400px; }
.message { max-width: 75%; margin-bottom: 12px; padding: 10px 14px; border-radius: 14px 14px 14px 3px; background: #eef1f2; }
.message.mine { margin-left: auto; border-radius: 14px 14px 3px 14px; background: var(--teal); color: #fff; }
.message time { display: block; margin-top: 4px; font-size: 10px; opacity: .7; }
.chat-form { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.chat-form input { margin: 0; flex: 1; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px 5vw; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 360px; padding: 14px 18px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow); }

@media (max-width: 850px) {
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 74px; padding: 18px 5vw; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: flex-start; gap: 14px; }
  .main-nav.open { display: flex; }
  .hero, .detail-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; gap: 34px; }
  .feature-grid, .card-grid, .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { display: flex; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .chat-contact { min-width: 210px; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 30px, 1160px); padding: 32px 0; }
  .feature-grid, .card-grid, .guide-grid, .form-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 22px; }
  .hero-stats { gap: 18px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .site-footer { flex-direction: column; }
  .toast { left: 15px; right: 15px; bottom: 15px; }
  .chat-form { flex-wrap: wrap; }
  .chat-form .btn { width: 100%; }
}
