/**
 * 渠道信息发布平台 - 自定义样式
 * 基于 Layui 框架扩展
 * 深绿色主题
 */

/* ==================== 变量定义 ==================== */
:root {
    /* 深绿色主题色系 */
    --primary-color: #0D6E4F;
    --primary-light: #E8F5E9;
    --primary-dark: #094D33;
    --primary-hover: #0A5C42;
    
    /* 功能色系 */
    --success-color: #10B981;
    --success-light: #D1FAE5;
    
    --warning-color: #F59E0B;
    --warning-light: #FEF3C7;
    
    --danger-color: #EF4444;
    --danger-light: #FEE2E2;
    
    --info-color: #3B82F6;
    --info-light: #DBEAFE;
    
    /* 中性色系 */
    --gray-color: #6B7280;
    --gray-light: #F3F4F6;
    --gray-border: #E5E7EB;
    --gray-dark: #374151;
    
    /* 文字色系 */
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    
    /* 背景色 */
    --bg-page: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    
    /* 布局尺寸 */
    --header-height: 60px;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    background-color: var(--bg-page);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-color);
}

/* ==================== 整体布局 ==================== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== 顶部导航栏 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-right: 48px;
    position: relative;
    z-index: 1;
}

.header-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-logo .logo-text {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 主导航菜单 */
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.nav-item {
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
    font-weight: 500;
}

.nav-item a {
    color: rgba(255, 255, 255, 0.85);
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 用户区域 */
.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.header-user:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.user-dropdown {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    transition: transform var(--transition-fast);
}

.header-user:hover .user-dropdown {
    transform: rotate(180deg);
}

/* ==================== 主体区域 ==================== */
.main-content {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ==================== 左侧菜单栏 ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transition: all var(--transition-normal);
    z-index: 900;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--gray-border) 20%, var(--gray-border) 80%, transparent);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    overflow: hidden;
}

/* 折叠时隐藏菜单标题文字和菜单项文字 */
.sidebar.collapsed .menu-title,
.sidebar.collapsed .menu-text {
    display: none;
}

/* 折叠时菜单标题区域只显示折叠按钮 */
.sidebar.collapsed .sidebar-toggle {
    justify-content: center;
    padding: 20px 0;
}

.sidebar.collapsed #menuTitle {
    display: none;
}

.sidebar-toggle {
    padding: 20px;
    border-bottom: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #FAFBFC 0%, #FFFFFF 100%);
}

.sidebar-toggle .toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    transition: all var(--transition-normal);
    font-size: 14px;
}

.sidebar-toggle .toggle-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: rotate(90deg);
}

/* 菜单容器 */
.menu-container {
    padding: 12px 8px;
}

.menu-title {
    padding: 12px 16px 8px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.menu-item {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
    margin: 2px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.menu-item:hover {
    background: var(--gray-light);
    color: var(--primary-color);
}

.menu-item.active {
    background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.menu-item .menu-icon {
    font-size: 18px;
    width: 28px;
    height: 28px;
    text-align: center;
    line-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-item:hover .menu-icon,
.menu-item.active .menu-icon {
    background: var(--primary-light);
}

/* ==================== 右侧内容区 ==================== */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    transition: all var(--transition-normal);
    min-height: calc(100vh - var(--header-height));
}

.content-area.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb-item {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: var(--gray-border);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* 搜索栏 */
.search-bar {
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-border);
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input-wrapper input {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 18px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-normal);
    background: var(--gray-light);
}

.search-input-wrapper input:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 79, 0.1);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-input-wrapper .search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.5;
    pointer-events: none;
}

.search-btn {
    height: 44px;
    padding: 0 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(13, 110, 79, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 79, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* 发布按钮 */
.publish-btn {
    height: 44px;
    padding: 0 24px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.publish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.publish-btn:active {
    transform: translateY(0);
}

/* ==================== 资源卡片列表 ==================== */
.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.resource-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 0;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid var(--gray-border);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.resource-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.resource-card:hover::before {
    transform: scaleX(1);
}

.resource-card.is-top {
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15), var(--shadow-md);
}

.resource-card.is-top::before {
    transform: scaleX(1);
    background: linear-gradient(90deg, var(--warning-color), #D97706);
}

.resource-card-inner {
    padding: 20px;
}

.resource-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.resource-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
}

.resource-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag-category {
    background: var(--primary-light);
    color: var(--primary-color);
}

.tag-region {
    background: var(--info-light);
    color: var(--info-color);
}

.tag-status-online {
    background: var(--success-light);
    color: #059669;
}

.tag-status-pending {
    background: var(--warning-light);
    color: #D97706;
}

.tag-status-expired {
    background: var(--gray-light);
    color: var(--gray-color);
}

.resource-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--gray-border);
}

.resource-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.resource-author .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(13, 110, 79, 0.2);
}

.resource-author .avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(13, 110, 79, 0.2);
}

.resource-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.resource-view {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 置顶标识 */
.top-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px 4px 8px;
    background: #FEF3C7;
    color: #D97706;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.5);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* ==================== 分页组件 ==================== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 0 20px;
}

/* Layui 分页样式覆盖 */
.layui-laypage .layui-laypage-curr .layui-laypage-em {
    background: var(--primary-color) !important;
    border-radius: var(--radius-sm);
}

.layui-laypage a:hover {
    color: var(--primary-color) !important;
}

/* ==================== 弹窗移动端适配 ==================== */
@media screen and (max-width: 768px) {
    .layui-layer {
        border-radius: var(--radius-lg) !important;
    }

    .layui-layer-title {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
        font-size: 15px !important;
        padding: 12px 50px 12px 16px !important;
    }

    .layui-layer-content {
        overflow-y: auto !important;
    }

    .layui-layer-btn {
        padding: 12px 16px !important;
    }

    .layui-layer-btn a {
        height: 36px !important;
        line-height: 36px !important;
        padding: 0 18px !important;
        font-size: 13px !important;
    }

    /* 移动端关闭按钮调整 */
    .layui-layer-setwin {
        right: 8px !important;
    }

    .layui-layer-setwin .layui-layer-close1 {
        width: 26px !important;
        height: 26px !important;
        line-height: 26px !important;
        font-size: 18px !important;
    }

    /* 移动端登录/注册表单适配 */
    .auth-form-container {
        padding: 20px;
    }

    .auth-form-close {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    /* 移动端个人中心内联关闭按钮 */
    .profile-inline-close {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    /* 移动端联系站长弹窗 */
    .contact-form-header {
        padding: 16px 20px 12px;
    }

    .contact-form-title {
        font-size: 16px;
    }

    .contact-form-close {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .contact-form-container .contact-content {
        padding: 8px 20px 20px;
    }

    /* 移动端小程序弹窗 */
    .mini-program-form-header {
        padding: 16px 20px 12px;
    }

    .mini-program-form-title {
        font-size: 16px;
    }

    .mini-program-form-close {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .mini-program-form-container .mini-program-content {
        padding: 16px 20px 20px;
    }
}

/* 右侧滑出个人中心专用适配 */
@media screen and (max-width: 768px) {
    .layui-layer-profile-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        top: 0 !important;
        left: 0 !important;
    }
}

/* ==================== 表单样式 ==================== */
.form-section {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-label .required {
    color: var(--danger-color);
    margin-left: 4px;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-normal);
    background: var(--gray-light);
}

.form-input:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 79, 0.1);
}

.form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px 16px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    outline: none;
    resize: vertical;
    transition: all var(--transition-normal);
    font-family: inherit;
    background: var(--gray-light);
    line-height: 1.6;
}

.form-textarea:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 79, 0.1);
}

.form-select {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    outline: none;
    background: var(--gray-light);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.form-select:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 79, 0.1);
}

/* ==================== 详情弹窗样式 ==================== */
.detail-content {
    padding: 24px;
}

.detail-header {
    border-bottom: 2px solid var(--gray-border);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.detail-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.detail-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.detail-info {
    margin-bottom: 24px;
}

.detail-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 4px solid var(--primary-color);
}

.detail-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.9;
    text-indent: 2em;
}

.detail-contact {
    background: linear-gradient(135deg, var(--primary-light) 0%, #F0FDF4 100%);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(13, 110, 79, 0.1);
}

.detail-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.detail-contact-item:last-child {
    margin-bottom: 0;
}

.detail-contact-label {
    color: var(--text-muted);
    min-width: 80px;
}

.detail-contact-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state .empty-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.empty-state .empty-hint {
    font-size: 14px;
    opacity: 0.7;
}

/* ==================== 加载状态 ==================== */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 2px 8px rgba(13, 110, 79, 0.2);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 侧边栏底部联系区域 ==================== */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, var(--gray-light) 20%);
    border-top: 1px solid var(--gray-border);
    padding: 16px 12px;
}

.sidebar-footer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 6px;
}

.sidebar-footer-item:last-child {
    margin-bottom: 0;
}

.sidebar-footer-item:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, transparent 100%);
}

.sidebar-footer-item:hover .sidebar-footer-icon {
    transform: scale(1.1);
}

.sidebar-footer-icon {
    font-size: 20px;
    transition: transform var(--transition-fast);
}

.sidebar-footer-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar-footer-item:hover .sidebar-footer-text {
    color: var(--primary-color);
}

/* 折叠时隐藏文字 */
.sidebar.collapsed .sidebar-footer-text {
    display: none;
}

.sidebar.collapsed .sidebar-footer {
    padding: 16px 8px;
}

.sidebar.collapsed .sidebar-footer-item {
    justify-content: center;
    padding: 12px;
}

/* 联系站长弹窗内容 */
.contact-form-container .contact-content {
    padding: 8px 24px 24px;
}

.contact-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-border);
}

.contact-form-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.contact-form-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-light);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.contact-form-close:hover {
    background: var(--danger-light);
    color: var(--danger-color);
    transform: rotate(90deg);
}

/* 小程序弹窗 */
.mini-program-form-container {
    padding: 0;
}

.mini-program-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-border);
}

.mini-program-form-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.mini-program-form-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-light);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.mini-program-form-close:hover {
    background: var(--danger-light);
    color: var(--danger-color);
    transform: rotate(90deg);
}

/* 小程序二维码弹窗 */
.mini-program-content {
    text-align: center;
    padding: 24px;
}

.mini-program-qrcode {
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
    margin: 0 auto 20px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gray-border);
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-md);
}

.mini-program-qrcode .qr-placeholder {
    font-size: 72px;
    opacity: 0.6;
}

.mini-program-qrcode .qr-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.mini-program-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.mini-program-desc p {
    margin-bottom: 10px;
}

.mini-program-desc p:last-child {
    margin-bottom: 0;
}

/* 联系站长弹窗 */
.contact-content {
    padding: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
    border: 1px solid rgba(13, 110, 79, 0.1);
    transition: all var(--transition-fast);
}

.contact-item:last-child {
    margin-bottom: 0;
}

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

.contact-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 110, 79, 0.3);
}

.contact-info {
    flex: 1;
}

.contact-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.contact-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ==================== 登录/注册按钮 ==================== */
.header-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.auth-btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    letter-spacing: 1px;
}

.auth-btn-login {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.auth-btn-login:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.auth-btn-register {
    background: #fff;
    color: var(--primary-color);
    font-weight: 600;
}

.auth-btn-register:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* ==================== 登录/注册弹窗表单 ==================== */
.auth-form-container {
    padding: 32px;
    width: 100%;
}

/* 表单头部（标题+关闭按钮） */
.auth-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-border);
}

.auth-form-title {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.auth-form-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-light);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.auth-form-close:hover {
    background: var(--danger-light);
    color: var(--danger-color);
    transform: rotate(90deg);
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-border);
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-tab:hover {
    color: var(--primary-color);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form-group {
    margin-bottom: 18px;
    position: relative;
}

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

.auth-input-wrapper {
    position: relative;
}

.auth-input-wrapper .form-input {
    padding-right: 100px;
}

.auth-input-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.auth-send-code-btn {
    background: var(--primary-light);
    color: var(--primary-color);
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.auth-send-code-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.auth-send-code-btn:disabled {
    background: var(--gray-light);
    color: var(--text-muted);
    cursor: not-allowed;
}

.auth-submit-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-top: 8px;
    letter-spacing: 2px;
    box-shadow: 0 4px 12px rgba(13, 110, 79, 0.3);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 110, 79, 0.4);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* 验证码输入（6位格子） */
.auth-code-grid {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.auth-code-digit {
    width: 44px;
    height: 48px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--gray-light);
    transition: all var(--transition-fast);
    outline: none;
}

.auth-code-digit:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 79, 0.1);
}

.auth-code-digit.filled {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--primary-color);
}

/* ==================== 个人中心弹窗 ==================== */
.profile-content {
    width: 480px;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* 个人中心内联关闭按钮 */
.profile-inline-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
}

.profile-inline-close:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #fff;
    transform: rotate(90deg);
}

/* 个人中心头部 */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 32px 28px 40px;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
    border: 3px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.profile-vip-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.profile-level {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 20px;
    font-size: 12px;
    color: #FEF3C7;
    font-weight: 600;
}

.profile-level-icon {
    font-size: 14px;
}

/* 个人中心统计数据 */
.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px 28px;
    background: var(--bg-card);
    margin-top: -20px;
    position: relative;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-border);
    border-bottom: none;
}

.profile-stat-item {
    text-align: center;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    flex: 1;
}

.profile-stat-item:hover {
    background: var(--gray-light);
}

.profile-stat-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.profile-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.profile-stat-divider {
    width: 1px;
    background: var(--gray-border);
    align-self: stretch;
    margin: 4px 0;
}

/* 个人中心菜单列表 */
.profile-body {
    padding: 8px 20px 24px;
    background: var(--bg-page);
}

.profile-menu-section {
    margin-bottom: 8px;
}

.profile-menu-title {
    padding: 12px 8px 8px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-menu-item:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.profile-menu-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.profile-menu-item:hover .profile-menu-icon {
    background: var(--primary-color);
    color: #fff;
}

.profile-menu-info {
    flex: 1;
}

.profile-menu-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.profile-menu-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-menu-arrow {
    color: var(--text-muted);
    font-size: 14px;
    transition: transform var(--transition-fast);
}

.profile-menu-item:hover .profile-menu-arrow {
    transform: translateX(4px);
    color: var(--primary-color);
}

.profile-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    background: var(--danger-light);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-logout:hover {
    background: var(--danger-color);
    color: #fff;
    border-color: var(--danger-color);
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }
    
    .header-logo .logo-text {
        display: none;
    }
    
    .nav-item {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .resource-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    .sidebar.mobile-show {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    
    .content-area {
        margin-left: 0;
        padding: 16px;
    }
    
    .search-bar {
        flex-wrap: wrap;
        padding: 16px;
    }
    
    .search-input-wrapper {
        width: 100%;
        order: 1;
    }
    
    .search-btn {
        order: 2;
        flex: 1;
    }
    
    .publish-btn {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 12px;
    }
    
    .resource-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .header-nav {
        display: none;
    }
    
    .header {
        padding: 0 16px;
    }
    
    .header-user .user-name {
        display: none;
    }
}

/* ==================== 动画效果 ==================== */
.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片入场动画延迟 */
.resource-card:nth-child(1) { animation-delay: 0s; }
.resource-card:nth-child(2) { animation-delay: 0.05s; }
.resource-card:nth-child(3) { animation-delay: 0.1s; }
.resource-card:nth-child(4) { animation-delay: 0.15s; }
.resource-card:nth-child(5) { animation-delay: 0.2s; }
.resource-card:nth-child(6) { animation-delay: 0.25s; }

/* ==================== 工具类 ==================== */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary-light) !important; }
.bg-success { background-color: var(--success-light) !important; }
.bg-warning { background-color: var(--warning-light) !important; }
.bg-danger { background-color: var(--danger-light) !important; }

/* 侧边栏折叠后的悬浮展开按钮 */
.sidebar-expand-btn {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 950;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: 12px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 3px 0 16px rgba(13, 110, 79, 0.35);
    transition: all var(--transition-normal);
    font-size: 13px;
    font-weight: 600;
    writing-mode: horizontal-tb;
    min-width: 36px;
}

.sidebar-expand-btn:hover {
    background: var(--primary-hover);
    padding-left: 16px;
    box-shadow: 4px 0 20px rgba(13, 110, 79, 0.5);
}

.sidebar-expand-btn:hover .expand-btn-label {
    opacity: 1;
    max-height: 20px;
}

.expand-btn-label {
    font-size: 11px;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    opacity: 0.8;
    transition: all var(--transition-normal);
}

/* ==================== 渐变背景装饰 ==================== */
.gradient-bg {
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 50%, var(--primary-light) 100%);
}
