/* ==================== 登录页面 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}

/* 左侧品牌区 */
.login-brand {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
    padding: var(--spacing-2xl);
}

.login-brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--text-white);
}

.login-brand-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    backdrop-filter: blur(10px);
}

.login-brand-icon .icon {
    width: 40px;
    height: 40px;
    color: white;
}

.login-brand-icon svg {
    width: 40px;
    height: 40px;
    stroke: white;
}

.login-brand-icon svg * {
    stroke: white;
}

.login-brand h1 {
    font-size: var(--font-size-hero);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.login-brand-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--spacing-2xl);
}

.login-brand-features {
    text-align: left;
    max-width: 280px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    font-size: var(--font-size);
    opacity: 0.95;
}

.feature-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon .icon {
    width: 18px;
    height: 18px;
    color: white;
}

.feature-icon svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

.feature-icon svg * {
    stroke: white;
}

.feature-icon svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

/* 装饰图形 */
.login-brand-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.decor-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
}

.decor-circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
}

.decor-circle-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
}

.decor-circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 右侧表单区 */
.login-form-section {
    width: 420px;
    min-width: 420px;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    position: relative;
}

.login-mobile-logo {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon .icon {
    width: 20px;
    height: 20px;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.logo-icon svg * {
    stroke: white;
}

.login-mobile-logo h1 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text);
}

.login-form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--spacing-2xl);
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

/* Tab切换 */
.login-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.login-tab {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--font-size);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.login-tab:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.login-tab.active {
    background: var(--primary-100);
    color: var(--primary);
}

/* 表单 */
.login-form .form-group {
    margin-bottom: var(--spacing-md);
}

.login-form .form-label {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.login-switch {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.login-switch a {
    color: var(--primary);
    font-weight: 500;
}

/* 输入框组 */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon .icon {
    width: 20px;
    height: 20px;
}

.input-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
}

.input-icon svg * {
    stroke: var(--text-muted);
}

.input-group .form-input {
    padding-left: 44px;
    padding-right: 44px;
}

.input-action {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.input-action:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.input-action .icon {
    width: 18px;
    height: 18px;
}

.input-action svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
}

.input-action svg * {
    stroke: var(--text-muted);
}

.input-action:hover svg {
    stroke: var(--text);
}

.input-action:hover svg * {
    stroke: var(--text);
}

/* 登录页底部 */
.login-footer {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    border-top: 1px solid var(--border-light);
}

/* ==================== 主布局 ==================== */
.main-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width var(--transition);
    position: relative;
    z-index: 100;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h1 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    color: var(--text-white);
}

.sidebar-header .nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header .nav-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.sidebar-header .nav-icon svg * {
    stroke: white;
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-sm) 0;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: var(--spacing-sm);
}

.nav-group-title {
    padding: var(--spacing-sm) var(--spacing-lg);
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px var(--spacing-lg);
    margin: 2px var(--spacing-sm);
    color: var(--sidebar-text);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--text-white);
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    margin-right: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item .nav-icon .icon {
    width: 20px;
    height: 20px;
}

.nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.nav-item .nav-icon svg * {
    stroke: currentColor;
}

.nav-item span:last-child {
    white-space: nowrap;
    overflow: hidden;
}

/* 收起状态 */
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-item .nav-icon {
    margin-right: 0;
}

.sidebar.collapsed .nav-item span:last-child,
.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .sidebar-header h1 {
    display: none;
}

/* 遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

/* 顶栏 */
.header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.toggle-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.toggle-btn .icon {
    width: 20px;
    height: 20px;
}

.toggle-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.toggle-btn svg * {
    stroke: currentColor;
}

/* 用户下拉 */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    padding: 6px var(--spacing-sm);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.user-dropdown:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 500;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: var(--text);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 通知按钮 */
.notification-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.notification-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.notification-btn .icon {
    width: 20px;
    height: 20px;
}

.notification-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.notification-btn svg * {
    stroke: currentColor;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: var(--text-white);
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* 下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--spacing-xs);
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: var(--spacing-xs);
    z-index: 100;
    border: 1px solid var(--border-light);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    border-radius: var(--radius);
    color: var(--text);
    transition: all var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: var(--danger-bg);
}

.dropdown-item .icon {
    width: 18px;
    height: 18px;
}

/* 页面内容 */
.page-content {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.page-header {
    margin-bottom: var(--spacing-lg);
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--text);
}

/* 页脚 */
.footer {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    border-top: 1px solid var(--border-light);
    background: var(--bg-white);
}

/* ==================== 移动端底部导航 ==================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.bottom-nav-scroll::-webkit-scrollbar {
    display: none;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 64px;
    padding: 8px 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.bottom-nav-item .icon {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
}

.bottom-nav-item .icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

.bottom-nav-item .icon svg * {
    stroke: currentColor;
}

.bottom-nav-item span {
    font-size: 10px;
    white-space: nowrap;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active .icon {
    color: var(--primary);
}

/* ==================== 响应式设计 ==================== */

/* 平板 */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .nav-group-title {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
    
    .nav-item {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
}

/* 大屏手机 */
@media (max-width: 768px) {
    /* 登录页移动端布局 */
    .login-page {
        flex-direction: column;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
        min-height: 100vh;
        min-height: 100dvh; /* 使用动态视口高度 */
        position: relative;
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    /* 移动端装饰背景 */
    .login-page::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -30%;
        width: 80%;
        height: 100%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
        pointer-events: none;
    }
    
    .login-page::after {
        content: '';
        position: absolute;
        bottom: -30%;
        left: -20%;
        width: 60%;
        height: 80%;
        background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
        pointer-events: none;
    }
    
    .login-brand {
        display: flex;
        padding: var(--spacing-md) var(--spacing-lg);
        background: transparent;
        min-height: auto;
    }
    
    .login-brand-content {
        width: 100%;
    }
    
    .login-brand-icon {
        width: 48px;
        height: 48px;
        margin-bottom: var(--spacing-sm);
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .login-brand-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .login-brand h1 {
        font-size: 1.5rem;
        text-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .login-brand-subtitle {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-sm);
        opacity: 0.85;
    }
    
    .login-brand-features {
        display: none;
    }
    
    .login-form-section {
        width: 100%;
        min-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0 var(--spacing-md) var(--spacing-md);
        background: transparent;
        flex: 0 0 auto;
    }
    
    .login-form-container {
        width: 100%;
        max-width: 400px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-radius: var(--radius-xl);
        padding: var(--spacing-lg);
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.15),
            0 8px 25px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.8);
        animation: cardFloat 0.6s ease-out;
    }
    
    @keyframes cardFloat {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .login-tabs {
        display: none; /* 手机端隐藏切换标签 */
    }
    
    .login-tab {
        border-radius: calc(var(--radius) - 2px);
    }
    
    .login-tab.active {
        background: var(--bg-white);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .login-form .btn-lg {
        padding: 14px 24px;
        font-size: var(--font-size);
        border-radius: var(--radius);
    }
    
    .login-footer {
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.8);
        padding: var(--spacing-md);
        text-align: center;
        flex-shrink: 0;
        width: 100%;
    }
    
    .login-footer p {
        margin: 0;
    }

    /* 侧边栏移动端 */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform var(--transition);
        width: var(--sidebar-width);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* 底部导航显示 */
    .bottom-nav {
        display: block;
    }
    
    /* 主内容区调整 */
    .main-content {
        padding-bottom: var(--bottom-nav-height);
    }
    
    .page-content {
        padding: var(--spacing-md);
    }
    
    .header {
        padding: 0 var(--spacing-md);
    }
    
    .user-name {
        display: none;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .login-brand {
        padding: var(--spacing-lg);
    }
    
    .login-brand h1 {
        font-size: 1.5rem;
    }
    
    .login-form-section {
        padding: 0 var(--spacing-sm) var(--spacing-lg);
    }
    
    .login-form-container {
        padding: var(--spacing-lg);
        border-radius: var(--radius-lg);
    }
    
    .page-title {
        font-size: var(--font-size-xl);
    }
    
    .page-content {
        padding: var(--spacing-sm);
    }
    
    .header {
        padding: 0 var(--spacing-sm);
    }
}

/* 超小屏手机 */
@media (max-width: 375px) {
    .page-content {
        padding: var(--spacing-xs);
    }
    
    .bottom-nav-item {
        min-width: 56px;
    }
    
    .bottom-nav-item span {
        font-size: 9px;
    }
}
    .bottom-nav-item span {
        font-size: 9px;
    }
}
