/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    overflow: hidden;
}

/* PC/平板端布局 */
.desktop-layout {
    display: flex;
    height: 100vh;
}

/* 手机端布局默认隐藏 */
.mobile-layout {
    display: none;
    flex-direction: column;
    height: 100vh;
}

/* 左侧菜单栏样式 */
.sidebar {
    width: 240px;
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-title {
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
}

.menu-nav {
    flex: 1;
    padding: 10px 0;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #333;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.menu-item.active {
    background-color: #e8f4f8;
    border-left-color: #1890ff;
    color: #1890ff;
    font-weight: 500;
}

/* 右侧内容区域 */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.iframe-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #fff;
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 错误提示样式 */
.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 30px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.error-message p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.refresh-btn {
    padding: 8px 24px;
    background-color: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.refresh-btn:hover {
    background-color: #40a9ff;
}

/* 手机端样式 */
.mobile-header {
    background-color: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.current-menu-item {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.hamburger-icon {
    color: #666;
    font-size: 20px;
    line-height: 1;
    font-weight: normal;
    position: absolute;
    right: 20px;
}

.mobile-content-area {
    flex: 1;
    overflow: hidden;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.mobile-menu-nav {
    padding: 10px 0;
    max-height: 60vh;
    overflow-y: auto;
}

.mobile-menu-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #333;
    border-left: 3px solid transparent;
}

.mobile-menu-item:hover {
    background-color: #f5f5f5;
}

.mobile-menu-item.active {
    background-color: #e8f4f8;
    border-left-color: #1890ff;
    color: #1890ff;
    font-weight: 500;
}

/* 响应式媒体查询 */
@media (max-width: 768px) {
    .desktop-layout {
        display: none;
    }

    .mobile-layout {
        display: flex;
    }
}

/* 平板端（768px - 1024px）使用桌面布局 */
@media (min-width: 769px) and (max-width: 1024px) {
    .desktop-layout {
        display: flex;
    }

    .mobile-layout {
        display: none;
    }
}

/* 桌面端（大于1024px） */
@media (min-width: 1025px) {
    .desktop-layout {
        display: flex;
    }

    .mobile-layout {
        display: none;
    }
}

/* Loading加载效果样式 */
.loading-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

/* PC端Loading - 相对于右侧内容区域定位 */
.desktop-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* 手机端Loading - 相对于整个屏幕定位 */
.mobile-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.loading-spinner {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    margin: 0;
    color: #666;
    font-size: 14px;
}
