/* design/shared/styles.css */
/* 共享设计系统：变量、布局、组件 */

:root {
  /* 色彩系统 */
  --primary: #FF6B6B;
  --primary-light: #FF8E8E;
  --primary-gradient: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
  --secondary: #FF9F43;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  --bg: #F8F9FA;
  --card-bg: #FFFFFF;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;
  --divider: #F3F4F6;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);

  --safe-bottom: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  height: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* ========== 通用工具类 ========== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.shrink-0 { flex-shrink: 0; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-white { color: #fff; }

.text-xs { font-size: 12px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 14px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 20px; }
.text-bold { font-weight: 600; }
.text-bolder { font-weight: 700; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.ml-4 { margin-left: 4px; }
.ml-8 { margin-left: 8px; }
.mr-4 { margin-right: 4px; }
.mr-8 { margin-right: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }

.line-clamp-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 移动端外框 ========== */
.mobile-frame {
  width: 375px;
  height: 812px;
  background: var(--bg);
  border-radius: 40px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.mobile-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 28px;
  background: #1a1a1a;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 100;
}

/* ========== 页面容器 ========== */
.page {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.page.active {
  display: flex;
  opacity: 1;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.page-content.has-header {
  padding-top: 56px;
}

.page-content.has-footer {
  padding-bottom: 84px;
}

.page-content.safe-bottom {
  padding-bottom: calc(64px + var(--safe-bottom));
}

/* ========== 导航栏 ========== */
.navbar {
  height: 56px;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  box-shadow: none;
  transition: background 0.2s, box-shadow 0.2s;
}

.navbar.transparent {
  background: transparent;
  color: #fff;
}

.navbar.scrolled {
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.navbar-title {
  font-size: 17px;
  font-weight: 600;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.navbar-primary {
  background: var(--primary);
  color: #fff;
}

.navbar-primary .navbar-title {
  color: #fff;
}

.nav-back,
.nav-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: inherit;
  transition: background 0.2s;
}

.nav-back:active,
.nav-action-btn:active {
  background: rgba(0, 0, 0, 0.06);
}

.navbar.transparent .nav-back:active,
.navbar.transparent .nav-action-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

.nav-action {
  font-size: 14px;
  color: var(--primary);
}

.navbar-primary .nav-action {
  color: #fff;
}

/* ========== 底部 Tab 栏 ========== */
.tabbar {
  height: 64px;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
  padding-bottom: var(--safe-bottom);
}

.tabbar-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  position: relative;
  transition: color 0.2s;
}

.tabbar-item .tab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tabbar-item .tab-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.tabbar-item.active {
  color: var(--primary);
}

.tabbar-item.active .tab-icon {
  transform: scale(1.05);
}

/* ========== 卡片 ========== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.card-flat {
  box-shadow: none;
  border: 1px solid var(--border);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-more {
  font-size: 13px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.card-more svg {
  width: 14px;
  height: 14px;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-xl);
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.1s, opacity 0.2s, box-shadow 0.2s;
}

.btn svg {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
  background: #FFF0F0;
  color: var(--primary);
}

.btn-outline {
  border: 1px solid var(--primary);
  color: var(--primary);
  background: #fff;
}

.btn-ghost {
  background: var(--bg);
  color: var(--text-secondary);
}

.btn-dark {
  background: var(--text);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-md);
}

.btn-md {
  padding: 8px 14px;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

.btn-round {
  border-radius: 50%;
  padding: 0;
  width: 44px;
  height: 44px;
}

.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ========== 列表 ========== */
.list-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}

.list-item:last-child {
  border-bottom: none;
}

.list-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  overflow: hidden;
}

.list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-body {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.list-extra {
  text-align: right;
  flex-shrink: 0;
}

/* ========== 表单 ========== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.form-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  background: var(--card-bg);
}

.form-input:focus {
  border-color: var(--primary);
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius-xl);
  padding: 0 12px;
  height: 40px;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  margin-left: 8px;
}

/* ========== 徽章 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.badge-primary {
  background: var(--primary);
  color: #fff;
}

.badge-secondary {
  background: #FFF0F0;
  color: var(--primary);
}

.badge-success {
  background: #ECFDF5;
  color: var(--success);
}

.badge-warning {
  background: #FEF3C7;
  color: var(--warning);
}

.badge-danger {
  background: #FEE2E2;
  color: var(--danger);
}

.badge-info {
  background: #DBEAFE;
  color: var(--info);
}

.badge-ghost {
  background: var(--divider);
  color: var(--text-muted);
}

/* ========== 宫格 ========== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.grid-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.2s;
}

.grid-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.grid-item:active .grid-icon {
  transform: scale(0.95);
}

.grid-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== 轮播图 ========== */
.banner {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  margin-bottom: 16px;
}

.banner-slides {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.banner-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 24px;
  color: #fff;
}

.banner-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.banner-subtitle {
  font-size: 13px;
  opacity: 0.95;
}

.banner-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s;
}

.banner-dot.active {
  background: #fff;
  width: 14px;
  border-radius: 3px;
}

/* ========== 数量选择器 ========== */
.quantity-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.quantity-box button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 16px;
}

.quantity-box button svg {
  width: 14px;
  height: 14px;
}

.quantity-box input {
  width: 36px;
  height: 28px;
  border: none;
  text-align: center;
  font-size: 13px;
}

/* ========== 空状态 ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-icon svg {
  width: 44px;
  height: 44px;
  stroke-width: 1.5;
}

.empty-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ========== 弹窗 / 底部面板 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 70%;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-sheet {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
}

.modal-footer {
  padding-top: 12px;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(31, 41, 55, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-xl);
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(4px);
}

.toast.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: rgba(16, 185, 129, 0.92);
}

.toast.error {
  background: rgba(239, 68, 68, 0.92);
}

.toast.warning {
  background: rgba(245, 158, 11, 0.92);
}

.toast svg {
  width: 18px;
  height: 18px;
}

/* ========== 优惠券券样式 ========== */
.coupon-ticket {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  position: relative;
}

.coupon-ticket.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.coupon-left {
  width: 100px;
  background: linear-gradient(135deg, #FFF0F0 0%, #FFE4E4 100%);
  color: var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
}

.coupon-left::after,
.coupon-left::before {
  content: '';
  position: absolute;
  right: -8px;
  width: 16px;
  height: 16px;
  background: var(--card-bg);
  border-radius: 50%;
}

.coupon-left::before {
  top: -8px;
}

.coupon-left::after {
  bottom: -8px;
}

.coupon-value {
  font-size: 22px;
  font-weight: 700;
}

.coupon-unit {
  font-size: 12px;
}

.coupon-right {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.coupon-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.coupon-rule {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.coupon-time {
  font-size: 11px;
  color: var(--text-muted);
}

.coupon-status {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* ========== Admin 桌面布局 ========== */
.admin-layout {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.admin-sidebar {
  width: 220px;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.admin-brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-menu {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-menu-item:hover,
.admin-menu-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-menu-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8f9fa;
}

.admin-header {
  height: 64px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
}

.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.admin-page {
  display: none;
}

.admin-page.active {
  display: block;
}

/* Admin 数据卡片 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.stat-trend {
  font-size: 12px;
  color: var(--success);
  margin-top: 4px;
}

/* Admin 表格 */
.admin-table {
  width: 100%;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-collapse: collapse;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: #fafafa;
  color: var(--text-secondary);
  font-weight: 600;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

/* Admin 搜索过滤栏 */
.admin-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-filter input,
.admin-filter select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 13px;
  background: #fff;
}

/* ========== POS 收银布局 ========== */
.pos-layout {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.pos-sidebar {
  width: 320px;
  background: #fff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.pos-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-header {
  height: 56px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.pos-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.pos-page {
  display: none;
}

.pos-page.active {
  display: block;
}

.pos-cart {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.pos-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.pos-cart-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.pos-total {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.pos-product-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s;
}

.pos-product-card:active {
  transform: scale(0.98);
}

.pos-product-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 10px;
}

/* ========== 入口导航页 ========== */
.portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
  color: #fff;
}

.portal-header {
  text-align: center;
  margin-bottom: 40px;
}

.portal-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.portal-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, 300px);
  gap: 24px;
}

.portal-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}

.portal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.4), rgba(255, 159, 67, 0.2), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s;
}

.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 107, 107, 0.4);
}

.portal-card:hover::before {
  opacity: 1;
}

.portal-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.portal-card-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.portal-card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #fff;
}

.portal-card-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 20px;
  line-height: 1.5;
}

.portal-card .btn {
  width: 100%;
}

.portal-footer {
  margin-top: 48px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

@media (max-width: 680px) {
  .portal-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 360px;
  }
}

/* ========== 复选框样式 ========== */
.checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox svg {
  width: 11px;
  height: 11px;
  color: #fff;
  opacity: 0;
}

.checkbox.checked svg {
  opacity: 1;
}

/* ========== 标签 ========== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.tag-primary {
  background: #FFF0F0;
  color: var(--primary);
}

.tag-warning {
  background: #FEF3C7;
  color: var(--warning);
}

.tag-success {
  background: #ECFDF5;
  color: var(--success);
}

/* ========== 进度条 ========== */
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ========== 通用动画 ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* ========== 消费者端专用增强 ========== */
.consumer-frame {
  background: var(--bg);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 4px 12px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

/* 商品卡片 */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:active {
  transform: scale(0.98);
}

.product-img-wrap {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.product-img-wrap svg {
  width: 48px;
  height: 48px;
  opacity: 0.9;
}

.product-corner-tag {
  position: absolute;
  top: 8px;
  left: 0;
  padding: 3px 8px 3px 6px;
  border-radius: 0 12px 12px 0;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.product-info {
  padding: 10px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  min-height: 38px;
}

.product-tags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.product-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8px;
}

.product-price {
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
}

.product-price small {
  font-size: 12px;
}

.product-original {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 4px;
}

.product-sales {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

.add-cart {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(255, 107, 107, 0.35);
  transition: transform 0.15s;
}

.add-cart:active {
  transform: scale(0.9);
}

.add-cart svg {
  width: 16px;
  height: 16px;
}

/* 横向商品卡片 */
.product-card-h {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.product-card-h .product-img-wrap {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  margin-right: 12px;
}

.product-card-h .product-name {
  min-height: auto;
}

/* 顶部搜索 */
.home-header {
  background: var(--primary-gradient);
  color: #fff;
  padding: 54px 16px 20px;
  position: relative;
}

.home-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.home-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.15);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}

.home-location svg {
  width: 14px;
  height: 14px;
}

.home-header-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  backdrop-filter: blur(4px);
}

.home-header-action svg {
  width: 18px;
  height: 18px;
}

.home-search {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.home-search svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.home-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  margin-left: 8px;
  font-size: 14px;
}

.home-search input::placeholder {
  color: var(--text-muted);
}

/* 运营位 */
.operate-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.operate-card {
  border-radius: var(--radius-md);
  padding: 14px 10px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.operate-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.operate-card-desc {
  font-size: 10px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* 分类页 */
.category-menu {
  display: flex;
  height: 100%;
}

.category-left {
  width: 92px;
  background: var(--bg);
  overflow-y: auto;
  flex-shrink: 0;
  border-right: 1px solid var(--divider);
}

.category-left-item {
  padding: 20px 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  transition: all 0.2s;
  border-radius: 0 16px 16px 0;
  margin: 4px 0;
  margin-right: 8px;
}

.category-left-item.active {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.category-left-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: var(--primary-gradient);
  border-radius: 0 3px 3px 0;
}

.category-right {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--card-bg);
}

.category-banner {
  height: 90px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 16px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.category-banner::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

/* 会员中心 */
.member-header {
  background: var(--primary-gradient);
  color: #fff;
  padding: 56px 16px 24px;
  position: relative;
}

.member-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.member-avatar svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

.member-level-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  margin-top: 6px;
}

.member-growth {
  margin-top: 16px;
}

.member-growth-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 6px;
}

/* 资产卡片 */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.asset-item {
  padding: 10px 4px;
}

.asset-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.asset-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 订单状态入口 */
.order-status-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  text-align: center;
}

.order-status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
}

.order-status-item .grid-icon {
  width: 40px;
  height: 40px;
  background: var(--divider);
  color: var(--text-secondary);
}

.order-status-item .grid-icon svg {
  width: 20px;
  height: 20px;
}

.order-status-item .grid-label {
  font-size: 11px;
}

/* 服务宫格 */
.service-grid .grid-icon {
  background: var(--divider);
  color: var(--text-secondary);
}

/* 购物车店铺卡片 */
.cart-store-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.cart-store-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.cart-store-left svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.cart-store-tip {
  font-size: 11px;
  color: var(--text-muted);
}

/* 底部结算栏 */
.cart-footer {
  position: absolute;
  bottom: 64px;
  left: 0;
  right: 0;
  background: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
  z-index: 40;
  border-top: 1px solid var(--divider);
}

.cart-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* 商品详情 */
.detail-gallery {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 48px;
  font-weight: 700;
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 12px;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
  z-index: 40;
}

.detail-actions .action-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-secondary);
  padding: 0 12px;
}

.detail-actions .action-icon svg {
  width: 20px;
  height: 20px;
}

/* SKU 选择器 */
.sku-section {
  margin-bottom: 16px;
}

.sku-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.sku-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sku-option {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.sku-option.active {
  background: #FFF0F0;
  color: var(--primary);
  border-color: var(--primary);
}

/* 确认订单 */
.address-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, #FFF5F5 0%, #fff 100%);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.address-card svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.price-row.total {
  font-size: 15px;
  font-weight: 600;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}

/* 订单列表 */
.order-tabs {
  display: flex;
  background: #fff;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 45;
  border-bottom: 1px solid var(--divider);
}

.order-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.2s;
}

.order-tab.active {
  color: var(--primary);
  font-weight: 600;
}

.order-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.order-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider);
}

.order-store {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.order-store svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.order-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.order-status.unpaid { background: #FFF0F0; color: var(--primary); }
.order-status.pending { background: #DBEAFE; color: var(--info); }
.order-status.shipped { background: #FEF3C7; color: var(--warning); }
.order-status.completed { background: #ECFDF5; color: var(--success); }
.order-status.refund { background: var(--divider); color: var(--text-secondary); }

.order-card-goods {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.order-card-img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.order-card-info {
  flex: 1;
  min-width: 0;
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}

/* 分销中心 */
.dist-summary {
  background: var(--primary-gradient);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.dist-amount {
  font-size: 32px;
  font-weight: 700;
}

.dist-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.dist-stat {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
}

.invite-card {
  background: #FFF5F5;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 积分商城 */
.points-header {
  background: var(--primary-gradient);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.points-header svg {
  width: 40px;
  height: 40px;
  opacity: 0.8;
}
