/* 清风社区 - 代理端控制台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #333; background: #f0f2f5; }

/* 顶部导航 */
.header { display: flex; justify-content: space-between; align-items: center; height: 48px; padding: 0 20px; background: #001529; color: #fff; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.header .logo { font-size: 16px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.btn-link { background: none; border: none; color: #1890ff; cursor: pointer; font-size: 13px; }
.btn-link:hover { color: #40a9ff; }

/* 主体布局 */
.main-layout { display: flex; margin-top: 48px; min-height: calc(100vh - 48px); }

/* 左侧导航 */
.sidebar { width: 180px; background: #fff; border-right: 1px solid #e8e8e8; padding: 12px 0; position: fixed; top: 48px; bottom: 0; overflow-y: auto; }
.nav-list { list-style: none; }
.nav-item { padding: 10px 20px; cursor: pointer; color: #666; transition: all 0.2s; font-size: 14px; }
.nav-item:hover { background: #e6f7ff; color: #1890ff; }
.nav-item.active { background: #e6f7ff; color: #1890ff; font-weight: 500; border-right: 3px solid #1890ff; }

/* 右侧内容 */
.content { margin-left: 180px; padding: 20px; flex: 1; min-width: 0; }

/* 卡片 */
.card { background: #fff; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 500; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 4px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); text-align: center; }
.stat-card .stat-value { font-size: 28px; font-weight: 600; color: #1890ff; }
.stat-card .stat-label { font-size: 12px; color: #999; margin-top: 4px; }
.stat-card.warn .stat-value { color: #faad14; }
.stat-card.danger .stat-value { color: #ff4d4f; }
.stat-card.success .stat-value { color: #52c41a; }

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

/* 状态标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; }
.tag-0 { background: #e6f7ff; color: #1890ff; } /* 未使用 */
.tag-1 { background: #f6ffed; color: #52c41a; } /* 已激活 */
.tag-2 { background: #fff7e6; color: #faad14; } /* 已冻结 */
.tag-3 { background: #fff1f0; color: #ff4d4f; } /* 已过期 */
.tag-4 { background: #f5f5f5; color: #999; }    /* 已回收 */

/* 按钮 */
.btn { display: inline-block; padding: 6px 16px; border-radius: 4px; border: 1px solid #d9d9d9; background: #fff; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.btn:hover { border-color: #1890ff; color: #1890ff; }
.btn-primary { background: #1890ff; border-color: #1890ff; color: #fff; }
.btn-primary:hover { background: #40a9ff; border-color: #40a9ff; color: #fff; }
.btn-danger { color: #ff4d4f; border-color: #ff4d4f; }
.btn-danger:hover { background: #ff4d4f; color: #fff; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* 表单 */
.form-row { display: flex; gap: 12px; margin-bottom: 14px; align-items: center; }
.form-row label { width: 80px; text-align: right; font-size: 13px; color: #666; flex-shrink: 0; }
.form-row input, .form-row select, .form-row textarea { flex: 1; padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: #1890ff; }

/* 搜索栏 */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.search-bar input, .search-bar select { padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; }

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

/* 模态框 */
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); z-index: 1000; display: flex; justify-content: center; align-items: center; }
.modal-box { background: #fff; border-radius: 8px; width: 520px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid #f0f0f0; }
.modal-header span { font-size: 16px; font-weight: 500; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #999; }
.modal-body { padding: 20px; }

/* 部署命令框 */
.cmd-box { background: #f6f8fa; border: 1px solid #e1e4e8; border-radius: 4px; padding: 12px; font-family: monospace; font-size: 12px; word-break: break-all; white-space: pre-wrap; position: relative; }
.cmd-copy { position: absolute; top: 8px; right: 8px; }

/* 提示消息 */
.toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); padding: 8px 20px; background: #333; color: #fff; border-radius: 4px; z-index: 2000; font-size: 13px; display: none; }
.toast.show { display: block; animation: fadeInOut 2s ease; }
@keyframes fadeInOut { 0% { opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } }

/* 空状态 */
.empty { text-align: center; padding: 40px; color: #999; }

/* 流水记录 */
.log-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f5f5f5; font-size: 12px; }
.log-item .log-action { color: #1890ff; }
.log-item .log-time { color: #999; }
.log-ok { color: #52c41a; }
.log-fail { color: #ff4d4f; }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { width: 100%; position: static; border-right: none; border-bottom: 1px solid #e8e8e8; }
  .content { margin-left: 0; }
  .main-layout { flex-direction: column; }
  .nav-list { display: flex; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
