:root {
  --red: #b3162d;
  --red-dark: #8d1025;
  --orange: #d9a441;
  --ink: #172235;
  --muted: #7b8492;
  --paper: #fffdf9;
  --card: #ffffff;
  --line: #eadfd9;
  --soft: #f7f1ea;
  --shadow: 0 20px 60px rgba(68, 35, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16px 16px, rgba(141, 16, 37, 0.035) 1.5px, transparent 1.5px),
    linear-gradient(180deg, #f7f2ec, #fffdf8 48%, #f5efe8);
  background-size: 18px 18px, auto;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow-y: auto;
  display: block;
  padding: 22px;
  background: rgba(23, 28, 36, 0.6);
  backdrop-filter: blur(2px);
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.login-screen--hidden {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.login-card {
  width: min(390px, 100%);
  margin: min(8vh, 64px) auto;
  padding: 38px 32px 34px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(43, 12, 21, 0.28);
  text-align: center;
}

.login-card h1 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.2;
}

.login-copy {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.login-card label,
.login-card label span {
  display: block;
}

.login-card label {
  margin-bottom: 14px;
  text-align: left;
}

.login-card label span {
  margin-bottom: 8px;
  color: #6c7280;
  font-size: 14px;
  font-weight: 800;
}

.login-card input,
.login-card select {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  outline: 0;
  padding: 15px 16px;
  color: var(--ink);
  background: #eef5ff;
  font-size: 17px;
}

.login-field--phone input:focus {
  border-color: #e0a51e;
  box-shadow: 0 0 0 2px rgba(224, 165, 30, 0.18);
}

.email-hint {
  min-height: 22px;
  margin: 2px 0 16px;
  color: #a65c24;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.saved-login-box {
  position: relative;
  margin: -4px 0 16px 54px;
  padding: 18px 18px 14px;
  border: 1px solid rgba(224, 224, 224, 0.9);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(33, 42, 54, 0.18);
  text-align: left;
}

.saved-login-box::before {
  position: absolute;
  top: -9px;
  left: 24px;
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  border-left: 1px solid rgba(224, 224, 224, 0.9);
  border-top: 1px solid rgba(224, 224, 224, 0.9);
  background: #fff;
  content: "";
}

.saved-login-box p {
  margin: 0 28px 12px 0;
  color: #6c7280;
  font-size: 13px;
}

.saved-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px !important;
  height: 28px;
  margin: 0 !important;
  padding: 0 !important;
  color: #343b48 !important;
  background: transparent !important;
  font-size: 24px !important;
  line-height: 1;
}

.saved-account {
  width: 100%;
  border: 0;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--ink) !important;
  background: transparent !important;
  text-align: left;
}

.saved-account strong,
.saved-account span {
  display: block;
}

.saved-account strong {
  margin-bottom: 8px;
  font-weight: 500;
}

.saved-account span {
  letter-spacing: 3px;
}

.saved-login-box small {
  display: block;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eceff3;
  color: #6c7280;
  text-align: left;
}

.email-hint--ok {
  color: #147567;
}

.login-card input:focus,
.login-card select:focus {
  border-color: rgba(191, 23, 50, 0.48);
}

.login-card button {
  width: 100%;
  border: 0;
  border-radius: 16px;
  margin-top: 14px;
  padding: 16px;
  color: #fff;
  background: var(--red);
  font-size: 18px;
  font-weight: 900;
}

.login-card .login-ghost {
  color: var(--red);
  background: transparent;
}

.login-card small {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 16px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-seal {
  display: block;
  overflow: hidden;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(151, 17, 42, 0.2);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(141, 16, 37, 0.12);
}

.brand-seal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-size: 19px;
  line-height: 1.25;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.top-actions {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 12px;
  color: var(--red);
  font-weight: 900;
}

.profile-pill {
  min-width: 92px;
  border: 1px solid rgba(151, 17, 42, 0.18);
  border-radius: 999px;
  padding: 12px 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.hero-card {
  overflow: hidden;
  position: relative;
  padding: 34px 28px 38px;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 255, 255, 0.16), transparent 130px),
    linear-gradient(135deg, #8d1025, #b3162d 62%, #d85638);
  box-shadow: var(--shadow);
}

.hero-card::before {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 10px 10px;
  content: "";
}

.hero-card > * {
  position: relative;
}

.hero-card p {
  margin: 0 0 26px;
  color: rgba(255, 235, 185, 0.92);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.hero-card h1 {
  margin: 0 0 18px;
  font-size: 34px;
  line-height: 1.18;
}

.hero-card h2 {
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.75;
}

.hero-card span {
  display: inline-flex;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.ask-card {
  margin-top: 26px;
  padding: 26px;
  border: 1px solid rgba(234, 223, 217, 0.78);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.desktop-content {
  display: block;
}

.ask-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.ask-head h2 {
  margin: 0;
  font-size: 27px;
}

.ask-head span {
  color: var(--muted);
  font-size: 13px;
}

.chat-list {
  display: grid;
  max-height: 300px;
  overflow: auto;
  gap: 12px;
  padding-right: 2px;
}

.message {
  display: flex;
}

.message p {
  max-width: 88%;
  margin: 0;
  padding: 15px 17px;
  border-radius: 18px;
  line-height: 1.75;
}

.message aside {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 4px solid rgba(179, 22, 45, 0.55);
  border-radius: 12px;
  color: #8a5a22;
  background: #fff7e8;
  line-height: 1.65;
}

.message--assistant {
  justify-content: flex-start;
}

.message--assistant p {
  color: #334155;
  background: #f4f1ec;
}

.message--assistant {
  display: block;
}

.message--user {
  justify-content: flex-end;
}

.message--user p {
  margin-left: auto;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--orange));
}

.answer-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.answer-gallery figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(234, 223, 217, 0.82);
  border-radius: 16px;
  background: #fff;
}

.answer-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.answer-gallery figcaption {
  padding: 9px 10px 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.answer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.answer-links a {
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff;
  background: var(--red);
  text-decoration: none;
  font-weight: 800;
}

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.quick-questions button {
  border: 1px solid rgba(191, 23, 50, 0.18);
  border-radius: 999px;
  padding: 10px 15px;
  color: #a21a31;
  background: #fffaf8;
}

.ask-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.ask-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 13px 12px;
  color: var(--ink);
  background: transparent;
}

.ask-form button {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: var(--red);
  font-size: 25px;
  font-weight: 900;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.guide-head {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.guide-head h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.guide-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.info-grid article {
  padding: 18px;
  border: 1px solid rgba(234, 223, 217, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.info-grid span {
  color: var(--red);
  font-weight: 900;
}

.info-grid h3 {
  margin: 8px 0 7px;
}

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

.footer {
  display: grid;
  gap: 8px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 14px;
}

.footer strong {
  color: #5d6675;
}

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

  .top-actions {
    display: none;
  }

  .hero-card,
  .ask-card {
    padding: 24px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .login-screen {
    padding: max(18px, env(safe-area-inset-top)) 14px max(26px, env(safe-area-inset-bottom));
  }

  .login-card {
    margin: 18px auto;
    padding: 30px 24px 24px;
    border-radius: 26px;
  }

  .login-card h1 {
    font-size: 25px;
  }

  .login-copy {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.65;
  }

  .login-card input,
  .login-card select {
    padding: 14px 15px;
    font-size: 16px;
  }

  .saved-login-box {
    margin-left: 0;
  }
}

@media (min-width: 900px) {
  .phone-shell {
    width: min(1280px, calc(100% - 72px));
    padding: 28px 0 48px;
  }

  .topbar {
    margin-bottom: 34px;
  }

  .brand-seal {
    width: 58px;
    height: 58px;
  }

  .brand strong {
    font-size: 22px;
    line-height: 1.15;
  }

  .top-actions {
    justify-content: flex-end;
    gap: 28px;
    font-size: 17px;
  }

  .profile-pill {
    min-width: 124px;
    padding: 13px 24px;
    background: rgba(255, 255, 255, 0.86);
  }

  .hero-card {
    min-height: 280px;
    padding: 54px 64px;
    border-radius: 30px;
  }

  .hero-card p {
    margin-bottom: 24px;
    font-size: 14px;
  }

  .hero-card h1 {
    font-size: 46px;
  }

  .hero-card h2 {
    max-width: 560px;
    font-size: 20px;
  }

  .desktop-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 26px;
    align-items: start;
    margin-top: 30px;
  }

  .ask-card,
  .info-grid {
    margin-top: 0;
  }

  .ask-card {
    min-height: 460px;
    padding: 34px;
  }

  .ask-head h2 {
    font-size: 31px;
  }

  .chat-list {
    max-height: 330px;
  }

  .message p {
    max-width: 78%;
  }

  .message--assistant p {
    max-width: 82%;
  }

  .guide-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 30px;
    border: 1px solid rgba(234, 223, 217, 0.78);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
  }

  .guide-card article {
    display: grid;
    grid-template-columns: 36px 1fr;
    column-gap: 14px;
    padding: 18px 0;
    border: 0;
    border-bottom: 1px solid rgba(234, 223, 217, 0.82);
    border-radius: 0;
    background: transparent;
  }

  .guide-card article:last-child {
    border-bottom: 0;
  }

  .guide-card article span {
    grid-row: span 2;
    margin-top: 2px;
  }

  .guide-card article h3 {
    margin: 0 0 6px;
    font-size: 20px;
  }

  .footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
  }
}
