/* 右侧滑入显示栏样式 */
.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.side-panel-overlay.show {
    opacity: 1;
    visibility: visible;
}

.side-panel {
    position: fixed;
    /* 从导航栏底部开始：navbar padding 15px + logo 60px + padding 15px = 90px */
    /* 增加5px间距确保不超出 */
    top: 95px;
    right: 0;
    width: calc(100vw * 2 / 7); /* 屏幕宽度的2/7 */
    /* 高度限制为从导航栏底部到视口底部 */
    height: calc(100vh - 95px);
    max-height: calc(100vh - 95px);
    background: white;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.side-panel.show {
    transform: translateX(0);
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.side-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.side-panel-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.side-panel-close:hover {
    background: #e0e0e0;
    color: #333;
}

.side-panel-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* 信息栏内容样式 */
.info-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.info-item:hover {
    background: #f8f9fa;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
}

.info-item-content {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.info-item-car {
    color: #165DFF;
    font-size: 14px;
    margin-top: 4px;
}

.info-item-time {
    color: #999;
    font-size: 12px;
    margin-top: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 买车/卖车/预约列表项样式 */
.buy-car-item,
.sell-car-item,
.appointment-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 1px solid #e0e0e0;
    margin-bottom: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.buy-car-item:hover,
.sell-car-item:hover,
.appointment-item:hover {
    background: #f5f5f5;
    border-color: #2196F3;
}

.buy-car-item.selected,
.sell-car-item.selected,
.appointment-item.selected {
    background: #e3f2fd;
    border-color: #2196F3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.buy-car-item.read,
.sell-car-item.read,
.appointment-item.read {
    opacity: 0.8;
}

.buy-car-item.unread,
.sell-car-item.unread,
.appointment-item.unread {
    border-left: 3px solid #f44336;
}

.item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
}

.item-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.item-phone {
    color: #666;
    font-size: 13px;
}

.item-car {
    color: #165DFF;
    font-size: 13px;
}

/* 文件名样式 */
.item-file-name {
    font-weight: 600;
    color: #165DFF;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: all 0.3s ease;
    text-decoration: underline;
    text-decoration-color: transparent;
}

.item-file-name:hover {
    color: #0b4ec7;
    text-decoration-color: #0b4ec7;
}

.buy-car-item.selected .item-file-name {
    color: #0b4ec7;
}

.buy-car-item.read .item-file-name {
    color: #666;
}

.buy-car-item.read .item-file-name:hover {
    color: #165DFF;
}

.item-time {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: #f44336;
    border-radius: 50%;
    margin: 0 8px;
    flex-shrink: 0;
}

/* 删除按钮样式 */
.btn-delete {
    padding: 4px 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 8px;
    align-self: flex-end;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #da190b;
}

/* 下载按钮样式 */
.btn-download {
    padding: 10px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 16px;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background: #0b7dda;
}

.btn-download:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 详情容器样式 */
.detail-container {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.detail-container.show {
    display: block;
}

.detail-container h4 {
    margin: 0 0 15px 0;
    color: #165DFF;
    font-size: 16px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.detail-row {
    margin-bottom: 10px;
    display: flex;
}

.detail-label {
    color: #666;
    font-weight: 500;
    width: 100px;
    flex-shrink: 0;
}

.detail-value {
    color: #333;
    flex: 1;
}

/* 列表容器 */
.buy-car-list,
.sell-car-list,
.appointment-list {
    margin-bottom: 16px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .side-panel {
        width: 80vw; /* 小屏幕使用80%宽度 */
        /* 小屏幕导航栏：padding 12px + logo 50px + padding 12px = 74px，再加5px间距 */
        top: 79px;
        height: calc(100vh - 79px);
        max-height: calc(100vh - 79px);
    }
    
    .item-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .item-time {
        align-self: flex-end;
    }
}

/* 更小屏幕适配 */
@media (max-width: 480px) {
    .side-panel {
        width: 85vw;
        /* 超小屏幕导航栏：padding 10px + logo 45px + padding 10px = 65px，再加5px间距 */
        top: 70px;
        height: calc(100vh - 70px);
        max-height: calc(100vh - 70px);
    }
}

/* 大屏幕适配 */
@media (min-width: 1200px) {
    .side-panel {
        /* 大屏幕导航栏保持95px */
        top: 95px;
        height: calc(100vh - 95px);
        max-height: calc(100vh - 95px);
    }
}

/* ==================== 用户个人信息侧滑栏样式 ==================== */

.user-profile-container {
    padding: 0;
}

/* 用户头部信息 */
.user-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #165DFF 0%, #0B4EC7 100%);
    color: white;
    margin: -24px -24px 24px -24px;
}

.user-avatar {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar svg {
    width: 36px;
    height: 36px;
    fill: white;
}

.user-basic-info {
    flex: 1;
}

.user-nickname {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    word-break: break-all;
}

.user-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
}

.user-type-badge.admin {
    background: #4CAF50;
}

.user-type-badge.user {
    background: #2196F3;
}

/* 信息分区 */
.user-info-section {
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 信息行 */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row.password-row {
    align-items: flex-start;
}

.info-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 16px;
}

.info-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

/* 密码区域 */
.password-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.password-value {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    min-width: 120px;
    text-align: center;
}

.password-value.visible {
    letter-spacing: 1px;
    color: #165DFF;
    background: #e3f2fd;
    border-color: #165DFF;
}

.toggle-password-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-password-btn:hover {
    background: #e0e0e0;
}

.toggle-password-btn.active {
    background: #165DFF;
}

.toggle-password-btn.active svg {
    stroke: white;
}

.eye-icon {
    width: 18px;
    height: 18px;
    stroke: #666;
}

/* 响应式适配 - 用户个人信息 */
@media (max-width: 768px) {
    .user-profile-header {
        padding: 20px;
        margin: -20px -20px 20px -20px;
    }
    
    .user-avatar {
        width: 56px;
        height: 56px;
    }
    
    .user-avatar svg {
        width: 30px;
        height: 30px;
    }
    
    .user-nickname {
        font-size: 18px;
    }
    
    .user-info-section {
        padding: 16px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .info-row.password-row {
        align-items: flex-start;
    }
    
    .password-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    
    .password-value {
        flex: 1;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .user-profile-header {
        padding: 16px;
        margin: -16px -16px 16px -16px;
    }
    
    .user-avatar {
        width: 48px;
        height: 48px;
    }
    
    .user-avatar svg {
        width: 26px;
        height: 26px;
    }
    
    .user-nickname {
        font-size: 16px;
    }
}

/* 注销账号按钮 */
.delete-account-btn {
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.delete-account-btn:hover {
    background: #d32f2f;
}

/* 响应式适配 - 注销账号按钮 */
@media (max-width: 768px) {
    .info-row:has(.delete-account-btn) {
        flex-direction: row;
        align-items: center;
    }
    
    .delete-account-btn {
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .delete-account-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 操作按钮容器 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.action-buttons .btn-download {
    flex: 1;
    margin-top: 0;
}

/* 详情条件样式 */
.detail-conditions {
    margin: 12px 0;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.condition-item {
    display: flex;
    margin-bottom: 8px;
    font-size: 13px;
}

.condition-item:last-child {
    margin-bottom: 0;
}

.condition-key {
    color: #666;
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
}

.condition-value {
    color: #333;
    flex: 1;
}

/* 详情头部 */
.detail-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-header h4 {
    margin: 0;
    color: #165DFF;
    font-size: 16px;
    font-weight: 600;
}

/* 详情主体 */
.detail-body {
    font-size: 14px;
}

/* 侧边栏列表容器 */
.side-panel-list {
    display: flex;
    flex-direction: column;
    height: 100%;
}
