/* EdgeBrain Cloud - 全局样式 */

/* ===== 重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background: #f1f5f9;
    color: #1A2426;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
code { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12px; background: #f1f5f9; padding: 2px 6px; border-radius: 3px; color: #475569; }

/* ===== 登录页 ===== */
body.login-page { background: linear-gradient(135deg, #152023 0%, #0F6878 50%, #1B9BA8 100%); min-height: 100vh; overflow: hidden; }
.login-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.login-bg-shape { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; }
.login-bg-shape.shape-1 { width: 500px; height: 500px; background: #0F6878; top: -100px; left: -100px; animation: float 20s infinite ease-in-out; }
.login-bg-shape.shape-2 { width: 400px; height: 400px; background: #1B9BA8; bottom: -100px; right: -100px; animation: float 25s infinite ease-in-out reverse; }
.login-bg-shape.shape-3 { width: 300px; height: 300px; background: #1B9BA8; top: 50%; left: 50%; transform: translate(-50%, -50%); animation: float 18s infinite ease-in-out; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(30px, -30px) scale(1.1); } 66% { transform: translate(-20px, 20px) scale(0.9); } }

.login-container {
    position: relative; z-index: 1; background: rgba(255,255,255,0.98); backdrop-filter: blur(20px);
    border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,0.4); padding: 40px 36px;
    width: 100%; max-width: 440px; margin: auto; position: relative;
    display: flex; flex-direction: column; min-height: 100vh; justify-content: center; max-height: 720px;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.login-brand h1 { font-size: 26px; color: #152023; margin-bottom: 6px; font-weight: 700; letter-spacing: -0.5px; }
.login-brand p { color: #64748b; font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: #334155; font-size: 13px; font-weight: 500; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 12px; color: #94a3b8; display: inline-flex; pointer-events: none; transition: color 0.2s; }
.input-wrapper input { width: 100%; padding: 11px 12px 11px 38px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 14px; transition: all 0.2s; background: #fff; color: #152023; }
.input-wrapper input:focus { outline: none; border-color: #0F6878; box-shadow: 0 0 0 4px rgba(15,104,120,0.12); }
.input-wrapper.focused .input-icon { color: #0F6878; }
.btn-login { margin-top: 8px; padding: 12px; background: linear-gradient(135deg, #0F6878 0%, #0B5562 100%); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 12px rgba(15,104,120,0.3); }
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15,104,120,0.4); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-msg { color: #B73A3A; font-size: 13px; min-height: 18px; text-align: center; }
.login-features { margin-top: 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 16px; background: #f8fafc; border-radius: 12px; }
.feature-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: #475569; }
.feature-icon { font-size: 22px; }
.login-footer { margin-top: 24px; text-align: center; color: #94a3b8; font-size: 12px; }

/* ===== 管理控制台布局 ===== */
body.admin-page { background: #f1f5f9; }
.app { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: 240px; background: linear-gradient(180deg, #1A2426 0%, #152023 100%); color: #A7B6B9;
    display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; transition: width 0.25s;
}
.app.collapsed .sidebar { width: 64px; }
.app.collapsed .logo-text, .app.collapsed .nav-item span:not(.icon), .app.collapsed .user-meta, .app.collapsed .btn-logout { display: none; }
.app.collapsed .nav-item { justify-content: center; padding: 12px; }
.app.collapsed .user-info { justify-content: center; }
.logo-area { padding: 18px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.logo-icon { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, #0F6878, #1B9BA8); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 12px rgba(15,104,120,0.4); }
.logo-text h2 { color: #fff; font-size: 15px; font-weight: 600; }
.logo-text span { color: #94a3b8; font-size: 11px; }
.nav-menu { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-section { margin-top: 8px; padding: 8px 12px 4px; font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.app.collapsed .nav-section { display: none; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: #A7B6B9; text-decoration: none; border-radius: 6px; margin-bottom: 2px; cursor: pointer; font-size: 14px; transition: all 0.15s; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, #0F6878, #0B5562); color: #fff; box-shadow: 0 2px 8px rgba(15,104,120,0.3); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #0F6878, #1B9BA8); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.user-meta { overflow: hidden; }
.username { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role { color: #94a3b8; font-size: 11px; }
.btn-logout { width: 100%; padding: 8px; background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); border-radius: 6px; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.15s; }
.btn-logout:hover { background: rgba(239,68,68,0.2); color: #fff; }

/* 主区域 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar { background: #fff; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 10; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle { width: 36px; height: 36px; border: none; background: transparent; color: #64748b; cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.menu-toggle:hover { background: #f1f5f9; color: #152023; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: #152023; }
.crumb-icon { font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-btn { width: 34px; height: 34px; border: 1px solid #e2e8f0; background: #fff; color: #64748b; cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.topbar-btn:hover { background: #f8fafc; color: #152023; border-color: #A7B6B9; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: #dcfce7; color: #166534; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-badge.warn { background: #fef3c7; color: #92400e; }
.status-badge.err { background: #fee2e2; color: #991b1b; }
.status-badge .dot { width: 6px; height: 6px; background: #16a34a; border-radius: 50%; animation: pulse 2s infinite; }
.status-badge.warn .dot { background: #E8912D; }
.status-badge.err .dot { background: #D64545; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.time { color: #64748b; font-size: 12px; font-variant-numeric: tabular-nums; }

/* 内容区 */
.content { flex: 1; padding: 20px 24px; overflow-y: auto; }
.card { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: #152023; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-title-text { display: flex; align-items: center; gap: 8px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); position: relative; overflow: hidden; transition: all 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #0F6878, #1B9BA8); }
.stat-card.green::before { background: linear-gradient(90deg, #2E9E7B, #1F7A5C); }
.stat-card.purple::before { background: linear-gradient(90deg, #1B9BA8, #0F6878); }
.stat-card.orange::before { background: linear-gradient(90deg, #E8912D, #C67A1F); }
.stat-card.red::before { background: linear-gradient(90deg, #D64545, #B73A3A); }
.stat-label { color: #64748b; font-size: 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 700; color: #152023; font-variant-numeric: tabular-nums; }
.stat-meta { color: #94a3b8; font-size: 11px; margin-top: 4px; }
.stat-icon { position: absolute; right: 16px; top: 16px; font-size: 28px; opacity: 0.2; }

/* 按钮 */
.btn { padding: 7px 14px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.15s; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #0F6878; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2563eb; }
.btn-secondary { background: #fff; color: #475569; border-color: #e2e8f0; }
.btn-secondary:hover:not(:disabled) { background: #f8fafc; border-color: #A7B6B9; }
.btn-danger { background: #D64545; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #B73A3A; }
.btn-success { background: #2E9E7B; color: #fff; }
.btn-success:hover:not(:disabled) { background: #1F7A5C; }
.btn-warning { background: #E8912D; color: #fff; }
.btn-warning:hover:not(:disabled) { background: #C67A1F; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 7px; font-size: 11px; }
.btn-icon { padding: 6px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th { background: #f8fafc; padding: 10px 12px; text-align: left; font-size: 12px; color: #64748b; font-weight: 600; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
table tbody tr:hover { background: #f8fafc; }
table .actions { white-space: nowrap; }
table .actions .btn { margin-right: 4px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.tag-blue { background: #dbeafe; color: #0B5562; }
.tag-green { background: #dcfce7; color: #166534; }
.tag-red { background: #fee2e2; color: #991b1b; }
.tag-yellow { background: #fef3c7; color: #92400e; }
.tag-gray { background: #e2e8f0; color: #475569; }
.tag-purple { background: #ede9fe; color: #5b21b6; }
.tag-cyan { background: #cffafe; color: #155e75; }
.tag-pink { background: #fce7f3; color: #9f1239; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 180px; padding: 7px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; transition: all 0.15s; background: #fff; }
.search-input:focus { outline: none; border-color: #0F6878; box-shadow: 0 0 0 3px rgba(15,104,120,0.1); }
.filter-select { padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; background: #fff; cursor: pointer; min-width: 120px; }
.filter-select:focus { outline: none; border-color: #0F6878; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.pagination button { padding: 5px 10px; border: 1px solid #e2e8f0; background: #fff; border-radius: 4px; cursor: pointer; font-size: 12px; transition: all 0.15s; }
.pagination button:hover:not(:disabled) { background: #f1f5f9; }
.pagination button.active { background: #0F6878; color: #fff; border-color: #0F6878; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .info { padding: 5px 10px; color: #64748b; font-size: 12px; }

/* 空状态 */
.empty-state { text-align: center; padding: 48px 20px; color: #94a3b8; }
.empty-state .icon { font-size: 48px; margin-bottom: 10px; opacity: 0.6; }
.empty-state .text { font-size: 13px; }

/* 加载 */
.loading { text-align: center; padding: 60px 20px; color: #94a3b8; }
.loading-spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid #e2e8f0; border-top-color: #0F6878; border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 10px; }

/* 模态框 */
.modal { position: fixed; inset: 0; z-index: 1000; }
.modal-overlay { position: absolute; inset: 0; background: rgba(15,23,42,0.5); backdrop-filter: blur(4px); animation: fadeIn 0.2s; }
.modal-container { position: relative; background: #fff; border-radius: 12px; max-width: 560px; width: calc(100% - 32px); margin: 60px auto; max-height: calc(100vh - 120px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,0.3); animation: slideDown 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #94a3b8; width: 30px; height: 30px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.modal-close:hover { background: #f1f5f9; color: #152023; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; gap: 8px; }

/* 抽屉 */
.drawer { position: fixed; inset: 0; z-index: 1000; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(15,23,42,0.4); animation: fadeIn 0.2s; }
.drawer-container { position: absolute; top: 0; right: 0; bottom: 0; width: 480px; max-width: 90vw; background: #fff; display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0,0,0,0.1); animation: slideLeft 0.25s; }
@keyframes slideLeft { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-header { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
.drawer-header h3 { font-size: 16px; font-weight: 600; }
.drawer-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #94a3b8; width: 30px; height: 30px; border-radius: 4px; }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 5px; color: #334155; font-size: 13px; font-weight: 500; }
.form-row label .required { color: #D64545; }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; transition: all 0.15s; background: #fff; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: #0F6878; box-shadow: 0 0 0 3px rgba(15,104,120,0.1); }
.form-row textarea { min-height: 70px; resize: vertical; font-family: inherit; }
.form-row .hint { color: #94a3b8; font-size: 11px; margin-top: 4px; }
.form-row .error { color: #D64545; font-size: 11px; margin-top: 4px; }
.info-tip { padding: 10px 12px; background: #f0f9ff; border-left: 3px solid #0F6878; border-radius: 4px; color: #475569; font-size: 12px; line-height: 1.6; margin: 10px 0; }
.warn-tip { padding: 10px 12px; background: #fef3c7; border-left: 3px solid #E8912D; border-radius: 4px; color: #92400e; font-size: 12px; line-height: 1.6; margin: 10px 0; }

/* Toast */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast { padding: 12px 16px; background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); border-left: 4px solid #0F6878; font-size: 13px; animation: slideInRight 0.2s; display: flex; align-items: flex-start; gap: 8px; }
.toast.success { border-left-color: #2E9E7B; }
.toast.error { border-left-color: #D64545; }
.toast.warning { border-left-color: #E8912D; }
.toast .toast-icon { font-size: 16px; flex-shrink: 0; }
.toast .toast-msg { flex: 1; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e2e8f0; margin-bottom: 16px; }
.tab { padding: 8px 16px; cursor: pointer; font-size: 13px; color: #64748b; border-bottom: 2px solid transparent; transition: all 0.15s; margin-bottom: -1px; }
.tab:hover { color: #152023; }
.tab.active { color: #0F6878; border-bottom-color: #0F6878; font-weight: 500; }

/* 详情字段 */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-label { color: #94a3b8; font-size: 11px; }
.detail-value { color: #152023; font-size: 13px; word-break: break-all; }
.detail-full { grid-column: 1 / -1; }

/* 进度条 */
.progress { background: #e2e8f0; border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #0F6878, #1B9BA8); transition: width 0.3s; }

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { width: 64px; }
    .logo-text, .nav-item span:not(.icon), .user-meta, .btn-logout, .nav-section { display: none; }
    .nav-item { justify-content: center; }
    .user-info { justify-content: center; }
    .content { padding: 14px; }
    .topbar { padding: 10px 14px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .login-features { grid-template-columns: repeat(2, 1fr); }
    .modal-container { margin: 20px auto; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #A7B6B9; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 工具类 */
.muted { color: #94a3b8; font-size: 12px; }
.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; }
.flex { display: flex; } .flex-1 { flex: 1; } .gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.text-sm { font-size: 12px; } .text-lg { font-size: 16px; }
.text-success { color: #2E9E7B; } .text-danger { color: #D64545; } .text-warning { color: #E8912D; }
.hidden { display: none !important; }
.copyable { cursor: pointer; user-select: all; }
.copyable:hover { background: #f1f5f9; }
