* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #333; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; outline: none; }
input, textarea, select { outline: none; }

/* 顶部导航 */
.topbar { background: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 100; }
.topbar .back { font-size: 24px; color: #333; width: 32px; }
.topbar .title { font-size: 18px; font-weight: 600; }
.topbar .actions { display: flex; gap: 12px; font-size: 20px; }

/* 按钮 */
.btn { padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary { background: linear-gradient(135deg, #4a90d9, #357abd); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-success { background: #52c41a; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-warning { background: #faad14; color: #fff; }
.btn-default { background: #f0f0f0; color: #333; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* 卡片 */
.card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; color: #666; margin-bottom: 6px; }
.form-label .required { color: #ff4d4f; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px; transition: border-color 0.2s; }
.form-input:focus { border-color: #4a90d9; }
.form-textarea { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px; min-height: 80px; resize: vertical; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.table th { background: #fafafa; font-weight: 600; color: #666; }
.table tr:hover { background: #f9f9f9; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.tag-danger { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.tag-info { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-default { background: #f5f5f5; color: #666; border: 1px solid #d9d9d9; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 12px; padding: 16px; display: flex; align-items: center; justify-content: space-between; }
.stat-card .stat-info .stat-label { font-size: 13px; color: #999; margin-bottom: 4px; }
.stat-card .stat-info .stat-value { font-size: 24px; font-weight: 700; color: #333; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; }
.stat-icon.blue { background: linear-gradient(135deg, #4a90d9, #357abd); }
.stat-icon.green { background: linear-gradient(135deg, #52c41a, #389e0d); }
.stat-icon.purple { background: linear-gradient(135deg, #722ed1, #531dab); }
.stat-icon.orange { background: linear-gradient(135deg, #fa8c16, #d46b08); }
.stat-icon.red { background: linear-gradient(135deg, #ff4d4f, #cf1322); }
.stat-icon.cyan { background: linear-gradient(135deg, #13c2c2, #08979c); }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; color: #999; }
.empty .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty .empty-text { font-size: 14px; }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 8px; color: #fff; font-size: 14px; z-index: 9999; animation: slideDown 0.3s; }
.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }
.toast.info { background: #1890ff; }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 模态框 */
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 500px; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 16px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { font-size: 20px; color: #999; cursor: pointer; }
.modal-body { padding: 16px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }

/* 列表项 */
.list-item { background: #fff; padding: 12px 16px; border-bottom: 1px solid #f5f5f5; display: flex; align-items: center; justify-content: space-between; }
.list-item:hover { background: #fafafa; }

/* 响应式 */
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 4px; }
}

/* 加载 */
.loading { text-align: center; padding: 40px; color: #999; }
.spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid #f0f0f0; border-top-color: #4a90d9; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 防长按选中整页：默认禁止选择，仅可复制元素可选中 */
body { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; }
.selectable, .copy-text, .pay-order-no, .invite-code-text, .order-no-text, code, pre { -webkit-user-select: text; user-select: text; }
