/* ============ 商家管理后台 · 全局样式 ============ */
:root {
  --primary: #4a6cf7;
  --primary2: #6c63ff;
  --grad: linear-gradient(135deg, #4a6cf7, #6c63ff);
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e8ecf3;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }

/* ---------- 输入框 / 按钮 ---------- */
.ipt {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; outline: none; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.ipt:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 108, 247, .12); }
textarea.ipt { resize: vertical; }

.btn {
  padding: 10px 20px; border: none; border-radius: 10px; cursor: pointer; font-size: 14px;
  font-weight: 500; transition: all .18s ease; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(74, 108, 247, .35); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(74, 108, 247, .45); }
.btn-ghost { background: #fff; color: #52607a; border: 1px solid var(--border); }
.btn-ghost:hover { border-color: #c9d2e3; background: #f8fafc; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f3c9c9; }
.btn-danger:hover { background: #fef2f2; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e2a4a 0%, #263a6b 45%, #3b4f8f 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(10px); opacity: .35;
}
.login-wrap::before { width: 420px; height: 420px; background: radial-gradient(circle, #6c63ff, transparent 70%); top: -140px; right: -100px; }
.login-wrap::after { width: 380px; height: 380px; background: radial-gradient(circle, #3b82f6, transparent 70%); bottom: -120px; left: -80px; }
.login-card {
  width: 400px; background: #fff; border-radius: 20px; padding: 40px 36px 32px;
  box-shadow: 0 30px 80px rgba(10, 16, 40, .35); position: relative; z-index: 2; text-align: center;
  animation: rise .5s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.login-logo {
  width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 20px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  box-shadow: 0 10px 24px rgba(74, 108, 247, .4);
}
.login-card h1 { font-size: 22px; letter-spacing: .5px; }
.sub { color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.login-tabs { display: flex; background: #f1f4fb; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.login-tabs span { flex: 1; text-align: center; padding: 8px 0; border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; transition: all .2s; }
.login-tabs span.on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 2px 8px rgba(16,24,40,.08); }
.form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.code-row { display: flex; gap: 8px; }
.code-row .ipt { flex: 1; }
.code-row .btn { flex-shrink: 0; }
.tip { color: var(--muted); font-size: 12px; text-align: center; }
.tip b { color: var(--primary); }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; background: linear-gradient(180deg, #1b2645, #232f54);
  color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0;
  z-index: 10;
}
.brand {
  font-size: 17px; font-weight: 700; padding: 22px 24px 18px; letter-spacing: .5px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand b { color: #8ea9ff; }
.merchant-box { padding: 18px 20px; border-bottom: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 12px; }
.merchant-logo {
  width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.merchant-name { font-size: 14px; font-weight: 600; }
.merchant-status { font-size: 12px; color: #6ee7b7; margin-top: 3px; }
.nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.nav a {
  padding: 12px 16px; border-radius: 10px; cursor: pointer; color: #aebad8; font-size: 14px;
  text-decoration: none; display: flex; align-items: center; gap: 10px; transition: all .18s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(74, 108, 247, .4); }
.logout { margin: 16px 20px; color: #cdd6ea !important; border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.06); }
.logout:hover { background: rgba(255,255,255,.12); color: #fff !important; }

.main { flex: 1; margin-left: 232px; padding: 30px 36px; }
.view-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
h2 { font-size: 21px; font-weight: 700; letter-spacing: .3px; }
h2::before { content: ""; display: inline-block; width: 5px; height: 20px; background: var(--grad); border-radius: 3px; margin-right: 10px; vertical-align: -3px; }

/* ---------- 统计卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin-bottom: 26px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .6); transition: transform .2s, box-shadow .2s; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(16, 24, 40, .1); }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}
.card-num { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.1; }
.card-label { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---------- 面板 / 列表 ---------- */
.panel { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-top: 20px; }
.panel h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--text); }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  padding: 8px 18px; border: 1px solid var(--border); background: #fff; border-radius: 20px;
  cursor: pointer; font-size: 13px; color: var(--muted); transition: all .18s;
}
.tabs button:hover { border-color: var(--primary); color: var(--primary); }
.tabs button.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(74,108,247,.3); }

.order-list { display: flex; flex-direction: column; gap: 12px; }
.order-item {
  border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.order-item:hover { border-color: #d6dff2; box-shadow: var(--shadow-sm); }
.order-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.order-no { font-weight: 700; color: var(--text); font-size: 14px; }
.order-status { font-size: 12px; padding: 4px 12px; border-radius: 20px; font-weight: 600; }
.st-paid{background:#fff4e6;color:#d97706} .st-accepted{background:#e8f0ff;color:#2563eb}
.st-working{background:#e5f7ef;color:#059669} .st-completed{background:#eef1f6;color:#64748b}
.st-cancelled{background:#fdecec;color:#dc2626} .st-pending_pay{background:#fff4e6;color:#d97706}
.order-info { font-size: 13px; color: var(--muted); line-height: 2; }
.order-info b { color: var(--text); }
.order-actions { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- 资金 ---------- */
.wallet-balance {
  background: var(--grad); border-radius: var(--radius); color: #fff; padding: 34px; text-align: center;
  box-shadow: 0 16px 40px rgba(74, 108, 247, .35); position: relative; overflow: hidden;
}
.wallet-balance::before {
  content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.12); top: -80px; right: -60px;
}
.wb-label { font-size: 14px; opacity: .9; }
.wb-num { font-size: 48px; font-weight: 800; margin: 10px 0 20px; letter-spacing: 1px; }
.withdraw-row { display: flex; gap: 10px; max-width: 380px; margin: 0 auto; }
.withdraw-row .ipt { background: rgba(255,255,255,.95); border: none; }

/* ---------- 表单 ---------- */
.form-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.form-row label { width: 90px; flex-shrink: 0; font-size: 14px; color: var(--muted); }
.form-panel .form-row input, .form-panel .form-row textarea { flex: 1; }
.form-panel { max-width: 720px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(4px); }
.modal-box {
  width: 500px; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.25);
  animation: rise .25s ease;
}
.modal-box h3 { font-size: 17px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: #9aa3b5; padding: 46px 0; font-size: 14px; }
.empty::before { content: "🗂️"; display: block; font-size: 42px; margin-bottom: 10px; opacity: .7; }

/* ---------- Toast ---------- */
#toastWrap { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  background: #1f2937; color: #fff; padding: 12px 24px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.25); animation: toastIn .25s ease; max-width: 80vw;
}
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

.price { color: #f97316; font-weight: 700; }
