:root {
  color-scheme: light;
  --page: #f5f5f5;
  --paper: #ffffff;
  --ink: #191d20;
  --muted: #8a8f94;
  --light: #eef0ef;
  --green: #09a33d;
  --green-deep: #087f31;
  --green-soft: #1f8d5a;
  --red: #d41132;
  --orange: #ffb13c;
  --shadow: 0 10px 28px rgba(25, 29, 32, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ededed;
  color: var(--ink);
}

button {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.mobile-app {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--page);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.wechat-chrome {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}

.status-bar {
  display: flex;
  height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px 0 62px;
  color: #000;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.status-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.signal-icon {
  position: relative;
  width: 20px;
  height: 16px;
}

.signal-icon::before {
  position: absolute;
  inset: auto 0 0 0;
  height: 14px;
  content: "";
  background:
    linear-gradient(#000 0 0) 0 8px / 4px 6px,
    linear-gradient(#000 0 0) 6px 5px / 4px 9px,
    linear-gradient(#c9c9c9 0 0) 12px 2px / 4px 12px,
    linear-gradient(#c9c9c9 0 0) 18px 0 / 4px 14px;
  background-repeat: no-repeat;
  border-radius: 2px;
}

.wifi-icon {
  position: relative;
  width: 20px;
  height: 16px;
}

.wifi-icon::before,
.wifi-icon::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
}

.wifi-icon::before {
  top: 0;
  width: 20px;
  height: 20px;
  border: 4px solid #000;
  border-color: #000 transparent transparent;
  border-radius: 50%;
}

.wifi-icon::after {
  bottom: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #000;
}

.battery-icon {
  display: inline-grid;
  min-width: 32px;
  height: 21px;
  place-items: center;
  border-radius: 7px;
  background: #000;
  color: #fff;
  font-size: 13px;
  line-height: 1;
}

.nav-bar {
  position: relative;
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #ebebeb;
}

.nav-bar h1 {
  margin: 0;
  color: #111;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
}

.back-button {
  position: absolute;
  left: 4px;
}

.back-button svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.4;
}

.capsule {
  position: absolute;
  right: 10px;
  display: inline-flex;
  width: 86px;
  height: 32px;
  align-items: center;
  justify-content: space-around;
  border: 1px solid #f0f0f0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.capsule span {
  transform: translateY(-3px);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}

.capsule i {
  display: block;
  width: 22px;
  height: 22px;
  border: 3px solid #111;
  border-radius: 50%;
}

.capsule i::after {
  display: block;
  width: 8px;
  height: 8px;
  margin: 4px;
  border-radius: 50%;
  background: #111;
  content: "";
}

.screen {
  min-height: calc(100vh - 100px);
  padding: 16px 14px 86px;
}

.home-view h2 {
  margin: 12px 12px 16px;
  color: #111;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0;
}

.product-list {
  display: grid;
  gap: 15px;
}

.product-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 104px;
  min-height: 76px;
  align-items: center;
  gap: 10px;
  border: 1px solid #ececec;
  border-radius: 8px;
  padding: 12px 10px;
  background: #fff;
  box-shadow: 0 3px 13px rgba(0, 0, 0, 0.025);
  text-align: left;
}

.product-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  justify-self: center;
  color: var(--green-soft);
}

.product-icon.people svg {
  width: 42px;
  height: 42px;
  fill: currentColor;
  stroke: none;
}

.product-icon.excel {
  position: relative;
  width: 35px;
  height: 42px;
  border-radius: 4px 8px 4px 4px;
  background: #08b439;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.product-icon.excel::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 0 7px 0 4px;
  background: #c6f1cf;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  content: "";
}

.product-main {
  min-width: 0;
}

.product-title {
  margin-bottom: 9px;
  overflow: hidden;
  color: #171a1c;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-meta {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.price {
  color: var(--red);
  font-size: 17px;
  font-weight: 900;
}

.product-side {
  display: grid;
  gap: 12px;
  justify-items: end;
  color: #858b90;
  font-size: 13px;
}

.download-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.download-count svg {
  width: 15px;
  height: 15px;
}

.detail-view {
  display: grid;
  gap: 18px;
}

.detail-card {
  border-radius: 8px;
  padding: 22px 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  padding-top: 24px;
}

.hero-info {
  min-width: 0;
}

.hero-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
}

.hero-line {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  align-items: center;
  color: var(--muted);
  font-size: 16px;
}

.hero-line .price {
  color: var(--green);
  font-size: 18px;
}

.hero-desc {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  color: #858b90;
  font-size: 15px;
  line-height: 1.65;
}

.source-text {
  grid-column: 1 / -1;
  margin-top: 6px;
  color: #a3a8ac;
  font-size: 13px;
}

.detail-card h2 {
  margin: 0 0 16px;
  color: var(--green);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-card .hero-title {
  color: #111;
}

.value-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.value-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 18px;
  line-height: 1.45;
}

.value-tag {
  display: inline-grid;
  height: 28px;
  place-items: center;
  border-radius: 5px;
  background: var(--orange);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.preview-box {
  border-radius: 6px;
  padding: 16px 2px;
  background: #f7f7f7;
  color: #202326;
  font-size: 17px;
  line-height: 1.55;
}

.preview-table {
  display: grid;
  gap: 6px;
  overflow: hidden;
}

.preview-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 76px;
  gap: 8px;
  border-bottom: 1px solid #e8e8e8;
  padding: 7px 10px;
  white-space: nowrap;
}

.preview-row strong,
.preview-row span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice-card h2 {
  color: var(--red);
}

.notice-card h2 span {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  margin-left: 2px;
  border: 1px solid #f4a9bd;
  border-radius: 50%;
  color: #e76b8d;
  font-size: 12px;
}

.notice-card p {
  margin: 0;
  color: #8d9296;
  font-size: 15px;
}

.mine-view {
  display: grid;
  gap: 14px;
}

.mine-toolbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mine-toolbar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.mine-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.refresh-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #f4f6f5;
  color: var(--green);
}

.refresh-button svg {
  width: 22px;
  height: 22px;
}

.mine-state {
  color: var(--muted);
  font-size: 15px;
}

.empty-state {
  display: grid;
  gap: 10px;
  border-radius: 8px;
  padding: 20px 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.empty-state strong {
  color: #15191c;
  font-size: 18px;
}

.empty-state span {
  color: #7f868b;
  line-height: 1.55;
}

.empty-state button {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.order-list {
  display: grid;
  gap: 12px;
}

.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 12px;
  align-items: center;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.order-card h3 {
  margin: 0;
  overflow: hidden;
  color: #171a1c;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card p {
  margin: 7px 0 0;
  color: #8b9297;
  font-size: 12px;
}

.order-status {
  justify-self: end;
  color: #8b9297;
  font-size: 13px;
  font-weight: 800;
}

.order-status.paid {
  color: var(--green);
}

.order-card button {
  grid-column: 1 / -1;
  height: 42px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.order-card button:disabled {
  background: #e8ebe9;
  color: #8d9498;
}

.teacher-button {
  position: fixed;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: 94px;
  z-index: 6;
  display: inline-flex;
  min-width: 130px;
  height: 58px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 8px 0 0 8px;
  background: rgba(55, 55, 55, 0.92);
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.teacher-button svg {
  width: 28px;
  height: 28px;
}

.detail-action,
.tabbar {
  position: fixed;
  left: 50%;
  z-index: 8;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  background: #fff;
}

.detail-action {
  bottom: 0;
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 12px;
  min-height: 78px;
  align-items: center;
  border-top: 1px solid #ececec;
  padding: 10px 14px max(10px, env(safe-area-inset-bottom));
}

.share-button,
.download-button {
  display: inline-flex;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.share-button {
  gap: 8px;
  color: #1f2326;
  font-size: 17px;
}

.share-button svg {
  width: 23px;
  height: 23px;
}

.download-button {
  background: var(--green);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.download-button:active {
  background: var(--green-deep);
}

.tabbar {
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 72px;
  border-top: 1px solid #e6e6e6;
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar button {
  display: grid;
  gap: 2px;
  place-items: center;
  align-content: center;
  color: #2f3336;
  font-size: 13px;
}

.tabbar svg {
  width: 27px;
  height: 27px;
  stroke-width: 2.2;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 20;
  max-width: min(340px, calc(100vw - 40px));
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

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

.delivery-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.36);
}

.delivery-card {
  position: relative;
  display: grid;
  width: min(430px, 100%);
  gap: 12px;
  border-radius: 8px;
  padding: 22px 18px 18px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.delivery-card h2 {
  margin: 0;
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
}

.delivery-card p {
  margin: 0;
  color: #596167;
  line-height: 1.5;
}

.delivery-card label {
  display: grid;
  gap: 6px;
  color: #858b90;
  font-size: 13px;
  font-weight: 800;
}

.delivery-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e1e4e2;
  border-radius: 8px;
  padding: 9px 10px;
  color: #111;
  background: #f8f8f8;
  font: inherit;
}

.copy-delivery {
  height: 46px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.sheet-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 34px;
  height: 34px;
  color: #7c8388;
  font-size: 26px;
  line-height: 1;
}

.delivery-note {
  font-size: 13px;
}

@media (min-width: 431px) {
  body {
    padding: 18px 0;
  }

  .mobile-app {
    min-height: calc(100vh - 36px);
    border-radius: 8px;
  }

  .detail-action,
  .tabbar {
    bottom: 18px;
  }

  .teacher-button {
    right: calc((100vw - 430px) / 2);
    bottom: 112px;
  }
}
