:root {
  --ink: #17202f;
  --muted: #6f7787;
  --line: rgba(28, 37, 58, 0.12);
  --paper: #fffaf1;
  --surface: rgba(255, 255, 255, 0.88);
  --brand: #a7372f;
  --brand-dark: #7e201d;
  --gold: #c99a45;
  --jade: #237a69;
  --night: #1b2638;
  --shadow: 0 22px 60px rgba(43, 27, 20, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    linear-gradient(rgba(255, 250, 241, 0.9), rgba(246, 239, 227, 0.95)),
    url("https://images.unsplash.com/photo-1566073771259-6a8506099945?auto=format&fit=crop&w=1800&q=82") center/cover fixed;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.demo-page {
  min-height: 100vh;
  padding: 28px;
}

.demo-topbar {
  max-width: 1320px;
  margin: 0 auto 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.demo-topbar h1 {
  font-size: 30px;
  line-height: 1.2;
}

.overline {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.top-actions,
.section-title,
.bottom-cta,
.admin-tools {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 999px;
}

.view-toggle {
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 999px;
  padding: 10px 16px;
}

.view-toggle.active {
  color: #fff;
  background: var(--brand);
}

.preview-grid {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(360px, 430px) minmax(230px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.strategy-panel,
.check-panel {
  position: sticky;
  top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.strategy-panel h2,
.check-panel h2 {
  margin-top: 8px;
  font-size: 25px;
  line-height: 1.25;
}

.strategy-panel p,
.check-panel li {
  color: var(--muted);
  line-height: 1.75;
}

.strategy-panel > p {
  margin-top: 14px;
}

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

.flow-list span,
.metric-strip article,
.profile-grid article,
.admin-kpis article {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
}

.flow-list span {
  padding: 10px 12px;
  color: var(--brand-dark);
  font-weight: 700;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.metric-strip article {
  padding: 14px 10px;
  text-align: center;
}

.metric-strip strong {
  display: block;
  font-size: 24px;
  color: var(--brand);
}

.metric-strip span {
  font-size: 12px;
  color: var(--muted);
}

.phone-frame {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 14px;
  border-radius: 36px;
  background: #16181f;
  box-shadow: 0 28px 90px rgba(21, 18, 15, 0.36);
}

.phone-speaker {
  width: 94px;
  height: 6px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #343946;
}

.phone-screen {
  height: 820px;
  overflow: auto;
  border-radius: 26px;
  background: #f7f1e9;
  padding: 16px 14px 86px;
  scrollbar-width: none;
}

.phone-screen::-webkit-scrollbar {
  display: none;
}

.app-header,
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.app-header p,
.admin-header p {
  color: var(--muted);
  font-size: 13px;
}

.app-header h2,
.admin-header h2 {
  margin-top: 3px;
  font-size: 20px;
  line-height: 1.22;
}

.mini-btn,
.notice-card button,
.section-title button,
.package-card button,
.module-card button,
.wide-action,
.bottom-cta button,
.modal-card button[type="submit"],
.admin-tools button {
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand);
}

.mini-btn {
  flex: 0 0 auto;
  padding: 9px 12px;
  font-size: 13px;
}

.mini-btn.light {
  color: var(--night);
  background: #fff;
}

.hero-slider {
  position: relative;
  min-height: 238px;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(70, 36, 23, 0.18);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  padding: 18px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  background-size: cover;
  background-position: center;
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.72));
}

.hero-slide > div {
  position: relative;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide[data-slide="0"] {
  background-image: url("https://images.unsplash.com/photo-1519167758481-83f550bb49b3?auto=format&fit=crop&w=1200&q=82");
}

.hero-slide[data-slide="1"] {
  background-image: url("https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?auto=format&fit=crop&w=1200&q=82");
}

.hero-slide[data-slide="2"] {
  background-image: url("https://images.unsplash.com/photo-1578683010236-d716f9a3f461?auto=format&fit=crop&w=1200&q=82");
}

.hero-slide p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.hero-slide h3 {
  max-width: 310px;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.22;
}

.hero-slide button {
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  color: var(--brand-dark);
  background: #fff;
}

.dots {
  position: absolute;
  right: 15px;
  bottom: 15px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
}

.dots button.active {
  width: 19px;
  background: #fff;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.quick-grid button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 6px;
  background: #fff;
  color: var(--ink);
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  font-weight: 800;
}

.quick-grid strong,
.quick-grid small {
  display: block;
}

.quick-grid strong {
  font-size: 13px;
}

.quick-grid small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.notice-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), #b87836);
}

.notice-card p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.notice-card strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.45;
}

.notice-card button {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: var(--brand-dark);
  background: #fff;
}

.content-section {
  margin-top: 18px;
}

.section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title h3 {
  font-size: 18px;
}

.section-title button,
.section-title span {
  flex: 0 0 auto;
  font-size: 12px;
}

.section-title button {
  padding: 8px 10px;
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}

.package-list,
.module-detail,
.activity-list,
.record-list,
.admin-list {
  display: grid;
  gap: 10px;
}

.package-card,
.module-card,
.activity-card,
.profile-card,
.record-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.package-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
}

.package-card img,
.module-visual {
  width: 100%;
  height: 100%;
  min-height: 94px;
  object-fit: cover;
  border-radius: var(--radius);
}

.package-card h4,
.module-card h4,
.activity-card h4 {
  margin: 0;
  font-size: 15px;
}

.package-card p,
.package-card ul,
.module-card p,
.module-card li,
.activity-card p,
.record-card,
.profile-card span,
.admin-card p,
.admin-list,
.check-panel ul {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.package-card ul,
.module-card ul,
.check-panel ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.price-row strong {
  color: var(--brand);
}

.package-card button,
.module-card button {
  padding: 8px 10px;
  font-size: 12px;
}

.module-card {
  overflow: hidden;
}

.module-body {
  padding: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.tag-row span {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #fff2e2;
  font-size: 12px;
}

.module-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.module-actions button {
  flex: 1;
}

.module-actions button.secondary {
  color: var(--brand);
  background: #fff4ea;
}

.hidden-panel {
  display: none;
}

.hidden-panel.show {
  display: block;
}

.activity-card,
.record-card,
.admin-card {
  padding: 12px;
}

.activity-card h4 {
  color: var(--brand-dark);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.profile-card span {
  display: block;
  margin-top: 4px;
}

.profile-grid,
.admin-kpis {
  display: grid;
  gap: 9px;
}

.profile-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 10px 0;
}

.profile-grid article {
  padding: 10px 6px;
  text-align: center;
}

.profile-grid strong {
  color: var(--brand);
}

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

.bottom-cta {
  position: sticky;
  bottom: -70px;
  gap: 10px;
  margin-top: 18px;
  padding: 10px;
  background: rgba(247, 241, 233, 0.92);
  backdrop-filter: blur(16px);
}

.bottom-cta button {
  flex: 1;
  padding: 12px 10px;
}

.bottom-cta button:last-child {
  background: var(--night);
}

.check-panel ul {
  padding-left: 20px;
}

.wide-action {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
}

.wide-action.secondary {
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--line);
}

.admin-screen {
  background: #eef2f7;
}

.admin-header {
  padding: 14px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--night), #39516d);
}

.admin-header p {
  color: rgba(255, 255, 255, 0.68);
}

.admin-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.admin-kpis article {
  padding: 13px;
  background: #fff;
}

.admin-kpis span {
  color: var(--muted);
  font-size: 12px;
}

.admin-kpis strong {
  display: block;
  margin-top: 5px;
  color: var(--night);
  font-size: 23px;
}

.admin-card {
  margin-top: 12px;
}

.admin-tools {
  flex-wrap: wrap;
  gap: 8px;
}

.admin-tools button {
  flex: 1 1 42%;
  padding: 10px 8px;
  background: var(--night);
  font-size: 12px;
}

.admin-card p {
  margin-top: 10px;
}

.admin-list {
  max-height: 190px;
  overflow: auto;
}

.admin-item {
  padding: 10px;
  border-radius: var(--radius);
  background: #f7f9fc;
}

.admin-item strong {
  display: block;
  color: var(--night);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 20, 31, 0.52);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #f3f3f3;
  font-size: 22px;
}

.modal-card h3 {
  padding-right: 38px;
  font-size: 22px;
}

.modal-card p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.modal-card button[type="submit"] {
  width: 100%;
  margin-top: 4px;
  padding: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(23, 32, 47, 0.94);
  transition: 0.25s ease;
}

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

@media (max-width: 1100px) {
  .preview-grid {
    grid-template-columns: minmax(320px, 430px) minmax(260px, 1fr);
  }

  .strategy-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .check-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .demo-page {
    padding: 16px;
  }

  .demo-topbar,
  .preview-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .demo-topbar h1 {
    font-size: 24px;
  }

  .top-actions {
    width: 100%;
  }

  .view-toggle {
    flex: 1;
  }

  .phone-frame {
    width: 100%;
    order: 1;
    padding: 8px;
    border-radius: 24px;
  }

  .strategy-panel {
    order: 2;
  }

  .check-panel {
    order: 3;
  }

  .phone-screen {
    height: 760px;
    border-radius: 18px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
