/* ============================================================
   茶室 - 用户主页样式
   ============================================================ */

.profile-page {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* ============================================================
   用户卡片
   ============================================================ */
.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 26px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent 70%);
    opacity: 0.7;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 4px 16px rgba(232, 164, 55, 0.25);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-text {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-size: 32px;
    font-weight: 700;
}

.profile-main {
    flex: 1;
    min-width: 0;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.tea-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    background: color-mix(in srgb, var(--role-color) 15%, transparent);
    color: var(--role-color);
    white-space: nowrap;
}

.tea-role-badge i {
    font-size: 10px;
    opacity: 0.85;
}

.profile-self-tag {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    background: rgba(232, 164, 55, 0.15);
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.profile-signature {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 12px;
    word-break: break-word;
}

.profile-signature-empty {
    color: var(--text-muted);
    font-style: italic;
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-muted);
}

.profile-meta .item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: var(--transition);
}

.profile-meta .item i {
    font-size: 11px;
    opacity: 0.75;
}

.profile-meta .item-link {
    color: var(--accent);
}

.profile-meta .item-link:hover {
    color: var(--accent-bright);
}

.profile-actions {
    flex-shrink: 0;
}

/* ============================================================
   统计栏
   ============================================================ */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 18px;
}

.stat-item {
    background: var(--bg-card);
    padding: 16px 12px;
    text-align: center;
    transition: var(--transition);
}

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

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-bright);
    line-height: 1.1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* ============================================================
   Tab
   ============================================================ */
.profile-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
    display: none;
}

.profile-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.profile-tab:hover {
    background: rgba(232, 164, 55, 0.06);
    color: var(--text-primary);
}

.profile-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #1a1a1a;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(232, 164, 55, 0.25);
}

/* ============================================================
   帖子列表
   ============================================================ */
.profile-post-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-post-list .post-card {
    padding: 16px 20px;
}

/* ============================================================
   回复列表
   ============================================================ */
.profile-reply-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-reply-item {
    display: block;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.profile-reply-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(232, 164, 55, 0.35);
    transform: translateY(-1px);
}

.profile-reply-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-muted);
}

.profile-reply-post {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.profile-reply-post:hover {
    color: var(--accent-bright);
}

.profile-reply-floor {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
}

.profile-reply-excerpt {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 10px;
    word-break: break-word;
}

.profile-reply-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.profile-reply-meta .item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.profile-reply-meta .item i {
    font-size: 11px;
    opacity: 0.7;
}

/* ============================================================
   关注话题列表
   ============================================================ */
.profile-topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-topic-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.profile-topic-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(232, 164, 55, 0.35);
    transform: translateY(-1px);
}

.profile-topic-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(232, 164, 55, 0.10);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.profile-topic-body {
    flex: 1;
    min-width: 0;
}

.profile-topic-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.profile-topic-title .hash {
    color: var(--accent);
    opacity: 0.8;
}

.profile-topic-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.profile-topic-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.profile-topic-meta .item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   ★ Bug 4 修复：处罚弹窗
   ============================================================ */
.punish-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: punishFadeIn 0.2s ease;
}

.punish-modal-backdrop[hidden] {
    display: none !important;
}

@keyframes punishFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.punish-modal {
    width: 100%;
    max-width: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    /* ★ Bug 4 修复：去掉 overflow: hidden */
    overflow: visible;
    max-height: 90vh;
    animation: punishSlideIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes punishSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.punish-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(224, 82, 82, 0.05);
    /* ★ Bug 4 修复：单独处理顶部圆角 */
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}

.punish-modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.punish-modal-header h3 i {
    color: var(--danger);
    font-size: 13px;
}

.punish-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.punish-modal-close:hover {
    background: rgba(224, 82, 82, 0.15);
    color: var(--danger);
    transform: rotate(90deg);
}

.punish-modal-body {
    padding: 20px;
    /* ★ Bug 4 修复：让 body 内部滚动 */
    overflow-y: auto;
    flex: 1;
}

.punish-hint {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 16px;
    padding: 10px 14px;
    background: rgba(232, 164, 55, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
}

.punish-hint strong {
    color: var(--accent-bright);
    font-weight: 600;
}

.punish-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.punish-type-option {
    cursor: pointer;
    display: block;
}

.punish-type-option input[type="radio"] {
    display: none;
}

.punish-type-card {
    padding: 14px 16px;
    background: rgba(11, 15, 20, 0.5);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.punish-type-card > i {
    font-size: 20px;
    color: var(--text-muted);
    transition: var(--transition);
}

.punish-type-option:hover .punish-type-card {
    background: rgba(224, 82, 82, 0.05);
    border-color: rgba(224, 82, 82, 0.3);
}

.punish-type-option input:checked + .punish-type-card {
    background: rgba(224, 82, 82, 0.10);
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(224, 82, 82, 0.12);
}

.punish-type-option input:checked + .punish-type-card > i {
    color: var(--danger);
}

.punish-type-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.punish-type-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.punish-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.10);
    /* ★ Bug 4 修复：单独处理底部圆角 */
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-shrink: 0;
}

.punish-modal-footer .btn {
    padding: 8px 22px;
    font-size: 13.5px;
    font-weight: 600;
}

/* ============================================================
   处罚面板（用户主页显示已有处罚）
   ============================================================ */
.profile-punish-section {
    background: var(--bg-card);
    border: 1px solid rgba(224, 82, 82, 0.25);
    border-left: 3px solid var(--danger);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 18px;
}

.profile-punish-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.profile-punish-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.profile-punish-header h3 i { color: var(--danger); font-size: 13px; }

.profile-punish-header .count {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 8px;
    background: rgba(224, 82, 82, 0.15);
    color: var(--danger);
    font-weight: 500;
}

.profile-punish-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-punish-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(224, 82, 82, 0.04);
    border: 1px solid rgba(224, 82, 82, 0.15);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.profile-punish-topic {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.profile-punish-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
}

.profile-punish-type.type-mute {
    background: rgba(230, 126, 34, 0.15);
    color: var(--warning);
}

.profile-punish-type.type-ban {
    background: rgba(224, 82, 82, 0.15);
    color: var(--danger);
}

.profile-punish-meta {
    flex: 1;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.profile-punish-revoke {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: transparent;
    border: 1px solid rgba(224, 82, 82, 0.3);
    border-radius: 16px;
    color: var(--danger);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

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

.profile-punish-revoke:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 640px) {
    .profile-header {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
    }
    .profile-avatar {
        width: 64px;
        height: 64px;
    }
    .profile-avatar-text {
        font-size: 26px;
    }
    .profile-name {
        font-size: 19px;
    }
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-stats .stat-item:nth-child(2) {
        border-right: none;
    }
    .profile-post-list .post-card,
    .profile-reply-item,
    .profile-topic-item {
        padding: 14px 16px;
    }
    .punish-type-grid {
        grid-template-columns: 1fr;
    }
    .punish-modal-footer {
        flex-direction: column-reverse;
    }
    .punish-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    .profile-punish-item {
        flex-direction: column;
        align-items: stretch;
    }
    .profile-punish-revoke {
        width: 100%;
        justify-content: center;
    }
}