/**
 * 整体布局样式
 * 从 base.html 提取
 */

/* 整体布局 */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-layout {
    display: flex;
    flex: 1;
    height: 100vh;
    overflow: hidden;
}

/* 左侧边栏 */
.sidebar {
    width: 230px;
    background: linear-gradient(180deg, #1e1e2f 0%, #16162a 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}

.sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #5B7FFF 0%, #7C3AED 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    font-weight: bold;
}

.sidebar-logo-text {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.sidebar-section-title {
    margin: 16px 0 8px 0;
    padding: 0 4px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 14px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--business-color, #5B7FFF);
    opacity: 0;
    border-radius: 0 4px 4px 0;
    transition: opacity 0.2s;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(var(--business-color-rgb, 91, 127, 255), 0.2) 0%, rgba(var(--business-color-rgb, 91, 127, 255), 0.1) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-item.active::before {
    opacity: 1;
}

.sidebar-item .item-name {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.sidebar-item .item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--item-color, #5B7FFF);
    margin-right: 10px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-footer-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

.sidebar-footer-btn svg {
    width: 16px;
    height: 16px;
}

.sidebar-version {
    text-align: center;
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.3);
}

/* 主内容区 */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
}

/* 顶部导航栏 */
.top-nav {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
}

.nav-tabs {
    display: flex;
    gap: 5px;
    flex: 1;
}

.nav-tab {
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-tab:hover {
    background: #f3f4f6;
    color: #333;
}

.nav-tab.active {
    background: rgba(91, 127, 255, 0.1);
    color: var(--business-color, #5B7FFF);
    border: 1px solid var(--business-color, #5B7FFF);
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: #e5e7eb;
    margin: 0 10px;
    align-self: center;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fafb;
}

.container {
    margin: 0 auto;
    padding: 50px 0;
}

/* 隐藏原来的头部 */
.header {
    display: none;
}

/* 浮动导航按钮调整 */
.float-nav {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.float-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.2s;
}

.float-nav-btn:hover {
    background: var(--business-color, #5B7FFF);
    color: #fff;
}

/* 侧边栏项目包装器 */
.sidebar-item-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-item-wrapper .sidebar-item {
    flex: 1;
}

.sidebar-item-actions {
    position: absolute;
    right: 6px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar-item-wrapper:hover .sidebar-item-actions {
    opacity: 1;
}

.sidebar-item-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-item-edit:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
}

.sidebar-item-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}
