:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --text: #22242b;
  --muted: #8d929c;
  --line: #e9edf3;
  --blue: #0872f4;
  --blue-soft: #e8f3ff;
  --red: #f2849b;
  --card: #fff;
  --bg: #f4f5f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #dfe3ea;
  color: var(--text);
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
}

.access-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #f4f5f7;
}

.access-panel {
  width: min(100%, 390px);
  padding: 34px 30px 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(34, 42, 56, .1);
}

.access-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
}

.access-icon svg {
  width: 30px;
  height: 30px;
  fill: var(--blue);
}

.access-panel h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

.access-panel > p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.access-panel label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.access-panel input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d9dee7;
  border-radius: 6px;
  outline: 0;
  font: inherit;
  letter-spacing: 0;
  text-transform: uppercase;
}

.access-panel input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(8, 114, 244, .12);
}

.access-panel button {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.access-panel button:disabled {
  background: #aab2be;
  cursor: wait;
}

.form-error {
  min-height: 38px;
  padding-top: 8px;
  color: #d93754;
  font-size: 13px;
  line-height: 1.4;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 12px 30px;
  background: var(--bg);
}

.top-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.1;
  font-weight: 900;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  color: var(--blue);
  font-weight: 800;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #77baf9;
  box-shadow: 0 0 18px #74b7ff;
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 86px;
  gap: 8px;
  margin: 18px 0 14px;
}

.card-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 86px;
  height: 42px;
  padding: 0 8px;
  border: 1px solid #ee9aaa;
  border-radius: 5px;
  background: #fff1f4;
  color: #c92f4b;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.card-logout-btn span {
  white-space: nowrap;
}

.card-logout-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-logout-btn:active {
  background: #ffe3e8;
}

.card-logout-btn:disabled {
  color: #a7adb7;
  cursor: wait;
}

.ghost {
  height: 42px;
  border-radius: 5px;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.ghost.blue {
  border: 1px solid var(--blue);
  background: #f2f8ff;
  color: var(--blue);
}

.ghost.red {
  border: 1px solid #ef5b75;
  background: #fff5f7;
  color: #e84764;
}

.ghost:disabled {
  border-color: #dfe3e9;
  background: #f0f2f5;
  color: #a7adb7;
  opacity: 1;
  cursor: not-allowed;
}

.ghost.blue:disabled {
  border-color: #b9d8fb;
  background: #edf6ff;
  color: #78aceb;
}

.ghost.red:disabled {
  border-color: #f1c0c9;
  background: #fff1f4;
  color: #df8495;
}

.ghost.locked-state:disabled {
  border-color: #efd18a;
  background: #fff8e6;
  color: #ad770e;
}

.ghost.dead-state:disabled {
  border-color: #efa6b3;
  background: #ffedf0;
  color: #cf3e58;
}

.rule-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -7px 0 18px;
  padding: 12px 13px;
  border: 1px solid;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.45;
}

.rule-banner.show {
  display: flex;
}

.rule-banner.locked {
  border-color: #efd18a;
  background: #fff8e6;
  color: #825900;
}

.rule-banner.dead {
  border-color: #efa6b3;
  background: #ffedf0;
  color: #ad2941;
}

.rule-banner button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
  cursor: pointer;
}

.number-card,
.code-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 1px 5px rgba(20, 24, 32, .04);
}

.number-main {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 14px;
}

.shield {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eef6ff;
}

.shield svg {
  width: 22px;
  height: 22px;
  fill: var(--blue);
}

.number-main p,
.code-card > span {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.number-main strong {
  display: block;
  min-height: 32px;
  overflow-wrap: anywhere;
  font-size: 27px;
  line-height: 1.05;
  font-weight: 900;
}

.copy-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  align-self: center;
  justify-self: end;
}

.copy-btn svg {
  width: 22px;
  height: 22px;
  fill: #666a72;
  transform: translate(-1px, -1px);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.info-grid div {
  min-height: 58px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-grid div:nth-child(2n) {
  border-right: 0;
}

.info-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.info-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.info-grid b {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.code-card {
  margin-top: 12px;
  padding: 14px;
}

.code-card strong {
  display: block;
  min-height: 36px;
  margin-top: 10px;
  font-size: 28px;
  letter-spacing: 6px;
}

.listen-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 10px;
}

.listen-line p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 3px solid #dbe7ff;
  border-top-color: var(--blue);
  animation: spin .9s linear infinite;
}

.refresh-btn,
.promo-card button {
  width: 100%;
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
}

.refresh-btn:disabled {
  color: #aab8cc;
  cursor: not-allowed;
}

.promo-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 14px 12px;
  border: 1px solid #c9e7ff;
  border-radius: 12px;
  background: linear-gradient(135deg, #f3fbff 0%, #e8f0ff 100%);
}

.gift {
  font-size: 30px;
  line-height: 1;
}

.promo-card h2 {
  margin: 0 0 5px;
  color: #103c88;
  font-size: 18px;
  line-height: 1.2;
}

.promo-card p {
  margin: 0;
  color: #1681e8;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
}

.promo-card button {
  grid-column: 1 / -1;
  margin-top: 8px;
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.instructions-card {
  margin-top: 18px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(20, 24, 32, .04);
}

.instructions-card h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 17px;
  font-size: 20px;
}

.instructions-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-line;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(18px);
  min-width: 180px;
  max-width: min(92vw, 380px);
  padding: 11px 14px;
  border-radius: 8px;
  background: rgba(20, 24, 32, .92);
  color: #fff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

.rule-modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(20, 25, 34, .58);
}

.rule-modal-backdrop.show {
  display: grid;
}

.rule-modal {
  width: min(100%, 380px);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.rule-modal-accent {
  height: 5px;
  background: #f0b43c;
}

.rule-modal.dead .rule-modal-accent {
  background: var(--red);
}

.rule-modal-body {
  padding: 26px 24px 20px;
}

.rule-modal-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  background: #fff4d9;
  color: #9b6700;
  font-size: 25px;
  font-weight: 900;
}

.rule-modal.dead .rule-modal-icon {
  background: #ffedf0;
  color: #c9324d;
}

.rule-modal h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.rule-modal p {
  margin: 0;
  color: #616976;
  font-size: 15px;
  line-height: 1.7;
}

.rule-modal-countdown {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  background: #f5f6f8;
  color: #4d5663;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.rule-modal-footer {
  padding: 0 24px 24px;
}

.rule-modal-footer button {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.rule-modal.dead .rule-modal-footer button {
  background: var(--red);
}

.faq-modal-backdrop {
  position: fixed;
  z-index: 25;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(20, 25, 34, .58);
}

.faq-modal-backdrop.show {
  display: grid;
}

.faq-modal {
  width: min(100%, 390px);
  padding: 30px 24px 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.faq-modal-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.faq-modal-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #f39a08;
}

.faq-modal-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.faq-modal h2 {
  margin: 0;
  font-size: 23px;
}

.faq-modal > p {
  min-height: 182px;
  margin: 0;
  padding: 16px;
  border: 1px solid #e0e5ec;
  border-radius: 7px;
  background: #f8f9fb;
  color: #8a929e;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-line;
}

.faq-modal-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 22px 0;
  color: #707986;
  font-size: 14px;
  cursor: pointer;
}

.faq-modal-choice input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.faq-modal > button {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.faq-modal > button:disabled {
  background: #e9edf2;
  color: #9ba4b1;
  cursor: not-allowed;
}

.contact-modal-backdrop {
  position: fixed;
  z-index: 28;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(24, 29, 37, .62);
}

.contact-modal-backdrop.show { display: grid; }

.contact-modal {
  width: min(100%, 390px);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 26px 22px 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

.contact-modal-heading { display: flex; align-items: center; justify-content: center; gap: 10px; }
.contact-wechat-mark { display: grid; width: 38px; height: 38px; border-radius: 7px; background: #eaf4ff; color: #0872f4; font-size: 12px; font-weight: 900; place-items: center; }
.contact-modal h2 { margin: 0; font-size: 24px; }
.contact-modal-lead { margin: 20px 0; color: #68717e; font-size: 15px; line-height: 1.65; text-align: center; }
.contact-services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 14px; }
.contact-services span { padding: 9px 3px; border: 1px solid #bbd9fb; border-radius: 6px; background: #f2f8ff; color: #1267bf; font-size: 12px; font-weight: 800; text-align: center; }
.contact-box { padding: 15px; border: 1px solid #e0e5ec; border-radius: 7px; background: #f8f9fb; }
.contact-qr-row { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; gap: 15px; }
.contact-qr-frame { display: grid; width: 124px; aspect-ratio: 1; border: 1px solid #d8dee7; background: #fff; place-items: center; }
.contact-qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.contact-qr-frame span { color: #929aa5; font-size: 12px; font-weight: 800; }
.contact-qr-row strong { display: block; font-size: 16px; line-height: 1.45; }
.contact-qr-row p { margin: 8px 0 0; color: #7b8491; font-size: 12px; line-height: 1.6; }
.contact-wechat-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 11px 12px; border: 1px solid #c9dff8; border-radius: 6px; background: #eef6ff; }
.contact-wechat-copy span { display: block; margin-bottom: 3px; color: #78828f; font-size: 11px; }
.contact-wechat-copy code { color: #172232; font-family: Consolas, monospace; font-size: 18px; font-weight: 900; overflow-wrap: anywhere; }
.contact-wechat-copy button { flex: 0 0 auto; min-width: 70px; height: 36px; border: 0; border-radius: 5px; background: #0872f4; color: #fff; font-weight: 900; cursor: pointer; }
.contact-wechat-copy button:disabled { background: #aeb9c8; cursor: not-allowed; }
.contact-point { margin: 15px 0 0; color: #4f5966; font-size: 13px; line-height: 1.6; }
.contact-point::before { content: "✓"; margin-right: 8px; color: #0872f4; font-weight: 900; }
.contact-note { margin: 16px 0; color: #8a929e; font-size: 12px; line-height: 1.55; text-align: center; }
.contact-modal-button { width: 100%; height: 48px; border: 0; border-radius: 6px; background: #0872f4; color: #fff; font-weight: 900; cursor: pointer; }
.contact-modal-button:disabled { background: #e7eaf0; color: #99a2af; cursor: not-allowed; }

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 420px) {
  .top-row {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  h1 {
    font-size: 24px;
  }

  .live-pill { font-size: 12px; }
}

@media (max-width: 380px) {
  .phone-shell {
    padding-inline: 10px;
  }

  .contact-modal { padding-inline: 16px; }
  .contact-qr-row { grid-template-columns: 104px minmax(0, 1fr); gap: 11px; }
  .contact-qr-frame { width: 104px; }
  .contact-wechat-copy code { font-size: 16px; }

  .number-main {
    grid-template-columns: 42px minmax(0, 1fr) 38px;
    padding-inline: 10px;
  }

  .number-main strong {
    font-size: 23px;
  }
}
