/* ========================================
   Bee Repair — Premium UI Layer
   Operate 模式：高级感来自层次、图标、反馈动效，不挡任务。
   依赖 design-system.css 令牌。
   ======================================== */

/* ===== 氛围底 ===== */
.bee-atmosphere {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 50% at 8% -10%, rgba(37, 99, 235, 0.07), transparent 55%),
        radial-gradient(ellipse 50% 45% at 100% 100%, rgba(14, 165, 233, 0.05), transparent 50%),
        var(--bg-base, #f8fafc);
}

/* 氛围光斑：用大面积径向渐变代替 filter:blur，避免全屏持续滤镜合成 */
.bee-atmosphere::before,
.bee-atmosphere::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    opacity: 0.85;
    pointer-events: none;
}

.bee-atmosphere::before {
    top: -18%;
    left: -12%;
    width: min(56vw, 620px);
    height: min(56vw, 620px);
    background: radial-gradient(circle, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0.05) 42%, transparent 70%);
    animation: bee-orb-a 22s ease-in-out infinite alternate;
}

.bee-atmosphere::after {
    right: -14%;
    bottom: -18%;
    width: min(62vw, 720px);
    height: min(62vw, 720px);
    background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, rgba(14, 165, 233, 0.04) 42%, transparent 70%);
    animation: bee-orb-b 28s ease-in-out infinite alternate;
}

@keyframes bee-orb-a {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(4%, 6%) scale(1.06); }
}

@keyframes bee-orb-b {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-5%, -4%) scale(1.08); }
}

/* ===== 图标分割按钮（工单详情等） ===== */
.btn-icon-split {
    display: inline-flex !important;
    align-items: stretch;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 12px !important;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.15),
                box-shadow 0.22s ease;
}

.btn-icon-split .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.7rem;
    background: rgba(15, 23, 42, 0.08);
}

.btn-icon-split .text {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem 0.5rem 0.65rem;
    white-space: nowrap;
}

.btn-icon-split:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.btn-icon-split.btn-primary .icon,
.btn-icon-split.btn-info .icon,
.btn-icon-split.btn-danger .icon,
.btn-icon-split.btn-success .icon,
.btn-icon-split.btn-warning .icon {
    background: rgba(255, 255, 255, 0.18);
}

/* ===== 统一页头 ===== */
.bee-page-header {
    margin-bottom: 1.25rem;
}

.bee-page-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.15rem;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.32);
    transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.15),
                box-shadow 0.25s ease;
}

.bee-page-icon:hover {
    transform: scale(1.06) rotate(-4deg);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.4);
}

.bee-page-icon.success {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.3);
}

.bee-page-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 8px 22px rgba(245, 158, 11, 0.3);
}

/* ===== 内容区表面 ===== */
.content-wrapper {
    position: relative;
}

.content-container {
    border-radius: var(--radius-lg, 16px);
    background: transparent;
}

/* 页面工具条：列表页顶部操作区 */
.content-container > .d-flex.justify-content-between,
.content-container > .page-toolbar,
.page-toolbar {
    gap: 0.75rem;
    margin-bottom: 1.25rem !important;
    align-items: center;
}

.content-container > h2,
.content-container > h3,
.content-container > .page-title {
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--text-main);
}

/* ===== 图标井（统一图标容器） ===== */
.bee-icon-well,
.metric-icon,
.g-icon,
.ql-icon,
.apt-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary);
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: transform var(--transition-base, 0.25s ease),
                background var(--transition-fast, 0.15s ease),
                box-shadow var(--transition-base, 0.25s ease),
                color var(--transition-fast, 0.15s ease);
}

/* KPI 图标只补齐布局，颜色/渐变交给页面 .ic-* 覆盖 */
.kpi-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--transition-base, 0.25s ease),
                box-shadow var(--transition-base, 0.25s ease);
}

.bee-icon-well.lg,
.kpi-icon.lg {
    width: 3rem;
    height: 3rem;
    border-radius: 16px;
    font-size: 1.15rem;
}

.bee-icon-well.sm {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    font-size: 0.85rem;
}

.bee-icon-well.success { background: var(--success-bg); color: var(--success); }
.bee-icon-well.warning { background: var(--warning-bg); color: #b45309; }
.bee-icon-well.danger  { background: var(--danger-bg); color: var(--danger); }
.bee-icon-well.info    { background: var(--info-bg); color: #0369a1; }
.bee-icon-well.neutral { background: var(--bg-muted); color: var(--text-muted); }

.bee-icon-well i,
.kpi-icon i,
.metric-icon i,
.g-icon i,
.ql-icon i,
.apt-icon i,
.empty-icon i {
    line-height: 1;
    transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* ===== 侧栏图标井（兼容指示条选中态） ===== */
.sidebar .nav-link .sidebar-icon {
    width: 1.85rem;
    height: 1.85rem;
    min-width: 1.85rem;
    border-radius: 10px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: inherit;
    font-size: 0.95rem;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.15),
                background 0.2s ease, color 0.2s ease, box-shadow 0.25s ease;
}

.sidebar:hover .nav-link .sidebar-icon,
.sidebar:focus-within .nav-link .sidebar-icon,
.sidebar.show .nav-link .sidebar-icon {
    background: rgba(148, 163, 184, 0.12);
}

.sidebar .nav-link:hover .sidebar-icon {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14);
}

.sidebar .nav-link.bg-primary .sidebar-icon,
.sidebar .nav-link.active .sidebar-icon {
    background: rgba(37, 99, 235, 0.14) !important;
    color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.sidebar .nav-link {
    letter-spacing: -0.01em;
}

/* ===== 顶栏精修 ===== */
.app-header-light,
.app-header {
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.03) !important;
}

.navbar-brand .brand-text-main {
    letter-spacing: -0.03em;
    font-weight: 750;
}

.app-menu-button {
    border-radius: 12px !important;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
}

.app-menu-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

/* ===== 卡片高级态 ===== */
.card:not(.no-glass),
.card-clean,
.glass-panel {
    position: relative;
}

.card:not(.no-glass)::after,
.card-clean::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 42%);
    opacity: 0.55;
}

.card-header,
.glass-panel .panel-header {
    position: relative;
    z-index: 1;
}

.card-body,
.glass-panel .panel-body {
    position: relative;
    z-index: 1;
}

/* ===== 表格高级态 ===== */
.table thead th {
    text-transform: none;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.table tbody tr {
    transition: background-color 0.18s ease, box-shadow 0.2s ease;
}

.table-hover tbody tr {
    cursor: default;
}

.table-hover tbody tr:hover {
    background: rgba(37, 99, 235, 0.035) !important;
}

.table-hover tbody tr.bee-row-link:hover,
.table tbody tr[data-href]:hover {
    cursor: pointer;
}

/* 操作列按钮组更紧凑高级 */
.table .btn-sm {
    border-radius: 9px;
}

.table .btn-group .btn {
    transition: transform 0.15s ease, background 0.15s ease;
}

.table .btn-group .btn:hover {
    z-index: 2;
    transform: translateY(-1px);
}

/* ===== 表单高级态 ===== */
.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
    border-color: #94a3b8;
}

.form-control:focus,
.form-select:focus {
    transform: translateZ(0);
}

.input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    border-radius: var(--radius-md);
}

.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
    box-shadow: none !important;
}

/* ===== Badge / 状态点 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    vertical-align: middle;
}

.bee-status-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: currentColor;
    display: inline-block;
    flex-shrink: 0;
}

.badge.bee-live .bee-status-dot,
.bee-live-dot {
    animation: bee-live-pulse 1.8s ease-out infinite;
}

@keyframes bee-live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
    70%  { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* ===== Alert：仅「带图标槽」的提示走 flex，避免与 Bootstrap
   alert-dismissible（绝对定位关闭钮）冲突导致文案逐字错乱换行 ===== */
.alert {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.alert:has(.bee-alert-icon) {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert.bee-flash-alert {
    align-items: center;
}

.alert .bee-alert-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.55);
    margin-top: 0.05rem;
}

/* 非 dismissible 的图标提示：关闭钮参与 flex 排布 */
.alert:has(.bee-alert-icon):not(.alert-dismissible) .btn-close {
    margin-left: auto;
    align-self: center;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    width: 4rem !important;
    height: 4rem !important;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
    border-radius: 20px !important;
    background: linear-gradient(145deg, var(--primary-light), #fff);
    color: var(--primary);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.empty-state h4,
.empty-state .empty-title {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

/* ===== Pagination ===== */
.pagination .page-link {
    border-radius: 10px !important;
    margin: 0 0.15rem;
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-weight: 500;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pagination .page-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

/* ===== Dropdown ===== */
.dropdown-menu {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.04);
    padding: 0.4rem;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    background: rgba(255, 255, 255, 0.96);
}

.dropdown-item {
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--primary-light);
    color: var(--primary);
}

.dropdown-item i {
    width: 1.15rem;
    text-align: center;
    margin-right: 0.45rem;
    opacity: 0.85;
}

/* ===== KPI / 统计卡通用抬升 ===== */
.kpi-card,
.metric-card,
.stat-card {
    transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.15),
                box-shadow 0.28s ease,
                border-color 0.2s ease;
}

.kpi-card:hover,
.metric-card:hover,
.stat-card:hover {
    transform: translateY(-3px);
}

.kpi-card:hover .kpi-icon,
.metric-card:hover .metric-icon,
.stat-card:hover .bee-icon-well {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

/* ===== 列表页过滤器条 ===== */
.filter-bar,
.filters-card,
.search-toolbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

/* ===== 骨架屏（加载态） ===== */
.bee-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
    background-size: 400% 100%;
    animation: bee-shimmer 1.35s ease infinite;
    border-radius: 8px;
    color: transparent !important;
}

@keyframes bee-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* ===== 登录与独立页兼容 ===== */
body.auth-page .bee-atmosphere::before {
    opacity: 1;
}

/* 页签隐藏时暂停光斑（由 ui-enhancements 切换 .is-paused） */
.bee-atmosphere.is-paused::before,
.bee-atmosphere.is-paused::after {
    animation-play-state: paused !important;
}

/* ===== 减少动效 ===== */
@media (prefers-reduced-motion: reduce) {
    .bee-atmosphere::before,
    .bee-atmosphere::after {
        animation: none !important;
    }
    .bee-live-dot,
    .badge.bee-live .bee-status-dot,
    .bee-skeleton {
        animation: none !important;
    }
}

/* 移动端 / 弱网：静态氛围，零动画开销 */
@media (max-width: 768px) {
    .bee-atmosphere::before,
    .bee-atmosphere::after {
        opacity: 0.55;
        animation: none !important;
    }
}

@media (prefers-reduced-data: reduce) {
    .bee-atmosphere::before,
    .bee-atmosphere::after {
        display: none;
    }
}
