/**
 * tcloud.css - 腾讯云控制台风格（v2 增强版）
 * 品牌蓝 #0052D9 / 浅灰背景 #F2F3F5 / 白色卡片 / 顶栏+侧边栏布局
 * 覆盖 Element Plus 主色变量
 *
 * v2 优化点：设计令牌体系化、毛玻璃顶栏、导航微交互动画、
 * 卡片悬浮投影、统计卡渐变趋势线、表格行hover、徽标精修、
 * 骨架屏、滚动条美化、响应式细化
 */

:root {
    /* Element Plus 主色 → 腾讯云品牌蓝 */
    --el-color-primary: #0052D9;
    --el-color-primary-light-3: #4D7FE8;
    --el-color-primary-light-5: #80A3EF;
    --el-color-primary-light-7: #B3CDF6;
    --el-color-primary-light-8: #CCE0F9;
    --el-color-primary-light-9: #E6EEFB;
    --el-color-primary-dark-2: #004AC0;

    /* 品牌色 */
    --tc-brand: #0052D9;
    --tc-brand-hover: #2670E1;
    --tc-brand-pressed: #004AC0;

    /* 背景 */
    --tc-bg: #F2F3F5;
    --tc-bg-layout: #F7F8FA;

    /* 边框 */
    --tc-border: #E7E8EB;
    --tc-border-light: #F0F2F5;

    /* 文字 */
    --tc-text: #1D2129;
    --tc-text-secondary: #4E5969;
    --tc-text-caption: #86909C;
    --tc-text-disabled: #C9CDD4;

    /* 功能色 */
    --tc-success: #0BA360;
    --tc-warning: #E6832C;
    --tc-danger: #D93036;
    --tc-info: #86909C;

    /* 阴影 */
    --tc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --tc-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --tc-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --tc-shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.10);
    --tc-shadow-brand: 0 2px 8px rgba(0, 82, 217, 0.12);

    /* 圆角 */
    --tc-radius-sm: 4px;
    --tc-radius: 6px;
    --tc-radius-md: 8px;
    --tc-radius-lg: 12px;

    /* 动效 */
    --tc-transition: 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    --tc-transition-fast: 0.15s cubic-bezier(0.38, 0, 0.24, 1);
}

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

html, body { height: 100%; font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif; }

body {
    background: var(--tc-bg);
    color: var(--tc-text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app { height: 100vh; }

/* ============ 布局骨架：顶栏 + 侧栏 + 内容 ============ */
.tc-layout { display: flex; flex-direction: column; height: 100vh; }

.tc-topbar {
    height: 56px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--tc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: var(--tc-shadow-sm);
}

.tc-topbar-left { display: flex; align-items: center; gap: 24px; }

.tc-logo { display: flex; align-items: center; gap: 10px; cursor: pointer; transition: opacity var(--tc-transition-fast); }
.tc-logo:hover { opacity: 0.85; }

.tc-logo-mark {
    width: 32px; height: 32px; border-radius: var(--tc-radius-md);
    background: linear-gradient(135deg, #0052D9, #2670E1);
    color: #fff; font-weight: 700; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--tc-shadow-brand);
}
.tc-logo-name { font-size: 17px; font-weight: 600; color: var(--tc-text); }
.tc-logo-sub { font-size: 12px; color: var(--tc-text-caption); margin-left: 2px; }

.tc-topbar-right { display: flex; align-items: center; gap: 16px; }

.tc-body { display: flex; flex: 1; overflow: hidden; }

/* ============ 侧边栏 ============ */
.tc-aside {
    width: 232px;
    background: #fff;
    border-right: 1px solid var(--tc-border);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    padding: 8px 0 24px;
    transition: width var(--tc-transition);
}
.tc-aside::-webkit-scrollbar { width: 4px; }
.tc-aside::-webkit-scrollbar-track { background: transparent; }
.tc-aside::-webkit-scrollbar-thumb { background: #DCDEE2; border-radius: 2px; }
.tc-aside::-webkit-scrollbar-thumb:hover { background: #C9CDD4; }

.tc-nav-group-title {
    font-size: 12px; color: var(--tc-text-caption);
    padding: 14px 20px 6px; letter-spacing: 1px;
    font-weight: 500;
}

.tc-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px; height: 42px; cursor: pointer;
    color: var(--tc-text-secondary); font-size: 14px;
    border-left: 3px solid transparent;
    transition: background var(--tc-transition-fast), color var(--tc-transition-fast), border-color var(--tc-transition-fast);
    user-select: none;
    position: relative;
}
.tc-nav-item:hover {
    background: var(--tc-border-light);
    color: var(--tc-text);
}
.tc-nav-item.active {
    background: var(--el-color-primary-light-9, #E6EEFB);
    color: var(--tc-brand);
    border-left-color: var(--tc-brand);
    font-weight: 600;
}
.tc-nav-item.active::after {
    content: '';
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 2px; height: 20px;
    background: var(--tc-brand);
    border-radius: 1px 0 0 1px;
}
.tc-nav-item .tc-nav-icon { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }

.tc-subnav-item {
    padding: 0 20px 0 44px; height: 38px;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; color: var(--tc-text-secondary); font-size: 13.5px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    position: relative;
}
.tc-subnav-item:hover {
    color: var(--tc-brand); background: var(--tc-border-light);
    transform: translateX(2px);
}
.tc-subnav-item.active { color: var(--tc-brand); font-weight: 600; }
.tc-subnav-item.active::before {
    content: ''; position: absolute; left: 35px; top: 10px;
    width: 4px; height: 18px; border-radius: 2px; background: var(--tc-brand);
}
.tc-subnav-item.active::after {
    content: ''; position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--tc-brand);
}

/* 子菜单图标 */
.tc-subnav-icon {
    font-size: 14px;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color var(--tc-transition-fast);
}
.tc-subnav-item:hover .tc-subnav-icon {
    transform: scale(1.15);
    color: var(--tc-brand);
}
.tc-subnav-item.active .tc-subnav-icon {
    color: var(--tc-brand);
}

/* 子菜单无图标时的圆点 */
.tc-subnav-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--tc-text-disabled);
    flex-shrink: 0;
    transition: background var(--tc-transition-fast);
}
.tc-subnav-item:hover .tc-subnav-dot { background: var(--tc-brand); }
.tc-subnav-item.active .tc-subnav-dot { background: var(--tc-brand); }

/* ============ 内容区 ============ */
.tc-main {
    flex: 1; overflow-y: auto; padding: 20px 24px 32px;
    background: var(--tc-bg);
}
.tc-main::-webkit-scrollbar { width: 6px; }
.tc-main::-webkit-scrollbar-track { background: transparent; }
.tc-main::-webkit-scrollbar-thumb { background: #DCDEE2; border-radius: 3px; }
.tc-main::-webkit-scrollbar-thumb:hover { background: #C9CDD4; }

.tc-page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.tc-page-title { font-size: 18px; font-weight: 600; letter-spacing: -0.2px; }
.tc-page-desc { font-size: 12.5px; color: var(--tc-text-caption); margin-top: 4px; }

/* ============ 卡片 ============ */
.tc-card {
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow var(--tc-transition);
}
.tc-card:hover {
    box-shadow: var(--tc-shadow-md);
}
.tc-card-title {
    font-size: 15px; font-weight: 600; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between;
}

/* ============ 统计卡（数据总览用） ============ */
.tc-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.tc-stat {
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    padding: 18px 20px;
    transition: transform var(--tc-transition), box-shadow var(--tc-transition);
    position: relative;
    overflow: hidden;
}
.tc-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--tc-brand), var(--tc-brand-hover));
    opacity: 0;
    transition: opacity var(--tc-transition);
}
.tc-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--tc-shadow-lg);
}
.tc-stat:hover::before { opacity: 1; }
.tc-stat-label { font-size: 13px; color: var(--tc-text-caption); }
.tc-stat-value { font-size: 28px; font-weight: 700; margin-top: 8px; color: var(--tc-text); letter-spacing: -0.5px; }
.tc-stat-extra { font-size: 12px; color: var(--tc-text-caption); margin-top: 6px; }

/* ============ 通用表格微调 ============ */
.tc-card .el-table { font-size: 13.5px; }
.el-table th.el-table__cell {
    background: var(--tc-bg-layout) !important;
    color: var(--tc-text-secondary);
    font-weight: 600;
    font-size: 13px;
}
.el-table .el-table__row:hover > td.el-table__cell {
    background: var(--el-color-primary-light-9, #E6EEFB) !important;
}
.el-table td.el-table__cell { border-bottom: 1px solid var(--tc-border-light); }
.el-button--primary { --el-button-font-weight: 500; }
.el-button { border-radius: var(--tc-radius); }

/* ============ 空状态 / 引导 ============ */
.tc-empty {
    text-align: center; padding: 48px 0; color: var(--tc-text-caption); font-size: 13px;
}
.tc-empty .tc-empty-icon { font-size: 48px; color: var(--tc-border); margin-bottom: 12px; }

/* ============ 徽标 ============ */
.tc-badge {
    display: inline-block; padding: 1px 8px; border-radius: 2px; font-size: 12px; line-height: 18px;
    font-weight: 500;
}
.tc-badge-blue { background: #E6EEFB; color: #0052D9; }
.tc-badge-green { background: #E8F7EA; color: #0BA360; }
.tc-badge-gray { background: #F0F2F5; color: #86909C; }
.tc-badge-orange { background: #FFF3E0; color: #E6832C; }
.tc-badge-red { background: #FDECEC; color: #D93036; }
.tc-badge-purple { background: #F3E8FF; color: #7B3FE4; }

/* ============ 骨架屏 ============ */
.tc-skeleton {
    background: linear-gradient(90deg, #F0F2F5 25%, #E7E8EB 37%, #F0F2F5 63%);
    background-size: 400% 100%;
    animation: tc-skeleton-loading 1.4s ease infinite;
    border-radius: var(--tc-radius-sm);
}
@keyframes tc-skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ============ 搜索栏 ============ */
.tc-search-bar {
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* ============ 分页 ============ */
.tc-pagination {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

/* ============ 过渡动画 ============ */
.tc-fade-enter-active,
.tc-fade-leave-active { transition: opacity 0.2s ease; }
.tc-fade-enter-from,
.tc-fade-leave-to { opacity: 0; }

/* ============ 响应式 ============ */
@media (max-width: 1200px) {
    .tc-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .tc-aside { width: 64px; }
    .tc-nav-group-title { display: none; }
    .tc-nav-item span { display: none; }
    .tc-subnav-item { display: none; }
    .tc-main { padding: 12px 12px 24px; }
    .tc-stat-grid { grid-template-columns: 1fr; }
}
