/* ============================================================
   assets/css/app.css — 用户端全局样式（移动端优先）
   ============================================================ */

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

:root {
  --c-primary:   #1677ff;
  --c-primary-light: #e6f4ff;
  --c-danger:    #ff4d4f;
  --c-success:   #52c41a;
  --c-warning:   #faad14;
  --c-text:      #1a1a1a;
  --c-text-sub:  #666;
  --c-text-hint: #999;
  --c-border:    #e8e8e8;
  --c-bg:        #f5f5f5;
  --c-white:     #fff;
  --nav-h:       56px;
  --header-h:    48px;
  --radius:      10px;
  --radius-sm:   6px;
}

html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

/* ---- 顶部导航栏 ---- */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--c-white);
  border-bottom: 0.5px solid var(--c-border);
  display: flex; align-items: center; padding: 0 16px;
  gap: 12px;
}
.header__back {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text);
  text-decoration: none; font-size: 18px;
  flex-shrink: 0;
}
.header__title {
  font-size: 16px; font-weight: 500;
  flex: 1; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header__right { width: 32px; }

/* ---- 底部导航 ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--c-white);
  border-top: 0.5px solid var(--c-border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; color: var(--c-text-hint);
  text-decoration: none; font-size: 11px;
}
.bottom-nav__item.active { color: var(--c-primary); }
.bottom-nav__icon { font-size: 22px; line-height: 1; }

/* ---- 卡片 ---- */
.card {
  background: var(--c-white);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

/* ---- 表单 ---- */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 13px; color: var(--c-text-sub); margin-bottom: 6px; display: block; }
.form-input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 0.5px solid var(--c-border); border-radius: var(--radius-sm);
  font-size: 15px; color: var(--c-text); background: var(--c-white);
  outline: none; -webkit-appearance: none;
}
.form-input:focus { border-color: var(--c-primary); }
.form-textarea {
  width: 100%; padding: 10px 12px; min-height: 80px;
  border: 0.5px solid var(--c-border); border-radius: var(--radius-sm);
  font-size: 15px; color: var(--c-text); resize: vertical;
  outline: none; line-height: 1.5;
}
.form-textarea:focus { border-color: var(--c-primary); }

/* ---- 按钮 ---- */
.btn {
  display: block; width: 100%; height: 48px;
  border: none; border-radius: 24px;
  font-size: 16px; font-weight: 500; cursor: pointer;
  text-align: center; line-height: 48px;
  text-decoration: none; -webkit-appearance: none;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:active { opacity: 0.85; }
.btn-danger  { background: var(--c-danger);  color: #fff; }
.btn-outline { background: transparent; border: 0.5px solid var(--c-primary); color: var(--c-primary); }
.btn-gray    { background: #f0f0f0; color: var(--c-text-sub); }
.btn-sm { height: 34px; line-height: 34px; font-size: 14px; border-radius: 17px; padding: 0 16px; width: auto; display: inline-block; }
.btn:disabled, .btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---- 标签状态 ---- */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 12px;
}
.badge-warning { background: #fff7e6; color: #d46b08; }
.badge-info    { background: #e6f7ff; color: #0958d9; }
.badge-success { background: #f6ffed; color: #389e0d; }
.badge-danger  { background: #fff2f0; color: #cf1322; }

/* ---- 商品网格 ---- */
.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding: 12px;
}
.product-card {
  background: var(--c-white); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit;
}
.product-card__img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  background: var(--c-bg);
}
.product-card__body { padding: 8px 10px 12px; }
.product-card__name {
  font-size: 13px; line-height: 1.4;
  overflow: hidden; display: -webkit-box;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.product-card__price { margin-top: 6px; color: var(--c-danger); font-size: 15px; font-weight: 500; }
.product-card__original { font-size: 12px; color: var(--c-text-hint); text-decoration: line-through; margin-left: 4px; }
.product-card__sales { font-size: 11px; color: var(--c-text-hint); margin-top: 3px; }

/* ---- 分类标签栏 ---- */
.category-bar {
  display: flex; overflow-x: auto; gap: 8px;
  padding: 10px 12px; background: var(--c-white);
  -webkit-overflow-scrolling: touch;
}
.category-bar::-webkit-scrollbar { display: none; }
.category-tag {
  flex-shrink: 0; padding: 5px 14px;
  border-radius: 16px; font-size: 13px; cursor: pointer;
  border: 0.5px solid var(--c-border);
  white-space: nowrap; color: var(--c-text-sub);
  background: var(--c-white); text-decoration: none;
}
.category-tag.active {
  background: var(--c-primary-light); color: var(--c-primary);
  border-color: var(--c-primary);
}

/* ---- 轮播图 ---- */
.banner-wrap { overflow: hidden; background: var(--c-white); margin-bottom: 10px; }
.banner-swipe { display: flex; transition: transform 0.3s ease; }
.banner-slide { flex-shrink: 0; width: 100%; }
.banner-slide img { width: 100%; aspect-ratio: 2.5/1; object-fit: cover; display: block; }
.banner-dots { display: flex; justify-content: center; gap: 5px; padding: 6px; }
.banner-dot { width: 6px; height: 6px; border-radius: 3px; background: var(--c-border); transition: width .2s, background .2s; }
.banner-dot.active { width: 16px; background: var(--c-primary); }

/* ---- 列表行 ---- */
.list-item {
  display: flex; align-items: center;
  padding: 14px 16px; background: var(--c-white);
  border-bottom: 0.5px solid var(--c-border);
  text-decoration: none; color: inherit;
  gap: 12px;
}
.list-item:last-child { border-bottom: none; }
.list-item__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--c-primary-light); display: flex; align-items: center; justify-content: center; color: var(--c-primary); font-size: 18px; flex-shrink: 0; }
.list-item__main { flex: 1; min-width: 0; }
.list-item__title { font-size: 15px; }
.list-item__sub { font-size: 13px; color: var(--c-text-hint); margin-top: 2px; }
.list-item__arrow { color: var(--c-text-hint); font-size: 14px; }

/* ---- 订单卡片 ---- */
.order-card { background: var(--c-white); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.order-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.order-card__no { font-size: 12px; color: var(--c-text-hint); }
.order-card__body { display: flex; gap: 12px; }
.order-card__img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; background: var(--c-bg); flex-shrink: 0; }
.order-card__info { flex: 1; min-width: 0; }
.order-card__name { font-size: 14px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.order-card__meta { font-size: 12px; color: var(--c-text-hint); margin-top: 4px; }
.order-card__price { font-size: 15px; color: var(--c-danger); font-weight: 500; }
.order-card__footer { margin-top: 10px; padding-top: 10px; border-top: 0.5px solid var(--c-border); display: flex; justify-content: space-between; align-items: center; }

/* ---- 步骤条 ---- */
.steps { display: flex; align-items: center; padding: 16px; background: var(--c-white); margin-bottom: 10px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step__dot { width: 24px; height: 24px; border-radius: 50%; background: var(--c-border); color: var(--c-text-hint); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.step__dot.active { background: var(--c-primary); color: #fff; }
.step__dot.done { background: var(--c-success); color: #fff; }
.step__label { font-size: 12px; color: var(--c-text-hint); }
.step__label.active { color: var(--c-primary); }
.step-line { flex: 0.5; height: 1px; background: var(--c-border); }
.step-line.done { background: var(--c-success); }

/* ---- 单选账号列表 ---- */
.account-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--c-white);
  border: 0.5px solid var(--c-border); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer;
}
.account-option.selected { border-color: var(--c-primary); background: var(--c-primary-light); }
.account-option__radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--c-border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.account-option.selected .account-option__radio { border-color: var(--c-primary); }
.account-option.selected .account-option__radio::after {
  content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c-primary);
}
.account-option__info { flex: 1; }
.account-option__platform { font-size: 13px; color: var(--c-text-hint); }
.account-option__name { font-size: 15px; font-weight: 500; }

/* ---- 空状态 ---- */
.empty { text-align: center; padding: 60px 20px; color: var(--c-text-hint); }
.empty__icon { font-size: 48px; margin-bottom: 12px; }
.empty__text { font-size: 14px; }

/* ---- 筛选标签 ---- */
.filter-tabs { display: flex; overflow-x: auto; background: var(--c-white); -webkit-overflow-scrolling: touch; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab { flex-shrink: 0; padding: 12px 16px; font-size: 14px; color: var(--c-text-sub); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.filter-tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* ---- 用户头部 ---- */
.user-header { background: var(--c-primary); padding: 24px 20px 40px; color: #fff; position: relative; }
.user-header__avatar { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); object-fit: cover; }
.user-header__name { font-size: 18px; font-weight: 500; margin-top: 10px; }
.user-header__phone { font-size: 14px; opacity: 0.8; margin-top: 4px; }

/* ---- 统计卡片 ---- */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 12px; }
.stat-card { background: var(--c-white); border-radius: var(--radius); padding: 14px 8px; text-align: center; text-decoration: none; color: inherit; }
.stat-card__num { font-size: 22px; font-weight: 500; color: var(--c-primary); }
.stat-card__label { font-size: 12px; color: var(--c-text-hint); margin-top: 4px; }

/* ---- 其他 ---- */
.divider { height: 8px; background: var(--c-bg); }
.section-title { font-size: 13px; color: var(--c-text-hint); padding: 12px 16px 6px; }
.text-danger { color: var(--c-danger); }
.text-sub { color: var(--c-text-sub); font-size: 13px; }
.text-hint { color: var(--c-text-hint); font-size: 12px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.px-16 { padding-left: 16px; padding-right: 16px; }

/* ---- Toast ---- */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75); color: #fff; padding: 10px 20px;
  border-radius: var(--radius); font-size: 14px; z-index: 9999;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }
