/* ===== Profile Page - Portal Style ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #333; font-size: 14px; }

/* CSS Variables (供通知面板等组件使用) */
:root {
    --primary-color: #4a90e2;
    --primary-light: #6ba9f0;
    --primary-dark: #357abd;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===== 顶部导航栏 ===== */
.portal-header {
    position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 1000;
    background: white; border-bottom: 1px solid #e8e8e8;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px;
}
.portal-header-left { display: flex; align-items: center; gap: 20px; }
.portal-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 16px; font-weight: 700; color: #4a90e2; }
.portal-logo .logo-icon { font-size: 20px; }
.portal-menu-btn { background: none; border: none; font-size: 22px; cursor: pointer; color: #666; padding: 4px; }
.portal-header-right { display: flex; align-items: center; gap: 16px; }
.header-icon-btn { color: #666; font-size: 18px; text-decoration: none; padding: 6px; }
.header-icon-btn:hover { color: #2058ff; }
.portal-user { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.portal-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #00b894, #00a381); display: flex; align-items: center; justify-content: center; color: white; font-size: 16px; }
.portal-username { font-size: 14px; color: #333; font-weight: 500; }

/* ===== 左侧导航栏 ===== */
.portal-sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0; width: 220px; z-index: 999;
    background: white; border-right: 1px solid #e8e8e8;
    overflow-y: auto; padding: 16px 0; transition: width 0.3s;
}
.portal-sidebar.collapsed { width: 60px; }
.sidebar-menu-group { margin-bottom: 8px; }
.sidebar-menu-title { padding: 8px 20px; font-size: 12px; color: #999; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.sidebar-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: #666; text-decoration: none; font-size: 14px;
    transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-menu-item:hover { background: #f5f8ff; color: #2058ff; border-left-color: #2058ff; }
.sidebar-menu-item.active { background: #e8f0fe; color: #2058ff; font-weight: 600; border-left-color: #2058ff; }
.sidebar-menu-item i { font-size: 16px; width: 20px; text-align: center; }

/* ===== 主内容区 ===== */
.portal-main {
    margin-left: 220px; margin-top: 56px; padding: 24px;
    min-height: calc(100vh - 56px);
    transition: margin-left 0.3s;
}

/* ===== 统计卡片（彩色渐变） ===== */
.stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.stat-card {
    border-radius: 12px; padding: 24px 20px; color: white;
    display: flex; align-items: center; gap: 16px;
    position: relative; overflow: hidden; min-height: 110px;
}
.stat-card::after {
    content: ''; position: absolute; top: -30px; right: -30px; width: 100px; height: 100px;
    border-radius: 50%; background: rgba(255,255,255,0.15);
}
.stat-card.stat-blue { background: linear-gradient(135deg, #4a90d9, #357abd); }
.stat-card.stat-red { background: linear-gradient(135deg, #e94560, #c62828); }
.stat-card.stat-green { background: linear-gradient(135deg, #00b894, #00a381); }
.stat-card.stat-purple { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.stat-card-icon { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.stat-card-info { z-index: 1; }
.stat-card-value { font-size: 32px; font-weight: 700; line-height: 1.2; color: #fff; }
.stat-card-value small { font-size: 14px; font-weight: 400; opacity: 0.8; margin-left: 4px; }
.stat-card-label { font-size: 14px; opacity: 0.85; margin-top: 2px; }

/* ===== 两列布局 ===== */
.profile-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }

/* ===== 卡片块 ===== */
.card-block { background: white; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; }
.card-block-title { padding: 16px 20px; font-size: 15px; font-weight: 600; color: #333; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.card-title-link { font-size: 13px; color: #2058ff; text-decoration: none; font-weight: 400; }
.card-title-link:hover { text-decoration: underline; }

/* ===== 用户信息 ===== */
.user-info-box { display: flex; gap: 20px; padding: 20px; align-items: flex-start; }
.avatar-placeholder { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #4a90d9, #6ba3e0); display: flex; align-items: center; justify-content: center; color: white; font-size: 36px; flex-shrink: 0; }
.user-info-detail { flex: 1; }
.user-info-name { font-size: 20px; font-weight: 700; color: #333; margin-bottom: 12px; }
.user-info-row { display: flex; align-items: center; padding: 6px 0; font-size: 14px; }
.user-info-row .label { color: #999; width: 80px; flex-shrink: 0; }
.user-info-row .value { color: #333; font-weight: 500; }
.notification-empty { text-align: center; padding: 40px 20px; color: #999; font-size: 14px; }

/* ===== 通知列表 ===== */
.notification-list { padding: 0; max-height: 300px; overflow-y: auto; }
.notification-item { display: flex; align-items: center; padding: 12px 20px; border-bottom: 1px solid #f5f5f5; font-size: 14px; color: #333; transition: background 0.2s; }
.notification-item:hover { background: #f8f9fa; }
.notification-item:last-child { border-bottom: none; }

/* ===== 资源列表表格 ===== */
.resource-table { padding: 0; }
.resource-table table { width: 100%; border-collapse: collapse; }
.resource-table thead tr { background: #f8f9fa; }
.resource-table th { padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; color: #666; border-bottom: 1px solid #e8e8e8; }
.resource-table td { padding: 12px 16px; font-size: 14px; color: #333; border-bottom: 1px solid #f0f0f0; }
.resource-table tr:hover { background: #f5f8ff; }
.status-tag { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.status-tag.approved { background: #e6f7ed; color: #28a745; }
.status-tag.pending { background: #fff3e0; color: #f57c00; }
.status-tag.rejected { background: #fce4ec; color: #dc3545; }
.card-title-link { font-size: 13px; color: #2058ff; text-decoration: none; font-weight: 400; }
.card-title-link:hover { text-decoration: underline; }

/* ===== 页面标题 ===== */
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 20px; font-weight: 600; color: #333; }

/* ===== 分页 ===== */
.pagination-list { display: flex; gap: 6px; padding: 20px; justify-content: center; }
.pagination-list li { list-style: none; }
.pagination-list li a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid #ddd; border-radius: 6px; text-decoration: none; color: #333; font-size: 14px; transition: all 0.2s; }
.pagination-list li a:hover { border-color: #2058ff; color: #2058ff; }
.pagination-list li.active a { background: #2058ff; color: white; border-color: #2058ff; }

/* ===== 表单 ===== */
.profile-form .form-group { margin-bottom: 20px; }
.profile-form .form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #333; font-size: 14px; }
.profile-form .form-group input,
.profile-form .form-group select,
.profile-form .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px;
    font-size: 14px; background: #f8f9fa; color: #333; transition: border-color 0.3s ease;
}
.profile-form .form-group input:focus,
.profile-form .form-group select:focus,
.profile-form .form-group textarea:focus {
    outline: none; border-color: #2058ff; box-shadow: 0 0 0 3px rgba(32,88,255,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.char-count { font-size: 12px; color: #999; font-weight: 400; margin-left: 8px; }

/* ===== 按钮 ===== */
.btn-action {
    display: inline-block; padding: 10px 24px; border: none; border-radius: 8px;
    background: #2058ff; color: white; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: background 0.2s;
}
.btn-action:hover { background: #1a4ae0; }

/* ===== 快捷功能网格 ===== */
.quick-actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px; }
.quick-action-item {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 20px 12px; border-radius: 10px; text-decoration: none; color: #333;
    transition: all 0.2s; border: 1px solid #f0f0f0;
}
.quick-action-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); background: #f8f9fa; }
.quick-action-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; color: white; font-size: 22px;
}
.quick-action-item span { font-size: 13px; font-weight: 500; }

/* ===== 账号信息行 ===== */
.info-row { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: #999; width: 90px; flex-shrink: 0; }
.info-value { color: #333; font-weight: 500; }
.bio-box { padding: 10px 14px; background: #f8f9fa; border-radius: 8px; font-size: 13px; color: #666; line-height: 1.6; }

/* ===== 公告列表 ===== */
.announcement-item {
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}
.announcement-item:hover { background: #f8f9fa; }
.announcement-item:last-child { border-bottom: none; }
.announcement-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.announcement-title strong {
    font-size: 14px;
    color: #333;
}
.ann-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}
.ann-pin { background: #fce4ec; color: #e91e63; }
.ann-date {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}
.announcement-content {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}
.announcement-meta {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ===== Loading / Empty ===== */
.loading-spinner { text-align: center; padding: 40px; }
.empty-state { text-align: center; padding: 40px; color: #999; }

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    /* 顶部导航栏 */
    .portal-header { padding: 0 12px; height: 50px; }
    .portal-logo { font-size: 14px; }
    .portal-logo .logo-icon { font-size: 18px; }
    .portal-header-right { gap: 10px; }
    .portal-username { display: none; }

    /* 侧边栏：默认隐藏，通过 toggle 展示 */
    .portal-sidebar {
        top: 50px;
        width: 220px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }
    .portal-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .portal-sidebar.collapsed { width: 220px; }

    /* 遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 50px; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.3);
        z-index: 998;
    }
    .sidebar-overlay.show { display: block; }

    /* 主内容区 */
    .portal-main {
        margin-left: 0;
        margin-top: 50px;
        padding: 16px;
    }

    /* 统计卡片：2列 */
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }
    .stat-card {
        padding: 16px 14px;
        min-height: 90px;
        gap: 10px;
    }
    .stat-card-icon { width: 40px; height: 40px; font-size: 20px; }
    .stat-card-value { font-size: 24px; }
    .stat-card-label { font-size: 12px; }

    /* 两列布局 → 单列 */
    .profile-two-col {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 用户信息 */
    .user-info-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 16px;
        gap: 12px;
    }
    .avatar-placeholder { width: 64px; height: 64px; font-size: 28px; }
    .user-info-name { font-size: 18px; }
    .user-info-detail { text-align: center; }
    .user-info-row { justify-content: center; }

    /* 快捷功能：2列 */
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 14px;
    }
    .quick-action-item { padding: 14px 8px; }
    .quick-action-icon { width: 40px; height: 40px; font-size: 18px; }

    /* 表单行 */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* 卡片 */
    .card-block-title { padding: 12px 14px; font-size: 14px; }

    /* 通知列表 */
    .notification-list { max-height: 200px; }
    .notification-item { padding: 10px 14px; font-size: 13px; }

    /* 公告 */
    .announcement-item { padding: 12px 14px; }
    .announcement-title strong { font-size: 13px; }
    .announcement-content { font-size: 12px; }

    /* 表格 - 水平滚动 */
    .resource-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .resource-table table { min-width: 500px; }
    .resource-table th, .resource-table td { padding: 8px 10px; font-size: 12px; }

    /* 分页 */
    .pagination-list { padding: 14px; gap: 4px; }
    .pagination-list li a { min-width: 30px; height: 30px; font-size: 12px; }

    /* 按钮 */
    .btn-action { padding: 8px 18px; font-size: 13px; }

    /* 页面标题 */
    .page-header h2 { font-size: 17px; }

    /* 账号信息 */
    .info-row { padding: 8px 0; font-size: 13px; }
    .info-label { width: 70px; }
}

@media (max-width: 480px) {
    .stats-row { gap: 8px; }
    .stat-card { padding: 12px 10px; min-height: 80px; gap: 8px; }
    .stat-card-icon { width: 36px; height: 36px; font-size: 18px; }
    .stat-card-value { font-size: 20px; }
    .quick-actions-grid { gap: 8px; padding: 10px; }
    .quick-action-item { padding: 10px 6px; }
    .portal-main { padding: 12px; }
}
