/* ============================================================
   角色终端布局
   ============================================================ */

.role-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    min-height: calc(100vh - 64px - 80px);
}

.role-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

/* 用户卡（深底，设计稿仪表盘样式） */
.role-user-card {
    background: #1a1a2e;
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    font-family: var(--font-serif);
}
.role-user-card::before {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    right: -80px;
    top: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 90, 79, 0.25) 0%, transparent 68%);
    pointer-events: none;
}
.role-user-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 10px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    position: relative;
    z-index: 1;
}
.role-user-card h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: #fff;
    position: relative;
    z-index: 1;
}
.role-user-card p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}
.role-credits {
    color: #fbbf24;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* 侧栏导航（深底 + 白色衬线字） */
.role-nav {
    background: #1a1a2e;
    border-radius: var(--radius-lg);
    padding: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-serif);
}
.role-nav a {
    display: block;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    text-decoration: none;
}
.role-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.role-nav a.active {
    background: linear-gradient(135deg, #e85a4f, #d14a40);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(232, 90, 79, 0.35);
}

/* 菜单分组：概览 / 我的功能 / 发现 三段分隔，保证三角色布局一致 */
.role-nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Role main */
.role-main {
    min-width: 0;
}
.role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.role-header h1 {
    font-size: 24px;
    font-weight: 700;
}
.role-header p {
    color: var(--text-light);
    font-size: 14px;
}

/* Stat grid for role terminals */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--primary-light);
    color: var(--primary);
    flex: none;
}
.stat-info { flex: 1; }
.stat-info .stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}
.stat-info .stat-label {
    font-size: 12px;
    color: var(--text-light);
}
.stat-link {
    font-size: 12px;
    color: var(--primary);
    margin-top: 4px;
    display: inline-block;
}

/* Quick actions */
.quick-actions { margin-bottom: 24px; }
.quick-actions h3 {
    font-size: 18px;
    margin-bottom: 16px;
}
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.action-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    color: var(--text);
    text-decoration: none;
    display: block;
}
.action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}
.action-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.action-card span {
    font-size: 13px;
    display: block;
}

/* Crowdfunding grid in role terminal */
.crowdfunding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.crowdfunding-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* 移动端：侧边栏取消 sticky，改为与内容自然堆叠 */
@media (max-width: 768px) {
    .role-layout { grid-template-columns: 1fr; }
    .role-sidebar { position: static; }
}
