:root {
  --primary-color: #4e54c8;
  --secondary-color: #8f94fb;
  --dark-bg: #0a0e14;
  --card-bg: rgba(16, 26, 61, 0.7);
  --text-primary: #ffffff;
  --text-secondary: #a0a0ee;
  --success: #64de88;
  --warning: #ffb347;
  --danger: #ef5b5b;
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    display: flex;
    height: 100vh;
    background: rgba(255, 255, 255, 0.02);
}

.sidebar {
    height: 100vh;
    width: 170px;
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.95) 0%, rgba(30, 30, 30, 0.92) 100%);
    padding: 40px 25px;
    z-index: 1;
    border-radius: 0 30px 30px 0;
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.logo {
    position: relative;
    top: -70px;
    left: -25px;
    margin-bottom: -130px;
}

.logo img {
    width: 180px;
    height: auto;
    z-index: 100;
    filter: brightness(1.1);
    transition: all 0.3s ease;
    display: block;
}

.logo img:hover {
    transform: scale(1.05);
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(143, 148, 251, 0.3));
}

.sidebar ul {
    list-style-type: none;
    margin-top: 30px;
}

.sidebar li {
    padding: 16px 20px;
    text-decoration: none;
    font-size: 18px;
    color: #b0b0b0;
    display: block;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.sidebar li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #4e54c8, #8f94fb);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar li:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sidebar li:hover::before {
    transform: scaleY(1);
}

.sidebar li.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(78, 84, 200, 0.15), rgba(143, 148, 251, 0.1));
    box-shadow: 0 4px 20px rgba(78, 84, 200, 0.3);
    transform: translateX(5px);
}

.sidebar li.active::before {
    transform: scaleY(1);
}

.sidebar li.active::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(78, 84, 200, 0.5);
}

.content {
    flex: 1;
    height: 100vh;
    background: rgba(10, 10, 20, 0.4);
    position: relative;
    overflow: hidden;
}

.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

iframe {
    width: 100%;
    height: 100vh;  /* 使用视口高度 */
    border: none;
    background: transparent;
    position: absolute;  /* 改为绝对定位 */
    top: 0;
    left: 0;
    z-index: 1;
}

/* 滚动条美化 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4e54c8, #8f94fb);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a60d4, #9da1ff);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar li {
    animation: fadeIn 0.5s ease forwards;
}

.sidebar li:nth-child(1) { animation-delay: 0.1s; }
.sidebar li:nth-child(2) { animation-delay: 0.2s; }
.sidebar li:nth-child(3) { animation-delay: 0.3s; }
.sidebar li:nth-child(4) { animation-delay: 0.4s; }


/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .sidebar li {
        animation: none;
        transition: none;
    }
    
    .logo img:hover {
        transform: none;
    }
    
    .sidebar li:hover,
    .sidebar li.active {
        transform: none;
    }
}

/* 响应式适配 */
@media (max-width: 1200px) {
    .sidebar {
        width: 150px;
        padding: 30px 20px;
    }
    
    .logo img {
        width: 160px;
    }
    
    .sidebar li {
        padding: 14px 18px;
        font-size: 16px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 130px;
        padding: 25px 15px;
    }
    
    .logo img {
        width: 140px;
    }
    
    .sidebar li {
        padding: 12px 15px;
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        min-height: 80px;
        padding: 10px 20px;
        border-radius: 0 0 20px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .logo {
        position: static; /* 取消绝对定位 */
        top: auto;
        left: auto;
        margin-bottom: 0; /* 取消负边距 */
        margin-right: 15px; /* 添加右边距，与菜单项隔开 */
    }
    
    .logo img {
        width: 100px; /* 为移动端设置一个更合适的宽度 */
        height: auto; /* 保持比例 */
    }
    
    .sidebar ul {
        display: flex;
        margin-top: 0;
        gap: 10px;
    }
    
    .sidebar li {
        margin-bottom: 0;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .sidebar li:hover,
    .sidebar li.active {
        transform: translateY(-2px);
    }
    
    .content {
        height: calc(100vh - 80px);
    }
}

@media (max-width: 576px) {
    .sidebar {
        min-height: 70px;
        padding: 8px 15px;
    }
    
    .logo img {
        width: 100px;
    }
    
    .sidebar li {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .content {
        height: calc(100vh - 70px);
    }
}