/* ===== Y.Mine 公共基础样式 v1.5 ===== */
/* 全局重置、侧边栏、光晕、容器、基础动画、响应式 */

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0b0b1a;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    color: #f1f5f9;
    overflow-x: hidden;
}

/* 布局模式1：flex伸缩（总控台等新页面） */
body.layout-flex {
    display: flex;
    padding: 20px 20px 20px 0;
}

/* 布局模式2：fixed侧边栏（通用） */
body.layout-fixed {
    padding: 20px 20px 20px 280px;
}

/* 布局模式2变体：fixed侧边栏+居中容器 */
body.layout-fixed.layout-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== 左侧导航栏 ===== */
.sidebar {
    width: 260px;
    min-height: 100vh;
    padding: 32px 16px 24px;
    background: rgba(11, 11, 26, 0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* layout-flex模式：sidebar是sticky */
.layout-flex .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
}

/* layout-fixed模式：sidebar是fixed */
.layout-fixed .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.sidebar::-webkit-scrollbar {
    width: 3px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, 0.15);
    border-radius: 4px;
}

.sidebar .logo {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.sidebar .logo span {
    color: #a78bfa;
}

.sidebar .logo-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.15);
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 14px;
}

.nav-group {
    margin-bottom: 16px;
}

.nav-group .group-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.1);
    padding: 0 12px;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
    cursor: pointer;
    border-left: 2px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
    border-left-color: rgba(167, 139, 250, 0.2);
}

.nav-item.active {
    color: #f1f5f9;
    background: rgba(167, 139, 250, 0.05);
    border-left-color: #a78bfa;
}

.nav-item .icon {
    font-size: 14px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .level-tag {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    padding: 0 8px;
    border-radius: 8px;
    margin-left: auto;
}

.nav-item .level-tag.active-tag {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.08);
}

.nav-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin: 8px 12px;
}

.sidebar .footer-nav {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.08);
    text-align: center;
}

/* ===== 鼠标跟随光晕 ===== */
#glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(600px circle at var(--x, 50%) var(--y, 50%), rgba(120, 80, 255, 0.06), transparent 80%);
    transition: background 0.1s;
}

/* ===== 主内容区域（layout-flex） ===== */
.main-content {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px 32px 32px;
    min-height: 100vh;
}

/* ===== 容器卡片 ===== */
.container {
    max-width: 1100px;
    width: 100%;
    background: radial-gradient(ellipse at 30% 30%, #120b24, #0b0b1a 70%, #05030a);
    border-radius: 32px;
    padding: 48px 52px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 30px 80px rgba(40, 10, 80, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
    backdrop-filter: blur(2px);
}

/* layout-fixed模式下的container（居中） */
.layout-fixed .container {
    max-width: 800px;
    padding: 32px;
}

.container::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(80, 30, 140, 0.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBg 12s ease-in-out infinite alternate;
}

.container::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(30, 60, 150, 0.1), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBg 10s ease-in-out infinite alternate-reverse;
}

/* ===== 基础动画 ===== */
@keyframes floatBg {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(30px, -20px) scale(1.1);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.015);
    }
}

/* ===== 通用卡片/按钮基础（部分页面共用） ===== */
.card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 20px;
    margin: 12px 0;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.btn {
    background: #a78bfa;
    border: none;
    color: #0b0b1a;
    padding: 8px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(167, 139, 250, 0.2);
    color: #a78bfa;
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: rgba(167, 139, 250, 0.08);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    body.layout-flex,
    body.layout-fixed {
        padding: 0;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .page-nav {
        display: none !important;
    }

    .sidebar {
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        position: relative !important;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        backdrop-filter: blur(8px);
    }
    .sidebar .logo,
    .sidebar .logo-sub,
    .sidebar .footer-nav {
        display: none;
    }
    .sidebar .nav-group {
        margin-bottom: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .sidebar .nav-group .group-label {
        display: none;
    }
    .sidebar .nav-item {
        padding: 4px 10px;
        font-size: 12px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    .sidebar .nav-item.active {
        border-bottom-color: #a78bfa;
        background: transparent;
    }
    .sidebar .nav-item .level-tag {
        display: none;
    }
    .sidebar .nav-divider {
        display: none;
    }
    .main-content {
        padding: 16px;
    }
    .container {
        padding: 24px 16px !important;
        border-radius: 0 !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px 12px !important;
    }
}
