/* 平台主控管理端样式 */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --sidebar-bg: #0f172a;
  --sidebar-width: 240px;
  --header-h: 64px;
  --bg: #f1f5f9;
  --white: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07),0 4px 16px rgba(0,0,0,0.05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'PingFang SC','Microsoft YaHei',sans-serif; background: var(--bg); color: var(--text); }

/* 登录 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#0f172a 0%,#1e1b4b 50%,#312e81 100%); }
.login-box { background: white; border-radius: 20px; padding: 48px 40px; width: 400px; box-shadow: 0 25px 60px rgba(0,0,0,0.3); }
.login-box .brand { text-align: center; margin-bottom: 32px; }
.login-box .brand-icon { width: 72px; height: 72px; background: linear-gradient(135deg,#6366f1,#8b5cf6); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 36px; margin: 0 auto 12px; }
.login-box h2 { text-align: center; font-size: 24px; color: var(--primary); }
.login-box p { text-align: center; color: var(--text-light); font-size: 13px; margin-top: 4px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input { width: 100%; height: 46px; border: 2px solid var(--border); border-radius: 10px; padding: 0 16px; font-size: 15px; outline: none; transition: 0.2s; }
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-full { width: 100%; height: 48px; font-size: 16px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 6px; }

/* 布局 */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--sidebar-bg); position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; display: flex; flex-direction: column; }
.sidebar-brand { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand .logo-row { display: flex; align-items: center; gap: 12px; }
.sidebar-brand .logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg,#6366f1,#8b5cf6); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sidebar-brand h1 { color: white; font-size: 15px; font-weight: 700; }
.sidebar-brand p { color: rgba(255,255,255,0.4); font-size: 11px; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-section { padding: 10px 20px 4px; font-size: 10px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: rgba(255,255,255,0.6); cursor: pointer; font-size: 14px; transition: all 0.2s; margin: 1px 8px; border-radius: 8px; }
.nav-item:hover { background: rgba(99,102,241,0.15); color: white; }
.nav-item.active { background: rgba(99,102,241,0.25); color: #a5b4fc; }
.nav-item .icon { font-size: 18px; width: 22px; }
.sidebar-user { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-user .u-row { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.7); font-size: 13px; }

.main-wrap { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.top-bar { height: var(--header-h); background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 90; }
.top-bar h2 { font-size: 19px; font-weight: 700; color: var(--text); }
.top-bar .actions { display: flex; align-items: center; gap: 12px; }

.content-area { flex: 1; padding: 28px; }
.page-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-hdr h2 { font-size: 20px; font-weight: 700; }

/* 卡片 */
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; }
.card-hd { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 700; }
.card-bd { padding: 22px; }

/* 统计卡片 */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 18px; margin-bottom: 24px; }
.kpi-card { background: white; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 16px; }
.kpi-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.kpi-icon.purple { background: #ede9fe; }
.kpi-icon.green { background: #d1fae5; }
.kpi-icon.blue { background: #dbeafe; }
.kpi-icon.orange { background: #ffedd5; }
.kpi-icon.red { background: #fee2e2; }
.kpi-icon.yellow { background: #fef9c3; }
.kpi-body h3 { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; }
.kpi-body p { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: #f8fafc; }
th { padding: 13px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--text-light); border-bottom: 2px solid var(--border); text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-green { background: #d1fae5; color: #059669; }
.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-orange { background: #ffedd5; color: #ea580c; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-yellow { background: #fef9c3; color: #b45309; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filter-bar input, .filter-bar select { height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; font-size: 13px; outline: none; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }

/* 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.6); z-index: 1000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal { background: white; border-radius: 16px; width: 520px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,0.25); }
.modal-lg { width: 720px; }
.modal-xl { width: 900px; }
.modal-hd { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-hd h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-light); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--border); }
.modal-bd { padding: 22px; }
.modal-ft { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 表单 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; }
.form-control { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; font-size: 14px; outline: none; transition: 0.2s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
textarea.form-control { height: 90px; padding: 10px 14px; resize: vertical; }
select.form-control { appearance: none; cursor: pointer; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 14px 20px; border-radius: 10px; color: white; font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; max-width: 340px; font-weight: 500; }
.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-info { background: #6366f1; }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; padding-top: 18px; justify-content: flex-end; }
.pager button { height: 34px; min-width: 34px; border: 1px solid var(--border); background: white; border-radius: 8px; cursor: pointer; font-size: 13px; padding: 0 12px; }
.pager button:hover:not(:disabled) { background: var(--primary); color: white; border-color: var(--primary); }
.pager button:disabled { opacity: 0.5; cursor: not-allowed; }
.pager .pager-info { font-size: 13px; color: var(--text-light); margin-right: 8px; }

/* 状态 */
.status-pending { background: #fef9c3; color: #b45309; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-paid { background: #dbeafe; color: #2563eb; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-completed { background: #d1fae5; color: #059669; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-refunded { background: #fee2e2; color: #dc2626; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-cancelled { background: #f1f5f9; color: #64748b; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* 数字增长动效 */
.num-big { font-size: 28px; font-weight: 800; color: var(--text); }

/* 空状态 */
.empty { text-align: center; padding: 50px; color: var(--text-light); }
.empty .empty-icon { font-size: 52px; margin-bottom: 12px; opacity: 0.5; }

/* 折叠区块 */
.info-block { background: #f8fafc; border-radius: 8px; padding: 14px 18px; border-left: 3px solid var(--primary); }
.info-block p { font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.info-block p:last-child { margin-bottom: 0; }
.info-block b { color: var(--text); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-wrap { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
