/* ========== 基础变量 ========== */
:root {
  --brand: #ff2c2c;
  --brand-hover: #e32525;
  --brand-soft: #fff0f0;
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-sub: #888;
  --text-mute: #b5b5b5;
  --border: #eee;
  --notice-bg: #fff5f5;
  --tag-bg: #f4f4f6;
  --shadow-card: 0 1px 4px rgba(0,0,0,0.04);
  --shadow-phone: 0 30px 60px rgba(0,0,0,0.18), 0 0 0 12px #1a1a1a, 0 0 0 14px #2a2a2a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #efeff3;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; outline: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, li { list-style: none; }

/* ========== 桌面端展示：手机居中，两侧品牌面板 ========== */
.device-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 32px 16px;
  background:
    linear-gradient(135deg, #ffe5e8 0%, #f5f5f7 50%, #e6f0ff 100%);
}

.brand-panel {
  width: 220px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}
.brand-panel h1 { font-size: 26px; line-height: 1.3; margin-bottom: 8px; color: #1a1a1a; }
.brand-panel h3 { font-size: 18px; margin-bottom: 12px; color: #1a1a1a; }
.brand-logo {
  display: inline-block;
  padding: 4px 10px;
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 16px;
}
.brand-tagline { color: var(--text-sub); margin-bottom: 16px; font-size: 14px; }
.brand-features li { font-size: 13px; color: #444; line-height: 1.9; }
.note-list { font-size: 13px; color: #444; padding-left: 18px; list-style: decimal; line-height: 1.9; }
.note-list b { color: var(--brand); }
.note-list code, .panel-btn code {
  background: #f1f1f4;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--brand);
}
.panel-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.panel-btn {
  display: block;
  width: 100%;
  padding: 10px 0;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.panel-btn:hover { background: var(--brand-hover); }
.panel-btn-link {
  background: #fff;
  color: var(--brand);
  box-shadow: inset 0 0 0 1.5px var(--brand);
}
.panel-btn-link:hover { background: var(--brand-soft); }

/* ========== 手机外壳 ========== */
.phone-frame {
  width: 380px;
  height: 780px;
  background: #1a1a1a;
  border-radius: 40px;
  padding: 12px;
  box-shadow: var(--shadow-phone);
  position: relative;
  flex-shrink: 0;
}
.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 22px;
  background: #000;
  border-radius: 0 0 14px 14px;
  z-index: 30;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ========== 状态栏 ========== */
.status-bar {
  height: 28px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 18px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.status-right { display: flex; align-items: center; gap: 6px; }
.status-svg { display: inline-block; }
.battery-wrap {
  display: inline-block;
  width: 22px;
  height: 11px;
  border: 1px solid #1a1a1a;
  border-radius: 2px;
  position: relative;
  padding: 1px;
}
.battery-level {
  display: block;
  height: 100%;
  background: #1a1a1a;
  border-radius: 1px;
}
.battery-text { font-size: 11px; color: #1a1a1a; }

/* ========== 标题栏 ========== */
.app-header {
  height: 44px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  flex-shrink: 0;
}
.header-back {
  font-size: 26px;
  color: #1a1a1a;
  width: 36px;
  height: 36px;
  line-height: 32px;
}
.page-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.header-actions { display: flex; gap: 2px; }
.header-icon {
  width: 32px;
  height: 32px;
  color: #1a1a1a;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.header-icon-dot::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border: 1.5px solid #1a1a1a;
  border-radius: 50%;
}

/* ========== 页面容器 ========== */
.page-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.page {
  display: none;
  flex-direction: column;
  min-height: 100%;
}
.page.active { display: flex; }

/* ============== 首页 ============== */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--notice-bg);
  margin: 8px 10px 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--brand);
}
.notice-icon { display: inline-flex; flex-shrink: 0; }
.notice-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-more { color: var(--brand); white-space: nowrap; font-size: 12px; }

.search-bar {
  margin: 10px 10px 0;
  background: #fff;
  border-radius: 24px;
  display: flex;
  align-items: center;
  height: 38px;
  padding-left: 12px;
  box-shadow: var(--shadow-card);
}
.search-icon { display: inline-flex; margin-right: 4px; }
.search-bar input {
  flex: 1;
  height: 100%;
  font-size: 13px;
  color: var(--text);
  background: transparent;
}
.search-bar input::placeholder { color: #b5b5b5; }
.search-btn {
  width: 80px;
  height: 30px;
  margin-right: 4px;
  background: var(--brand);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}
.search-btn:hover { background: var(--brand-hover); }

.category-tabs {
  margin: 12px 0 4px;
  padding: 0 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 22px;
  background: #fff;
  font-size: 13px;
  color: #333;
  border: 1px solid #eee;
}
.cat-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.product-list {
  padding: 8px 10px 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product-card {
  background: #fff;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  padding: 12px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.product-cover {
  width: 80px;
  height: 100px;
  border-radius: 6px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f0f4ff 0%, #dde6ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-cover.skeleton {
  background: linear-gradient(90deg, #efefef 25%, #f8f8f8 50%, #efefef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.product-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #b5b5b5;
  font-size: 10px;
  text-align: center;
  padding: 4px;
}
.product-cover-placeholder::before {
  content: '';
  width: 26px;
  height: 26px;
  background: #d9d9d9;
  border-radius: 4px;
  margin-bottom: 4px;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z' fill='black'/></svg>") center/contain no-repeat;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-tags {
  font-size: 12px;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
  text-align: right;
}
.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.product-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,44,44,0.08);
  color: var(--brand);
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-mute);
  gap: 6px;
}
.empty-state-icon {
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-card);
}
.empty-state-title { font-size: 14px; color: var(--text); }
.empty-state-desc { font-size: 12px; color: var(--text-sub); text-align: center; }

/* 客服 FAB */
.fab-chat {
  position: absolute;
  right: 14px;
  bottom: 90px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* ============== 寄售 ============== */
.toggle-bar {
  margin: 10px;
  background: #fff;
  border-radius: 24px;
  display: flex;
  padding: 3px;
  box-shadow: var(--shadow-card);
}
.toggle-btn {
  flex: 1;
  height: 32px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  transition: all .2s;
}
.toggle-btn.active {
  background: var(--brand);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(255,44,44,.35);
}

.consign-list {
  flex: 1;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 80px;
}
.consign-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 10px;
  position: relative;
  box-shadow: var(--shadow-card);
}
.consign-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 40px;
  accent-color: var(--brand);
}
.consign-cover {
  width: 76px;
  height: 96px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f0f4ff 0%, #dde6ff 100%);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.consign-cover.skeleton {
  background: linear-gradient(90deg, #efefef 25%, #f8f8f8 50%, #efefef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.consign-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.consign-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.consign-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.consign-tag {
  font-size: 11px;
  color: var(--text-sub);
  background: var(--tag-bg);
  padding: 2px 8px;
  border-radius: 10px;
}
.consign-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
}
.qty-control button {
  width: 24px;
  height: 24px;
  font-size: 14px;
  color: #666;
  background: #fff;
}
.qty-control button:hover { background: #fafafa; }
.qty-control button:disabled { color: #ccc; cursor: not-allowed; }
.qty-input {
  width: 32px;
  height: 24px;
  text-align: center;
  font-size: 13px;
  border-left: 1px solid #eee;
  border-right: 1px solid #eee;
}
.consign-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
}

/* 底部操作条 */
.bottom-action {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  z-index: 10;
}
.select-all {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.select-all input { accent-color: var(--brand); width: 16px; height: 16px; }
.total {
  flex: 1;
  text-align: right;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
}
.total-label { font-size: 13px; color: var(--text-sub); }
.total-amount { font-size: 17px; font-weight: 600; color: var(--brand); }
.checkout-btn {
  background: var(--brand);
  color: #fff;
  padding: 0 22px;
  height: 38px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity .2s;
}
.checkout-btn.disabled,
.checkout-btn:disabled {
  background: #d9d9d9;
  cursor: not-allowed;
}

/* ============== 我的 ============== */
.user-card {
  background: #fff;
  margin: 10px;
  padding: 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-card);
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
}
.avatar svg { display: block; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 16px; font-weight: 600; }
.user-meta { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.user-edit {
  font-size: 12px;
  color: var(--brand);
  padding: 4px 8px;
  border-radius: 14px;
  background: var(--brand-soft);
}

.order-card, .link-card {
  background: #fff;
  margin: 0 10px 10px;
  padding: 14px 4px 8px;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}
.card-title {
  padding: 0 12px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.order-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 4px;
}
.order-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 12px;
  gap: 6px;
  text-align: center;
}
.order-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-label {
  font-size: 12px;
  color: var(--text);
}

.link-list {
  padding: 0 4px;
}
.link-item {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  border-top: 1px solid #f5f5f5;
  font-size: 14px;
  color: var(--text);
}
.link-item:first-child { border-top: none; }
.link-icon {
  display: inline-flex;
  margin-right: 10px;
  align-items: center;
  justify-content: center;
}
.link-label { flex: 1; }
.link-arrow { color: #c5c5c5; font-size: 16px; }

.footer-tip {
  text-align: center;
  padding: 30px 16px 20px;
  font-size: 12px;
  color: var(--text-mute);
}

/* ========== Tab 栏 ========== */
.tab-bar {
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.tab-row {
  display: flex;
  height: 50px;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #888;
  font-size: 11px;
}
.tab-icon { display: inline-flex; }
.tab.active { color: var(--brand); }
.icp-bar {
  text-align: center;
  font-size: 10px;
  padding: 2px 0 6px;
  background: #fff;
}
.icp-bar a {
  color: #999;
  text-decoration: none;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 13px;
  z-index: 999;
  pointer-events: none;
  transition: opacity .25s;
}

/* ========== 小屏幕适配 ========== */
@media (max-width: 880px) {
  .device-wrap {
    gap: 0;
    padding: 0;
    background: var(--bg);
  }
  .brand-panel { display: none; }
  .phone-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .phone-notch { display: none; }
  .phone-screen { border-radius: 0; }
}
@media (max-width: 380px) {
  .phone-frame { width: 100vw; }
}
