:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #17211d;
  background: #e7efec;
  --brand: #0f766e;
  --brand-dark: #12433e;
  --accent: #2dd4bf;
  --line: #dce5e1;
  --muted: #697772;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.preview-shell {
  position: relative;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) 68px;
  width: min(100%, 430px);
  height: min(900px, 100vh);
  margin: 0 auto;
  overflow: hidden;
  background: #f5f7f6;
}

.mini-header {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.mini-header img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.mini-header strong {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-header span {
  text-align: right;
}

.screen {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.loading,
.empty-state {
  padding: 64px 28px;
  color: var(--muted);
  text-align: center;
}

.brand-band {
  padding: 28px 22px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  display: block;
  width: 190px;
  height: 48px;
  margin-bottom: 20px;
  object-fit: contain;
  object-position: left center;
}

.brand-band h1,
.paper-card h1,
.section-title,
.service-detail h1 {
  margin: 0;
  letter-spacing: 0;
}

.brand-band h1 {
  font-size: 28px;
  line-height: 1.25;
}

.brand-band p,
.service-copy p,
.service-detail p,
.muted {
  color: var(--muted);
  line-height: 1.65;
}

.primary-actions,
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.button-primary,
.button-plain {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  font-weight: 700;
}

.button-primary {
  background: var(--brand);
  color: #fff;
}

.button-plain {
  background: #fff;
  color: var(--brand);
}

.content-section {
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.content-section + .content-section {
  margin-top: 10px;
}

.section-title {
  margin-bottom: 14px;
  font-size: 19px;
}

.service-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 88px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #edf2ef;
  background: transparent;
  color: inherit;
  text-align: left;
}

.service-row:last-child {
  border-bottom: 0;
}

.service-thumb {
  width: 76px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #e7f4f0;
}

.service-placeholder {
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 800;
}

.service-copy {
  min-width: 0;
}

.service-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-copy p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 48px;
  align-items: center;
  border-bottom: 1px solid #edf2ef;
}

.contact-row:last-child {
  border-bottom: 0;
}

.contact-row span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.card-page {
  padding: 18px 16px 30px;
}

.paper-card {
  min-height: 330px;
  padding: 24px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 30px rgba(18, 67, 62, 0.18);
}

.paper-logo {
  width: 154px;
  height: 40px;
  object-fit: contain;
  object-position: left center;
}

.identity {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 32px;
}

.identity.no-avatar {
  grid-template-columns: minmax(0, 1fr);
}

.avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity h1 {
  font-size: 31px;
}

.identity p {
  margin: 5px 0 0;
  font-weight: 700;
}

.identity span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.card-contacts {
  margin-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.card-contacts .contact-row {
  min-height: 44px;
  border-bottom-color: rgba(255, 255, 255, 0.2);
  font-size: 14px;
}

.service-detail {
  padding: 28px 22px 36px;
  background: #fff;
}

.service-detail h1 {
  font-size: 27px;
}

.detail-image {
  width: 100%;
  max-height: 220px;
  margin: 18px 0;
  border-radius: 8px;
  object-fit: cover;
}

.lead-form {
  display: grid;
  gap: 14px;
  padding: 24px 22px 36px;
  background: #fff;
}

.lead-form label {
  display: grid;
  gap: 7px;
  color: #43514c;
  font-size: 14px;
  font-weight: 700;
}

.lead-form input,
.lead-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #17211d;
  background: #fff;
}

.lead-form textarea {
  min-height: 110px;
  resize: vertical;
}

.lead-form button {
  margin-top: 6px;
}

.invalid-card {
  padding: 90px 24px;
  text-align: center;
}

.invalid-card h1 {
  margin: 0 0 12px;
  font-size: 28px;
}

.invalid-card button {
  margin-top: 20px;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.tabbar button {
  border: 0;
  background: transparent;
  color: #697772;
  font-weight: 700;
}

.tabbar button.active {
  color: var(--brand);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.48);
}

.modal[hidden] {
  display: none;
}

.modal-dialog {
  width: min(100%, 340px);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.modal-dialog img {
  width: 240px;
  height: 240px;
  max-width: 100%;
}

.modal-dialog button {
  width: 100%;
  margin-top: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 6;
  max-width: calc(100% - 40px);
  padding: 10px 14px;
  border-radius: 8px;
  background: #17211d;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.filing-footer {
  display: grid;
  gap: 4px;
  padding: 14px 10px 2px;
  color: #65736f;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.filing-footer button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

@media (min-width: 700px) {
  body {
    display: grid;
    place-items: center;
    padding: 28px;
  }

  .preview-shell {
    border: 1px solid #c8d7d1;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(23, 33, 29, 0.16);
  }
}
