/* 线框原型样式 — 无视觉稿、无示例数据依赖 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 14px/1.5 system-ui, sans-serif;
  color: #111;
  background: #e8e8e8;
}

/* 固定画板：跳转后尺寸不变 */
.proto-stage {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
  box-sizing: border-box;
}

.proto-size-label {
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}

/* 用户端 H5：390 × 844 */
.proto-mobile {
  position: relative;
  width: 390px;
  height: 844px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.proto-mobile .app-header {
  flex-shrink: 0;
}

.proto-mobile .app-body {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
}

.proto-mobile--sub .app-body {
  padding-bottom: 16px;
}

.proto-mobile--has-tab .app-body {
  padding-bottom: 48px;
}

.proto-mobile .tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 390px;
  max-width: none;
  transform: none;
  flex-shrink: 0;
  z-index: 2;
}

.proto-mobile .bottom-cta {
  flex-shrink: 0;
  border-top: 1px solid #ccc;
}

.proto-mobile--has-tab.proto-mobile--has-cta .app-body {
  padding-bottom: 48px;
}

/* 管理端：1440 × 900 */
.proto-admin {
  position: relative;
  width: 1440px;
  height: 900px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #999;
  overflow: hidden;
}

.proto-admin .frame-admin {
  height: 100%;
  min-height: 0;
}

.proto-admin .main {
  min-width: 0;
  overflow: hidden;
}

.proto-admin .content {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(900px - 49px);
}

/* 入口页 */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  background: #fff;
  min-height: 100vh;
  box-sizing: border-box;
}

body.page-body {
  background: #fff;
}

a {
  color: #111;
}

a:hover {
  text-decoration: underline;
}

/* 入口 */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

.page h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.lead,
.meta {
  color: #666;
  font-size: 13px;
}

.card {
  border: 1px dashed #999;
  padding: 16px;
  margin: 16px 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

/* 按钮 / 链接块 */
.btn,
button.btn,
a.btn {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #333;
  background: #fff;
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.btn--block {
  display: block;
  text-align: center;
  margin: 8px 0;
}

.btn--primary {
  background: #eee;
}

.bottom-cta {
  padding: 12px 16px;
  border-top: 1px solid #ccc;
  display: flex;
  gap: 8px;
}

.bottom-cta .btn {
  flex: 1;
  text-align: center;
}

/* 用户端（画板内） */
.app-header,
.proto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #ccc;
}

.app-header h1,
.proto-header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.back {
  text-decoration: none;
  color: inherit;
}

.app-body,
.proto-body,
main.app-body {
  padding: 16px;
}

.app-body--no-tab {
  padding-bottom: 16px;
}

.tab-bar {
  display: flex;
  border-top: 1px solid #ccc;
  background: #fff;
}

.tab-bar a {
  flex: 1;
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
  text-decoration: none;
  color: #666;
  border-right: 1px solid #eee;
}

.tab-bar a:last-child {
  border-right: none;
}

.tab-bar a.active {
  font-weight: 600;
  color: #111;
  background: #f5f5f5;
}

.block {
  border: 1px dashed #999;
  padding: 12px;
  margin: 12px 0;
}

.block h2,
.block h3,
.block h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.list-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-links li {
  border-bottom: 1px solid #eee;
}

.list-links a {
  display: block;
  padding: 12px 0;
  text-decoration: none;
}

.notice {
  border: 1px dashed #999;
  padding: 8px 12px;
  margin: 12px 0;
  font-size: 13px;
  color: #444;
  background: #fafafa;
}

.form-group {
  margin: 12px 0;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #444;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #999;
  font: inherit;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

.data-table th {
  background: #f5f5f5;
}

.actions a {
  margin-right: 8px;
}

/* 管理端（画板内） */
.frame-admin-wrap {
  margin: 0;
}

.frame-admin {
  display: flex;
  height: 100%;
}

.sidebar {
  width: 200px;
  border-right: 1px solid #ccc;
  padding: 16px 0;
  flex-shrink: 0;
}

.sidebar .brand {
  padding: 0 16px 12px;
  font-weight: 600;
  font-size: 13px;
}

.sidebar nav a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  color: #444;
  font-size: 13px;
}

.sidebar nav a.active {
  background: #eee;
  font-weight: 600;
  color: #111;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #ccc;
}

.content {
  padding: 16px;
  flex: 1;
}

.breadcrumb {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

.panel {
  border: 1px dashed #999;
  padding: 16px;
  margin-bottom: 16px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.stat-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  border: 1px dashed #999;
  padding: 12px 16px;
  min-width: 100px;
}

.stat strong {
  display: block;
  font-size: 16px;
}

.stat span {
  font-size: 12px;
  color: #666;
}

.placeholder {
  color: #888;
  font-style: italic;
}

/* —— 设计 token（线框原型） —— */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-8: 32px;
  --text-sm: 12px;
  --text-xl: 18px;
  --color-border: #ccc;
  --color-border-strong: #999;
  --color-bg-muted: #f5f5f5;
  --color-bg-card: #fafafa;
  --color-text-secondary: #666;
  --color-danger: #c0392b;
  --color-primary: #333;
  --color-success: #2e7d32;
  --radius-sm: 4px;
  --radius-md: 8px;
}

/* —— 用户端 H5 组件 —— */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.icon-btn .dot {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: #fff;
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 10px 0;
  background: transparent;
}

.search-bar input:focus {
  outline: none;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-3);
}

.section-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.section-head a {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
}

.filter-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.filter-sort-bar__title {
  font-size: var(--text-sm);
  font-weight: 600;
}

.filter-sort-bar__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.sort-opt {
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 11px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.sort-opt.active {
  border-color: var(--color-border-strong);
  color: #111;
  font-weight: 600;
  background: var(--color-bg-muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--color-text-secondary);
  background: #fff;
}

.chip.active {
  border-color: var(--color-border-strong);
  color: #111;
  font-weight: 600;
  background: var(--color-bg-muted);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.stat-card {
  display: block;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.stat-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.stat-card span {
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* 商品卡：上图区 + 下信息区，实线边框 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.product-card:hover {
  border-color: #666;
}

.product-card .thumb {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-muted);
  border-bottom: 1px solid var(--color-border);
}

.product-card .thumb-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  max-width: 120px;
  max-height: 120px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--color-text-secondary);
  background: #fff;
}

.product-card .info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-3) var(--space-3);
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
}

.product-card .card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.product-card .card-meta-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: #fff;
}

.product-card .tag {
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 1px 6px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 10px;
  line-height: 1.4;
  background: #fff;
}

.product-card .name {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.product-card .card-desc {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.product-card .price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
}

.product-card .price {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-danger);
}

.product-card .price small {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: line-through;
}

.product-card .sales {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--color-text-secondary);
}

.product-card--member {
  border-color: #888;
}

/* 横排商品卡（活动页限定 SKU 等） */
.product-card--row {
  flex-direction: row;
  margin-bottom: var(--space-4);
}

.product-card--row .thumb {
  flex-shrink: 0;
  width: 72px;
  aspect-ratio: auto;
  min-height: 72px;
  border-bottom: none;
  border-right: 1px solid var(--color-border);
}

.product-card--row .thumb-inner {
  width: 52px;
  height: 52px;
  max-width: none;
  max-height: none;
}

.product-card--row .info {
  flex: 1;
  border-top: none;
}

/* 订单 / 列表卡 */
.order-card {
  display: block;
  margin-bottom: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.order-card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-muted);
  font-size: var(--text-sm);
}

.order-card .body {
  padding: var(--space-3);
}

.order-card .body h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.order-card .foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

.status-tag {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  background: #fff;
}

.status-tag--paid {
  border-color: var(--color-border-strong);
  font-weight: 600;
}

.status-tag--done {
  color: var(--color-success);
  border-color: var(--color-success);
}

.status-tag--muted {
  color: var(--color-text-secondary);
}

.order-card--muted {
  opacity: 0.7;
}

.suborder-card {
  margin-bottom: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.suborder-card .head {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.suborder-card .line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border-bottom: 1px solid #eee;
  font-size: var(--text-sm);
}

.suborder-card .total {
  padding: var(--space-2) var(--space-3);
  text-align: right;
  font-weight: 600;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-card);
}

.cart-group {
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.cart-group-head {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.cart-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item .thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-muted);
  font-size: 11px;
  color: var(--color-text-secondary);
}

.cart-item .detail {
  flex: 1;
  min-width: 0;
}

.cart-item .detail h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

.cart-item .spec {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.cart-item .price {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-danger);
}

.product-detail h2 {
  margin: var(--space-3) 0 var(--space-2);
  font-size: 17px;
}

.product-detail > .block.placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  border-style: solid;
  border-color: var(--color-border-strong);
  background: var(--color-bg-muted);
  font-style: normal;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.product-detail > .block.placeholder::after {
  content: "商品主图";
}

.product-detail .price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.product-detail .price-row .now {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-danger);
}

.product-detail .price-row .was {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: line-through;
}

.product-detail .meta {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.sku-label {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
}

.sku-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.sku-opt {
  min-width: 40px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.sku-opt.selected {
  border-color: var(--color-border-strong);
  font-weight: 600;
  background: var(--color-bg-muted);
}

.sku-opt.disabled {
  color: #bbb;
  border-style: dashed;
  cursor: not-allowed;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-control button {
  width: 32px;
  height: 32px;
  border: none;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg-muted);
  font: inherit;
  cursor: pointer;
}

.qty-control button:last-child {
  border-right: none;
  border-left: 1px solid var(--color-border);
}

.qty-control span {
  min-width: 36px;
  text-align: center;
  font-size: var(--text-sm);
}

.tabs-inline {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tabs-inline a,
.tabs-inline button {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-right: 1px solid var(--color-border);
  background: #fff;
  font: inherit;
  font-size: var(--text-sm);
  text-align: center;
  text-decoration: none;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.tabs-inline a:last-child,
.tabs-inline button:last-child {
  border-right: none;
}

.tabs-inline a.active,
.tabs-inline button.active {
  font-weight: 600;
  color: #111;
  background: var(--color-bg-muted);
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.menu-list li {
  border-bottom: 1px solid var(--color-border);
}

.menu-list li:last-child {
  border-bottom: none;
}

.menu-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}

.menu-list a::after {
  content: "›";
  color: var(--color-text-secondary);
}

.points-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: #fff;
}

.points-item .thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-muted);
}

.points-item .detail {
  flex: 1;
  min-width: 0;
}

.points-item h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

.event-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.event-card-date {
  flex-shrink: 0;
  width: 48px;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-align: center;
  background: var(--color-bg-muted);
}

.event-card-date strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.event-card-date span {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.event-card-body h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.merchant-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.merchant-chip-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-bg-muted);
  font-size: 11px;
}

.merchant-chip .arrow {
  margin-left: auto;
  color: var(--color-text-secondary);
}

.member-badge {
  display: inline-block;
  margin-bottom: var(--space-2);
  padding: 2px 8px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 11px;
  background: #fff;
}

.notice--info {
  border-style: solid;
  border-color: var(--color-border);
}

.notice--warn {
  border-style: solid;
  border-color: #c90;
  background: #fffef5;
}
