/* 个人中心 / My Account 页面 */

/* 确保页面占满整个视口高度 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body > nav.header {
    flex-shrink: 0;
}

body > section.account-section {
    flex: 1;
}

body > footer.account-footer {
    flex-shrink: 0;
}

.account-section {
    background-color: #fff;
    padding: 40px 0 60px;
    min-height: 0; /* 让 flex 控制高度 */
}

.account-page-title {
    font-size: 28px;
    font-weight: bold;
    color: #000;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.account-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

/* 左侧导航 */
.account-sidebar {
    flex-shrink: 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-nav-item {
    display: block;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.account-nav-item:hover {
    color: #0066cc;
}

.account-nav-item.active {
    color: #0066cc;
    font-weight: 600;
}

.account-nav-item.active[data-panel="logout"] {
    font-weight: 500;
}

/* 右侧内容 */
.account-content {
    flex: 1;
    min-width: 0;
}

/* 多面板：默认隐藏，active 显示 */
.account-panel {
    display: none;
}

.account-panel.active {
    display: block;
}

.account-welcome {
    font-size: 15px;
    color: #666;
    margin-bottom: 16px;
}

.account-welcome a {
    color: #0066cc;
    text-decoration: none;
}

.account-welcome a:hover {
    text-decoration: underline;
}

.account-desc {
    font-size: 14px;
    line-height: 1.7;
    max-width: 560px;
}

/* ========== 订单 Orders ========== */
.account-orders-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 12px;
}

.account-tab {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    padding: 4px 8px;
}

.account-tab:hover {
    color: #0066cc;
}

.account-tab.active {
    color: #0066cc;
    font-weight: 600;
    border-bottom: 2px solid #0066cc;
    margin-bottom: -13px;
}

.account-orders-table-wrap {
    overflow-x: auto;
}

.account-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.account-orders-table th {
    text-align: left;
    padding: 12px 10px;
    color: #666;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

.account-orders-table td {
    padding: 14px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.account-order-row {
    background: #fafafa;
}

.account-order-row td {
    background: #fff;
    border: 1px solid #eee;
    color: #666;
}

.account-order-meta-row td {
    background: #f5f5f5;
    border: 1px solid #eee;
    padding: 10px 14px;
    font-size: 12px;
    color: #666;
}

.account-order-meta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.account-order-delete {
    flex-shrink: 0;
    padding: 4px 8px;
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
}

.account-order-delete:hover {
    color: #c62828;
}
.account-order-price{
    color: #666;
    font-weight: 600;
}

.account-order-meta {
    font-size: 12px;
    color: #999;
    display: block;

}
.account-order-meta-number {
    color: #666;
    font-weight: 600;
}
.account-payment-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.account-payment-wrap small {
    margin: 0;
    line-height: 1.3;
}

.account-order-meta-row .account-order-meta {
    margin-bottom: 0;   
}


.account-order-product {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 一个订单中包含多件商品的列表容器（桌面端） */
.account-order-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-order-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-order-more-items {
    font-size: 12px;
    color: #0066cc;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 102, 204, 0.08);
}

.account-order-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 4px;
}

.account-order-name {
    font-weight: 600;
    color: #666;
}

.account-order-spec {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.account-payment {
    color: #c62828;
    font-weight: bold;
}

.account-orders-table a {
    color: #0066cc;
    text-decoration: none;
}


.account-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none;
}

.account-btn-primary {
    background: #0066cc;
    color: #fff !important;
}



.account-btn-danger {
    background: #c62828;
    color: #fff !important;
}



.account-empty-msg {
    font-size: 14px;
    color: #999;
    margin-top: 20px;
}

/* ========== 分页 Pagination ========== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 20px;
    width: 100%;
}

.pagination-wrapper .pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination-wrapper .page-item {
    margin: 0;
}

.pagination-wrapper .page-item .page-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    padding: 0;
    text-decoration: none;
    transition: all 0.3s ease;
    background: #fff;
}

.pagination-wrapper .page-item .page-link:hover {
    border-color: #0066cc;
    color: #0066cc;
    background: #f5f5f5;
}

.pagination-wrapper .page-item.active .page-link {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
}

.pagination-wrapper .page-item.active .page-link:hover {
    background: #0052a3;
    border-color: #0052a3;
}

/* ========== 地址 Addresses ========== */
.account-address-intro {
    margin-bottom: 24px;
}

.account-address-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.account-address-row .account-address-block {
    flex: 1;
    min-width: 280px;
}

.account-address-block {
    margin-bottom: 28px;
}

.account-address-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.account-address-head .account-address-title {
    margin-bottom: 0;
}

.account-address-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.account-address-add {
    font-size: 13px;
    color: #0066cc;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 10px;
}

.account-address-add:hover {
    text-decoration: underline;
}

.account-address-box {
    background: #f5f5f5;
    border: 1px solid #eee;
    padding: 16px;
    position: relative;
}

.account-address-actions {
    position: absolute;
    top: 16px;
    right: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.account-address-edit,
.account-address-delete {
    font-size: 13px;
    color: #0066cc;
    text-decoration: underline;
    white-space: nowrap;
}

.account-address-edit:hover,
.account-address-delete:hover {
    text-decoration: none;
}

.account-address-delete {
    color: #c62828;
}

.account-address-delete:hover {
    color: #a02020;
}

.account-address-box p {
    margin: 4px 0;
    font-size: 14px;
}

.account-address-empty {
    font-size: 14px;
    color: #999;
    margin: 0;
    padding: 16px;
    background: #fff;
    border-radius: 6px;
}

/* ========== 个人设置 Account Details ========== */
/* 头像上传区域 */
.account-avatar-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #eee;
}

.account-avatar-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.account-avatar-preview:hover {
    border-color: #0066cc;
}

.account-avatar-preview:hover .account-avatar-overlay {
    opacity: 1;
}

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

.account-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    color: #999;
    font-size: 40px;
}

.account-avatar-preview.has-image .account-avatar-placeholder {
    display: none;
}

.account-avatar-preview.has-image .account-avatar-img {
    display: block;
}

.account-avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #fff;
    font-size: 12px;
}

.account-avatar-overlay i {
    font-size: 20px;
    margin-bottom: 4px;
}

.account-avatar-overlay span {
    font-size: 11px;
    font-weight: 500;
}

.account-avatar-input {
    display: none;
}

.account-avatar-info {
    flex: 0 0 auto;
    max-width: 300px;
}

.account-avatar-hint {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin: 0 0 4px 0;
}

.account-avatar-format {
    font-size: 12px;
    color: #999;
    margin: 0;
}

.account-form-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.account-form-title + .account-form {
    margin-bottom: 28px;
}

.account-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.account-form-row .account-input {
    flex: 1;
}

.account-form-group {
    margin-bottom: 16px;
}

.account-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.account-input:focus {
    outline: none;
    border-color: #0066cc;
}

.account-form-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.account-btn-save {
    margin-top: 8px;
    width: 200px;
    border-radius: 0px;
}

/* ========== 心愿单 Wishlist ========== */
.account-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.account-wishlist-card {
    font-size: 14px;
}

.account-wishlist-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 10px;
    background-size: cover;
    background-position: center;
}

.account-wishlist-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    padding: 5px;
    border-radius: 50%;
    font-size: 14px;
    color: #000;
    cursor: pointer;
}

.account-wishlist-heart:hover {
    color: #e74c3c;
}

.account-wishlist-category {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.account-wishlist-name {
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
    /* 固定两行高度，超出省略，保证名称区域等高，价格对齐 */
    font-size: 14px;
    line-height: 1.4;
    max-height: 2.8em;              /* 约两行 */
    overflow: hidden;
    display: -webkit-box;
    /* 兼容性 line-clamp 定义 */
    line-clamp: 2;
    -webkit-line-clamp: 2;          /* WebKit 浏览器两行省略 */
    -webkit-box-orient: vertical;
}

.account-wishlist-swatches {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.account-swatch {
    width: 18px;
    height: 18px;
    border: 1px solid #eee;
    display: inline-block;
}

.account-wishlist-price {
    font-weight: 600;
    color: #666;
}


/* Footer：深色底、Follow Us、Logo、政策链接 */
.account-footer {
    background-color: #3d3d3d;
    color: #ccc;
    padding: 32px 0 24px;
}

.account-footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.account-footer-follow {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-footer-label {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.account-footer-social {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.account-footer-social:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.account-footer-logo {
    flex-shrink: 0;
}

.account-footer-logo-img {
    height: 40px;
    width: auto;
    opacity: 0.9;
    filter: brightness(0) invert(1);
}

.account-footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.account-footer-links a {
    font-size: 13px;
    color: #ccc;
    text-decoration: none;
}

.account-footer-links a:hover {
    color: #fff;
}

.account-footer-copy {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin: 16px 0 0;
}

/* 响应式 */
@media (max-width: 991px) {
    .account-layout {
        flex-direction: column;
        gap: 24px;
    }

    .account-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .account-nav-item {
        padding: 8px 12px;
        background: #f5f5f5;
        border-radius: 4px;
    }

    .account-form{text-align: center;}

    .account-form-row {
        flex-direction: column;
    }
    
    /* 移动端头像上传样式 */
    .account-avatar-upload {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        margin-bottom: 24px;
        padding-bottom: 24px;
    }
    
    .account-avatar-preview {
        width: 80px;
        height: 80px;
    }
    
    .account-avatar-info {
        width: 100%;
    }

    .account-footer-top {
        flex-direction: column;
        text-align: center;
    }

    .account-footer-follow {
        justify-content: center;
    }

    .account-footer-links {
        justify-content: center;
    }


}

/* 兼容移动端：Wishlist 区域 */
@media (max-width: 767px) {
    .account-wishlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        margin-top: 16px;
    }

    .account-wishlist-card {
        font-size: 13px;
    }

    .account-wishlist-img {
        margin-bottom: 8px;
    }

    .account-wishlist-name {
        font-size: 13px;
        margin-bottom: 6px;
        line-height: 1.4;
        max-height: 2.8em;          /* 保持两行高度，价格对齐 */
    }

    .account-wishlist-price {
        font-size: 13px;
    }
}

@media (max-width: 575px) {
    .account-page-title {
        font-size: 22px;
    }

    .account-footer-links {
        flex-direction: column;
    }

    .account-wishlist-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .account-wishlist-card {
        font-size: 12px;
    }

    .account-wishlist-category {
        font-size: 11px;
    }

    .account-wishlist-name {
        font-size: 12px;
        line-height: 1.4;
        max-height: 2.8em;          /* 仍然锁定两行区域高度 */
    }

    .account-swatch {
        width: 14px;
        height: 14px;
    }

    /* 移动端：地址操作按钮优化 */
    .account-address-actions {
        top: 12px;
        right: 8px;
        gap: 10px;
    }

    .account-address-edit,
    .account-address-delete {
        font-size: 12px;
        padding: 2px 4px;
    }
}

/* ========== 订单页面移动端优化 ========== */
@media (max-width: 768px) {
    /* 订单标签页：移动端横向滚动 */
    .account-orders-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 8px;
        margin-bottom: 16px;
    }
    
    .account-orders-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .account-orders-tabs::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 2px;
    }
    
    .account-tab {
        display: inline-block;
        white-space: nowrap;
        margin-right: 12px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* 表格在移动端隐藏 */
    .account-orders-table {
        display: none;
    }
    
    /* 移动端卡片式订单列表 */
    .account-orders-mobile {
        display: block;
    }
    
    .account-order-card {
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .account-order-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .account-order-card-meta {
        flex: 1;
    }
    
    .account-order-card-time {
        font-size: 12px;
        color: #999;
        margin-bottom: 4px;
    }
    
    .account-order-card-number {
        font-size: 13px;
        color: #666;
        font-weight: 600;
    }
    
    .account-order-card-delete {
        padding: 4px 8px;
        border: none;
        background: none;
        color: #999;
        cursor: pointer;
        font-size: 14px;
        flex-shrink: 0;
    }
    
    .account-order-card-delete:hover {
        color: #c62828;
    }
    
    .account-order-card-product {
        display: flex;
        gap: 12px;
        margin-bottom: 12px;
    }

    /* 移动端：一个订单中显示多件商品时的列表容器 */
    .account-order-card-product-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 6px;
    }

    .account-order-card-product-secondary .account-order-card-name {
        font-size: 13px;
    }

    .account-order-card-items-more {
        font-size: 12px;
        color: #0066cc;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        padding: 2px 8px;
        border-radius: 999px;
        background: rgba(0, 102, 204, 0.08);
        margin-bottom: 8px;
    }
    
    .account-order-card-thumb {
        width: 70px;
        height: 70px;
        border-radius: 6px;
        flex-shrink: 0;
    }
    
    .account-order-card-info {
        flex: 1;
        min-width: 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
    }

    /* 左侧：商品名称 + 规格 */
    .account-order-card-info-main {
        flex: 1;
        min-width: 0;
    }
    
    .account-order-card-name {
        font-weight: 600;
        color: #333;
        font-size: 14px;
        margin-bottom: 4px;
        line-height: 1.4;
        /* 移动端：商品名称最多两行，超出省略号，保持卡片高度一致 */
        max-height: 2.8em;              /* 约两行 */
        overflow: hidden;
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .account-order-card-spec {
        font-size: 12px;
        color: #666;
        margin-top: 2px;
    }

    /* 右侧：单价 + 数量，紧凑排列，避免拉高整个卡片 */
    .account-order-card-info-meta {
        flex-shrink: 0;
        font-size: 11px;
        line-height: 1.4;
    }

    .account-order-card-meta-line {
        display: flex;
        justify-content: space-between;
        gap: 4px;
        min-width: 90px;
    }

    /* Unit / Qty 左对齐，数值右对齐 */
    .account-order-card-info-meta .account-order-card-label {
        text-align: left;
    }

    .account-order-card-info-meta .account-order-card-value {
        text-align: right;
        flex-shrink: 0;
    }
    
    .account-order-card-details {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
    }
    
    .account-order-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }
    
    .account-order-card-label {
        color: #999;
    }
    
    .account-order-card-value {
        color: #333;
        font-weight: 600;
    }
    
    .account-order-card-payment {
        color: #c62828;
        font-weight: 600;
        font-size: 14px;
    }
    
    .account-order-card-payment-detail {
        font-size: 11px;
        color: #999;
        margin-top: 2px;
    }
    
    .account-order-card-status {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .account-order-card-status-text {
        font-size: 13px;
        color: #333;
        font-weight: 500;
    }
    
    .account-order-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
    }
    
    .account-order-card-btn {
        flex: 1;
        padding: 10px;
        font-size: 12px;
        text-align: center;
        border-radius: 4px;
        text-decoration: none;
        font-weight: 600;
    }
    
    .account-order-card-btn-primary {
        background: #0066cc;
        color: #fff;
    }
    
    .account-order-card-btn-danger {
        background: #c62828;
        color: #fff;
    }
    
    .account-order-card-link {
        color: #0066cc;
        font-size: 12px;
        text-decoration: none;
    }
    
    /* 移动端分页器样式 */
    .pagination-wrapper {
        margin-top: 24px;
        margin-bottom: 16px;
        padding: 0 8px;
    }
    
    .pagination-wrapper .page-item .page-link {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .pagination-wrapper .pagination {
        gap: 6px;
    }
}

/* 桌面端隐藏移动端卡片 */
@media (min-width: 769px) {
    .account-orders-mobile {
        display: none;
    }
}
