/* 【主站】static/css/pages/profile/base.css */
/* 位置：mcres/static/css/pages/profile/base.css */

/* ============================================================
   基础
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    color: #e4e4ea;
    min-height: 100vh;
    padding: 0;
    background-image:
        linear-gradient(135deg, rgba(11,11,18,0.88), rgba(11,11,18,0.92)),
        url('/background');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-blend-mode: overlay;
    line-height: 1.6;
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #14141e; }
::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a4e; }
.container { max-width: 1440px; margin: 0 auto; padding: 80px 40px 40px; }

.card {
    background: rgba(22,22,34,0.20);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.02);
    padding: 32px 36px;
    margin-bottom: 28px;
    transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.2s ease;
    border-radius: 5px;
}
.card:hover {
    transform: translateY(-3px);
    border-color: var(--role-color-33);
    box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ========== 个人信息头部（保留兼容，但不使用） ========== */
.profile-header { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; }
.avatar {
    width: 120px; height: 120px; border-radius: 50%;
    border: 3px solid var(--role-color);
    padding: 0;
    box-shadow: 0 8px 32px var(--role-color-40);
    flex-shrink: 0;
    overflow: hidden;
    background: #0b0b12;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.profile-info { flex: 1; }
.profile-info .name-row {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 4px;
}
.profile-info .name-row h1 {
    font-size: 34px; font-weight: 700; color: #f0f0f6; letter-spacing: -0.5px;
}
.profile-info .name-row .role-badge {
    font-size: 14px; font-weight: 600;
    padding: 4px 20px;
    background: var(--role-color-22);
    color: var(--role-color);
    border: 1px solid var(--role-color-44);
    border-radius: 0;
}
.profile-info .signature {
    font-size: 16px; color: #8a8a9e; margin-bottom: 14px;
    font-style: italic; border-left: 3px solid var(--role-color); padding-left: 18px;
}
.profile-info .meta {
    display: flex; flex-wrap: wrap; gap: 20px 36px; font-size: 14px; color: #6f6f84;
}
.profile-info .meta span { display: flex; align-items: center; gap: 8px; }
.profile-info .meta i { width: 18px; color: var(--role-color); opacity: 0.8; }
.profile-actions { margin-top: 18px; }
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 28px; font-weight: 600; font-size: 14px;
    border: none; cursor: pointer;
    background: var(--role-color); color: #fff;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    text-decoration: none; font-family: inherit;
    box-shadow: 0 4px 20px var(--role-color-40);
    border-radius: 0;
}
.btn:hover {
    background: var(--role-color);
    filter: brightness(0.85);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--role-color-60);
}

/* ========== 选项卡菜单（兼容旧版） ========== */
.profile-tabs {
    display: flex;
    gap: 4px;
    margin: 24px 0 0 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0;
    flex-wrap: wrap;
}
.profile-tabs .tab-btn {
    background: transparent;
    border: none;
    padding: 10px 24px;
    color: #8a8a9e;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 2px solid transparent;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.profile-tabs .tab-btn:hover {
    color: #e4e4ea;
}
.profile-tabs .tab-btn.active {
    color: var(--role-color);
    border-bottom-color: var(--role-color);
}
.profile-tabs .tab-btn i {
    font-size: 16px;
}
.tab-content {
    display: none;
    padding-top: 24px;
}
.tab-content.active {
    display: block;
}

/* ========== 统计卡片（旧版兼容） ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.stat-item {
    text-align: center; padding: 20px 12px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    transition: background 0.25s, border-color 0.25s;
    border-radius: 0;
}
.stat-item:hover { background: rgba(255,255,255,0.04); border-color: var(--role-color-33); }
.stat-item .stat-icon { font-size: 26px; color: var(--role-color); display: block; margin-bottom: 2px; opacity: 0.8; }
.stat-item .stat-number { font-size: 32px; font-weight: 700; color: #f0f0f6; line-height: 1.2; }
.stat-item .stat-number.gold { color: var(--role-color); }
.stat-item .stat-number.green { color: #55d88b; }
.stat-item .stat-number.blue { color: #5dade2; }
.stat-item .stat-number.warning { color: #f39c12; }
.stat-item .stat-number.danger { color: #e74c3c; }
.stat-item .stat-label { font-size: 14px; color: #6f6f84; margin-top: 4px; }

/* ========== 编辑动态 ========== */
.history-list {
    position: relative;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.history-list::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--role-color);
    opacity: 0.35;
    border-radius: 2px;
}
.history-item {
    position: relative;
    padding: 12px 12px 12px 28px;
    background: rgba(255,255,255,0.02);
    border-left: none;
    border-radius: 0;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}
.history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--role-color);
    border: 2px solid rgba(0,0,0,0.4);
    box-shadow: 0 0 0 3px var(--role-color-33);
    z-index: 1;
}
.history-item:hover {
    background: rgba(255,255,255,0.04);
}
.history-item:hover::before {
    box-shadow: 0 0 0 4px var(--role-color-44);
    transform: translateY(-50%) scale(1.1);
}
.history-item .history-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.history-item .history-left .op-type {
    color: #8a8a9e;
    font-size: 14px;
}
.history-item .history-left .res-name {
    font-weight: 500;
    color: #f0f0f6;
}
.history-item .history-left .res-name a {
    color: #f0f0f6;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255,255,255,0.15);
    transition: border-color 0.2s;
}
.history-item .history-left .res-name a:hover {
    border-color: var(--role-color);
    color: var(--role-color);
}
.history-item .history-time {
    font-size: 13px;
    color: #6f6f84;
    white-space: nowrap;
}
.history-empty {
    text-align: center;
    color: #4d4d60;
    font-style: italic;
    padding: 12px 0;
}

/* ========== 管辖区 ========== */
.area-section-title {
    font-size: 22px; font-weight: 600; color: #f0f0f6;
    margin-bottom: 24px; display: flex; align-items: center; gap: 14px;
}
.area-section-title i { color: var(--role-color); }
.area-section-title .badge {
    font-size: 14px; font-weight: 400; color: #6f6f84;
    background: rgba(255,255,255,0.04); padding: 0 16px; border-radius: 0;
}
.area-vertical { display: flex; flex-direction: column; gap: 20px; }
.area-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 20px 24px 18px;
    transition: background 0.25s, border-color 0.25s;
    border-radius: 0;
}
.area-card:hover { background: rgba(255,255,255,0.04); border-color: var(--role-color-33); }
.area-card .area-header {
    display: flex; align-items: center; gap: 12px;
    font-size: 17px; font-weight: 600; color: #e4e4ea;
    margin-bottom: 14px;
}
.area-card .area-header i { color: var(--role-color); font-size: 20px; width: 28px; text-align: center; }
.area-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.area-table th {
    text-align: left; font-weight: 600; color: #6f6f84;
    padding: 6px 8px 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px; text-transform: uppercase; letter-spacing: 0.3px;
}
.area-table td {
    padding: 10px 8px 10px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
    color: #e4e4ea; vertical-align: middle;
}
.area-table tr:last-child td { border-bottom: none; }
.area-table .cat-name { font-weight: 500; color: #8a8a9e; width: 90px; flex-shrink: 0; }
.area-table .resource-list { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.area-table .resource-list .tag {
    display: inline-block; padding: 3px 16px; font-size: 13px; font-weight: 500;
    background: var(--role-color-15); color: #e4e4ea;
    border: 1px solid var(--role-color-22);
    transition: all 0.2s ease; cursor: pointer; border-radius: 0;
}
.area-table .resource-list .tag a { color: inherit; text-decoration: none; display: block; }
.area-table .resource-list .tag:hover {
    background: var(--role-color-30); border-color: var(--role-color-55); transform: translateY(-1px);
}
.area-table .resource-list .tag-all {
    background: rgba(85,216,139,0.08); color: #55d88b; border-color: rgba(85,216,139,0.10); cursor: default;
}
.area-table .resource-list .tag-all:hover { background: rgba(85,216,139,0.12); transform: none; }

/* ========== 贡献日历（旧版兼容） ========== */
.contribution-graph {
    padding: 10px 0;
    overflow-x: auto;
    text-align: center;
}
.contribution-graph .graph-container {
    display: inline-block;
    min-width: auto;
    text-align: left;
}
.graph-wrapper {
    display: flex;
    align-items: flex-start;
}
.contribution-grid {
    display: flex;
    gap: 2px;
}
.week-column {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 20px;
    flex-shrink: 0;
    align-items: center;
}
.week-column .day-cell {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background-color: #2a2a3a;
    transition: transform 0.15s ease, background-color 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}
.week-column .day-cell:hover {
    transform: scale(1.25);
    z-index: 2;
    box-shadow: 0 0 12px rgba(255,255,255,0.25);
}
.week-column .day-cell.empty {
    background-color: transparent !important;
    cursor: default;
}
.week-column .day-cell.empty:hover {
    transform: none !important;
    box-shadow: none !important;
}
.week-column .month-label {
    font-size: 11px;
    color: #8a8a9e;
    height: 18px;
    line-height: 18px;
    text-align: center;
    width: 100%;
    margin-bottom: 2px;
    font-weight: 500;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    text-transform: uppercase;
}
.week-column .month-label.hidden {
    visibility: hidden;
}
.custom-tooltip {
    position: fixed;
    background: #0f171f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d0d6dc;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    max-width: 320px;
    white-space: normal;
    word-break: break-word;
}
.custom-tooltip.visible {
    opacity: 1;
    visibility: visible;
}
.custom-tooltip .tip-title {
    font-weight: 600;
    color: #e8edf2;
    margin-bottom: 2px;
}
.custom-tooltip .tip-detail {
    color: #9ea8b4;
    font-size: 12px;
}
.custom-tooltip .tip-highlight {
    color: var(--role-color);
    font-weight: 600;
}
.weekday-labels {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 8px;
    font-size: 12px;
    color: #6f6f84;
    width: 30px;
    text-align: right;
    padding-top: 20px;
}
.weekday-labels span {
    height: 20px;
    line-height: 20px;
}
.year-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
}
.year-selector label { font-size: 14px; color: #8a8a9e; }
.year-selector select {
    padding: 6px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e4e4ea;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}
.year-selector select:hover { border-color: var(--role-color-55); }
.year-selector select option { background: #14141e; }
.comment-placeholder { text-align: center; color: #4d4d60; font-size: 15px; padding: 18px 0 10px; font-style: italic; }
.comment-section-title i { color: var(--role-color); }

/* ========== 资源卡片网格（作品/赞过/收藏） ========== */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 8px;
}
.resource-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}
.resource-card:hover {
    transform: translateY(-4px);
    border-color: var(--role-color-44);
}
.resource-card .thumb {
    aspect-ratio: 16/10;
    background: #0b0f14;
    overflow: hidden;
}
.resource-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.resource-card .info {
    padding: 12px 14px;
}
.resource-card .info .title {
    font-weight: 600;
    color: #e4e4ea;
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.resource-card .info .meta {
    font-size: 13px;
    color: #6f6f84;
    display: flex;
    gap: 12px;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6f6f84;
}
.empty-state i {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 16px;
}
.empty-state p {
    font-size: 16px;
}

/* ========== 成就网格 ========== */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}
.achievement-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 20px 12px;
    text-align: center;
    transition: 0.2s;
}
.achievement-item:hover {
    border-color: var(--role-color-44);
    background: rgba(255,255,255,0.06);
}
.achievement-item .icon {
    font-size: 36px;
    color: var(--role-color);
    display: block;
    margin-bottom: 8px;
}
.achievement-item .name {
    font-weight: 600;
    color: #e4e4ea;
    font-size: 14px;
}
.achievement-item .desc {
    font-size: 12px;
    color: #6f6f84;
    margin-top: 2px;
}

/* ========== 底部 ========== */
.footer {
    max-width: 1440px; margin: 0 auto; padding: 24px 40px 16px;
    border-top: 1px solid rgba(255,255,255,0.04);
    text-align: center; font-size: 14px; color: #6f6f84;
}

/* ========== 响应式 ========== */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 900px) {
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-info .name-row { justify-content: center; }
    .profile-info .signature { border-left: none; padding-left: 0; text-align: center; }
    .profile-info .meta { justify-content: center; }
    .profile-actions { text-align: center; }
    .area-table .cat-name { width: 70px; }
    .container { padding: 24px 20px; }
}
@media (max-width: 600px) {
    .container { padding: 16px; }
    .card { padding: 20px 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .profile-info .name-row h1 { font-size: 26px; }
    .avatar { width: 96px; height: 96px; }
    .area-card { padding: 16px 14px; }
    .area-table { font-size: 14px; }
    .area-table .cat-name { width: 60px; font-size: 13px; }
    .area-table .resource-list .tag { font-size: 12px; padding: 2px 12px; }
    .footer { padding: 16px 20px; }
    .week-column { width: 96px; }
    .week-column .day-cell { width: 12px; height: 12px; }
    .week-column .day-cell.empty { width: 12px; height: 12px; }
    .week-column .month-label { font-size: 9px; height: 14px; line-height: 14px; }
    .weekday-labels { width: 20px; font-size: 8px; padding-top: 16px; }
    .weekday-labels span { height: 12px; line-height: 12px; }
    .contribution-grid { gap: 1px; }
    .week-column { gap: 1px; }
    .profile-tabs .tab-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .achievement-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

/* ========== 作品侧边栏布局 ========== */
.works-card {
    padding: 0 !important;
    overflow: hidden;
}
.works-layout {
    display: flex;
    min-height: 400px;
}
.works-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}
.works-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 16px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #e4e4ea;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.works-sidebar-header i {
    font-size: 20px;
    color: var(--role-color);
}
.works-total-badge {
    margin-left: auto;
    background: var(--role-color-22);
    color: var(--role-color);
    padding: 0 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 22px;
}
.works-submenu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 8px;
    flex: 1;
}
.works-sub-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    padding: 10px 16px;
    color: #8a8a9e;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    width: 100%;
    text-align: left;
}
.works-sub-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #e4e4ea;
}
.works-sub-btn.active {
    color: var(--role-color);
    background: var(--role-color-15);
}
.works-sub-btn i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}
.works-sub-btn .sub-label {
    flex: 1;
}
.works-sub-btn .sub-count {
    background: rgba(255, 255, 255, 0.06);
    padding: 0 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6f6f84;
    line-height: 22px;
    flex-shrink: 0;
}
.works-sub-btn.active .sub-count {
    background: var(--role-color-22);
    color: var(--role-color);
}
.works-content {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 600px;
}
.works-sub-content {
    display: none;
}
.works-sub-content.active {
    display: block;
}
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

/* 响应式 works 侧边栏 */
@media (max-width: 768px) {
    .works-layout {
        flex-direction: column;
        min-height: auto;
    }
    .works-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 12px 0;
    }
    .works-submenu {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 4px;
    }
    .works-sub-btn {
        flex: 1 0 auto;
        padding: 8px 14px;
        font-size: 13px;
        justify-content: center;
        min-width: 80px;
    }
    .works-sidebar-header {
        padding: 0 16px 12px 16px;
        font-size: 15px;
    }
    .works-content {
        padding: 16px;
        max-height: none;
    }
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}
@media (max-width: 400px) {
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    .works-sub-btn {
        font-size: 12px;
        padding: 6px 10px;
        min-width: 60px;
    }
    .works-sub-btn .sub-count {
        font-size: 11px;
        padding: 0 6px;
        line-height: 18px;
    }
}

/* 右键菜单项悬停效果 */
.context-item:hover {
    background: rgba(255,255,255,0.06);
}
.context-item[data-action="delete"]:hover {
    background: rgba(249,117,131,0.15);
}

/* ========== 任务卡片样式 ========== */
.task-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
    margin-bottom: 8px;
}
.task-item:hover {
    background: rgba(255,255,255,0.04);
    border-color: var(--role-color-33);
}
.task-item .task-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.task-item .task-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.task-item .task-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.task-item .task-info .task-name {
    font-weight: 600;
    color: #e4e4ea;
    font-size: 15px;
}
.task-item .task-info .task-desc {
    font-size: 13px;
    color: #8a8a9e;
}
.task-item .task-action {
    flex-shrink: 0;
}
.task-completed-badge {
    color: #55d88b;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}
.task-action-btn {
    background: var(--role-color);
    color: #fff;
    border: none;
    padding: 4px 16px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.task-action-btn:hover:not(:disabled) {
    filter: brightness(0.9);
    transform: scale(1.02);
}
.task-action-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

/* ========== 第五人格风格 · 侧边栏布局 ========== */
.profile-layout {
    display: flex;
    gap: 28px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 80px 32px 40px;
    min-height: calc(100vh - 80px);
    align-items: flex-start;
}

/* ----- 左侧菜单栏 ----- */
.profile-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: rgba(22,22,34,0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 24px 16px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    position: sticky;
    top: 80px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* 头像容器（相对定位，供齿轮定位） */
.sidebar-avatar {
    position: relative;
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 16px;
}
.sidebar-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--role-color);
    box-shadow: 0 4px 20px var(--role-color-40);
    object-fit: cover;
    margin-bottom: 8px;
}
.sidebar-avatar-name {
    font-size: 18px;
    font-weight: 700;
    color: #f0f0f6;
}

/* ===== 头像包装器（用于徽章定位） ===== */
.sidebar-avatar .avatar-wrapper {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
}

.sidebar-avatar .avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--role-color);
    box-shadow: 0 4px 20px var(--role-color-40);
    object-fit: cover;
    display: block;
    margin-bottom: 0;
}

/* ===== 头衔徽章（钉钉风格 · 底部居中，短文字居中，长文字滚动） ===== */
.sidebar-avatar .user-title-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border: 2px solid #1a1e26;
    letter-spacing: 0.5px;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sidebar-avatar .user-title-badge:not(.scroll) {
    justify-content: center;
}

.sidebar-avatar .user-title-badge.scroll .title-text {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 6s linear infinite;
}

@keyframes marquee {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 齿轮图标（右上角） */
.sidebar-gear {
    position: absolute;
    top: 4px;
    right: 4px;
    color: #8a8a9e;
    font-size: 18px;
    transition: color 0.2s, transform 0.3s;
    text-decoration: none;
    padding: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    line-height: 1;
}
.sidebar-gear:hover {
    color: #f0f0f6;
    transform: rotate(90deg);
    background: rgba(255,255,255,0.08);
}

/* ============================================================
   用户组：管理中心同款「标签 + 值」多行形式
   ============================================================ */
.sidebar-avatar .sidebar-role-tags {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 10px;
    width: 100%;
    padding: 0 4px;
    text-align: left;
}

.sidebar-avatar .sidebar-role-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    max-width: 100%;
    min-width: 0;
}

.sidebar-avatar .sidebar-role-label {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
    flex-shrink: 0;
}

.sidebar-avatar .sidebar-role-value {
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 主站用户组：使用 --role-color 传入的颜色 */
.sidebar-avatar .sidebar-role-tag-main .sidebar-role-value {
    color: var(--main-role-color, #55d88b);
}

/* 选料用户组：紫色 */
.sidebar-avatar .sidebar-role-tag-sel .sidebar-role-value {
    color: #c084fc;
}
.sidebar-avatar .sidebar-role-tag-sel.is-inactive .sidebar-role-value {
    color: rgba(255, 255, 255, 0.3);
}

/* 茶室用户组：琥珀色 */
.sidebar-avatar .sidebar-role-tag-tea .sidebar-role-value {
    color: #e8a437;
}
.sidebar-avatar .sidebar-role-tag-tea.is-inactive .sidebar-role-value {
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   转到茶室主页
   ============================================================ */
.sidebar-tea-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(232, 164, 55, 0.10);
    border: 1px solid rgba(232, 164, 55, 0.22);
    color: #e8a437;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.sidebar-tea-link i {
    font-size: 13px;
    opacity: 0.9;
}
.sidebar-tea-link:hover {
    background: rgba(232, 164, 55, 0.20);
    border-color: rgba(232, 164, 55, 0.45);
    color: #f5b855;
    transform: translateY(-1px);
}
.sidebar-tea-link:active {
    transform: translateY(0);
}

/* 侧边栏统计数据 */
.sidebar-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.02);
    padding: 12px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
}
.sidebar-stat {
    text-align: center;
}
.sidebar-stat-icon {
    display: block;
    font-size: 14px;
    color: #6f6f84;
}
.sidebar-stat-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #f0f0f6;
    line-height: 1.3;
}
.sidebar-stat-label {
    font-size: 11px;
    color: #6f6f84;
}

/* 导航菜单 */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-bottom: 16px;
}
.sidebar-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    padding: 10px 14px;
    color: #8a8a9e;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    width: 100%;
    text-align: left;
}
.sidebar-nav-btn i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}
.sidebar-nav-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #e4e4ea;
}
.sidebar-nav-btn.active {
    color: var(--role-color);
    background: var(--role-color-15);
}

.sidebar-footer {
    font-size: 11px;
    color: #4d4d60;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding-top: 12px;
}

/* ----- 右侧主内容 ----- */
.profile-main {
    flex: 1;
    min-width: 0;
}
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* ========== 贡献日历 · 按月网格 (3行 x 4列) ========== */
.month-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 20px;
    margin-top: 8px;
}
.month-grid-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 12px 10px 10px;
}
.month-grid-item .month-title {
    font-size: 14px;
    font-weight: 600;
    color: #b0b0c4;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.month-grid-item .weekday-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}
.month-grid-item .weekday-row span {
    font-size: 9px;
    color: #6f6f84;
    text-align: center;
    height: 16px;
    line-height: 16px;
}
.month-grid-item .day-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.month-grid-item .day-cell {
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    background-color: #2a2a3a;
    transition: transform 0.15s ease, background-color 0.2s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.month-grid-item .day-cell.empty {
    background-color: transparent !important;
    cursor: default;
}
.month-grid-item .day-cell:hover:not(.empty) {
    transform: scale(1.2);
    z-index: 2;
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* 响应式：日历网格 */
@media (max-width: 1024px) {
    .month-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .profile-layout {
        flex-direction: column;
        padding: 80px 16px 40px;
        min-height: calc(100vh - 80px);
        gap: 16px;
    }
    .profile-sidebar {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
        gap: 12px;
        align-items: center;
        top: auto;
        max-height: none;
    }
    .sidebar-avatar {
        display: flex;
        align-items: center;
        gap: 12px;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
        flex: 1;
        text-align: left;
        flex-wrap: wrap;
    }
    .sidebar-avatar .avatar-wrapper {
        width: 48px;
        height: 48px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .sidebar-avatar .avatar-wrapper img {
        width: 48px;
        height: 48px;
        margin-bottom: 0;
    }
    .sidebar-avatar .user-title-badge {
        font-size: 9px;
        padding: 1px 10px;
        bottom: -4px;
        border-width: 1.5px;
        max-width: 92%;
    }
    .sidebar-avatar .user-title-badge.scroll .title-text {
        animation-duration: 4s;
    }
    .sidebar-avatar-name {
        font-size: 16px;
    }

    .sidebar-avatar .sidebar-role-tags {
        gap: 2px;
        margin-top: 6px;
        padding: 0;
    }
    .sidebar-avatar .sidebar-role-label {
        font-size: 10.5px;
    }
    .sidebar-avatar .sidebar-role-value {
        font-size: 11.5px;
    }
    .sidebar-tea-link {
        margin-top: 8px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .sidebar-stats {
        flex: 1;
        min-width: 120px;
        margin-bottom: 0;
        padding: 8px;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        order: 10;
        margin-bottom: 0;
        gap: 4px;
    }
    .sidebar-nav-btn {
        flex: 1 0 auto;
        padding: 6px 12px;
        font-size: 13px;
        justify-content: center;
        min-width: 60px;
    }
    .sidebar-footer { display: none; }
    .month-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
@media (max-width: 480px) {
    .month-grid-container {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .month-grid-item { padding: 8px 6px; }
    .month-grid-item .day-cell {
        font-size: 7px;
        border-radius: 2px;
    }
}

/* ===== 个性签名 ===== */
.sidebar-avatar-signature {
    font-size: 13px;
    color: #8a8a9e;
    margin-top: 4px;
    font-style: italic;
    text-align: center;
    padding: 0 8px;
    word-break: break-all;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ===== 分页控件 ===== */
.pagination-wrapper {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 16px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.pagination a,
.pagination span.active,
.pagination span.ellipsis {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #8a8a9e;
    background: transparent;
    transition: all 0.2s;
}

.pagination a:hover {
    background: rgba(255,255,255,0.08);
    color: #e4e4ea;
}

.pagination span.active {
    background: var(--role-color);
    color: #fff;
    font-weight: 600;
}

.pagination span.ellipsis {
    color: #6f6f84;
    cursor: default;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #8a8a9e;
    flex-shrink: 0;
}

.page-jump input[type="number"] {
    width: 60px;
    padding: 4px 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    color: #e4e4ea;
    font-size: 14px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.page-jump input[type="number"]:focus {
    border-color: var(--role-color);
}

.page-jump button {
    padding: 4px 16px;
    background: var(--role-color);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.page-jump button:hover {
    filter: brightness(0.9);
}

@media (max-width: 600px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .pagination {
        justify-content: center;
    }
    .page-jump {
        justify-content: center;
    }
}

.sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    margin-bottom: 12px;
    font-size: 13px;
    color: #6f6f84;
}

.sidebar-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-meta-item i {
    width: 18px;
    color: var(--role-color);
    opacity: 0.7;
    text-align: center;
}

.sidebar-meta-item .meta-label {
    opacity: 0.7;
}

.sidebar-meta-item .meta-value {
    color: #b0b0c4;
}

/* ============================================================
   绑定茶室话题
   ============================================================ */
.tea-bound-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tea-bound-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}

.tea-bound-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--role-color);
    opacity: 0.6;
    border-radius: 5px 0 0 5px;
    transition: opacity 0.2s;
}

.tea-bound-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--role-color-44);
    transform: translateX(3px);
}

.tea-bound-item:hover::before {
    opacity: 1;
}

.tea-bound-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--role-color-15);
    color: var(--role-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.tea-bound-body {
    flex: 1;
    min-width: 0;
}

.tea-bound-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #f0f0f6;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.tea-bound-item:hover .tea-bound-title {
    color: var(--role-color);
}

.tea-bound-hash {
    color: var(--role-color);
    opacity: 0.8;
}

.tea-bound-desc {
    font-size: 13px;
    color: #8a8a9e;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.tea-bound-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #6f6f84;
    flex-wrap: wrap;
}

.tea-bound-meta i {
    font-size: 11px;
    opacity: 0.75;
    margin-right: 3px;
}

.tea-bound-arrow {
    flex-shrink: 0;
    color: #4d4d60;
    font-size: 13px;
    transition: color 0.2s, transform 0.2s;
}

.tea-bound-item:hover .tea-bound-arrow {
    color: var(--role-color);
    transform: translate(2px, -2px);
}

/* 茶室话题档位徽章（主站内自包含，不依赖茶室 CSS） */
.topic-level-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.topic-level-yajian {
    background: rgba(232, 164, 55, 0.15);
    color: #e8a437;
    box-shadow: 0 0 0 1px rgba(232, 164, 55, 0.35);
}

.topic-level-chatai {
    background: #f5b855;
    color: #1a1a1a;
}

.topic-level-sanzuo {
    background: rgba(139, 148, 158, 0.10);
    color: #8b949e;
}

.topic-level-sealed {
    background: rgba(224, 82, 82, 0.15);
    color: #e05252;
}

.topic-level-counter {
    background: rgba(139, 148, 158, 0.15);
    color: #8b949e;
}

/* 响应式：绑定茶室 */
@media (max-width: 600px) {
    .tea-bound-item {
        padding: 12px 14px;
        gap: 10px;
    }
    .tea-bound-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .tea-bound-title {
        font-size: 14px;
    }
    .tea-bound-meta {
        gap: 12px;
        font-size: 11.5px;
    }
}

/* ============================================================
   在线状态
   ------------------------------------------------------------
   ① 头像左上角小圆点（避开底部居中的头衔徽章）
   ② 侧边栏 meta 区一行文字
   ============================================================ */

/* 头像角标：放左上角 */
.sidebar-avatar .avatar-wrapper .online-dot {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--dot-color, #4d4d60);
    border: 2.5px solid #1a1e26;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
    z-index: 3;
    transition: background-color 0.2s;
}

/* 在线：加呼吸光晕 */
.sidebar-avatar .avatar-wrapper .online-dot-online {
    animation: onlinePulse 2s ease-in-out infinite;
}

/* 茶室在线：琥珀光晕，慢一点 */
.sidebar-avatar .avatar-wrapper .online-dot-tea_online {
    animation: onlinePulse 3s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%   { box-shadow: 0 0 0 0 var(--dot-color); }
    70%  { box-shadow: 0 0 0 5px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* 侧边栏 meta 行：状态 */
.sidebar-meta-item.sidebar-meta-online .meta-value {
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* 移动端：角标缩小 */
@media (max-width: 768px) {
    .sidebar-avatar .avatar-wrapper .online-dot {
        width: 11px;
        height: 11px;
        border-width: 2px;
        left: 0;
        top: 0;
    }
}