:root {
  --primary: #4f6ef2;
  --primary-dark: #3b55d9;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #2b2f36;
  --muted: #8a919c;
  --border: #ececf1;
  --green: #2eaa6e;
  --red: #e5484d;
  --orange: #f5a623;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
.container { max-width: 640px; margin: 0 auto; padding: 16px; }
.container-wide { max-width: 1080px; margin: 0 auto; padding: 16px; }

/* 顶部栏 */
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 22px 16px;
}
.topbar-inner { max-width: 640px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar a { color: rgba(255,255,255,.85); font-size: 13px; text-decoration: none; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  padding-left: 9px;
  border-left: 3px solid var(--primary);
}
.card h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 14px 0 8px; }

/* 表单 */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fafafc;
  outline: none;
  transition: border .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; gap: 0; } }

/* 按钮 */
.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 15px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  text-align: center;
  transition: opacity .2s;
}
.btn:hover { opacity: .88; }
.btn-block { width: 100%; }
.btn-outline {
  background: #fff; color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn-danger { background: var(--red); }
.btn-green { background: var(--green); }
.btn-plain { background: #eef0f5; color: var(--text); }

/* 订单列表 */
.order-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border-radius: 12px;
  padding: 15px 16px; margin-bottom: 10px;
  text-decoration: none; color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.order-item .t { font-weight: 600; }
.order-item .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; white-space: nowrap;
}
.badge-0 { background: #fff6e6; color: var(--orange); }   /* 待初审 */
.badge-1 { background: #eef2ff; color: var(--primary); }   /* 待补充材料 */
.badge-2 { background: #fdebec; color: var(--red); }       /* 已驳回 */
.badge-3 { background: #f3ecff; color: #8b5cf6; }          /* 待终审 */
.badge-4 { background: #fff0e6; color: #f0731f; }          /* 待打款 */
.badge-5 { background: #e6f7ef; color: var(--green); }     /* 已打款 */

/* 详情展示 */
.detail-row {
  display: flex; padding: 9px 0; border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .k { width: 110px; color: var(--muted); flex-shrink: 0; }
.detail-row .v { flex: 1; word-break: break-all; }
/* 订单详情双栏（桌面双列，手机单列） */
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .detail-cols { grid-template-columns: 1fr; } }

/* 图片 */
.img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.img-grid .img-box img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; }
.img-grid .img-box p { font-size: 12px; color: var(--muted); text-align: center; margin-top: 4px; }
.upload-preview { margin-top: 6px; max-width: 120px; max-height: 90px; border-radius: 6px; display: none; }

/* 视频与文件 */
.order-video { width: 100%; max-width: 360px; border-radius: 8px; background: #000; }
.file-list { list-style: none; }
.file-list li { padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.file-list a { color: var(--primary); text-decoration: none; word-break: break-all; }
.pay-voucher { max-width: 320px; width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.step-flow { display: flex; gap: 4px; flex-wrap: wrap; font-size: 12px; margin-bottom: 6px; }
.step-flow span { padding: 3px 10px; border-radius: 20px; background: #eef0f5; color: var(--muted); }
.step-flow span.on { background: var(--primary); color: #fff; }
.step-flow span.done { background: #e6f7ef; color: var(--green); }

/* 提示 */
.alert {
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 14px;
}
.alert-error { background: #fdebec; color: var(--red); }
.alert-info { background: #eef2ff; color: var(--primary-dark); }
.notice {
  font-size: 12px; color: var(--muted); background: #fafafc;
  border-radius: 8px; padding: 10px 12px; margin-top: 12px;
}

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.login-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; text-align: center; padding: 54px 20px 80px;
}
.login-hero h1 { font-size: 24px; font-weight: 600; }
.login-hero p { font-size: 13px; opacity: .85; margin-top: 8px; }
.login-card { max-width: 380px; margin: -50px auto 0; width: calc(100% - 32px); }

/* 后台表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
th, td { padding: 11px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #fafafc; color: var(--muted); font-weight: 500; }
td .nowrap { white-space: nowrap; }

/* 后台导航 */
.nav-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.nav-tabs a {
  padding: 8px 18px; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-size: 14px; background: var(--card);
}
.nav-tabs a.active { background: var(--primary); color: #fff; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 14px; outline: none;
}
.filter-bar input, .filter-bar select { flex: 1 1 150px; min-width: 130px; }
.muted { color: var(--muted); font-size: 13px; }

/* ============ 管理后台布局 ============ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 210px; flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 10;
}
.admin-sidebar .logo {
  padding: 22px 18px; font-weight: 600; font-size: 16px;
  border-bottom: 1px solid var(--border);
}
.admin-sidebar nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 14px;
  transition: background .15s;
}
.admin-sidebar nav a:hover { background: #f2f4fb; }
.admin-sidebar nav a.active { background: var(--primary); color: #fff; }
.nav-badge {
  background: var(--red); color: #fff; font-size: 11px;
  border-radius: 10px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.admin-sidebar nav a.active .nav-badge { background: rgba(255,255,255,.3); }

/* 二级菜单分组 */
.nav-group { margin-bottom: 2px; }
.nav-group-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-radius: 8px; cursor: pointer;
  color: var(--text); font-size: 14px; font-weight: 500;
  user-select: none; transition: background .15s;
}
.nav-group-title:hover { background: #f2f4fb; }
.nav-group-title .arrow { font-size: 13px; color: var(--muted); transform: rotate(90deg); transition: transform .2s; }
.nav-group:not(.open) .arrow { transform: rotate(0deg); }
.nav-sub {
  display: none; flex-direction: column; gap: 2px;
  padding-left: 10px; margin: 2px 0 4px;
  border-left: 2px solid var(--border); margin-left: 14px;
}
.nav-group.open > .nav-sub { display: flex; }
.nav-sub a {
  padding: 9px 12px; font-size: 13px;
}

.sidebar-foot { padding: 16px 18px; border-top: 1px solid var(--border); font-size: 13px; }
.sidebar-foot a { color: var(--red); text-decoration: none; display: inline-block; margin-top: 4px; }
/* padding-top 44px：给 fixed 的收起按钮留出一行空间，避免它压住页面 h1 标题（展开态按钮在侧栏内，收起态滑到最左） */
.admin-main { flex: 1; margin-left: 210px; padding: 44px 24px 22px; min-width: 0; }

/* 订单详情：基本信息两栏（窄屏自动单栏） */
.od-basic { display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 1fr); gap: 18px; }
@media (max-width: 900px) { .od-basic { grid-template-columns: 1fr; } }

/* 宽表格在卡片内横向滚动，避免撑破整个页面宽度 */
.od-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.od-scroll > .od-tbl, .od-scroll > .od-scale { min-width: 560px; }
/* 列表页普通表格（订单/付款/会员/投资人等）统一在窄屏可横向滚动 */
.od-scroll > table { min-width: 480px; }
@media (max-width: 900px) { .od-tbl th, .od-scale th { white-space: normal; } }

/* 左侧菜单整体收起 / 展开 */
.admin-sidebar { transition: transform .2s ease; }
/* 收起按钮：
   展开态贴在侧栏 logo 行右端（不压主区标题，也不压侧栏 logo 文字）；
   收起态滑到屏幕最左，侧栏移出后可继续点击展开。 */
.nav-toggle {
  position: fixed; top: 8px; left: 150px; z-index: 30;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 15px; line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: left .2s ease;
}
.nav-toggle:hover { background: #f2f4fb; }
body.nav-collapsed .nav-toggle { left: 12px; }
body.nav-collapsed .admin-sidebar { transform: translateX(-100%); }
body.nav-collapsed .admin-main { margin-left: 0; }

/* 移动端：左侧菜单改为顶部固定栏 + 横向滚动导航 */
@media (max-width: 820px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    position: sticky; top: 0; z-index: 50;
    width: 100%; flex-direction: row; align-items: center;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 0;
  }
  .admin-sidebar .logo {
    padding: 11px 14px; border-bottom: none; border-right: 1px solid var(--border);
    font-size: 15px; white-space: nowrap; flex-shrink: 0;
  }
  .admin-sidebar nav {
    flex: 1; flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding: 8px 10px; gap: 6px; align-items: stretch;
  }
  .admin-sidebar nav::-webkit-scrollbar { display: none; }
  .admin-sidebar nav > a,
  .admin-sidebar .nav-group-title {
    flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; font-size: 13px;
  }
  .admin-sidebar .nav-group { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; }
  .admin-sidebar .nav-group-title { margin: 0; }
  .admin-sidebar .nav-group-title .arrow { display: none; }
  .admin-sidebar .nav-sub {
    display: flex !important; flex-direction: row; flex-wrap: nowrap;
    border: none; margin: 0; padding-left: 0; gap: 4px;
  }
  .admin-sidebar .nav-sub a { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .sidebar-foot {
    border-top: none; border-left: 1px solid var(--border);
    padding: 10px 14px; white-space: nowrap; display: flex; align-items: center; gap: 8px;
  }
  .sidebar-foot a { margin-top: 0; }
  .admin-main { margin-left: 0; padding: 14px; }
  .nav-toggle { display: none; }
  /* 移动端分组标题当作分区标签，不再表现为可点击按钮 */
  .admin-sidebar .nav-group-title { cursor: default; background: transparent; font-weight: 600; }
  .admin-sidebar .nav-group-title:hover { background: transparent; }
}

/* 超小屏细节 */
@media (max-width: 480px) {
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .dash-card, .card { padding: 14px; }
  .dash-head h1 { font-size: 19px; }
  .trend-val { font-size: 10px; }
  th, td { padding: 9px 10px; font-size: 12px; }
  .dist-row .num { width: 78px; font-size: 12px; }
  .detail-row .k { width: 88px; font-size: 13px; }
  .img-grid { gap: 8px; }
}

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1000px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: #fff; border-radius: 12px; padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }

/* ============ 数据中台 ============ */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; flex-wrap: wrap; gap: 8px; }
.dash-head h1 { font-size: 22px; font-weight: 700; }
.dash-sub { color: var(--muted); font-size: 13px; }
.dash-card { background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.dash-card h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; padding-left: 9px; border-left: 3px solid var(--primary); }
.dash-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
@media (max-width: 1000px) { .dash-2col { grid-template-columns: 1fr; } }
.dist-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.dist-row .name { width: 76px; flex-shrink: 0; }
.dist-bar { flex: 1; height: 10px; border-radius: 6px; background: #eef0f5; overflow: hidden; }
.dist-bar > i { display: block; height: 100%; border-radius: 6px; }
.dist-row .num { width: 96px; text-align: right; color: var(--muted); flex-shrink: 0; }
.fin-bar { height: 14px; border-radius: 8px; background: #eef0f5; overflow: hidden; display: flex; margin: 10px 0 4px; }
.fin-bar > i { display: block; height: 100%; }
.fin-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.fin-legend span i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.trend-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.trend-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.trend-chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-val { font-size: 11px; color: var(--text); font-weight: 600; margin-bottom: 3px; }
.trend-bar { width: 56%; max-width: 30px; border-radius: 6px 6px 0 0; min-height: 2px; }
.trend-label { font-size: 11px; color: var(--muted); margin-top: 6px; }
.todo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 820px) { .todo-grid { grid-template-columns: repeat(2, 1fr); } }
.todo-item { display: block; text-align: center; padding: 16px 8px; border-radius: 10px; background: #fafafc; text-decoration: none; color: inherit; transition: background .15s; }
.todo-item:hover { background: #f0f3ff; }
.todo-item .n { font-size: 26px; font-weight: 700; }
.todo-item .t { font-size: 12px; color: var(--muted); margin-top: 2px; }
.todo-item.alert .n { color: var(--red); }
.todo-item .go { font-size: 11px; color: var(--primary); margin-top: 4px; }

