/* ============================================
   common.css — KVM管理平台 公共样式
   字体 / reset / 变量 / header / nav / footer / 通知 / 布局
   ============================================ */

/* --- Local Fonts --- */
@import url('../fonts/fontawesome/all.min.css');
@import url('../fonts/inter/inter.css');

/* --- Reset & Variables --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --cyan: #06b6d4;
    --bg-body: #f3f4f6;
    --bg-card: #fff;
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e5e7eb;
    --radius-card:4px;
}
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', "Microsoft YaHei", system-ui, sans-serif;
    min-height: 100vh;
}

/* ============================================
   Header
   ============================================ */
.header-a {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    padding: 0;
    box-shadow: 0 2px 12px rgba(30, 58, 138, 0.3);
    position: relative;
    z-index: 100;
}
.header-a .hd-row-top {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 16px; padding: 14px 24px 10px;
}
.header-a .hd-row-bottom {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 10px; padding: 0 24px 6px; min-height: 46px;
}
.brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Header Icon Button (铃铛) --- */
.header-icon-btn {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s;
    position: relative;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.22); }

/* --- Bell Dot (红/绿提示点) --- */
.bell-dot {
    display: none;
    position: absolute;
    top: 4px; right: 4px;
    width: 8px; height: 8px;
    border-radius: 50%;
    border: none;
}
.bell-dot-red {
    display: block;
    background: #ef4444;
}
.bell-dot-green {
    display: block;
    background: #10b981;
}

/* ============================================
   Nav Menu
   ============================================ */
.nav-menu a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    padding: 8px 14px;
    border-radius:4px;
    font-size: 0.86rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    white-space: nowrap;
}
.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    padding: 8px 14px;
    font-weight: 600;
    border-radius:4px;
}

/* ============================================
   Dropdown (通用下拉)
   ============================================ */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
}

/* 下拉菜单基础 */
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    background: white;
    border-radius:4px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    width: 95px; min-width: 95px;
    z-index: 1000;
}

/* 主导航下拉：居中对齐 */
.nav-menu .nav-dropdown-menu {
    left: 50%;
    transform: translateX(-50%);
}

/* 齿轮 / 管理员下拉：右对齐 */
/* hover 穿透区 */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover { display: block; }

/* 下拉链接：无下划线、无图标、左对齐 */
.nav-dropdown-menu a {
    color: #475569 !important;
    text-decoration: none !important;
    padding: 9px 18px !important;
    border-radius: 0 !important;
    font-size: 0.82rem !important;
    display: block;
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover {
    background: #f1f5f9 !important;
    color: #3b82f6 !important;
}
.nav-dropdown-menu a.danger-link {
    color: #ef4444 !important;
}
.nav-dropdown-menu a.danger-link:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}


/* --- 管理员下拉定位 --- */
.admin-menu {
    right: -20px;
    left: auto;
    transform: none;
    width: 85px;
    min-width: 85px;
    border-radius:4px;
}
.admin-menu a {
    display: flex !important;
    align-items: center;
    gap: 8px;
}
.dropdown-divider {
    border-top: 1px solid #f1f5f9;
    margin: 4px 0;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* --- 齿轮按钮 --- */
.gear-btn {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s;
    padding: 0 !important;
    text-decoration: none !important;
}
.gear-btn:hover { background: rgba(255,255,255,0.22); }
.gear-btn i { color: white; font-size: 15px; }

/* --- 管理员按钮 --- */
.admin-pill {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s;
}
.admin-pill:hover { background: rgba(255,255,255,0.22); }

/* ============================================
   通知中心面板
   ============================================ */
.notify-panel {
    display: none;
    position: fixed;
    top: 70px;
    right: 24px;
    width: 340px;
    max-height: 420px;
    background: white;
    border-radius:4px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    z-index: 9999;
    overflow: hidden;
    animation: notifySlideIn 0.2s ease;
}
.notify-panel.open { display: block; }
@keyframes notifySlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.notify-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #eef2f6;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
}
.notify-clear {
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s;
}
.notify-clear:hover { color: #3b82f6; }
.notify-body {
    max-height: 350px;
    overflow-y: auto;
    padding: 6px 0;
}
.notify-empty {
    text-align: center;
    padding: 32px 16px;
    color: #94a3b8;
    font-size: 0.82rem;
}
.notify-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 18px;
    transition: background 0.12s;
    cursor: default;
}
.notify-item:hover { background: #f8fafc; }
.notify-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.notify-dot-info { background: #3b82f6; }
.notify-dot-success { background: #10b981; }
.notify-dot-warning { background: #f59e0b; }
.notify-dot-error { background: #ef4444; }
.notify-msg {
    flex: 1;
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notify-time {
    font-size: 0.7rem;
    color: #94a3b8;
    flex-shrink: 0;
    margin-top: 2px;
}
.notify-error .notify-msg { color: #dc2626; }
.notify-warning .notify-msg { color: #b45309; }
.notify-success .notify-msg { color: #059669; }

/* ============================================
   Footer
   ============================================ */
footer {
    margin-top: 0;
    background: #eef2f8;
    padding: 12px 0;
    text-align: center;
    font-size: 0.8rem;
    color: #5e6f8c;
    border-top: 1px solid #e2e8f0;
}
footer a { color: var(--primary); text-decoration: none; }

/* ============================================
   统计卡片
   ============================================ */
.stats-row { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-card {
    background: white; border-radius:4px; padding: 20px 24px;
    flex: 1; min-width: 160px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #eef2f6;
    display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 48px; height: 48px; background: #eff6ff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--primary);
}
.stat-info h3 { font-size: 18px; font-weight: 600; color: #475569; }
.stat-info p { font-size: 13px; color: #64748b; margin-top: 4px; }

/* ============================================
   Layout
   ============================================ */
.workspace-full {
    width: 100%;
    max-width: 100%;
    margin: 8px auto;
    padding: 0 10px;
}

/* ============================================
   Toast
   ============================================ */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    align-items: center;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
}
.toast {
    padding: 12px 20px;
    border-radius:4px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
}
.toast.success { background: #10b981; }
.toast.error   { background: #ef4444; }
.toast.warning { background: #f59e0b; }
.toast.info    { background: #3b82f6; }
@keyframes toastIn  { from { transform: translateY(-8px) scale(.98); opacity: 0 } to { transform: translateY(0) scale(1); opacity: 1 } }
@keyframes toastOut { from { opacity: 1 } to { opacity: 0; transform: translateY(-8px) scale(.98) } }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1000px) {
    .workspace-full { padding: 0 10px; }
    .header-a .hd-row-top { padding: 10px 16px 8px; }
    .header-a .hd-row-bottom { padding: 0 16px 4px; min-height: 42px; }
}

/* ═══ 统一间距规范 (首页标准) ═══ */
.stats-row{gap:18px;margin-bottom:16px}
.chart-row{gap:18px;margin-bottom:16px}
.card-grid{gap:18px;margin-bottom:16px}
.section-gap{margin-bottom:16px}
.content-gap{gap:18px}

/* ═══ 统一操作按钮（全站唯一真源，对齐 vm-detail 范本） ═══
   轮廓风：白底 + 1px 同色细边 + 同色文字；hover 浅染同色
   语义：中性=蓝边 / 正向(挂载·测试·同步)=绿边 / 警告(卸载·过户)=橙边 / 危险(删除)=红边
   页面级主按钮用 .btn-primary（实心蓝），与行内轮廓按钮形成层级
*/
.act{
    display:inline-flex;align-items:center;gap:4px;
    padding:3px 10px;border-radius:4px;font-size:0.72rem;font-weight:500;line-height:1.4;
    cursor:pointer;border:1px solid transparent;background:#fff;color:var(--text-main);transition:all .15s;
}
.act:hover{border-color:var(--primary);color:var(--primary);background:#f9fafb;}
.act-primary{border-color:#bfdbfe;color:var(--primary);}
.act-primary:hover{background:#f9fafb;border-color:var(--primary);}
.act-success{border-color:#bbf7d0;color:#16a34a;}
.act-success:hover{background:#f0fdf4;border-color:#86efac;}
.act-warn{border-color:#fde68a;color:#d97706;}
.act-warn:hover{background:#fffbeb;border-color:#fcd34d;}
.act-danger{border-color:#fecaca;color:#dc2626;}
.act-danger:hover{background:#fef2f2;border-color:#fca5a5;}
.act:disabled,.act.disabled{opacity:.5;cursor:not-allowed;background:#fff !important;color:#94a3b8 !important;border-color:#e2e8f0 !important;}

/* 主按钮：实心蓝（添加/保存/立即备份等页面级操作） */
.btn-primary{
    display:inline-flex;align-items:center;gap:6px;
    padding:7px 16px;border-radius:4px;font-size:0.82rem;font-weight:500;
    cursor:pointer;border:none;background:var(--primary);color:#fff;transition:all .15s;
}
.btn-primary:hover{background:var(--primary-dark);}
.btn-primary:disabled{opacity:.5;cursor:not-allowed;}

/* 面包屑（全站统一，范本 vm-detail） */
.breadcrumb-row{display:flex;align-items:center;gap:10px;padding:14px 0 6px;}
.breadcrumb{display:flex;align-items:center;gap:8px;font-size:1rem;color:#94a3b8;}
.breadcrumb .breadcrumb-label{color:#64748b;display:inline-flex;align-items:center;gap:6px;font-size:1rem;font-weight:500;}
.breadcrumb .breadcrumb-label i{font-size:1rem;color:var(--primary);}
.breadcrumb .fa-chevron-right{font-size:0.6rem;color:#cbd5e1;}
.breadcrumb .current{color:#475569;font-weight:500;font-size:1rem;}
.breadcrumb .sep{color:#cbd5e1;}
.breadcrumb a{color:#64748b;text-decoration:none;}
.breadcrumb a:hover{color:var(--primary);}
