/* H5免签封装系统 - 管理后台样式 */

/* 基础重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }
a { text-decoration: none; color: inherit; }

/* 登录页 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: #fff; border-radius: 12px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 24px; color: #333; margin-bottom: 8px; }
.login-header p { color: #999; font-size: 14px; }

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #555; font-size: 13px; }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; transition: border-color 0.3s; outline: none; }
.form-control:focus { border-color: #667eea; box-shadow: 0 0 0 2px rgba(102,126,234,0.2); }
textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }
.code-editor { font-family: "Fira Code", Consolas, monospace; font-size: 13px; background: #1e1e1e; color: #d4d4d4; border-color: #333; }

/* 按钮 */
.btn { display: inline-block; padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; transition: all 0.3s; font-weight: 500; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #45a717; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #e33e3f; }
.btn-warning { background: #faad14; color: #fff; }
.btn-warning:hover { background: #e09e12; }
.btn-default { background: #fff; color: #333; border: 1px solid #d9d9d9; }
.btn-default:hover { border-color: #667eea; color: #667eea; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

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

/* 侧边栏 */
.sidebar { width: 220px; background: #001529; color: #fff; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform 0.3s; }
.sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 18px; color: #fff; }
.sidebar-nav { padding: 12px 0; }
.nav-item { display: flex; align-items: center; padding: 12px 24px; color: rgba(255,255,255,0.65); transition: all 0.3s; cursor: pointer; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active { color: #fff; background: #667eea; }
.nav-icon { margin-right: 10px; font-size: 12px; }

/* 主内容 */
.main-content { flex: 1; margin-left: 220px; min-height: 100vh; }

/* 顶部栏 */
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 50; }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-info span { color: #666; }

/* 页面内容 */
.page-content { padding: 24px; }

/* 卡片 */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.stat-card .stat-label { color: #999; font-size: 13px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #333; }
.stat-card .stat-icon { float: right; font-size: 36px; opacity: 0.2; }

/* 表格 */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; }
th { background: #fafafa; font-weight: 600; color: #666; font-size: 13px; white-space: nowrap; }
td { font-size: 14px; }
tr:hover { background: #f5f7fa; }

/* 状态标签 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.badge-danger { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.badge-info { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.badge-default { background: #f5f5f5; color: #999; border: 1px solid #d9d9d9; }

/* 弹窗 */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: flex-start; padding-top: 60px; overflow-y: auto; }
.modal.show { display: flex; }
.modal-content { background: #fff; border-radius: 8px; width: 90%; max-width: 600px; margin-bottom: 40px; }
.modal-lg { max-width: 800px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
.modal-body { padding: 20px; max-height: 65vh; overflow-y: auto; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }

/* 配置标签页 */
.config-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid #f0f0f0; }
.config-tab { padding: 10px 20px; background: none; border: none; cursor: pointer; font-size: 14px; color: #999; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.config-tab.active { color: #667eea; border-bottom-color: #667eea; }
.config-panel { display: none; }
.config-panel.active { display: block; }

/* 表单行 */
.form-row { display: flex; gap: 16px; margin-bottom: 0; }
.form-row .form-group { flex: 1; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.33%; max-width: 33.33%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }

/* 上传区域 */
.upload-area { border: 2px dashed #d9d9d9; border-radius: 8px; padding: 40px 20px; text-align: center; cursor: pointer; transition: border-color 0.3s; }
.upload-area:hover { border-color: #667eea; }
.upload-area p { color: #999; }
.upload-preview { margin-top: 12px; text-align: center; }
.upload-preview img { max-width: 200px; max-height: 200px; border-radius: 8px; }

/* 进度条 */
.progress-bar { width: 100%; height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(135deg, #667eea, #764ba2); transition: width 0.3s; border-radius: 4px; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.pagination button { padding: 6px 12px; border: 1px solid #d9d9d9; background: #fff; border-radius: 4px; cursor: pointer; }
.pagination button.active { background: #667eea; color: #fff; border-color: #667eea; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast { padding: 12px 20px; border-radius: 6px; color: #fff; margin-bottom: 8px; animation: slideIn 0.3s; min-width: 200px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.toast-success { background: #52c41a; }
.toast-error { background: #ff4d4f; }
.toast-info { background: #1890ff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }

/* 搜索栏 */
.search-bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar .form-control { max-width: 240px; }

/* 操作按钮组 */
.action-group { display: flex; gap: 6px; }

/* 图标预览 */
.app-icon { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .form-row { flex-direction: column; }
    .col-3, .col-4, .col-6 { flex: 0 0 100%; max-width: 100%; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .modal-content { width: 95%; }
}

.section-title { font-size: 15px; color: #667eea; margin: 20px 0 12px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }
