/* ═══════════════════════════════════════════════════════
   个人中心 - 自定义样式
   ═══════════════════════════════════════════════════════ */

/* 覆盖 Astra 页面构建器模板内边距 */
.woocommerce.ast-page-builder-template .site-main,
.ast-single-post.ast-page-builder-template .site-main > article,
.ast-page-builder-template .site-main {
    padding: 0 !important;
}

/* 覆盖 Astra entry-content 标题默认 margin */
.entry-content .uc-wrap h1,
.entry-content .uc-wrap h2,
.entry-content .uc-wrap h3,
.entry-content .uc-wrap h4 {
    margin-bottom: 0 !important;
}

/* 移除 WooCommerce 默认样式 */
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
    display: none !important;
}

/* ── 整体容器 ── */
.uc-wrap {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* ── 顶部横幅 ── */
.uc-banner {
    height: 160px;
    background-color: #f2f3f8;
    background-image:
        linear-gradient(rgba(255,255,255,.45), rgba(255,255,255,.45)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='200'%3E%3Crect fill='%23f2f3f8' width='800' height='200'/%3E%3Ccircle cx='600' cy='80' r='120' fill='%23eaebf2' opacity='.5'/%3E%3Ccircle cx='680' cy='140' r='80' fill='%23e8e9f0' opacity='.4'/%3E%3Ccircle cx='400' cy='60' r='100' fill='%23ecedF4' opacity='.35'/%3E%3Ccircle cx='150' cy='120' r='140' fill='%23e9eaf1' opacity='.3'/%3E%3Ccircle cx='300' cy='160' r='60' fill='%23ebedf3' opacity='.4'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
}

/* ── 主体布局 ── */
.uc-body {
    display: flex;
    gap: 28px;
    max-width: 1600px;
    margin: -70px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ── 左侧边栏 ── */
.uc-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.uc-user-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px 24px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.uc-avatar {
    width: 72px;
    height: 72px;
    margin: -52px auto 8px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    background: #eee;
}

.uc-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.uc-username {
    font-size: 16px;
    font-weight: 300 !important;
    margin: 0 0 2px !important;
    color: #1a1a2e;
}

.uc-uid {
    font-size: 13px;
    color: #999;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.uc-role {
    display: none;
}

.uc-vip-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 15px;
    background: #f5f5f7;
    border-radius: 8px;
    margin-top: 6px;
    width: 100%;
    box-sizing: border-box;
}

.uc-vip-icon {
    display: inline-flex;
    flex-shrink: 0;
}

.uc-vip-label {
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

.uc-vip-expire {
    margin-left: auto;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.uc-vip-btn {
    margin-left: auto;
    display: inline-block;
    padding: 3px 12px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff !important;
    font-size: 10px;
    font-weight: 500;
    border-radius: 14px;
    text-decoration: none;
    transition: opacity .2s;
}

.uc-vip-btn:hover {
    opacity: .85;
}

.uc-uid-copy {
    cursor: pointer;
    opacity: .5;
    transition: opacity .2s;
}

.uc-uid-copy:hover {
    opacity: 1;
}

/* ── 导航菜单 ── */
.uc-nav {
    background: #fff;
    border-radius: 12px;
    padding: 8px 0;
    margin-top: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.uc-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 300;
    transition: all .2s;
    cursor: pointer;
}

.uc-nav-item:hover {
    color: #6366f1;
    background: #f8f7ff;
}

.uc-nav-item.is-active {
    color: #6366f1;
    background: #f8f7ff;
    font-weight: 400;
}

.uc-nav-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.uc-nav-logout {
    margin-top: 4px;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.uc-nav-logout:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ── 右侧内容区 ── */
.uc-content {
    flex: 1;
    min-width: 0;
    padding-top: 90px;
}

.uc-section {
    margin-bottom: 24px;
}

.uc-title {
    font-size: 20px !important;
    font-weight: 400 !important;
    margin: 0 0 10px !important;
    line-height: 1.4 !important;
    color: #333;
}

.uc-card {
    background: #fff;
    border-radius: 0 !important;
    padding: 24px;
    box-shadow: none !important;
}

.uc-empty {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 40px 0;
    margin: 0;
}

.uc-empty a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.uc-empty a:hover {
    text-decoration: underline;
}

/* ── 会员信息 ── */
.uc-membership-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uc-membership-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8f7ff;
    border-radius: 8px;
    border-left: 3px solid #6366f1;
}

.uc-membership-name {
    font-weight: 600;
    color: #6366f1;
}

.uc-membership-expire {
    font-size: 13px;
    color: #888;
}

/* ── 表格 ── */
.uc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.uc-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #f0f0f0;
    color: #888;
    font-weight: 600;
    font-size: 13px;
}

.uc-table td {
    padding: 12px;
    border-bottom: 1px solid #f5f5f5;
    color: #555;
}

.uc-table tr:last-child td {
    border-bottom: none;
}

.uc-btn-sm {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 6px;
    background: #6366f1;
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
}

.uc-btn-sm:hover {
    opacity: .85;
}

/* ── 个人信息表单 ── */
.uc-profile-form {
    max-width: 480px;
}

.uc-form-row {
    margin-bottom: 18px;
}

.uc-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.uc-form-row input[type="text"],
.uc-form-row input[type="email"],
.uc-form-row input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    box-sizing: border-box;
}

.uc-form-row input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
    background: #fff;
}

.uc-avatar-upload {
    display: inline-block;
}

.uc-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

.uc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 32px;
    border: none;
    border-radius: 8px;
    background: #6366f1;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}

.uc-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.uc-btn:active {
    transform: translateY(0);
}

/* ── 会员计划卡片网格 ── */
.uc-plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.uc-plan-card {
    position: relative;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, border-color .2s;
}

.uc-plan-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
    border-color: #f7931e;
}

.uc-plan-card.is-current {
    border-color: #f7931e;
}

.uc-plan-current-tag {
    position: absolute;
    top: -1px;
    right: 16px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 0 0 6px 6px;
}

.uc-plan-name {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

.uc-plan-price-row {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin: 8px 0 4px;
}

.uc-plan-currency {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.uc-plan-amount {
    font-size: 36px;
    font-weight: 800;
    color: #111;
    line-height: 1;
}

.uc-plan-period {
    font-size: 13px;
    color: #999;
    margin-left: 2px;
}

.uc-plan-expire {
    font-size: 12px;
    color: #f7931e;
    margin-bottom: 4px;
}

.uc-plan-action {
    margin: 12px 0 0;
}

.uc-plan-btn {
    display: block;
    text-align: center;
    padding: 8px 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff !important;
    border: none;
    cursor: pointer;
}

.uc-plan-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.uc-plan-btn.is-active {
    background: #f5f5f7;
    color: #999 !important;
    cursor: default;
    pointer-events: none;
}

.uc-plan-btn.is-free {
    background: #fff;
    color: #333 !important;
    border: 1px solid #d1d5db;
}

.uc-plan-btn.is-free:hover {
    background: #f9fafb;
}

.uc-plan-desc {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #555;
    line-height: 1.8;
}

.uc-plan-desc p {
    margin: 0 0 6px;
}

.uc-plan-desc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.uc-plan-desc li {
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.uc-plan-desc li .uc-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f7931e;
    flex-shrink: 0;
    font-style: normal;
}

.uc-plan-desc li .uc-check::before {
    content: '';
    display: block;
    width: 5px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -1px;
}

/* ═══════════════════════════════════════════════════
   响应式：平板 (≤1024px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .uc-body {
        gap: 20px;
    }

    .uc-sidebar {
        width: 200px;
    }

    .uc-plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════════════════
   响应式：手机 (≤768px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .uc-banner {
        height: 120px;
    }

    .uc-body {
        flex-direction: column;
        margin-top: -50px;
    }

    .uc-sidebar {
        width: 100%;
    }

    .uc-user-card {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 16px 20px;
        text-align: left;
    }

    .uc-avatar {
        width: 56px;
        height: 56px;
        margin: 0;
        flex-shrink: 0;
    }

    .uc-username {
        font-size: 15px;
        margin: 0;
    }

    .uc-uid {
        font-size: 11px;
    }

    .uc-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 6px;
        gap: 2px;
    }

    .uc-nav-item {
        flex: 0 0 auto;
        padding: 8px 14px;
        border-left: none;
        border-radius: 8px;
        font-size: 13px;
        gap: 6px;
    }

    .uc-nav-item.is-active {
        border-left-color: transparent;
        background: #6366f1;
        color: #fff;
    }

    .uc-nav-item.is-active .uc-nav-icon svg {
        stroke: #fff;
    }

    .uc-nav-logout {
        border-top: none;
        margin-top: 0;
        padding-top: 8px;
    }

    .uc-content {
        padding-top: 0;
    }

    .uc-card {
        padding: 16px;
    }

    .uc-plans-grid {
        grid-template-columns: 1fr;
    }

    .uc-profile-form {
        max-width: 100%;
    }
}
