/* ========================================
   数字托付后台管理系统 - 样式表
   ======================================== */

:root {
  --primary: #1a73e8;
  --primary-light: #e8f0fe;
  --success: #0d9e6c;
  --warning: #f29900;
  --danger: #e54545;
  --bg: #f5f6fa;
  --card: #fff;
  --text: #1f2937;
  --text2: #6b7280;
  --text3: #9ca3af;
  --border: #e5e7eb;
  --sidebar-w: 220px;
  --header-h: 56px;
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== 登录页 ========== */
.login-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #1a73e8 0%, #4a90d9 100%);
}
.login-box {
  background: #fff; border-radius: 16px; padding: 48px 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.login-box h1 { text-align: center; font-size: 24px; margin-bottom: 8px; }
.login-box .sub { text-align: center; color: var(--text2); font-size: 14px; margin-bottom: 32px; }
.login-box .field { margin-bottom: 20px; }
.login-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text2); }
.login-box input {
  width: 100%; height: 44px; border: 2px solid var(--border); border-radius: var(--radius);
  padding: 0 14px; font-size: 15px; outline: none; transition: border .2s;
}
.login-box input:focus { border-color: var(--primary); }
.login-box .btn {
  width: 100%; height: 44px; background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px;
}
.login-box .btn:hover { opacity: 0.9; }
.login-error { color: var(--danger); text-align: center; font-size: 13px; margin-top: 8px; min-height: 20px; }

/* ========== 布局 ========== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: #1e293b; color: #cbd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-logo { padding: 20px 20px; border-bottom: 1px solid #334155; }
.sidebar-logo h2 { color: #fff; font-size: 18px; }
.sidebar-logo .ver { font-size: 12px; color: #64748b; margin-top: 4px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-nav a {
  display: flex; align-items: center; padding: 12px 20px; color: #94a3b8;
  text-decoration: none; font-size: 14px; transition: all .15s; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: #334155; color: #e2e8f0; text-decoration: none; }
.sidebar-nav a.active { background: #1a73e8; color: #fff; border-left-color: #fff; }
.sidebar-nav a .icon { margin-right: 12px; font-size: 18px; width: 24px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #334155; font-size: 13px; }
.sidebar-footer .user { color: #e2e8f0; font-weight: 500; }
.sidebar-footer .role { color: #64748b; font-size: 11px; }
.sidebar-footer .logout-btn { display: inline-block; margin-top: 8px; color: #94a3b8; text-decoration: none; font-size: 12px; }
.sidebar-footer .logout-btn:hover { color: #fff; text-decoration: none; }

.main-area { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 28px; font-size: 14px; color: var(--text2);
  position: sticky; top: 0; z-index: 50;
}
.breadcrumb { font-size: 14px; font-weight: 500; color: var(--text); }
.content { flex: 1; padding: 24px 28px; overflow-y: auto; }

/* ========== 卡片 ========== */
.card { background: var(--card); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-header h3 { font-size: 16px; font-weight: 600; }

/* ========== 统计卡片 ========== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); display: flex; align-items: center;
}
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-right: 14px; }
.stat-icon.blue { background: #e8f0fe; color: #1a73e8; }
.stat-icon.green { background: #e8f5e9; color: #0d9e6c; }
.stat-icon.orange { background: #fff3e0; color: #f29900; }
.stat-icon.red { background: #ffebee; color: #e54545; }
.stat-info .num { font-size: 26px; font-weight: 700; }
.stat-info .label { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* ========== 表格 ========== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 12px; background: #f8fafc; color: var(--text2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
tr:hover td { background: #f8fafc; }

/* ========== 标签 ========== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag-gray { background: #f1f5f9; color: #64748b; }
.tag-blue { background: #e8f0fe; color: #1a73e8; }
.tag-green { background: #e8f5e9; color: #0d9e6c; }
.tag-orange { background: #fff3e0; color: #f29900; }
.tag-red { background: #ffebee; color: #e54545; }

/* ========== 按钮 ========== */
.btn { display: inline-flex; align-items: center; padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-gray { background: #e5e7eb; color: #374151; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: default; }
a.btn:hover { text-decoration: none; }

/* ========== 表单 ========== */
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text2); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; outline: none; background: #fafafa; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); background: #fff; }
.form-group textarea { min-height: 80px; resize: vertical; }

.form-inline { display: flex; gap: 12px; align-items: center; }
.form-inline select { height: 36px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; font-size: 13px; outline: none; }

/* ========== 搜索栏 ========== */
.search-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-bar input { width: 220px; height: 36px; border: 1px solid var(--border); border-radius: 6px; padding: 0 12px; font-size: 13px; outline: none; }
.search-bar input:focus { border-color: var(--primary); }
.search-bar select { height: 36px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; font-size: 13px; outline: none; }

/* ========== 弹窗 ========== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 12px; padding: 28px; max-width: 520px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.hidden { display: none !important; }

/* ========== 提示 ========== */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

/* ========== 详情页 ========== */
.detail-section { border-top: 1px solid var(--border); padding: 18px 0; }
.detail-section:first-of-type { border-top: none; padding-top: 0; }
.detail-section h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.detail-item { display: flex; align-items: center; font-size: 14px; padding: 4px 0; }
.detail-label { color: var(--text3); width: 80px; flex-shrink: 0; font-size: 12px; }
.detail-value { font-weight: 500; }

/* ========== 分页 ========== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.pagination .btn { font-size: 12px; }
.page-info { font-size: 13px; color: var(--text3); }

/* ========== 公用 ========== */
.text-center { text-align: center; }
.text-muted { color: var(--text3); }
.text-ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace; font-size: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ========== 流程步骤 ========== */
.flow-steps { display: flex; align-items: flex-start; gap: 0; padding: 12px 0; flex-wrap: wrap; }
.flow-step { flex: 1; min-width: 180px; text-align: center; padding: 8px; }
.flow-num { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; margin: 0 auto 10px; }
.flow-text strong { font-size: 14px; display: block; margin-bottom: 4px; }
.flow-text p { font-size: 12px; color: var(--text2); line-height: 1.5; }
.flow-arrow { font-size: 24px; color: var(--text3); padding-top: 6px; flex-shrink: 0; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .flow-steps { flex-direction: column; }
  .flow-arrow { display: none; }
}
