/* ========== 个人资料页整体 ========== */
.profile-page {
    padding: 0;
}

.profile-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ========== 顶部头像区 ========== */
.profile-header {
    padding: 1.75rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.img-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.default-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #64748b;
}

.btn-avatar {
    font-size: 0.875rem;
    padding: 0.35rem 0.75rem;
}

.profile-username {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1rem 0 0 0;
    letter-spacing: -0.02em;
}

/* ========== 分区标题 ========== */
.profile-section {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-section:last-of-type {
    border-bottom: none;
}

.profile-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-section-title i {
    color: #64748b;
    font-size: 1rem;
}

/* ========== 信息行网格 ========== */
.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem 1.5rem;
}

@media (min-width: 576px) {
    .profile-info-grid {
        grid-template-columns: 1fr 1fr;
    }
    .info-row-full {
        grid-column: 1 / -1;
    }
}

.info-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.info-label {
    font-size: 0.8125rem;
    color: #64748b;
    min-width: 5.5em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.info-label i {
    font-size: 0.9em;
    color: #94a3b8;
}

.info-value {
    font-size: 0.9375rem;
    color: #1e293b;
    font-weight: 500;
}

.info-value-brief {
    display: block;
    margin-top: 0.25rem;
    font-weight: 400;
    line-height: 1.5;
    color: #334155;
}

.info-link {
    font-size: 0.8125rem;
    color: #0d6efd;
    text-decoration: none;
    margin-left: auto;
}

.info-link:hover {
    text-decoration: underline;
    color: #0a58ca;
}

.status-dot {
    font-size: 0.5rem;
    vertical-align: middle;
}

/* ========== 修改密码区域 - 全新设计 ========== */
.change-password-box {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    padding: 20px 24px;
    animation: cpSlideIn .3s ease;
}
@keyframes cpSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.cp-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cp-title i { color: #6366f1; font-size: 18px; }
.cp-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.cp-field { position: relative; }
.cp-input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.cp-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.cp-input::placeholder { color: #9ca3af; }
.cp-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}
.cp-msg.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.cp-msg.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.cp-actions {
    display: flex;
    gap: 10px;
}
.cp-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.cp-btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
}
.cp-btn-primary:hover { box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.cp-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.cp-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}
.cp-btn-cancel:hover { background: #e2e8f0; }
.cp-loading {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cpSpin .6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes cpSpin { to { transform: rotate(360deg); } }

#avatar-upload {
    display: none;
}

/* ========== 收货地址 / 订单 ========== */
.profile-section-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
}

.address-list {
    padding: 0.5rem 0;
}

.address-card {
    margin: 0 1.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
}

.address-card.address-default {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.02);
}

.address-default-tag {
    position: absolute;
    top: -1px;
    right: -1px;
    background: #0d6efd;
    color: #fff;
    font-size: 0.65rem;
    padding: 0.1rem 0.5rem;
    border-radius: 0 10px 0 8px;
}

.address-info {
    flex: 1;
    min-width: 0;
}

.address-contact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
}

.address-phone {
    color: #64748b;
    font-size: 0.85rem;
}

.address-full {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
    word-break: break-all;
}

.address-actions {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding-left: 0.5rem;
    border-left: 1px solid #f1f5f9;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
}

.empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay .modal-dialog {
    background: #fff;
    border-radius: 12px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-overlay .modal-header,
.modal-overlay .modal-body,
.modal-overlay .modal-footer {
    padding: 1rem 1.25rem;
}

.modal-overlay .modal-header {
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-overlay .modal-footer {
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ========== SweetAlert2 360浏览器兼容 ========== */
/* 360浏览器对CSS Grid + :where()支持不完整，导致弹窗按钮沉底 */
.swal2-container {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-align-items: center !important;
    align-items: center !important;
    -webkit-justify-content: center !important;
    justify-content: center !important;
}
.swal2-popup {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-flex-direction: column !important;
    flex-direction: column !important;
}
.swal2-actions {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-justify-content: center !important;
    justify-content: center !important;
    margin-top: 1em !important;
}
