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

/* 根元素样式 */
:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    --background-color: #F2F2F7;
    --surface-color: rgba(255, 255, 255, 0.95);
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --border-radius-small: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器布局 */
.container {
    display: flex;
    height: 100vh;
    transition: var(--transition);
}

/* 左侧边栏样式 */
.sidebar {
    width: 320px;
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow-medium);
    position: relative;
    z-index: 100;
}

.sidebar.collapsed {
    width: 40px;
}

/* 边栏头部 */
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.sidebar-header h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* 菜单列表 */
.menu-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* 菜单项样式 - 更紧凑 */
.menu-item {
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.menu-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-light);
}

.menu-item:hover::before {
    opacity: 1;
}

.menu-item:hover {
    color: white;
}

.menu-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-medium);
    transform: translateX(4px);
}

/* 菜单文本 */
.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 菜单箭头 */
.menu-arrow {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    transition: var(--transition);
}

.menu-item:hover .menu-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* 边栏底部 */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

/* 按钮样式 - 更紧凑 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    min-height: 32px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: var(--transition);
    transform: translate(-50%, -50%);
}

.btn:hover::before {
    width: 100%;
    height: 100%;
}

.btn-icon {
    width: 14px;
    height: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #6c757d;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

/* 右侧内容区域 */
.main-content {
    flex: 1;
    position: relative;
    background: var(--background-color);
}

/* 移除了原有的显示边栏按钮样式，现在只使用浮动展开按钮 */

/* 浮动展开按钮（更人性化的位置） */
.floating-expand-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1500;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 0 12px 12px 0;
    width: 28px;
    height: 60px;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.floating-expand-btn:hover {
    width: 32px;
    box-shadow: var(--shadow-heavy);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.floating-expand-btn svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

/* 内嵌框架 */
#contentFrame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    border-radius: 0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--surface-color);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-heavy);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.modal-header h3 {
    font-weight: 600;
    margin: 0;
}

.close {
    color: rgba(255, 255, 255, 0.8);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 32px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

/* 菜单管理器 */
.menu-manager {
    background: var(--background-color);
    padding: 24px;
    border-radius: var(--border-radius-small);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.menu-list-display {
    max-height: 300px;
    overflow-y: auto;
}

/* 设置菜单项 */
.settings-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin: 8px 0;
    background: white;
    border-radius: var(--border-radius-small);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.settings-menu-item:hover {
    box-shadow: var(--shadow-light);
    transform: translateY(-1px);
}

.settings-menu-item.selected {
    background: rgba(0, 122, 255, 0.1);
    border-color: var(--primary-color);
}

.menu-info {
    flex: 1;
}

.menu-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.menu-url {
    font-size: 0.8rem;
    color: var(--text-secondary);
    word-break: break-all;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: absolute;
        z-index: 1000;
        height: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .sidebar-footer {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    /* 移动端浮动按钮优化 */
    .floating-expand-btn {
        width: 24px;
        height: 50px;
    }
    
    .floating-expand-btn:hover {
        width: 28px;
    }
    
    .floating-expand-btn svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .modal-body {
        padding: 20px;
    }
    
    .menu-manager {
        padding: 16px;
    }
    
    .form-group input {
        padding: 12px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item {
    animation: fadeIn 0.3s ease-out;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1C1C1E;
        --surface-color: rgba(28, 28, 30, 0.95);
        --text-primary: #FFFFFF;
        --text-secondary: #8E8E93;
        --border-color: rgba(255, 255, 255, 0.1);
    }
    
    .form-group input {
        background: #2C2C2E;
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    
    .settings-menu-item {
        background: #2C2C2E;
    }
} 