/**
 * 喜木个人中心 — 淡绿配色；上：个人资料，下：我的数据
 */
.ximu-profile-page {
    --ximu-profile-primary: #15803d;
    --ximu-profile-secondary: #22c55e;
    --ximu-profile-primary-dark: #14532d;
    --ximu-profile-card-bg: #ffffff;
    --ximu-profile-page-bg: transparent;
    --ximu-profile-text: #14532d;
    --ximu-profile-light: #64748b;
    --ximu-profile-border: rgba(22, 163, 74, 0.28);
    --ximu-profile-soft-bg: #f0fdf4;
}

.ximu-profile-page .main-container {
    padding: 10px 8px 16px;
    max-width: 100%;
    margin: 0 auto;
}

.ximu-profile-page .user-profile {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 48%, #ecfdf5 100%);
    border-radius: 16px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 8px 22px rgba(22, 163, 74, 0.1);
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--ximu-profile-border);
}

.ximu-profile-page .user-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #4ade80, #16a34a, #15803d);
}

.ximu-profile-page .profile-header {
    padding: 16px 14px 14px;
}

.ximu-profile-page .profile-header-columns {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px 12px;
    width: 100%;
    box-sizing: border-box;
}

.ximu-profile-page .profile-col {
    min-width: 0;
    box-sizing: border-box;
}

.ximu-profile-page .profile-col--info {
    flex: 1 1 52%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.ximu-profile-page .profile-col--actions {
    flex: 0 1 46%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

@media (max-width: 479px) {
    .ximu-profile-page .profile-header {
        padding: 12px 10px;
    }

    .ximu-profile-page .profile-col--info {
        flex: 1 1 54%;
    }

    .ximu-profile-page .profile-col--actions {
        flex: 0 1 46%;
    }

    .ximu-profile-page .user-avatar {
        width: 72px;
        height: 72px;
        border-width: 2px;
    }

    .ximu-profile-page .vip-badge {
        top: 58px;
        width: 36px;
        height: 16px;
    }

    .ximu-profile-page .user-name {
        font-size: 0.92rem;
    }

    .ximu-profile-page .user-level {
        font-size: 0.72rem;
        padding: 2px 8px;
    }

    .ximu-profile-page .profile-hint {
        font-size: 0.68rem;
    }

    .ximu-profile-page .profile-actions {
        max-width: none;
    }

    .ximu-profile-page .profile-actions-row {
        gap: 6px;
    }

    .ximu-profile-page .profile-action-link {
        font-size: 0.76rem;
        padding: 7px 4px;
        border-radius: 6px;
    }
}

/* 全站数据 / 我的数据：独立容器，位于个人资料卡片下方 */
.ximu-profile-page .ximu-profile-site-data,
.ximu-profile-page .ximu-profile-data {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 48%, #ecfdf5 100%);
    border-radius: 16px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 8px 22px rgba(22, 163, 74, 0.1);
    margin-bottom: 10px;
    border: 1px solid var(--ximu-profile-border);
    overflow: hidden;
}

.ximu-profile-stats {
    padding: 14px 16px 16px;
    box-sizing: border-box;
}

/* 全站数据：默认折叠 */
.ximu-profile-site-stats {
    margin: 0;
}

.ximu-profile-site-stats__title {
    margin: 0;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 800;
    color: var(--ximu-profile-primary-dark);
    letter-spacing: 0.04em;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.ximu-profile-site-stats__title::-webkit-details-marker {
    display: none;
}

.ximu-profile-site-stats__title::after {
    content: '展开';
    font-size: 12px;
    font-weight: 600;
    color: var(--ximu-profile-light);
    flex-shrink: 0;
}

.ximu-profile-site-stats[open] .ximu-profile-site-stats__title::after {
    content: '收起';
}

.ximu-profile-site-stats__body {
    padding: 0 16px 14px;
}

.ximu-profile-site-stats__users {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(240, 253, 244, 0.85);
    border: 1px solid rgba(22, 163, 74, 0.14);
    font-size: 13px;
    color: var(--ximu-profile-primary-dark);
}

.ximu-profile-site-stats__users strong {
    font-size: 18px;
    font-weight: 800;
    margin: 0 2px;
}

.ximu-profile-site-stats__modules {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 640px) {
    .ximu-profile-site-stats__modules {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .ximu-profile-site-stats__modules {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.ximu-profile-site-stats__module {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(22, 163, 74, 0.14);
    min-width: 0;
}

.ximu-profile-site-stats__module-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--ximu-profile-primary-dark);
    letter-spacing: 0.03em;
    padding: 0 2px 2px;
    border-bottom: 1px solid rgba(22, 163, 74, 0.1);
}

.ximu-profile-site-stats__module-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(240, 253, 244, 0.7);
    border: 1px solid rgba(22, 163, 74, 0.12);
}

.ximu-profile-site-stats__line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #000;
}

.ximu-profile-site-stats__line strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--ximu-profile-primary-dark);
    margin: 0 2px 0 0;
}

.ximu-profile-stats__title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: var(--ximu-profile-primary-dark);
    letter-spacing: 0.04em;
}

.ximu-profile-stats__grid {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 640px) {
    .ximu-profile-stats__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .ximu-profile-stats__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.ximu-profile-stats__card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(22, 163, 74, 0.14);
    min-width: 0;
}

.ximu-profile-stats__card[data-module='bazi']:has(a.ximu-profile-stats__row) {
    cursor: pointer;
}

.ximu-profile-stats__card-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--ximu-profile-primary-dark);
    letter-spacing: 0.03em;
    padding: 0 2px 2px;
    border-bottom: 1px solid rgba(22, 163, 74, 0.1);
}

.ximu-profile-stats__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(240, 253, 244, 0.7);
    border: 1px solid rgba(22, 163, 74, 0.12);
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

a.ximu-profile-stats__row:hover,
a.ximu-profile-stats__row:focus-visible {
    background: #ecfdf5;
    border-color: rgba(22, 163, 74, 0.28);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.1);
    outline: none;
}

.ximu-profile-stats__row--static {
    cursor: default;
}

.ximu-profile-stats__row-label {
    font-size: 12px;
    color: var(--ximu-profile-light);
    flex-shrink: 0;
}

.ximu-profile-stats__row-value {
    font-size: 12px;
    color: var(--ximu-profile-primary-dark);
    text-align: right;
    white-space: nowrap;
}

.ximu-profile-stats__row-value strong {
    font-size: 16px;
    font-weight: 800;
    margin-right: 2px;
}

/* 卦录/记录 + 笔记：合并为一个入口，两行数字，统一进该模块记录页 */
.ximu-profile-stats__row--combined {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.ximu-profile-stats__combined-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1px;
    font-size: 12px;
    color: #000000;
}

.ximu-profile-stats__combined-line strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--ximu-profile-primary-dark);
    margin: 0 2px 0 0;
}

.ximu-profile-stats__empty {
    font-size: 13px;
    color: var(--ximu-profile-light);
    padding: 8px 4px;
    margin: 0;
}

.ximu-profile-page .user-avatar-wrapper {
    position: relative;
    display: block;
    flex-shrink: 0;
    width: auto;
    text-align: center;
}

.ximu-profile-page .user-avatar {
    display: inline-block;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid #fff;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.22);
}

.ximu-profile-page .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ximu-profile-page .profile-left-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    margin-top: 0;
}

.ximu-profile-page .user-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ximu-profile-text);
    word-break: break-all;
}

.ximu-profile-page .user-levels {
    margin-top: 6px;
}

.ximu-profile-page .user-level {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--ximu-profile-primary-dark);
    background: #ecfdf5;
    border: 1px solid rgba(22, 163, 74, 0.35);
}

.ximu-profile-page .vip-badge {
    position: absolute;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 19px;
    z-index: 2;
}

.ximu-profile-page .vip-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ximu-profile-vip-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    width: 100%;
}

.ximu-profile-vip-entry__expire {
    font-size: 0.72rem;
    color: var(--ximu-profile-light);
    white-space: nowrap;
}

.ximu-profile-vip-entry__cta {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff !important;
    background: linear-gradient(160deg, #fbbf24 0%, #f59e0b 45%, #b45309 100%);
    box-shadow: 0 3px 10px rgba(180, 83, 9, 0.22);
    white-space: nowrap;
}

.ximu-profile-vip-entry__cta:hover {
    filter: brightness(1.05);
}

/* 站长管理区：成员查看，与下方个人操作以横线分隔 */
.ximu-profile-page .profile-admin-zone {
    width: 100%;
    max-width: 220px;
    margin-bottom: 10px;
}

.ximu-profile-page .profile-admin-divider {
    width: 100%;
    max-width: 220px;
    margin: 0 0 10px;
    border: none;
    border-top: 1px solid rgba(22, 163, 74, 0.22);
}

.ximu-profile-page .profile-action-link--admin {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* 操作按钮：右栏，一行两个 */
.ximu-profile-page .profile-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 0;
    width: 100%;
    max-width: 220px;
}

.ximu-profile-page .profile-actions-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.ximu-profile-page .profile-action-link {
    color: #334155;
    font-size: 0.85rem;
    padding: 8px 6px;
    border-radius: 8px;
    text-decoration: none;
    background: #ecfdf5;
    border: 1px solid rgba(22, 163, 74, 0.2);
    text-align: center;
    white-space: nowrap;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.ximu-profile-page .profile-action-link:hover {
    background: #d1fae5;
    border-color: rgba(22, 163, 74, 0.4);
}

.ximu-profile-page .profile-hint {
    font-size: 0.75rem;
    color: var(--ximu-profile-light);
    margin-top: 6px;
    text-align: center;
    line-height: 1.4;
}

.ximu-profile-page .profile-hint a {
    color: var(--ximu-profile-primary);
}

.ximu-profile-page .profile-guest-card {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border-radius: 16px;
    border: 1px solid var(--ximu-profile-border);
}

.ximu-profile-page .profile-guest-card p {
    margin: 0 0 16px;
    color: var(--ximu-profile-light);
}

.ximu-profile-page .profile-guest-card .btn-primary {
    border: none;
    padding: 10px 28px;
    border-radius: 24px;
    background: linear-gradient(160deg, #4ade80 0%, #22c55e 45%, #15803d 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}

.ximu-profile-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: transparent;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.ximu-profile-modal.is-open {
    display: flex;
}

.ximu-profile-modal__panel {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 22px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--ximu-profile-border);
}

.ximu-profile-modal__panel h3 {
    text-align: center;
    margin: 0 0 16px;
    color: var(--ximu-profile-primary-dark);
    font-size: 1.1rem;
}

.ximu-profile-modal__field {
    margin-bottom: 12px;
}

.ximu-profile-modal__field label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 6px;
}

.ximu-profile-modal__field input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.ximu-profile-modal__field input:focus {
    outline: none;
    border-color: var(--ximu-profile-secondary);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.ximu-profile-modal__actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.ximu-profile-modal__actions button {
    flex: 1;
    padding: 9px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.ximu-profile-modal__cancel {
    background: #e2e8f0;
    color: #334155;
}

.ximu-profile-modal__submit {
    background: linear-gradient(160deg, #4ade80 0%, #22c55e 45%, #15803d 100%);
    color: #fff;
}

.ximu-profile-modal__msg {
    margin-top: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: #dc2626;
    display: none;
}

body.caiyun-page.ximu-page .ximu-paipan-app--vip .ximu-paipan-app__icon {
    background: linear-gradient(160deg, #fbbf24 0%, #f59e0b 45%, #b45309 100%);
    box-shadow: 0 6px 18px rgba(180, 83, 9, 0.28);
}

