/* yang的ai小店 — 复刻版样式 */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --dis: #6f6f75;
  --line: #e5e5ea;
  --line-soft: #efeff2;
  --blue: #0071e3;
  --blue-rgb: 0, 113, 227;
  --price: #d81b3a;
  --green: #0f7350;
  --radius-panel: 20px;
  --radius-card: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, .024);
  --shadow-lg: 0 14px 40px rgba(31, 45, 70, .12);
  --field: #ffffff;
  --ease: cubic-bezier(.32, .72, 0, 1);
}

:root[data-theme="dark"] {
  --bg: #111113;
  --card: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --dis: #9a9aa0;
  --line: #38383a;
  --line-soft: #2a2a2d;
  --blue: #0a84ff;
  --blue-rgb: 10, 132, 255;
  --price: #ff8095;
  --green: #4fd39b;
  --shadow: 0 4px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, .5);
  --field: #242427;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

a { color: var(--blue); text-decoration: none; }
img { display: block; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 14px 16px 4px;
  background: var(--bg);
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  padding-right: 4px;
}

.brand img { width: 30px; height: 30px; border-radius: 9px; }

.brand__name {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .16s, color .16s;
}

.nav__item svg { width: 15px; height: 15px; }
.nav__item:hover { color: var(--ink); background: rgba(var(--blue-rgb), .08); }
.nav__item.active { color: #fff; background: var(--blue); box-shadow: 0 4px 14px rgba(var(--blue-rgb), .28); }

.nav__search {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  padding: 0 6px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color .16s, box-shadow .16s;
}

.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), .18);
}

.search-box svg { width: 15px; height: 15px; flex: 0 0 auto; }

.search-box input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.search-box input::placeholder { color: var(--dis); }

.nav__right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: auto; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .16s, color .16s;
}

.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: rgba(var(--blue-rgb), .09); color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s, border-color .16s, color .16s, filter .16s;
}

.btn svg { width: 15px; height: 15px; }

.btn--ghost { color: var(--ink); border-color: var(--line); background: transparent; }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }

.btn--primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 4px 14px rgba(var(--blue-rgb), .28);
}
.btn--primary:hover { filter: brightness(1.06); }

.burger { display: none; }

.mobile-menu {
  display: none;
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 6px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.mobile-menu[hidden] { display: none; }

.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.mobile-menu a:hover { background: rgba(var(--blue-rgb), .08); color: var(--blue); }
.mobile-menu svg { width: 16px; height: 16px; }

/* ---------- 主容器 ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 12px 60px;
}

/* ---------- 面板 ---------- */
.panel {
  border-radius: var(--radius-panel);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel + .panel { margin-top: 18px; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 0;
}

.panel-head .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(var(--blue-rgb), .1);
  color: var(--blue);
}

.panel-head .icon svg { width: 16px; height: 16px; }

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.panel-body {
  padding: 16px 20px 20px;
  color: var(--muted);
  line-height: 1.8;
}

/* ---------- 公告排版 ---------- */
.notice h2 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
}

.notice h2 + h2 { margin-top: 14px; }
.notice p { margin: 0 0 12px; font-size: 13.5px; }
.notice p:last-child { margin-bottom: 0; }
.notice .hl { color: var(--green); font-weight: 600; }
.notice .hl.strong { font-size: 15px; letter-spacing: .3px; }
.notice a { color: var(--blue); word-break: break-all; }
.notice a:hover { text-decoration: underline; }

.notice__contact {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .16s, color .16s, background-color .16s;
}

.copy-chip svg { width: 14px; height: 14px; }
.copy-chip:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- 分类 chip ---------- */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--field);
  border: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s, border-color .16s, background-color .16s, box-shadow .16s;
}

.chip:hover { color: var(--ink); border-color: var(--blue); }

.chip.is-primary {
  color: var(--blue);
  background: rgba(var(--blue-rgb), .09);
  border-color: var(--blue);
  font-weight: 600;
}

.chip__icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex: 0 0 auto;
  background-size: cover;
  background-position: center;
}

/* ---------- 商品网格 ---------- */
.item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.item-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-card);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(31, 45, 70, .07);
  overflow: hidden;
  color: inherit;
  transition: transform .18s cubic-bezier(.4, 0, .2, 1), box-shadow .18s, border-color .18s;
}

.item-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--blue-rgb), .45);
}

.item-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: rgba(var(--blue-rgb), .06);
  background-size: cover;
  background-position: center;
}

.item-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 4px;
  padding: 10px 13px 12px;
}

.tags { display: flex; flex-wrap: wrap; gap: 5px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
}

.tag--green { color: #0f7350; background: rgba(31, 169, 113, .14); }
.tag--blue { color: #2f5fd0; background: rgba(76, 126, 240, .14); }
.tag--red { color: #b81f28; background: rgba(229, 72, 77, .14); }
.tag--orange { color: #8a5a00; background: rgba(217, 138, 0, .16); }

:root[data-theme="dark"] .tag--green { color: #4fd39b; background: rgba(31, 169, 113, .18); }
:root[data-theme="dark"] .tag--blue { color: #8ab4ff; background: rgba(76, 126, 240, .18); }
:root[data-theme="dark"] .tag--red { color: #ff8a8e; background: rgba(229, 72, 77, .18); }
:root[data-theme="dark"] .tag--orange { color: #ffc15c; background: rgba(217, 138, 0, .18); }

.item-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.price {
  color: var(--price);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.price .unit { font-size: 12px; margin-right: 1px; }

.item-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--dis);
}

.item-empty {
  grid-column: 1 / -1;
  padding: 34px 4px;
  text-align: center;
  color: var(--dis);
  font-size: 13.5px;
}

/* 分类切换的入场 */
.item-grid.is-swapping .item-card {
  opacity: 0;
  transform: translateY(6px);
}

.item-card {
  animation: card-in .32s var(--ease) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 详情页 ---------- */
.buy-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  padding: 20px;
  align-items: stretch;
}

.cover {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--field);
  width: 100%;
  min-height: 260px;
  background-size: cover;
  background-position: center;
}

.buy h1 {
  margin: 0 0 9px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.4;
}

.buy .tags { margin-bottom: 10px; }

.buy .price { font-size: 26px; }

.buy-divider { height: 1px; background: var(--line); margin: 12px 0 16px; }

.field { margin-bottom: 14px; }

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 6px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  transition: border-color .16s, box-shadow .16s;
}

.input:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), .18);
}

.input::placeholder { color: var(--dis); }

.qty {
  display: inline-flex;
  align-items: stretch;
  width: auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--field);
}

.qty button {
  width: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.qty button:hover { background: rgba(var(--blue-rgb), .1); color: var(--ink); }

.qty input {
  width: 66px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font: inherit;
  -moz-appearance: textfield;
}

.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.buy-submit {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(var(--blue-rgb), .28);
  transition: filter .16s, transform .1s;
}

.buy-submit:hover { filter: brightness(1.07); }
.buy-submit:active { transform: translateY(1px); }

.detail-body h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
}

.detail-body p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.9; }
.detail-body .hl { color: var(--green); font-weight: 600; }

/* ---------- 订单查询 ---------- */
.query-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.query-row .input { width: 300px; }

.query-result { display: none; }
.query-result.show { display: block; }

.empty-state { text-align: center; padding: 34px 20px; }
.empty-state svg { width: 44px; height: 44px; color: var(--dis); margin: 0 auto 12px; }
.empty-state h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13px; color: var(--muted); }

.order-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-top: 1px solid var(--line-soft);
}

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

.order-row__thumb {
  width: 64px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.order-row__main { flex: 1 1 auto; min-width: 0; }
.order-row__main strong { display: block; font-size: 13.5px; color: var(--ink); }
.order-row__main span { font-size: 12px; color: var(--muted); }

.order-row__price { font-size: 15px; font-weight: 700; color: var(--price); }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
}

.modal.is-open { visibility: visible; }

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 28, .42);
  opacity: 0;
  transition: opacity .32s var(--ease);
}

.modal.is-open .modal__scrim { opacity: 1; }

.modal__win {
  position: relative;
  width: min(400px, 100%);
  padding: 26px 26px 22px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(10, 14, 24, .28);
  opacity: 0;
  transform: scale(.9);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}

.modal.is-open .modal__win { opacity: 1; transform: scale(1); }

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .16s, color .16s;
}

.modal__close:hover { background: rgba(var(--blue-rgb), .1); color: var(--ink); }
.modal__close svg { width: 15px; height: 15px; }

.modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: .4px;
}

.modal__title {
  margin: 8px 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.modal__text {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

.wx-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--field);
}

.wx-card__ico {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(7, 193, 96, .13);
  color: #07c160;
}

.wx-card__ico svg { width: 21px; height: 21px; }

.wx-card__body { flex: 1 1 auto; min-width: 0; }
.wx-card__label { font-size: 11.5px; color: var(--muted); }
.wx-card__id {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.modal__actions { display: flex; gap: 8px; margin-top: 16px; }
.modal__actions .btn { flex: 1 1 0; justify-content: center; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 950;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  pointer-events: none;
}

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

/* ---------- 页脚 ---------- */
.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 12px 40px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--dis);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav__list, .nav__search, .nav__right .btn { display: none; }
  .burger { display: inline-flex; margin-left: auto; }
  .buy-grid { grid-template-columns: 1fr; gap: 18px; }
  .mobile-menu { display: block; }
}

@media (max-width: 620px) {
  .topbar { padding: 10px 10px 2px; }
  .nav { height: 54px; padding: 0 6px 0 10px; gap: 6px; }
  .brand__name { max-width: 120px; font-size: 15px; }
  .container { padding: 16px 10px 40px; }
  .panel-body { padding: 14px 14px 16px; }
  .panel-head { padding: 14px 14px 0; }
  .item-grid { grid-template-columns: 1fr; gap: 12px; }
  .buy-grid { padding: 14px; }
  .query-row .input { width: 100%; }
  .modal__win { padding: 22px 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
