:root {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --text: #121417;
  --muted: #68707a;
  --line: #e7ebef;
  --blue: #1677ff;
  --green: #29b866;
  --coral: #ff7b6f;
  --amber: #ffbf3f;
  --ink: #222831;
  --shadow: 0 14px 42px rgba(27, 39, 53, .14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2f5 0%, #d9e6ee 48%, #f3f0ea 100%);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 12px;
}

.phone {
  width: min(390px, 100%);
  height: min(920px, calc(100vh - 24px));
  background: #f5f6f8;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-rows: 64px 1fr 74px;
  min-width: 0;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 52px 1fr 96px;
  align-items: center;
  padding: 0 12px;
  font-size: 20px;
}

.topbar strong {
  text-align: center;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3f5f7;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.icon-btn.ghost {
  background: transparent;
}

.icon-btn.close {
  position: absolute;
  right: 14px;
  top: 14px;
}

.screen {
  display: none;
  overflow: auto;
  padding: 18px 17px 24px;
  width: 100%;
  min-width: 0;
}

.screen.active {
  display: block;
}

.search-row {
  height: 50px;
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 8px;
  margin-bottom: 14px;
  background: #dfeae6;
  border-radius: 25px;
  padding: 6px;
}

.search-row input {
  border: 0;
  background: transparent;
  min-width: 0;
  padding: 0 14px;
  outline: 0;
  color: var(--text);
}

.search-row button,
.primary {
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(22, 119, 255, .22);
  min-width: 0;
}

.hero {
  width: 100%;
  height: 224px;
  border: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  position: relative;
  background: #dce9f8;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.hero-copy {
  position: absolute;
  left: 18px;
  bottom: 18px;
  color: #fff;
  text-align: left;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

.hero-copy b {
  display: block;
  font-size: 24px;
  max-width: 320px;
}

.hero-copy small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

.topic-grid {
  margin-top: 14px;
  background: var(--surface);
  border-radius: 8px;
  padding: 18px 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 8px;
}

.topic {
  border: 0;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--text);
  min-width: 0;
}

.topic i {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-style: normal;
  font-weight: 700;
}

.topic span {
  font-size: 14px;
  white-space: nowrap;
}

.feature-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 86px 86px;
  gap: 12px;
}

.feature-layout button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  text-align: left;
  padding: 16px;
  overflow: hidden;
}

.feature-main {
  grid-row: span 2;
  background: linear-gradient(135deg, #298aff, #005bd3);
}

.feature-tile.green {
  background: linear-gradient(135deg, #74d952, #22aa5c);
}

.feature-tile.coral {
  background: linear-gradient(135deg, #ff9e91, #fb6262);
}

.feature-layout span {
  display: block;
  font-size: 22px;
  font-weight: 700;
}

.feature-layout small {
  display: block;
  margin-top: 9px;
  font-size: 14px;
  opacity: .9;
}

.section-title {
  margin: 20px 0 12px;
  font-size: 22px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-card {
  border: 0;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
  min-width: 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1.48;
  object-fit: cover;
  display: block;
}

.product-card h3 {
  margin: 12px 12px 5px;
  font-size: 18px;
  line-height: 1.22;
}

.product-card p {
  margin: 0 12px 14px;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.segment {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.segment button {
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segment button.active {
  background: var(--ink);
  color: #fff;
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.filter-pills button {
  border: 0;
  border-radius: 18px;
  padding: 8px 13px;
  background: #e9edf2;
  color: var(--ink);
  white-space: nowrap;
}

.filter-pills button.active {
  background: #dceaff;
  color: #0a62d0;
}

.app-category-panel {
  margin: -18px -17px 12px;
  padding: 22px 23px 108px;
  background: #fff;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, .16);
  position: relative;
  z-index: 2;
}

.app-category-panel.collapsed {
  display: none;
}

.category-group + .category-group {
  margin-top: 20px;
}

.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-group h2,
.category-head h2 {
  margin: 0 0 16px;
  font-size: 21px;
  line-height: 1.1;
}

.collapse-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #3b4046;
  font-size: 25px;
  line-height: 1;
}

.category-cloud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 18px;
}

.category-cloud.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 18px;
}

.category-cloud button {
  border: 0;
  background: transparent;
  color: #111820;
  padding: 0;
  text-align: left;
  font-size: 17px;
  line-height: 1.18;
  min-height: 22px;
}

.category-cloud button.active {
  color: #2aa5f7;
}

.horizontal-filter {
  display: none;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  margin: -4px -17px 12px;
  padding: 14px 24px 10px;
  background: #fff;
  scrollbar-width: none;
}

.horizontal-filter.show {
  display: flex;
}

.horizontal-filter::-webkit-scrollbar {
  display: none;
}

.horizontal-filter button {
  border: 0;
  background: transparent;
  color: #111820;
  padding: 8px 0;
  white-space: nowrap;
  font-size: 16px;
}

.horizontal-filter button.active {
  color: #2aa5f7;
  background: #dff0ff;
  border-radius: 18px;
  padding: 8px 15px;
}

.app-products {
  align-items: start;
}

.device-screen {
  padding: 0;
  background: #f1f1f1;
  display: none;
  grid-template-columns: 91px 1fr;
  overflow: hidden;
}

.device-screen.active {
  display: grid;
}

.device-sidebar {
  background: #fff;
  padding: 20px 0 24px;
  overflow-y: auto;
}

.device-sidebar button {
  width: 100%;
  min-height: 54px;
  border: 0;
  background: transparent;
  color: #111820;
  font-size: 17px;
  line-height: 1.2;
  text-align: center;
  padding: 7px 8px;
}

.device-sidebar button.active {
  color: #111820;
  font-weight: 700;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 204, 92, .34), transparent 26px),
    #fff;
}

.device-content {
  overflow: auto;
  padding: 14px 15px 26px;
  min-width: 0;
}

.device-products {
  gap: 12px;
}

.device-products .product-card {
  text-align: center;
}

.device-products .product-card img {
  aspect-ratio: 1.06;
  object-fit: contain;
  background: #fff;
  padding: 10px;
}

.device-products .product-card h3 {
  margin: 8px 8px 12px;
  font-size: 17px;
}

.device-products .product-card p {
  display: none;
}

.empty {
  grid-column: 1 / -1;
  margin: 28px 0;
  color: var(--muted);
  text-align: center;
}

.detail-screen {
  padding: 0 0 24px;
  background: var(--surface);
}

.detail-hero {
  position: relative;
}

.detail-hero img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.video-badge {
  position: absolute;
  right: 0;
  top: 22px;
  border-radius: 22px 0 0 22px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, .58);
  color: #fff;
}

.detail-body {
  padding: 18px 17px 92px;
}

.detail-head {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 12px;
  align-items: start;
}

.detail-body h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.share-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #f3f5f7;
  font-size: 22px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.tags span {
  background: #f0f2f4;
  border-radius: 18px;
  padding: 7px 11px;
  color: #30363d;
}

.detail-desc {
  color: #222;
  line-height: 1.6;
  margin: 0 0 18px;
  font-size: 16px;
}

.params {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 16px 0;
}

.param-row {
  display: grid;
  grid-template-columns: 98px 1fr;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.param-row:first-child {
  border-top: 0;
}

.param-row b {
  color: var(--muted);
  font-weight: 400;
}

.sticky-cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 74px;
  padding: 12px 17px;
  background: rgba(255, 255, 255, .94);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sticky-cta button {
  height: 44px;
  border: 0;
  border-radius: 22px;
}

.secondary {
  background: #eef3ff;
  color: #0a62d0;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.admin-summary div {
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.admin-summary b {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

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

.admin-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 14px;
}

.admin-card h2 {
  margin: 0 0 13px;
  font-size: 18px;
}

.admin-card label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
}

.admin-card input,
.admin-card select,
.admin-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr 78px;
  gap: 8px;
}

.inline-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}

.channel-form {
  grid-template-columns: 1fr 1fr;
}

.channel-form select,
.channel-form button {
  min-width: 0;
}

.hint-line {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 12px;
  word-break: break-all;
}

.lead-ranking,
.lead-list {
  display: grid;
  gap: 8px;
}

.lead-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.lead-row b {
  display: block;
  margin-bottom: 4px;
}

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

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px !important;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.primary {
  min-height: 42px;
  padding: 0 18px;
}

.admin-tools {
  margin-bottom: 12px;
}

.admin-tools .secondary {
  border: 0;
  border-radius: 20px;
  min-height: 40px;
  padding: 0 16px;
}

.danger {
  border: 0;
  border-radius: 20px;
  min-height: 40px;
  padding: 0 16px;
  color: #c52323;
  background: #fff1f1;
}

.form-cancel {
  display: none;
  margin-left: 8px;
  border: 0;
  border-radius: 20px;
  min-height: 42px;
  padding: 0 18px;
}

.admin-item {
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
}

.admin-item img {
  width: 58px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
}

.admin-item h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.admin-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-item-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.admin-item-actions button {
  border: 0;
  border-radius: 16px;
  min-height: 32px;
  padding: 0 12px;
  background: #eef3ff;
  color: #0a62d0;
}

.admin-item-actions .delete {
  background: #fff1f1;
  color: #c52323;
}

.tabbar {
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}

.tab {
  border: 0;
  background: transparent;
  color: #3a3f45;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  padding: 6px 2px 7px;
  word-break: keep-all;
}

.tab span {
  font-size: 24px;
  line-height: 1;
}

.tab[data-tab="software"] {
  font-size: 10px;
}

.tab.active {
  color: var(--green);
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .36);
  place-items: center;
  padding: 18px;
}

.modal.show {
  display: grid;
}

.modal-panel {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 28px 22px 22px;
  position: relative;
  text-align: center;
}

.qr-box {
  width: 156px;
  height: 156px;
  margin: 12px auto 14px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #111 12px, transparent 12px) 0 0 / 28px 28px,
    linear-gradient(#111 12px, transparent 12px) 0 0 / 28px 28px,
    #f3f5f7;
  display: grid;
  place-items: center;
  color: #1677ff;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 10;
  border-radius: 20px;
  padding: 10px 16px;
  background: rgba(18, 20, 23, .92);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}

@media (max-width: 520px) {
  .stage {
    padding: 0;
  }

  .phone {
    width: min(390px, 100%);
    height: 100vh;
    border-radius: 0;
    border: 0;
  }
}
