/* === 自包含样式：断网可运行；响应式 === */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; color: #222; background: #f5f7fa; line-height: 1.6; }
a { color: #1e6fff; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* === 通用卡片 === */
.card { background: #fff; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.06); padding: 24px; margin-bottom: 16px; }
.card h2, .card h3 { color: #222; margin-bottom: 16px; }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #eee; }

/* === 按钮 === */
.btn { display: inline-block; min-height: 44px; line-height: 44px; padding: 0 20px; border-radius: 4px; border: 1px solid transparent; cursor: pointer; font-size: 14px; text-decoration: none; transition: all .2s ease; }
.btn-primary { background: #1e6fff; color: #fff; }
.btn-primary:hover { background: #1557d0; text-decoration: none; }
.btn-secondary { background: #fff; color: #1e6fff; border-color: #1e6fff; }
.btn-secondary:hover { background: #f0f6ff; text-decoration: none; }
.btn-danger { background: #f56c6c; color: #fff; }
.btn-danger:hover { background: #e84242; text-decoration: none; }
.btn-sm { min-height: 32px; line-height: 32px; padding: 0 12px; font-size: 12px; }

/* === 表单 === */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 14px; color: #555; margin-bottom: 6px; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=number], .form-row input[type=datetime-local], .form-row select, .form-row textarea {
    width: 100%; min-height: 44px; padding: 8px 12px; font-size: 14px; border: 1px solid #ddd; border-radius: 4px; background: #fff; transition: border-color .2s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: #1e6fff; }
.form-row textarea { min-height: 88px; }
.form-row .hint { font-size: 12px; color: #888; margin-top: 4px; }
.form-row .error { font-size: 12px; color: #f56c6c; margin-top: 4px; }
.form-actions { margin-top: 24px; }

/* === 表格 === */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th { background: #f5f7fa; text-align: left; padding: 12px; font-size: 13px; color: #555; font-weight: 600; border-bottom: 1px solid #eee; }
.table td { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.table tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; }

/* === 提示 === */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.alert-ok { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-err { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

/* === 后台布局 === */
.admin-wrap { min-height: 100vh; }
.admin-topbar { background: #1e6fff; color: #fff; height: 56px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.admin-topbar .brand { font-size: 16px; font-weight: 600; color: #fff; }
.admin-topbar a { color: #fff; margin-left: 16px; font-size: 14px; }
.admin-body { display: flex; min-height: calc(100vh - 56px); }
.admin-side { width: 220px; background: #fff; border-right: 1px solid #eee; padding: 16px 0; flex-shrink: 0; }
.admin-side a { display: block; padding: 12px 24px; color: #555; font-size: 14px; }
.admin-side a:hover { background: #f5f7fa; text-decoration: none; }
.admin-side a.active { background: #e8f0ff; color: #1e6fff; border-right: 3px solid #1e6fff; font-weight: 600; }
.admin-main { flex: 1; padding: 24px; min-width: 0; }

/* === 前台布局 === */
.front-wrap { max-width: 720px; margin: 60px auto; padding: 0 16px; }
.front-header { text-align: center; margin-bottom: 32px; }
.front-header .logo { font-size: 32px; font-weight: 700; color: #1e6fff; margin-bottom: 8px; }
.front-header .desc { color: #888; font-size: 14px; }

/* === 统计卡片 === */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.stat-card .label { color: #888; font-size: 13px; margin-bottom: 8px; }
.stat-card .num { font-size: 28px; font-weight: 700; color: #1e6fff; }
.stat-card.warn .num { color: #f56c6c; }
.stat-card.ok .num { color: #67c23a; }

/* === SVG 图表 === */
.chart-svg { display: block; max-width: 100%; height: auto; }

/* === 验证码 === */
.captcha { display: inline-block; vertical-align: middle; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; }

/* === 安装向导 === */
.install-wrap { max-width: 640px; margin: 40px auto; padding: 0 16px; }
.install-step { background: #f5f7fa; border-radius: 4px; padding: 8px 16px; margin-bottom: 8px; display: flex; align-items: center; }
.install-step .num { width: 24px; height: 24px; line-height: 24px; text-align: center; background: #ddd; color: #fff; border-radius: 50%; margin-right: 12px; font-size: 12px; }
.install-step.active .num { background: #1e6fff; }
.install-step.done .num { background: #67c23a; }
.install-step .label { font-size: 14px; }

/* === 响应式 === */
@media (max-width: 768px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .admin-body { flex-direction: column; }
    .admin-side { width: 100%; border-right: none; border-bottom: 1px solid #eee; display: flex; overflow-x: auto; padding: 8px 0; }
    .admin-side a { white-space: nowrap; padding: 8px 16px; border-right: none; border-bottom: 3px solid transparent; }
    .admin-side a.active { border-bottom: 3px solid #1e6fff; border-right: none; }
    .admin-main { padding: 16px; }
    .front-wrap { margin: 24px auto; }
}
@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .table { font-size: 12px; }
    .table th, .table td { padding: 8px; }
}

/* === 工具类 === */
.text-muted { color: #888; }
.text-success { color: #67c23a; }
.text-danger { color: #f56c6c; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.row-flex { display: flex; gap: 16px; flex-wrap: wrap; }
.col-2 { flex: 1 1 200px; }
.badge { display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 10px; background: #f0f0f0; color: #555; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warn { background: #fff8e1; color: #ef6c00; }
.badge-danger { background: #ffebee; color: #c62828; }
