:root {
    --primary: #00b894;
    --primary-dark: #009b7d;
    --primary-light: #ecfdf5;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #f0f2f5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
[v-cloak] { display: none !important; }
.auth-loading { position: fixed; inset: 0; background: #fff; display: flex; align-items: center; justify-content: center; z-index: 10000; flex-direction: column; gap: 12px; }
.loading-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; animation: dot-pulse 1s infinite ease-in-out; }
@keyframes dot-pulse { 0%, 100% { transform: scale(0.8); opacity: 0.5; } 50% { transform: scale(1.5); opacity: 1; } }
.el-message { z-index: 20000 !important; }

/* 登录 */
.login-wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#f0f2f5,#e4f7f2); z-index: 9999; padding: 20px; }
.login-box { background: #fff; border-radius: 16px; padding: 40px 28px; width: 100%; max-width: 360px; box-shadow: 0 4px 32px rgba(0,0,0,0.08); }
.logo-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; justify-content: center; }
.logo-icon { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg,#00b894,#00cec9); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; font-weight: bold; flex-shrink: 0; }
.logo-name { font-size: 18px; font-weight: 700; color: #1a1a2e; }
.logo-sub { font-size: 10px; color: var(--primary); font-weight: 600; letter-spacing: 1px; margin-top: 2px; }

/* 布局 */
.layout { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* 侧边栏 */
.sidebar { width: 220px; min-width: 220px; background: #fff; border-right: 1px solid #e4e7ed; display: flex; flex-direction: column; }
.sidebar-logo { padding: 18px 16px 14px; border-bottom: 1px solid #f0f2f5; display: flex; align-items: center; gap: 10px; }
.sidebar-logo .s-name { font-size: 15px; font-weight: 700; color: #1a1a2e; }
.sidebar-logo .s-desc { font-size: 10px; color: var(--primary); font-weight: 600; margin-top: 2px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 18px; font-size: 14px; color: #606266; cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent; }
.nav-item:hover { background: #f5f7fa; color: #303133; }
.nav-item.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.nav-icon-svg { width: 16px; height: 16px; flex-shrink: 0; fill: currentColor; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid #f0f2f5; text-align: center; }

/* 主区域 */
.main-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { height: 52px; min-height: 52px; background: #fff; border-bottom: 1px solid #e4e7ed; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; width: 36px; height: 36px; border-radius: 8px; background: #f5f7fa; border: none; cursor: pointer; align-items: center; justify-content: center; color: #606266; font-size: 24px; line-height: 1; }
.topbar-title { font-size: 15px; font-weight: 600; color: #303133; display: flex; align-items: center; gap: 8px; }
.topbar-title::before { content: ''; display: inline-block; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }
.user-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #606266; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#00b894,#00cec9); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: bold; }

/* 内容 */
.content { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.stat-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 10px; padding: 16px; border: 1px solid #e4e7ed; }
.stat-label { font-size: 11px; color: #909399; margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 700; color: #303133; }
.stat-value.green { color: var(--primary); }
.chart-card { background: #fff; border-radius: 10px; padding: 16px; border: 1px solid #e4e7ed; margin-bottom: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.card-title { font-size: 14px; font-weight: 600; color: #303133; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ''; display: inline-block; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }
.chart-box { height: 200px; }
.col-card-wrap { background: #fff; border-radius: 10px; padding: 16px; border: 1px solid #e4e7ed; }

/* 表单样式 */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 600; color: #303133; margin-bottom: 8px; display: block; }
.form-hint { font-size: 11px; color: #909399; margin-top: 4px; }

/* 全局检测样式 */
.check-all-result { background: #fff; border-radius: 10px; padding: 16px; border: 1px solid #e4e7ed; }
.check-all-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.check-all-title { font-size: 14px; font-weight: 600; color: #303133; display: flex; align-items: center; gap: 8px; }
.check-all-title::before { content: ''; display: inline-block; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }
.check-collection-item { background: #f5f7fa; border-radius: 8px; padding: 12px; margin-bottom: 12px; cursor: pointer; transition: all 0.2s; }
.check-collection-item:hover { background: #ecfdf5; }
.check-collection-header { display: flex; align-items: center; justify-content: space-between; }
.check-collection-name { font-size: 13px; font-weight: 600; color: #303133; }
.check-collection-stats { display: flex; gap: 16px; font-size: 12px; }
.check-stat { display: flex; align-items: center; gap: 4px; }
.check-stat-label { color: #909399; }
.check-stat-value { font-weight: 600; color: #303133; }
.check-stat-value.ok { color: var(--primary); }
.check-stat-value.fail { color: #f56c6c; }
.check-collection-expand { color: #909399; transition: transform 0.2s; }
.check-collection-expand.open { transform: rotate(180deg); }
.check-error-list { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e4e7ed; }
.check-error-list.show { display: block; }
.check-error-item { background: #fff; border-radius: 6px; padding: 10px; margin-bottom: 8px; border-left: 3px solid #f56c6c; }
.check-error-url { font-size: 11px; color: #606266; font-family: monospace; word-break: break-all; margin-bottom: 4px; }
.check-error-reason { font-size: 11px; color: #f56c6c; font-weight: 600; }

.api-link-text { flex: 1; min-width: 0; font-size: 12px; color: #409eff; font-family: monospace; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 4px 8px; background: #f0f8ff; border-radius: 4px; transition: background 0.2s; }
.api-link-text:hover { background: #d9ecff; }

/* 手机卡片 */
.mobile-list { display: none; }
.pc-table { display: block; margin-top: 12px; }
.m-card { border: 1px solid #e4e7ed; border-radius: 10px; padding: 14px; background: #fafafa; margin-top: 12px; }
.m-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.m-name { font-size: 15px; font-weight: 600; color: #303133; }
.m-id { font-size: 11px; color: #909399; margin-top: 2px; font-family: monospace; }
.m-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 12px; }
.m-stat { background: #fff; border-radius: 8px; padding: 8px; text-align: center; border: 1px solid #e4e7ed; }
.m-stat-label { font-size: 10px; color: #909399; margin-bottom: 4px; }
.m-stat-val { font-size: 16px; font-weight: 700; color: #303133; }
.m-stat-val.green { color: var(--primary); }
.m-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.m-actions .el-button { flex: 1; }
.m-api { background: #f5f7fa; border-radius: 8px; padding: 10px; }
.m-modes { display: flex; gap: 6px; margin-bottom: 8px; }
.mode-tag { cursor: pointer; border-radius: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; background: #fff; color: #909399; border: 1px solid #e4e7ed; transition: all 0.2s; user-select: none; }
.mode-tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.m-url { display: flex; align-items: center; gap: 8px; }
.m-url input { flex: 1; border: none; background: transparent; font-size: 11px; color: #409eff; font-family: monospace; outline: none; min-width: 0; cursor: pointer; }

/* 底部导航 */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #e4e7ed; padding-bottom: var(--safe-bottom); z-index: 100; }
.bn-inner { display: flex; }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; cursor: pointer; color: #909399; font-size: 11px; gap: 3px; transition: color 0.2s; }
.bn-item.active { color: var(--primary); }
.bn-icon-wrap { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.bn-icon-wrap svg { width: 22px; height: 22px; fill: currentColor; }
.bn-placeholder { display: none; height: calc(56px + var(--safe-bottom)); flex-shrink: 0; }

/* 抽屉遮罩 */
.drawer-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; }
.drawer-mask.show { display: block; }
.drawer { position: fixed; top: 0; left: -240px; bottom: 0; width: 240px; background: #fff; z-index: 201; transition: left 0.3s cubic-bezier(0.4,0,0.2,1); display: flex; flex-direction: column; box-shadow: 4px 0 16px rgba(0,0,0,0.1); }
.drawer.open { left: 0; }

/* 预览网格 */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; max-height: 55vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.preview-item { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f5f7fa; border: 1px solid #e4e7ed; cursor: pointer; transition: all 0.2s; }
.preview-item:hover { border-color: #00b894; box-shadow: 0 4px 12px rgba(0,184,148,0.1); }
.preview-item .el-image { width: 100%; height: 100%; }

@media (max-width: 768px) {
    /* 手机端预览图片留白，模拟缩小效果 */
    .el-image-viewer__canvas img {
        max-width: 85% !important;
        max-height: 85% !important;
    }
}

/* 体检项 */
.check-item { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-bottom: 1px solid #f0f2f5; gap: 12px; }
.check-url { flex: 1; font-size: 11px; color: #606266; font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.s-ok { background: #ecfdf5; color: #00b894; }
.s-fail { background: #fef2f2; color: #f56c6c; }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .menu-btn { display: flex; }
    .stat-cards { grid-template-columns: 1fr; }
    .pc-table { display: none; }
    .mobile-list { display: block; }
    .bottom-nav, .bn-placeholder { display: block; }
    .content { padding: 12px; }
    .el-overlay-dialog { display: flex; align-items: center; justify-content: center; }
    .el-dialog { width: 92% !important; margin: 0 !important; border-radius: 12px; }
}

/* 下拉列表样式微调 */
.chart-card .card-header .el-button + div div {
    text-align: center !important;
}
