:root {
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-light: #ccfbf1;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-600: #475569;
  --slate-800: #1e293b;
  --danger: #dc2626;
  --tabbar-h: 58px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--slate-50); color: var(--slate-800); font-size: 14px; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { border: 1px solid var(--slate-200); border-radius: 8px; padding: 9px 11px; font-size: 14px; background: #fff; outline: none; width: 100%; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
input:disabled { background: var(--slate-100); color: var(--slate-600); }

/* ---------- 顶栏 ---------- */
.topbar { background: var(--teal-dark); color: #fff; padding: 0 20px; display: flex; align-items: center; height: 52px; gap: 18px; position: sticky; top: 0; z-index: 10; }
.topbar .logo { font-weight: 700; font-size: 16px; letter-spacing: 1px; white-space: nowrap; }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { padding: 6px 12px; border-radius: 8px; color: #99f6e4; font-size: 14px; white-space: nowrap; }
.topbar nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.topbar .user { font-size: 13px; color: #99f6e4; white-space: nowrap; }

.container { max-width: 1080px; margin: 0 auto; padding: 18px 16px 60px; }

/* ---------- 移动端底部标签栏（桌面隐藏） ---------- */
.tabbar { display: none; }

/* ---------- 按钮 ---------- */
.btn-primary { background: var(--teal); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; font-size: 14px; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--slate-600); border: 1px solid var(--slate-200); border-radius: 8px; padding: 8px 14px; font-size: 13px; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #fecaca; border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* ---------- 卡片与统计 ---------- */
.card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(30,41,59,.06); margin-bottom: 14px; }
.notice-bar { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 12px; padding: 13px 14px; box-shadow: 0 1px 4px rgba(30,41,59,.06); display: block; }
.stat .k { color: var(--slate-400); font-size: 12px; }
.stat .v { font-size: 20px; font-weight: 700; margin-top: 4px; color: var(--teal-dark); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 6px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--slate-200); font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.plan-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(30,41,59,.06); cursor: pointer; }
.plan-item .t { font-weight: 600; }
.plan-item .m { color: var(--slate-400); font-size: 12px; margin-top: 4px; }
.plan-item .price { color: var(--teal); font-weight: 700; white-space: nowrap; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--slate-100); font-size: 13px; }
th { color: var(--slate-400); font-weight: 500; font-size: 12px; }
tr.trow { cursor: pointer; }
tbody tr:hover td, tr:hover td { background: var(--slate-50); }
.muted { color: var(--slate-400); font-size: 12px; }
.money { color: var(--teal); font-weight: 600; }
.back-link { display: inline-block; color: var(--slate-400); font-size: 13px; margin-bottom: 10px; }
.back-link:hover { color: var(--teal); }

/* ---------- 表单 ---------- */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.form-field label { font-size: 13px; color: var(--slate-600); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 380px; max-width: 100%; background: #fff; border-radius: 16px; padding: 36px 30px; box-shadow: 0 8px 30px rgba(15,118,110,.12); }
.login-card h1 { font-size: 22px; color: var(--teal-dark); }
.login-card .sub { color: var(--slate-400); margin: 4px 0 22px; }

/* ---------- 步骤条 ---------- */
.steps { display: flex; gap: 8px; margin: 4px 0 14px; }
.step { flex: 1; text-align: center; padding: 8px 4px; border-radius: 8px; background: var(--slate-100); color: var(--slate-400); font-size: 12px; }
.step.on { background: var(--teal-light); color: var(--teal-dark); font-weight: 600; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(520px, 100%); max-height: 86vh; overflow: auto; padding: 20px; }
.modal h3 { margin-bottom: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: var(--slate-800); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 99; font-size: 13px; max-width: 86vw; }
.toast.err { background: var(--danger); }
.empty { text-align: center; color: var(--slate-400); padding: 40px 0; }

/* ---------- 我的（移动端个人中心） ---------- */
.me-card { background: var(--teal-dark); border-radius: 14px; padding: 22px 20px; display: flex; align-items: center; gap: 14px; margin-bottom: 14px; color: #fff; }
.me-card .avatar { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.me-card .me-info { flex: 1; }
.me-card .me-info div { color: #99f6e4; font-size: 12px; margin-top: 2px; }
.me-card .me-sum { text-align: right; }
.me-card .me-sum .k { font-size: 11px; color: #99f6e4; }
.me-card .me-sum .v { font-size: 16px; font-weight: 700; }
.menu-card { padding: 4px 16px; }
.menu-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--slate-100); font-size: 14px; }
.menu-row:last-child { border-bottom: none; }

/* ---------- 寄售流程与首页操作 ---------- */
.flow-card .flow { margin-top: 10px; font-size: 13px; color: var(--slate-600); line-height: 1.9; }
.flow-card .flow i { color: var(--teal); font-style: normal; font-weight: 700; margin: 0 4px; }
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.home-actions .btn-primary, .home-actions .btn-ghost { padding: 11px 18px; }
@media (max-width: 768px) {
  .home-actions .btn-primary, .home-actions .btn-ghost { flex: 1; text-align: center; }
}

/* ---------- v8 首页展示统一 ---------- */
.home-topbar { margin-bottom: 12px; }
.banner-wrap { display: grid; gap: 10px; margin-bottom: 12px; }
.banner-img { width: 100%; height: 120px; object-fit: cover; border-radius: 12px; cursor: pointer; display: block; }
.addr-bar { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 11px 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(30,41,59,.06); cursor: pointer; font-size: 13px; }
.addr-bar b { color: var(--teal); flex-shrink: 0; }
.addr-bar .muted { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marquee-bar { display: flex; align-items: center; gap: 8px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #92400e; overflow: hidden; }
.marquee-scroll { flex: 1; display: flex; gap: 32px; overflow: hidden; white-space: nowrap; animation: marquee 18s linear infinite; }
.marquee-item { flex-shrink: 0; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.stat4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.s4 { text-align: center; display: block; }
.s4 .v { font-size: 22px; font-weight: 700; color: var(--teal-dark); }
.s4 .k { font-size: 12px; color: var(--slate-400); margin-top: 3px; }
@media (max-width: 768px) {
  .banner-img { height: 140px; }
  .s4 .v { font-size: 19px; }
}

/* ============================================
   移动端自适应（≤768px）
   ============================================ */
@media (max-width: 768px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar nav, .topbar .user { display: none; }

  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .container { padding: 14px 12px 24px; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--slate-200);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--slate-400); }
  .tabbar a .ti { font-size: 19px; line-height: 1; }
  .tabbar a.active { color: var(--teal); font-weight: 600; }

  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .v { font-size: 17px; }

  /* 表格转卡片：隐藏表头，每行变卡片，单元格带 data-th 标签 */
  .rtable { display: block; }
  .rtable tr:first-child { display: none; }
  .rtable tr { display: block; padding: 10px 14px; border-bottom: 8px solid var(--slate-50); background: #fff; }
  .rtable tr:hover td { background: transparent; }
  .rtable th { display: none; }
  .rtable td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px dashed var(--slate-100); padding: 7px 0; }
  .rtable td:last-child { border-bottom: none; }
  .rtable td::before { content: attr(data-th); color: var(--slate-400); font-size: 12px; flex-shrink: 0; }
  .rtable td.hide-sm { display: none; }
  .rtable .empty, .rtable td[colspan] { display: block; text-align: center; padding: 40px 0; }
  .rtable .empty::before, .rtable td[colspan]::before { content: none; }

  .grid2 { grid-template-columns: 1fr; }

  /* 弹窗变底部抽屉 */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal { width: 100%; border-radius: 16px 16px 0 0; max-height: 88vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .modal .actions { position: sticky; bottom: 0; background: #fff; padding-top: 10px; }
  .modal .actions .btn-primary, .modal .actions .btn-ghost { flex: 1; padding: 12px 0; }

  .toast { top: auto; bottom: calc(var(--tabbar-h) + 16px); }
  .steps .step { font-size: 11px; padding: 7px 2px; }
  .card { padding: 14px; border-radius: 12px; }
  .plan-item { padding: 13px 14px; }
  .login-card { padding: 30px 22px; }
}

/* 超小屏（≤380px）微调 */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .steps .step { font-size: 10px; }
}

/* 桌面隐藏小屏专用列 */
@media (min-width: 769px) {
  .hide-sm { display: table-cell; }
}
