﻿/**
 * 邀请码输入弹窗样式模块
 * 符合规范：CSS样式独立性，使用命名空间避免冲突
 */

/* ==================== 邀请码输入弹窗样式 ==================== */

.invite-code-modal {
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.invite-code-content {
    max-width: 480px;
    width: 90%;
    margin: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--bg-card) 0%, #1f1f1f 100%);
    border-radius: 16px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    max-height: 90vh;
    height: auto;
}

.invite-code-header {
    padding: 24px 28px 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invite-code-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    letter-spacing: 0.3px;
}

.invite-code-close {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: none;
    padding: 0;
}

.invite-code-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.invite-code-body {
    padding: 24px 28px;
    flex: 0 0 auto;
    min-height: 0;
}

.invite-code-input-group {
    margin-bottom: 16px;
}

.invite-code-input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.invite-code-input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.invite-code-input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.15),
        0 4px 12px rgba(102, 126, 234, 0.1);
}

.invite-code-input-group input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0;
}

/* 权限显示区域 */
.invite-code-permissions {
    margin-top: 20px;
    padding: 16px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    animation: fadeIn 0.3s ease;
    flex: 0 0 auto;
}

/* 权限加载状态 */
.permissions-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--text-secondary);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 权限为空提示 */
.permissions-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: var(--text-secondary);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.empty-icon {
    font-size: 18px;
}

.empty-text {
    font-size: 13px;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.permissions-header {
    margin-bottom: 12px;
}

.permissions-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.permissions-content {
    max-height: 300px;
    overflow-y: auto;
    flex: 0 0 auto;
}

.permissions-content::-webkit-scrollbar {
    width: 6px;
}

.permissions-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.permissions-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.permissions-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.permission-group-item {
    margin-bottom: 16px;
}

.permission-group-item:last-child {
    margin-bottom: 0;
}

.permission-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.group-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.group-type {
    padding: 2px 8px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    color: #667eea;
    font-size: 11px;
    font-weight: 500;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.permission-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.permission-folder {
    color: var(--text-secondary);
    font-size: 13px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.permission-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    white-space: nowrap;
}

.permission-badge.permission-none {
    background: rgba(128, 128, 128, 0.2);
    color: #999;
    border: 1px solid rgba(128, 128, 128, 0.3);
}

.permission-badge.permission-read {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.permission-badge.permission-write {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.permission-badge.permission-write-download {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* 邀请码类型信息样式 */
.invite-code-type-info {
    padding: 16px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

.invite-code-type-info:last-child {
    margin-bottom: 0;
}

.type-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.type-icon {
    font-size: 20px;
    line-height: 1;
}

.type-title {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.type-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0;
    margin-top: 8px;
}

.tip-icon {
    font-size: 16px;
    line-height: 1.4;
    flex-shrink: 0;
    margin-top: 1px;
}

.tip-text {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    flex: 1;
}

.invite-code-footer {
    padding: 20px 28px 24px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
}
