/* ============ 平台管理后台 · 全局样式 ============ */
: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; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #111a33 0%, #1c2a52 50%, #2a3d74 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(10px); opacity: .3;
}
.login-wrap::before { width: 460px; height: 460px; background: radial-gradient(circle, #6c63ff, transparent 70%); top: -150px; right: -120px; }
.login-wrap::after { width: 400px; height: 400px; background: radial-gradient(circle, #3b82f6, transparent 70%); bottom: -140px; left: -90px; }
.login-card {
  width: 400px; background: #fff; border-radius: 20px; padding: 40px 36px 32px;
  box-shadow: 0 30px 80px rgba(5, 10, 30, .4); 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; }
.form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.tip { color: var(--muted); font-size: 12px; text-align: center; }
.tip b { color: var(--primary); }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: linear-gradient(180deg, #141d38, #1e2a52);
  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; }
.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: 220px; 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(160px, 1fr)); gap: 18px; margin-bottom: 26px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.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: 26px; 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; }
.search { display: flex; gap: 8px; width: 340px; }
.table-wrap { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 12px; text-transform: none; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f8faff; }

.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; font-size: 14px; }
.order-status { font-size: 12px; padding: 4px 12px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.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}
.st-approved{background:#e5f7ef;color:#059669} .st-pending{background:#fff4e6;color:#d97706}
.st-rejected{background:#fdecec;color:#dc2626} .st-banned{background:#fdecec;color:#dc2626}
.order-info { font-size: 13px; color: var(--muted); line-height: 2; }
.order-info b { color: var(--text); }
.order-actions { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- 趋势图 ---------- */
.trend { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; }
.trend-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trend-col {
  width: 100%; max-width: 46px; background: var(--grad); border-radius: 8px 8px 0 0; min-height: 4px;
  transition: filter .2s; position: relative;
}
.trend-bar:hover .trend-col { filter: brightness(1.12); }
.trend-num { font-size: 12px; color: var(--text); font-weight: 700; }
.trend-date { font-size: 11px; color: var(--muted); }

/* ---------- 表单 / 弹窗 ---------- */
.form-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.form-row label { width: 80px; flex-shrink: 0; font-size: 14px; color: var(--muted); }
.form-panel .form-row input, .form-panel .form-row textarea { flex: 1; }
.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: 460px; 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; }
.price { color: #f97316; font-weight: 700; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #e8f0ff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: var(--primary); margin-right: 6px; vertical-align: middle; }

/* ---------- 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; } }
