/* ============ 基础重置 ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: #333; background: #f0f2f5; line-height: 1.6; min-height: 100vh; }
a { color: #165dff; text-decoration: none; }
a:hover { color: #0e42d2; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e8e8e8; }
th { background: #fafafa; font-weight: 600; font-size: 13px; color: #666; }
tr:hover { background: #fafafa; }

/* ============ 通用组件 ============ */
.btn { display: inline-block; padding: 8px 18px; border-radius: 6px; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; text-decoration: none; line-height: 1.5; }
.btn-primary { background: #165dff; color: #fff; border-color: #165dff; }
.btn-primary:hover { background: #0e42d2; color: #fff; }
.btn-success { background: #00b42a; color: #fff; border-color: #00b42a; }
.btn-success:hover { background: #009a23; color: #fff; }
.btn-danger { background: #f53f3f; color: #fff; border-color: #f53f3f; }
.btn-danger:hover { background: #cb2634; color: #fff; }
.btn-outline { border: 1px solid #d0d5dd; background: #fff; color: #333; }
.btn-outline:hover { border-color: #165dff; color: #165dff; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; border-radius: 4px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ 登录页 ============ */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { background: #fff; border-radius: 12px; padding: 40px; width: 400px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-card h2 { text-align: center; margin-bottom: 8px; font-size: 22px; color: #1a1a1a; }
.login-card .subtitle { text-align: center; color: #999; margin-bottom: 28px; font-size: 13px; }
.login-switch { text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid #f0f0f0; }
.login-switch a { color: #165dff; font-size: 13px; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; color: #555; }
.form-group label .required { color: #f53f3f; margin-left: 2px; }
.form-control { display: block; width: 100%; padding: 9px 12px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px; color: #333; background: #fff; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: #165dff; box-shadow: 0 0 0 2px rgba(22,93,255,0.1); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* ============ 提示 ============ */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-info { background: #e8f3ff; color: #165dff; border: 1px solid #bedaFF; }
.alert-success { background: #e8ffea; color: #00b42a; border: 1px solid #b6f0be; }
.alert-warning { background: #fff7e8; color: #d46b08; border: 1px solid #ffe2b8; }
.alert-danger { background: #ffece8; color: #f53f3f; border: 1px solid #ffcfc7; }

/* ============ 后台布局 ============ */
.admin-layout, .user-layout { min-height: 100vh; }
.topbar { background: #fff; border-bottom: 1px solid #e8e8e8; height: 56px; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.topbar .logo { font-size: 17px; font-weight: 700; color: #1a1a1a; }
.topbar .logo span { color: #165dff; font-weight: 400; font-size: 14px; margin-left: 4px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { color: #666; font-size: 13px; }
.main-wrapper { display: flex; padding-top: 56px; min-height: calc(100vh - 56px); }
.sidebar { width: 200px; background: #fff; border-right: 1px solid #e8e8e8; padding: 16px 0; position: fixed; top: 56px; bottom: 0; overflow-y: auto; }
.side-nav { display: flex; flex-direction: column; }
.side-link { display: block; padding: 10px 24px; color: #555; font-size: 14px; transition: all 0.15s; border-left: 3px solid transparent; }
.side-link:hover { background: #f5f7fa; color: #165dff; }
.side-link.active { background: #e8f3ff; color: #165dff; border-left-color: #165dff; font-weight: 600; }
.content { flex: 1; margin-left: 200px; padding: 24px; }
.content-header { margin-bottom: 24px; }
.content-header h2 { font-size: 20px; font-weight: 600; }

/* ============ 卡片 ============ */
.card { background: #fff; border-radius: 8px; border: 1px solid #e8e8e8; margin-bottom: 20px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid #f0f0f0; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid #f0f0f0; }

/* ============ 状态标签 ============ */
.badge { display: inline-block; padding: 2px 10px; border-radius: 100px; font-size: 12px; font-weight: 500; }
.badge-pending { background: #fff7e8; color: #d46b08; }
.badge-approved { background: #e8ffea; color: #00b42a; }
.badge-rejected { background: #ffece8; color: #f53f3f; }
.badge-active { background: #e8ffea; color: #00b42a; }
.badge-inactive { background: #f2f3f5; color: #86909c; }
.badge-disabled { background: #ffece8; color: #f53f3f; }

/* ============ 数据统计卡片 ============ */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; border: 1px solid #e8e8e8; padding: 20px; }
.stat-card .stat-num { font-size: 30px; font-weight: 700; color: #165dff; }
.stat-card .stat-label { font-size: 13px; color: #999; margin-top: 4px; }

/* ============ 域名卡片（用户前台） ============ */
.domain-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.domain-card { background: #fff; border-radius: 8px; border: 1px solid #e8e8e8; padding: 20px; transition: box-shadow 0.2s; }
.domain-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.domain-card h3 { font-size: 16px; margin-bottom: 8px; }
.domain-card .domain-remark { color: #999; font-size: 12px; margin-bottom: 12px; }
.domain-card .domain-action { margin-top: 12px; }

/* ============ 搜索栏 ============ */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
.search-bar .form-control { width: auto; min-width: 200px; }

/* ============ 空状态 ============ */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ============ 模态框 ============ */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 480px; max-width: 90vw; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #999; padding: 0; line-height: 1; }
.modal-close:hover { color: #333; }

/* ============ 分页 ============ */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; }
.pagination a, .pagination span { display: inline-block; padding: 6px 12px; border-radius: 4px; font-size: 13px; border: 1px solid #e8e8e8; color: #555; }
.pagination a:hover { border-color: #165dff; color: #165dff; }
.pagination .current { background: #165dff; color: #fff; border-color: #165dff; }

/* ============ 用户端顶部 ============ */
.user-topbar { background: #1a1a2e; border-bottom-color: #16213e; }
.user-topbar .logo { color: #fff; }
.user-topbar .topbar-user { color: #bbb; }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .sidebar { width: 160px; }
    .content { margin-left: 160px; padding: 16px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .domain-cards { grid-template-columns: 1fr; }
    .login-card { padding: 24px; }
}
@media (max-width: 540px) {
    .sidebar { display: none; }
    .content { margin-left: 0; }
    .topbar-inner { padding: 0 12px; }
}
