/* ============ 奇斋 管理后台样式（webadmin 风格） ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: #1f2937; background: #f1f5f9; }

/* 登录页 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0f766e 0%, #115e59 55%, #1e293b 100%); }
.login-box { width: 360px; background: #fff; border-radius: 12px; padding: 40px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 24px; color: #111827; }
.login-box label { display: block; margin-bottom: 16px; font-size: 13px; color: #6b7280; }
.login-box input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; }
.login-box input:focus { outline: none; border-color: #12bd6b; box-shadow: 0 0 0 3px rgba(18,189,107,.15); }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #0f172a; flex-shrink: 0; }
.sidebar-logo { padding: 20px 16px; color: #fff; font-size: 16px; font-weight: 600; border-bottom: 1px solid #1e293b; }
.sidebar-nav a { display: block; padding: 13px 20px; color: #cbd5e1; text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.sidebar-nav a:hover { background: #16233a; color: #fff; }
.sidebar-nav a.active { background: #16233a; color: #fff; border-left-color: #12bd6b; }
.sidebar-nav .sidebar-group { padding: 16px 20px 6px; color: #64748b; font-size: 12px; letter-spacing: .5px; }
.sidebar-nav .sidebar-group:first-child { padding-top: 10px; }
.main { flex: 1; min-width: 0; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-user { color: #6b7280; font-size: 13px; }
.content { padding: 24px; }

/* 卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-num { font-size: 26px; font-weight: 700; color: #111827; }
.stat-num.warn { color: #ea580c; }
.stat-label { margin-top: 6px; color: #6b7280; font-size: 13px; }
.panel { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 24px; }
.panel h2 { font-size: 15px; margin-bottom: 16px; color: #111827; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table th { background: #f8fafc; color: #6b7280; font-weight: 600; font-size: 13px; white-space: nowrap; }
.table .empty { text-align: center; color: #9ca3af; padding: 32px; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: #6b7280; font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

/* 报价图片缩略图 */
.thumb-list { display: flex; align-items: center; gap: 6px; }
.thumb-sm { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }

/* 标签 / 按钮 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-gray { background: #e5e7eb; color: #4b5563; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.btn { display: inline-block; padding: 8px 16px; border: 1px solid #d1d5db; background: #fff; color: #374151; border-radius: 8px; cursor: pointer; font-size: 14px; text-decoration: none; }
.btn:hover { background: #f9fafb; }
.btn-primary { background: #12bd6b; border-color: #12bd6b; color: #fff; }
.btn-primary:hover { background: #0ea45c; }
.btn-danger { background: #fff; border-color: #fca5a5; color: #dc2626; }
.btn-block { display: block; width: 100%; }
.btn-small { padding: 4px 10px; font-size: 12px; }
.link { color: #12bd6b; text-decoration: none; margin-right: 8px; font-size: 13px; }
.link-danger { color: #dc2626; }
.ops { white-space: nowrap; }

/* 表单 */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.filter-form { display: flex; gap: 8px; align-items: center; }
.filter-form input, .filter-form select { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; }
.form-panel label { display: block; margin-bottom: 14px; color: #374151; font-size: 13px; }
.form-panel input[type=text], .form-panel input[type=number], .form-panel input[type=password], .form-panel select, .form-panel textarea {
    display: block; width: 100%; margin-top: 6px; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; font-family: inherit;
}
.form-panel input:focus, .form-panel select:focus, .form-panel textarea:focus { outline: none; border-color: #12bd6b; }
.form-panel h3 { font-size: 14px; color: #111827; margin: 20px 0 12px; padding-left: 8px; border-left: 3px solid #12bd6b; }
.form-panel h2 + .muted { margin-top: -8px; margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-actions { margin-top: 8px; display: flex; gap: 12px; }
.inline-form { display: flex; gap: 8px; }

/* 图片预览 */
.preview-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.preview-item { position: relative; width: 110px; height: 110px; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; display: block; }

/* 分页 */
.pagination { display: flex; gap: 6px; margin-top: 16px; justify-content: center; }
.page-item { padding: 6px 12px; border: 1px solid #e5e7eb; border-radius: 6px; color: #374151; text-decoration: none; font-size: 13px; }
.page-item.active { background: #12bd6b; border-color: #12bd6b; color: #fff; }

/* 提示 */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* 密钥查看切换 */
.secret-wrap { display: flex; align-items: center; gap: 6px; }
.secret-wrap input { flex: 1; }

/* 后台：测试接入 / 配置检测结果 */
.detect-row { display: flex; align-items: center; margin: 4px 0 8px; }
.detect-result { margin-left: 12px; font-size: 13px; color: #6b7280; }
.detect-ok { color: #15803d; }
.detect-fail { color: #b91c1c; }

/* 后台：视频本地上传 / 预览 */
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.upload-row input[type=file] { font-size: 13px; color: #374151; border: none; padding: 0; background: none; }
.upload-label { color: #374151; font-size: 13px; }
.video-preview-wrap { margin-top: 12px; }
.video-preview { width: 100%; max-width: 460px; border-radius: 10px; background: #000; display: block; }
.video-item .video-preview { margin-bottom: 14px; }

/* 复选框行（播放有声音 / 启用） */
.form-panel .check-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.form-panel .check-line input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }

/* 图表 */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding-top: 10px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.chart .bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, #12bd6b, #6ee7b7); border-radius: 6px 6px 0 0; min-height: 2px; transition: height .3s; }
.chart .bar-label { font-size: 12px; color: #6b7280; margin-top: 6px; }
.chart .bar-count { font-size: 12px; color: #0ea45c; margin-bottom: 4px; }
