/* ================================================================
 * 共享样式文件 - 所有业务页面引用此文件
 * 规范：所有全局样式统一在此管理
 * ================================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 50%, #f5f8ff 100%);
    min-height: 100vh;
    color: #1f2937;
}

* { transition: all 0.24s ease; }

/* 磨砂玻璃卡片 */
.glass-card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(22, 93, 255, 0.06);
}
.glass-card:hover {
    box-shadow: 0 8px 32px rgba(22, 93, 255, 0.12);
    border-color: rgba(22, 93, 255, 0.15);
}

/* 磨砂导航栏 */
.glass-nav {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(22, 93, 255, 0.08);
}

/* 按钮样式 */
.btn-primary {
    background: #165DFF; color: #fff; border-radius: 10px;
    padding: 10px 20px; font-weight: 600; border: none;
    cursor: pointer; display: inline-flex; align-items: center;
    gap: 6px; box-shadow: 0 4px 14px rgba(22, 93, 255, 0.3);
}
.btn-primary:hover {
    background: #0d47e1; box-shadow: 0 6px 20px rgba(22, 93, 255, 0.4);
    transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background: rgba(22, 93, 255, 0.08); color: #165DFF; border-radius: 10px;
    padding: 10px 20px; font-weight: 600; border: 1px solid rgba(22, 93, 255, 0.2);
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { background: rgba(22, 93, 255, 0.12); }

.ai-btn {
    background: linear-gradient(135deg, #165DFF 0%, #7c3aed 100%);
    color: #fff; border-radius: 10px; padding: 10px 18px; font-weight: 600;
    border: none; cursor: pointer; display: inline-flex; align-items: center;
    gap: 6px; box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}
.ai-btn:hover { box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45); transform: translateY(-1px); }
.ai-btn:active { transform: scale(0.98); }
.ai-btn.hidden { display: none !important; }

.btn-danger {
    background: #fee2e2; color: #dc2626; border-radius: 10px;
    padding: 10px 20px; font-weight: 600; border: 1px solid #fecaca; cursor: pointer;
}
.btn-danger:hover { background: #fecaca; }

.hover-glow:hover { box-shadow: 0 0 20px rgba(22, 93, 255, 0.25); }

/* 表格 */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th {
    background: rgba(22, 93, 255, 0.04); padding: 12px 16px;
    text-align: left; font-weight: 600; color: #4b5563; font-size: 13px;
    border-bottom: 2px solid rgba(22, 93, 255, 0.08);
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(22, 93, 255, 0.03); }

/* 表单输入 */
input[type="text"], input[type="number"], input[type="email"], input[type="tel"],
input[type="date"], input[type="password"], textarea, select {
    border: 1.5px solid #e5e7eb; border-radius: 10px; padding: 10px 14px;
    width: 100%; background: rgba(255, 255, 255, 0.9); color: #1f2937;
    font-size: 14px; outline: none; transition: all 0.2s;
}
input:focus, textarea:focus, select:focus {
    border-color: #165DFF; box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1); background: #fff;
}

/* 标签徽章 */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; gap: 4px; }
.badge-blue   { background: rgba(22, 93, 255, 0.1); color: #165DFF; }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-orange { background: #ffedd5; color: #ea580c; }
.badge-purple { background: #f3e8ff; color: #9333ea; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }

/* Toast */
#toast {
    position: fixed; top: 80px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #1f2937; color: #fff; padding: 12px 24px; border-radius: 12px;
    font-size: 14px; font-weight: 500; z-index: 99999; opacity: 0;
    pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,0.2); white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { background: #065f46; }
#toast.error   { background: #991b1b; }
#toast.warning { background: #92400e; }

/* 分页 */
.pagination-btn {
    min-width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid #e5e7eb;
    background: #fff; color: #374151; font-size: 14px; display: inline-flex;
    align-items: center; justify-content: center; cursor: pointer; padding: 0 10px;
}
.pagination-btn:hover { border-color: #165DFF; color: #165DFF; }
.pagination-btn.active { background: #165DFF; border-color: #165DFF; color: #fff; font-weight: 600; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 模态框 */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px);
    position: fixed; inset: 0; z-index: 100; display: flex;
    align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
    background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,0.15);
    width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
}
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid #f3f4f6; display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px 20px; border-top: 1px solid #f3f4f6; display: flex; gap: 12px; justify-content: flex-end; }

/* AI故障提示条 */
#ai-error-bar { display: none; background: linear-gradient(90deg, #dc2626, #b91c1c); color: #fff; padding: 8px 16px; text-align: center; font-size: 13px; font-weight: 500; position: sticky; top: 0; z-index: 200; }
#ai-error-bar.show { display: block; }

/* 加载动画 */
.loading-spinner { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 趋势图 */
.chart-bar { border-radius: 4px 4px 0 0; background: linear-gradient(to top, #165DFF, #60a5fa); min-height: 4px; transition: height 0.4s ease; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(22,93,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(22,93,255,0.4); }

/* 空状态 */
.empty-state { text-align: center; padding: 48px 24px; color: #9ca3af; }
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* 数字 */
.stat-num { font-variant-numeric: tabular-nums; }

/* Alpine cloak（配合 x-cloak 使用，加载前隐藏元素） */
[x-cloak] { display: none !important; }
.stat-num { font-variant-numeric: tabular-nums; }

/* 标签芯片 */
.tag-chip { display: inline-flex; padding: 2px 10px; border-radius: 20px; font-size: 11px; background: rgba(22, 93, 255, 0.08); color: #165DFF; margin: 2px; }
