/* =============================================================
   社区生活 · 五端统一设计规范（主流生活服务官网/App 视觉）
   品牌黄 #FFD100 · 强调橙 #FF6D00 · 圆角卡片 · 轻阴影
   ============================================================= */
:root {
  --mt-yellow: #FFD100;        /* 品牌黄 */
  --mt-yellow-dark: #FFC400;
  --mt-orange: #FF6D00;        /* 强调橙 */
  --mt-red: #FF5000;           /* 价格/促销红 */
  --mt-black: #1A1A1A;
  --mt-text: #333333;
  --mt-text-2: #666666;
  --mt-text-3: #999999;
  --mt-bg: #F6F6F6;            /* 页面背景 */
  --mt-card: #FFFFFF;
  --mt-line: #EFEFEF;
  --mt-green: #07C160;         /* 成功 */
  --mt-blue: #1989FA;          /* 链接/信息 */
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-1: 0 1px 4px rgba(0,0,0,.06);
  --shadow-2: 0 4px 16px rgba(0,0,0,.10);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--mt-text);
  background: var(--mt-bg);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { font-family: var(--font); border: none; background: none; cursor: pointer; }
input, textarea, select { font-family: var(--font); font-size: 14px; outline: none; }

/* ---------- 通用工具 ---------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-1 { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ellipsis-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-price { color: var(--mt-red); font-weight: 600; }
.text-price::first-letter { font-size: .78em; }
.text-3 { color: var(--mt-text-3); }
.text-2 { color: var(--mt-text-2); }
.text-orange { color: var(--mt-orange); }
.text-green { color: var(--mt-green); }
.text-bold { font-weight: 600; }
.text-s { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-l { font-size: 16px; }
.text-xl { font-size: 20px; font-weight: 700; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.p-12 { padding: 12px; }

/* ---------- 按钮（高仿主流生活服务 App） ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 36px; padding: 0 18px; border-radius: 18px;
  font-size: 14px; font-weight: 600; color: var(--mt-black);
  background: var(--mt-yellow); transition: filter .15s, transform .1s;
  user-select: none;
}
.btn:active { transform: scale(.97); filter: brightness(.94); }
.btn-block { display: flex; width: 100%; height: 44px; border-radius: 22px; font-size: 16px; }
.btn-orange { background: linear-gradient(135deg, #FF8A00, #FF5000); color: #fff; }
.btn-plain { background: #fff; border: 1px solid var(--mt-line); color: var(--mt-text); }
.btn-ghost { background: rgba(255,209,0,.14); color: #8A6D00; }
.btn-danger { background: linear-gradient(135deg,#FF7B7B,#FF4D4F); color:#fff; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; border-radius: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- 卡片 ---------- */
.card { background: var(--mt-card); border-radius: var(--radius-m); box-shadow: var(--shadow-1); }
.card-pad { padding: 14px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field-label { font-size: 13px; color: var(--mt-text-2); margin-bottom: 6px; display: block; }
.input {
  width: 100%; height: 42px; padding: 0 14px;
  background: #fff; border: 1px solid var(--mt-line); border-radius: var(--radius-s);
  transition: border-color .15s;
}
.input:focus { border-color: var(--mt-yellow-dark); }
textarea.input { height: auto; padding: 10px 14px; resize: none; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
  font-size: 11px; border-radius: 4px; background: #FFF7D6; color: #8A6D00;
  margin-right: 4px; white-space: nowrap;
}
.tag-orange { background: #FFF1E8; color: var(--mt-orange); }
.tag-red { background: #FFECE8; color: var(--mt-red); }
.tag-green { background: #E8F9EF; color: #059B05; }
.tag-blue { background: #E8F3FF; color: var(--mt-blue); }
.tag-gray { background: #F2F2F2; color: var(--mt-text-3); }

/* ---------- 徽标 ---------- */
.badge {
  min-width: 17px; height: 17px; padding: 0 5px;
  background: var(--mt-red); color: #fff; font-size: 11px; font-weight: 600;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- 订单状态色 ---------- */
.st-0 { color: var(--mt-orange); }   /* 待付款 */
.st-1, .st-2, .st-3, .st-4, .st-5, .st-6, .st-7 { color: var(--mt-blue); } /* 进行中 */
.st-8 { color: var(--mt-text-3); }   /* 已完成 */
.st-9, .st-10 { color: var(--mt-text-3); } /* 已取消/关闭 */
.st-11 { color: var(--mt-orange); }  /* 售后中 */
.st-12 { color: var(--mt-green); }   /* 已退款 */

/* ---------- 移动端 App 骨架 ---------- */
.app {
  max-width: 420px; margin: 0 auto; min-height: 100vh;
  background: var(--mt-bg); position: relative;
  box-shadow: 0 0 24px rgba(0,0,0,.08);
}
@media (min-width: 480px) { .app { min-height: 100vh; } }

/* App 顶栏（品牌黄） */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--mt-yellow), #FFDD33);
  padding: 10px 14px;
}
.app-header .loc { font-size: 15px; font-weight: 700; color: var(--mt-black); }
.app-search {
  flex: 1; height: 34px; border-radius: 17px; background: #fff;
  display: flex; align-items: center; padding: 0 14px; gap: 6px;
  color: var(--mt-text-3); font-size: 13px; box-shadow: var(--shadow-1);
}

/* 底部 TabBar */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 420px; z-index: 60;
  background: #fff; border-top: 1px solid var(--mt-line);
  display: flex; padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 10px; color: var(--mt-text-3); padding: 3px 0;
}
.tabbar-item .ico { font-size: 21px; line-height: 1; }
.tabbar-item.active { color: var(--mt-black); font-weight: 600; }
.app-body { padding-bottom: 64px; }

/* ---------- PC 端 Dashboard 骨架 ---------- */
.dash {
  display: flex; min-height: 100vh; background: #F0F2F5;
}
.dash-side {
  width: 208px; background: #1D2129; color: #C9CDD4;
  position: sticky; top: 0; height: 100vh; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.dash-logo {
  height: 56px; display: flex; align-items: center; gap: 8px;
  padding: 0 16px; font-size: 16px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.dash-logo .logo-box {
  width: 28px; height: 28px; border-radius: 6px; background: var(--mt-yellow);
  color: var(--mt-black); font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.dash-menu { flex: 1; padding: 8px 0; overflow-y: auto; }
.dash-menu-group { padding: 10px 16px 4px; font-size: 11px; color: #86909C; }
.dash-menu-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; font-size: 13px; color: #C9CDD4; cursor: pointer;
  border-left: 3px solid transparent; transition: all .15s;
}
.dash-menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.dash-menu-item.active { background: rgba(255,209,0,.12); color: var(--mt-yellow); border-left-color: var(--mt-yellow); }
.dash-menu-item .ico { font-size: 16px; width: 18px; text-align: center; }
.dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-top {
  height: 56px; background: #fff; border-bottom: 1px solid var(--mt-line);
  display: flex; align-items: center; padding: 0 20px; gap: 14px;
  position: sticky; top: 0; z-index: 40;
}
.dash-content { padding: 20px; flex: 1; }
.dash-user { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mt-text-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--mt-yellow);
  color: var(--mt-black); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- 区块标题（各端通用） ---------- */
.sec-head { display: flex; align-items: center; padding: 16px 14px 10px; }
.sec-head .title { font-size: 17px; font-weight: 800; }
.sec-head .more { margin-left: auto; font-size: 12px; color: var(--mt-text-3); cursor: pointer; }

/* ---------- 登录页（五端通用；--login-brand / --login-brand-2 定制品牌色） ---------- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--login-brand, #FFD100) 0%, var(--login-brand-2, #FFE566) 32%, var(--mt-bg) 32%);
}
.login-box { padding: 40px 26px 0; }
.login-logo { display: flex; align-items: center; gap: 9px; margin-bottom: 30px; }
.login-logo .logo-box {
  width: 44px; height: 44px; border-radius: 12px; background: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; letter-spacing: -1px; flex-shrink: 0;
}
.login-title { font-size: 23px; font-weight: 800; color: var(--mt-black); }
.login-sub { font-size: 13px; color: rgba(0,0,0,.5); margin: 5px 0 24px; }
.login-card { background: #fff; border-radius: var(--radius-l); padding: 20px 18px; box-shadow: var(--shadow-2); }
.login-tip { font-size: 11px; color: var(--mt-text-3); text-align: center; margin-top: 16px; line-height: 1.7; }
.sms-row { display: flex; gap: 10px; }
.sms-row .input { flex: 1; }
.sms-btn {
  width: 108px; height: 42px; border-radius: var(--radius-s); flex-shrink: 0;
  background: var(--mt-yellow); font-size: 13px; font-weight: 700; color: var(--mt-black);
}
.sms-btn[disabled] { background: #F2F2F2; color: var(--mt-text-3); }

/* ---------- 统计卡片 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: var(--radius-m); padding: 16px 18px; box-shadow: var(--shadow-1); }
.stat-card .label { font-size: 12px; color: var(--mt-text-3); margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; color: var(--mt-black); }
.stat-card .value.text-price { font-size: 24px; }
.stat-card .extra { font-size: 11px; color: var(--mt-text-3); margin-top: 4px; }

/* ---------- 数据表格 ---------- */
.table-wrap { background: #fff; border-radius: var(--radius-m); box-shadow: var(--shadow-1); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 11px 14px; background: #FAFAFA;
  color: var(--mt-text-2); font-weight: 500; font-size: 12px; white-space: nowrap;
  border-bottom: 1px solid var(--mt-line);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--mt-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAFCFF; }

/* ---------- 弹窗 / 抽屉 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .15s;
}
.dialog {
  background: #fff; border-radius: var(--radius-l); width: 100%; max-width: 340px;
  overflow: hidden; animation: pop .18s;
}
.dialog-title { font-size: 16px; font-weight: 700; text-align: center; padding: 18px 16px 6px; }
.dialog-body { padding: 10px 18px 18px; font-size: 14px; color: var(--mt-text-2); text-align: center; }
.dialog-foot { display: flex; border-top: 1px solid var(--mt-line); }
.dialog-foot button { flex: 1; height: 46px; font-size: 15px; color: var(--mt-text-2); }
.dialog-foot button.confirm { color: var(--mt-black); font-weight: 600; border-left: 1px solid var(--mt-line); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 44%; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(0,0,0,.78); color: #fff; font-size: 13px;
  padding: 9px 16px; border-radius: 8px; max-width: 78vw; text-align: center;
  animation: toastIn .18s;
}
.toast.toast-ok { background: rgba(7,193,96,.92); }
.toast.toast-err { background: rgba(255,77,79,.92); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Loading ---------- */
.loading {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,.12); border-top-color: var(--mt-orange);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 空状态 ---------- */
.empty { padding: 48px 20px; text-align: center; color: var(--mt-text-3); }
.empty .ico { font-size: 44px; margin-bottom: 10px; opacity: .5; }
.empty .txt { font-size: 13px; }

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg, #F0F0F0 25%, #E8E8E8 37%, #F0F0F0 63%);
  background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 6px;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); border-radius: 3px; }

/* =============================================================
   窄屏（≤767px）：PC Dashboard 侧栏折叠为顶部横向 Tab
   商家端/后台在手机上使用时，208px 的固定侧栏会把主内容挤成一条，
   这里把它变成可横向滑动的顶部导航条，不改 HTML、不动 JS。
   ============================================================= */
@media (max-width: 767px) {
  .dash { flex-direction: column; }
  .dash-side {
    width: 100%; height: 46px; position: sticky; top: 0; z-index: 60;
    flex-direction: row; align-items: center;
    box-shadow: 0 1px 0 rgba(255,255,255,.06);
  }
  .dash-logo { display: none; }
  /* 侧栏里除菜单外的附属块（店铺信息等）在窄屏一律隐藏，
     否则会被 flex row 拉到菜单右侧，挤占导航空间 */
  .dash-side > :not(.dash-menu) { display: none; }
  .dash-menu {
    flex: 1; display: flex; flex-direction: row; align-items: center;
    padding: 0; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .dash-menu::-webkit-scrollbar { display: none; }
  .dash-menu-group { display: none; }
  /* 提高一级特异性：各端会在页面内的 <style> 里覆盖 .dash-menu-item.active 的 border-left */
  .dash .dash-menu-item {
    height: 46px; padding: 0 13px; flex: 0 0 auto; white-space: nowrap;
    border-left: 0; border-bottom: 2px solid transparent;
  }
  .dash .dash-menu-item.active {
    background: transparent; border-left: 0;
    border-bottom-color: var(--mt-brand, var(--mt-yellow));
    color: var(--mt-brand, var(--mt-yellow));
  }
  .dash-top { position: sticky; top: 46px; height: 52px; padding: 0 14px; gap: 10px; }
  .dash-content { padding: 12px; }
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .stat-card .value { font-size: 20px; }
  /* 数据表在窄屏横向滚动，避免列被压成瀑布 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 560px; }
}

