/* 个人中心样式 */
.profile-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 100px auto 4rem;
    padding: 0 2rem;
}

/* 侧边栏 */
.profile-sidebar {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 80px;
}

/* 退出登录按钮样式 */
.profile-sidebar .btn-full {
    width: 100%;
    box-sizing: border-box;
}

.profile-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e8e8e8;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.avatar-upload-label {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative;
}

.avatar-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 50%;
    color: white;
}

.avatar-upload-label:hover .avatar-upload-overlay {
    opacity: 1;
}

.profile-info h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-info p {
    font-size: 0.9rem;
    color: #6b6b6b;
}

.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.profile-nav-item {
    padding: 10px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #2c2c2c;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.profile-nav-item:hover {
    background: #f5f5f5;
}

.profile-nav-item.active {
    background: #2c2c2c;
    color: white;
}

/* 主内容区 */
.profile-main {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    min-height: 600px;
}

.profile-main h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.profile-tab {
    display: none;
}

.profile-tab.active {
    display: block;
}

/* 订单列表 */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s;
}

.order-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.order-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.order-product {
    font-weight: 500;
}

.order-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c2c2c;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f5f5f5;
}

.order-actions-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* 确保"查看详情"和"删除订单"按钮宽度一致 */
.order-actions-group .btn-sm.btn-secondary,
.order-actions-group .btn-sm.btn-danger {
    flex: 0 1 auto;
    min-width: fit-content;
}

.order-date {
    font-size: 0.9rem;
    color: #6b6b6b;
}

/* 按钮基础样式 - 与其他按钮保持一致 */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    border: 1px solid;
}

/* 订单卡片中的按钮样式 */
.order-actions-group .btn-sm.btn-primary {
    background: #2c2c2c;
    color: white;
    border-color: #2c2c2c;
}

.order-actions-group .btn-sm.btn-primary:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.order-actions-group .btn-sm.btn-secondary {
    background: transparent;
    color: #2c2c2c;
    border-color: #e8e8e8;
}

.order-actions-group .btn-sm.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
    transform: translateY(-1px);
}

/* 删除订单按钮 - 红色版本，但样式与其他按钮一致 */
.order-actions-group .btn-sm.btn-danger {
    background: transparent;
    color: #ef4444;
    border-color: #ef4444;
}

.order-actions-group .btn-sm.btn-danger:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.order-actions-group .btn-sm.btn-danger:active,
.order-actions-group .btn-sm.btn-primary:active,
.order-actions-group .btn-sm.btn-secondary:active {
    transform: translateY(0);
}

/* 优惠券 */
.coupon-balance {
    margin-bottom: 2rem;
}

.balance-card {
    background: linear-gradient(135deg, #2c2c2c 0%, #4b5563 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.balance-label {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 700;
}

.coupon-hint {
    text-align: center;
    color: #6b6b6b;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* 优惠券列表 */
.coupon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.coupon-item {
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.coupon-item:hover {
    border-color: #2c2c2c;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.coupon-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.coupon-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #ef4444;
    min-width: 80px;
    text-align: center;
}

.coupon-details {
    flex: 1;
}

.coupon-type {
    font-size: 1rem;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 0.25rem;
}

.coupon-condition {
    font-size: 0.875rem;
    color: #6b6b6b;
    margin-bottom: 0.25rem;
}

.coupon-validity {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* 推荐返利 */
.referral-card {
    background: #f5f5f5;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.referral-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.referral-code-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.referral-code {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #2c2c2c;
}

.referral-hint {
    color: #6b6b6b;
    font-size: 0.9rem;
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e8e8e8;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6b6b6b;
    font-size: 0.95rem;
}

.referral-history {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.referral-record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 6px;
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.record-user {
    font-weight: 500;
}

.record-date {
    font-size: 0.85rem;
    color: #6b6b6b;
}

.record-reward {
    font-size: 1.2rem;
    font-weight: 600;
    color: #10b981;
}

/* 设置表单 */
.settings-form {
    max-width: 600px;
}

.settings-form .form-group {
    margin-bottom: 1.5rem;
}

.settings-form label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c2c2c;
    margin-bottom: 0.5rem;
}

.settings-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.settings-form input:focus {
    outline: none;
    border-color: #2c2c2c;
    box-shadow: 0 0 0 3px rgba(44, 44, 44, 0.1);
}

.settings-form input[readonly] {
    background: #f5f5f5;
    color: #6b6b6b;
    cursor: not-allowed;
}

.settings-form .btn-primary {
    background: #2c2c2c;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.settings-form .btn-primary:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.settings-form .btn-primary:active {
    transform: translateY(0);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b6b6b;
    font-size: 1.1rem;
}

/* 响应式 */
@media (max-width: 1024px) {
    .profile-container {
        grid-template-columns: 1fr;
        margin-top: 80px;
        padding: 0 1rem;
    }
    
    .profile-sidebar {
        position: relative;
        top: 0;
    }
    
    .profile-nav {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .referral-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .profile-main {
        padding: 1rem;
    }
    
    .order-card {
        padding: 1rem;
    }
    
    .order-card-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    /* 确保按钮组在移动端也保持横向布局 */
    .order-actions-group {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }
    
    /* 移动端按钮样式调整 - 确保"查看详情"和"删除订单"宽度一致 */
    .order-actions-group .btn-sm {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* 确保"查看详情"和"删除订单"按钮宽度完全一致 */
    .order-actions-group .btn-sm.btn-secondary,
    .order-actions-group .btn-sm.btn-danger {
        flex: 1 1 calc(50% - 0.25rem);
        width: calc(50% - 0.25rem);
        box-sizing: border-box;
    }
    
    /* 如果有"继续支付"按钮，它占据整行 */
    .order-actions-group .btn-sm.btn-primary {
        flex: 1 1 100%;
        width: 100%;
    }
    
    /* 退出登录按钮与订单按钮组对齐 */
    .profile-sidebar .btn-full {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕：按钮可以更紧凑 */
    .order-actions-group .btn-sm {
        padding: 0.45rem 0.6rem;
        font-size: 14px;
    }
    
    .order-actions-group .btn-sm.btn-secondary,
    .order-actions-group .btn-sm.btn-danger {
        width: calc(50% - 0.25rem);
    }
}

