/* --------------------------------------------------------------------------
   6.3 Badges - 徽章系统
   -------------------------------------------------------------------------- */

/* ==================== 徽章系统样式 ==================== */

.uap-badges-container {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 徽章统计头部 */
.uap-badges-stats {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px 32px;
    margin-bottom: 24px;
    background: var(--uap-surface);
    background-image: linear-gradient(115deg, var(--uap-accent-bg), var(--uap-surface) 65%);
    border: 1px solid rgba(var(--uap-accent-rgb), 0.24);
    border-radius: var(--uap-radius-md);
    overflow: hidden;
}

/* 环形进度 */
.uap-badges-stats-ring {
    position: relative;
    width: 108px;
    height: 108px;
    flex-shrink: 0;
}

.uap-badges-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.uap-badges-ring-track {
    fill: none;
    stroke: rgba(var(--uap-accent-rgb), 0.18);
    stroke-width: 9;
}

.uap-badges-ring-fill {
    fill: none;
    stroke: var(--uap-accent);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: var(--uap-ring-circ);
    stroke-dashoffset: var(--uap-ring-circ);
    animation: uap-badges-ring-fill 1.1s cubic-bezier(0.25, 0.8, 0.4, 1) 0.15s forwards;
}

@keyframes uap-badges-ring-fill {
    to {
        stroke-dashoffset: var(--uap-ring-offset);
    }
}

.uap-badges-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.uap-badges-ring-percent {
    font-size: var(--uap-text-2xl);
    font-weight: 700;
    line-height: 1;
    color: var(--uap-accent-strong);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.uap-badges-ring-percent small {
    font-size: var(--uap-text-base);
    font-weight: 600;
    margin-left: 1px;
}

.uap-badges-ring-caption {
    margin-top: 4px;
    font-size: var(--uap-text-xs);
    font-weight: 500;
    color: var(--uap-text-light);
}

/* 详情区 */
.uap-badges-stats-detail {
    flex: 1;
    min-width: 0;
}

.uap-badges-stats-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.uap-badges-stats-trophy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: var(--uap-radius-md);
    background: var(--uap-accent-bg);
    color: var(--uap-accent-strong);
    box-shadow: inset 0 0 0 1px rgba(var(--uap-accent-rgb), 0.22);
}

.uap-badges-stats-trophy svg {
    width: 22px;
    height: 22px;
}

.uap-badges-stats-title {
    margin: 0;
    font-size: var(--uap-text-lg);
    font-weight: 700;
    color: var(--uap-text);
    line-height: 1.25;
}

.uap-badges-stats-subtitle {
    margin: 3px 0 0;
    font-size: var(--uap-text-sm);
    color: var(--uap-text-muted);
}

.uap-badges-stats-subtitle strong {
    color: var(--uap-accent-strong);
    font-weight: 700;
}

.uap-badges-stats-metrics {
    display: flex;
}

.uap-badges-metric {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 22px;
}

.uap-badges-metric:first-child {
    padding-left: 0;
}

.uap-badges-metric + .uap-badges-metric::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 30px;
    background: var(--uap-border);
}

.uap-badges-metric-num {
    font-size: var(--uap-text-2xl);
    font-weight: 700;
    line-height: 1;
    color: var(--uap-text);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.uap-badges-metric-label {
    font-size: var(--uap-text-xs);
    font-weight: 500;
    color: var(--uap-text-light);
}

@media (prefers-reduced-motion: reduce) {
    .uap-badges-ring-fill {
        animation: none;
        stroke-dashoffset: var(--uap-ring-offset);
    }
}

/* 徽章网格 */
.uap-badges-grid {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    grid-auto-flow: row;
    align-items: stretch;
    justify-content: stretch;
    justify-items: stretch;
    gap: 16px;
    box-sizing: border-box;
}

/* 徽章卡片 */
.uap-badge-item {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 16px 20px;
    background: var(--uap-surface);
    border: 1px solid var(--uap-border);
    border-radius: var(--uap-radius-md);
    transition: border-color 0.15s ease;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/*
 * 用户中心徽章页的卡片必须按 DOM 顺序自动进入网格轨道。
 * 使用页面级作用域隔离可能来自主题/页面构建器的 grid-column、浮动和外边距规则，
 * 避免所有卡片被挤到最右侧单列。
 */
.uap-user-center .uap-uc-content .uap-badges-container > .uap-badges-grid > .uap-badge-item {
    grid-column: auto !important;
    grid-row: auto !important;
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    justify-self: stretch;
}

.uap-badge-item:hover {
    border-color: var(--uap-border-hover);
}

/* Earned badges have a quiet warm finish; locked labels remain fully readable. */
.uap-badge-item.earned {
    background-image: linear-gradient(135deg, var(--uap-surface) 55%, var(--uap-accent-bg));
    border-color: rgba(var(--uap-accent-rgb), 0.32);
}

.uap-badge-item.earned:focus-within {
    border-color: var(--uap-accent-strong);
}

.uap-badge-item.earned .uap-badge-icon {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 3px 8px -4px rgba(28, 25, 23, 0.2);
}

.uap-badge-item.locked {
    background: var(--uap-bg);
}

.uap-badge-item.locked .uap-badge-icon {
    opacity: 0.55;
    filter: saturate(0.2);
}

/* 精美 SVG 徽章 */
.uap-badge-icon-wrap {
    width: 72px;
    height: 86px;
    flex-shrink: 0;
}

/* 旧版图标兼容 */
.uap-badge-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--uap-surface-hover);
    border-radius: var(--uap-radius-md);
    flex-shrink: 0;
}

.uap-badge-icon svg {
    width: 24px;
    height: 24px;
}

/* 徽章信息 */
.uap-badge-info {
    flex: 1;
    min-width: 0;
}

.uap-badge-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.uap-badge-item.locked .uap-badge-name {
    color: #6b7280;
}

.uap-badge-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.uap-badge-earned-time {
    font-size: 12px;
    color: #10b981;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.uap-badge-earned-time::before {
    content: '✓';
    font-weight: bold;
}

/* 徽章进度条 */
.uap-badge-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.uap-badge-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--uap-border-light);
    border-radius: 2px;
    overflow: hidden;
}

.uap-badge-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--uap-action-bg), var(--uap-action-end));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.uap-badge-progress-text {
    font-size: var(--uap-text-xs);
    color: var(--uap-text-muted);
    min-width: 32px;
    text-align: right;
}

/* 徽章奖励 */
.uap-badge-reward {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: var(--uap-text-xs);
    font-weight: 600;
    color: var(--uap-accent-strong);
    background: var(--uap-accent-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.uap-badge-item.earned .uap-badge-reward {
    color: var(--uap-accent-strong);
    background: var(--uap-accent-bg);
}

/* 空状态 */
.uap-badges-empty {
    text-align: center;
    padding: 48px 24px;
    color: #9ca3af;
}

.uap-badges-empty-icon {
    margin-bottom: 12px;
}

.uap-badges-empty-icon svg {
    stroke: #d1d5db;
}

.uap-badges-empty p {
    margin: 0;
    font-size: 14px;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .uap-badges-grid {
        grid-template-columns: 1fr;
    }

    .uap-badges-stats {
        flex-direction: column;
        gap: 20px;
        padding: 24px 20px;
        text-align: center;
    }

    .uap-badges-stats-heading {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        margin-bottom: 16px;
    }

    .uap-badges-stats-metrics {
        justify-content: center;
    }

    .uap-badge-item {
        padding: 14px 16px;
    }

    .uap-badge-icon-wrap {
        width: 60px;
        height: 72px;
    }
}

/* ==================== 徽章图标样式切换 ==================== */

/* 仅图标模式 - 前台徽章列表 */
.uap-badges-grid.icon-style-icon-only .uap-badge-icon {
    background: transparent !important;
    box-shadow: none !important;
}

.uap-badges-grid.icon-style-icon-only .uap-badge-icon svg {
    width: 36px;
    height: 36px;
}

.uap-badges-grid.icon-style-icon-only .uap-badge-item.earned .uap-badge-icon svg {
    color: var(--badge-color, var(--uap-primary));
}

.uap-badges-grid.icon-style-icon-only .uap-badge-item.locked .uap-badge-icon svg {
    color: #9ca3af;
}

/* ==================== 徽章展示按钮 ==================== */

.uap-badge-display-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: #9ca3af;
    outline: none;
}

.uap-badge-display-btn svg {
    width: 14px;
    height: 14px;
}

.uap-badge-display-btn .icon-check {
    display: none;
}

.uap-badge-display-btn:hover,
.uap-badge-display-btn:focus {
    color: var(--uap-action-bg, #4f46e5);
    background: var(--uap-primary-bg);
    border-color: var(--uap-primary);
    transform: scale(1.1);
    outline: none;
    box-shadow: none;
}

.uap-badge-display-btn.displayed {
    color: #fff;
    background: #10b981;
    border-color: #10b981;
}

.uap-badge-display-btn.displayed .icon-display {
    display: none;
}

.uap-badge-display-btn.displayed .icon-check {
    display: block;
}

.uap-badge-display-btn.displayed:hover,
.uap-badge-display-btn.displayed:focus {
    color: #fff;
    background: #ef4444;
    border-color: #ef4444;
    outline: none;
    box-shadow: none;
}

.uap-badge-display-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.uap-badge-display-btn.loading svg {
    animation: uapBtnSpin 0.8s linear infinite;
}

@keyframes uapBtnSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ==================== 用户中心头部展示徽章 ==================== */

.uap-uc-displayed-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    vertical-align: middle;
}

.uap-uc-badge {
    display: inline-block;
}

.uap-uc-badge-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: #fff;
    transition: transform 0.2s;
    position: relative;
}

.uap-uc-badge-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 5px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, transparent 50%);
    pointer-events: none;
}

.uap-uc-badge:hover .uap-uc-badge-icon {
    transform: scale(1.15);
}

.uap-uc-badge-icon svg {
    width: 14px;
    height: 14px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

/* 仅图标模式 - 头部展示徽章 */
.uap-uc-displayed-badges.icon-style-icon-only .uap-uc-badge-icon {
    background: transparent !important;
    box-shadow: none;
    width: 20px;
    height: 20px;
}

.uap-uc-displayed-badges.icon-style-icon-only .uap-uc-badge-icon::before {
    display: none;
}

.uap-uc-displayed-badges.icon-style-icon-only .uap-uc-badge-icon svg {
    width: 18px;
    height: 18px;
    color: var(--badge-color, var(--uap-primary));
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* 响应式 */
@media (max-width: 640px) {
    .uap-uc-displayed-badges {
        gap: 4px;
        margin-left: 6px;
    }

    .uap-uc-badge-icon {
        width: 20px;
        height: 20px;
        border-radius: 4px;
    }

    .uap-uc-badge-icon svg {
        width: 12px;
        height: 12px;
    }

    .uap-uc-displayed-badges.icon-style-icon-only .uap-uc-badge-icon {
        width: 18px;
        height: 18px;
    }

    .uap-uc-displayed-badges.icon-style-icon-only .uap-uc-badge-icon svg {
        width: 16px;
        height: 16px;
    }

    .uap-badge-display-btn {
        width: 24px;
        height: 24px;
        bottom: 8px;
        right: 8px;
    }

    .uap-badge-display-btn svg {
        width: 12px;
        height: 12px;
    }
}

/* --------------------------------------------------------------------------
   4.5 Settings - 设置页面
   -------------------------------------------------------------------------- */

/* ==================== 用户中心设置页面 ==================== */

.uap-settings-section {
    background: var(--uap-surface);
    border-radius: var(--uap-radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--uap-shadow-sm), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    transition: var(--uap-transition-bounce);
}

.uap-settings-section:hover {
    box-shadow: var(--uap-shadow-md), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    transform: translateY(-2px);
}

.uap-settings-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--uap-text);
}

.uap-settings-section-title svg {
    color: var(--uap-action-bg, #4f46e5);
}

.uap-settings-section-desc {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--uap-text-muted);
    line-height: 1.6;
}

/* 隐私设置项 */
.uap-privacy-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uap-privacy-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--uap-bg);
    border-radius: var(--uap-radius-lg);
    border: 1px solid var(--uap-border-light);
    transition: var(--uap-transition);
}

.uap-privacy-item:hover {
    background: var(--uap-surface-hover);
    border-color: var(--uap-border);
}

.uap-privacy-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.uap-privacy-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--uap-text);
}

.uap-privacy-item-default {
    font-size: 12px;
    color: var(--uap-text-muted);
}

/* 隐私开关 (iOS 级丝滑 Switch) */
.uap-privacy-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.uap-privacy-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.uap-privacy-toggle-slider {
    position: relative;
    width: 50px;
    height: 28px;
    background: var(--uap-border);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.uap-privacy-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.uap-privacy-toggle input:checked+.uap-privacy-toggle-slider {
    background: var(--uap-success, #10b981);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.uap-privacy-toggle input:checked+.uap-privacy-toggle-slider::before {
    transform: translateX(22px);
}

.uap-privacy-toggle input:active+.uap-privacy-toggle-slider::before {
    width: 30px;
}

.uap-privacy-toggle input:checked:active+.uap-privacy-toggle-slider::before {
    transform: translateX(16px);
}

.uap-privacy-toggle-label {
    position: absolute;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    transition: opacity 0.2s;
    pointer-events: none;
}

.uap-privacy-toggle-on {
    left: 8px;
    color: #fff;
    opacity: 0;
}

.uap-privacy-toggle-off {
    right: 8px;
    color: var(--uap-text-muted);
}

.uap-privacy-toggle input:checked~.uap-privacy-toggle-on {
    opacity: 1;
}

.uap-privacy-toggle input:checked~.uap-privacy-toggle-off {
    opacity: 0;
}

/* 隐私设置操作按钮 */
.uap-privacy-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* 公开主页链接区域 */
.uap-profile-url-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uap-profile-url-input {
    display: flex;
    align-items: stretch;
    background: var(--uap-bg);
    border-radius: var(--uap-radius);
    overflow: hidden;
    border: 1px solid var(--uap-border-light);
    transition: var(--uap-transition);
}

.uap-profile-url-input:focus-within {
    border-color: var(--uap-primary);
    box-shadow: 0 0 0 3px var(--uap-primary-alpha);
    background: var(--uap-surface);
}

.uap-profile-url-input input,
.uap-profile-url-input input[type="text"],
.uap-profile-url-input input[type="url"] {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--uap-text);
    outline: none;
    box-shadow: none;
}

.uap-profile-url-input input:focus,
.uap-profile-url-input input[type="text"]:focus,
.uap-profile-url-input input[type="url"]:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

.uap-copy-url-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    background: var(--uap-surface);
    border: none;
    border-left: 1px solid var(--uap-border-light);
    cursor: pointer;
    color: var(--uap-text-muted);
    transition: all 0.2s;
}

.uap-copy-url-btn:hover {
    background: var(--uap-surface-hover);
    color: var(--uap-action-bg, #4f46e5);
}

.uap-copy-url-btn.copied {
    background: var(--uap-success, #10b981);
    color: #fff;
    border-color: transparent;
}

.uap-view-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--uap-primary-light);
    color: var(--uap-action-bg, #4f46e5);
    border-radius: var(--uap-radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--uap-transition-bounce);
    align-self: flex-start;
}

.uap-view-profile-btn:hover {
    background: var(--uap-action-bg, #4f46e5);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--uap-primary-alpha);
}

/* 公开主页模式样式调整 */
.uap-user-center.uap-public-profile .uap-uc-header {
    min-height: 200px;
}

.uap-user-center.uap-public-profile .uap-uc-info h2 {
    font-size: 22px;
}

/* 响应式 */
@media (max-width: 640px) {
    .uap-settings-section {
        padding: 20px;
        border-radius: 0;
        margin-bottom: 12px;
    }

    .uap-settings-section-title {
        font-size: 16px;
    }

    .uap-privacy-item {
        padding: 14px 16px;
    }

    .uap-privacy-item-name {
        font-size: 14px;
    }

    .uap-privacy-toggle-slider {
        width: 46px;
        height: 26px;
    }

    .uap-privacy-toggle-slider::before {
        width: 20px;
        height: 20px;
    }

    .uap-privacy-toggle input:checked+.uap-privacy-toggle-slider::before {
        transform: translateX(20px);
    }

    .uap-profile-url-input input {
        padding: 10px 14px;
        font-size: 13px;
    }

    .uap-copy-url-btn {
        width: 44px;
    }
}

/* ==================== 设置页面子菜单样式 ==================== */

/* 设置容器 */
.uap-settings-container {
    width: 100%;
}

/* 设置子菜单 Tab */
.uap-settings-tabs {
    display: flex;
    gap: 4px;
    background: #f9fafb;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.uap-settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.uap-settings-tab:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.8);
}

.uap-settings-tab.active {
    color: var(--uap-action-bg, #4f46e5);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.uap-settings-tab svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.uap-settings-tab.active svg {
    opacity: 1;
}

/* 设置区块 */
.uap-settings-section {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.uap-settings-section:last-child {
    margin-bottom: 0;
}

.uap-settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px;
}

.uap-settings-section-desc {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 20px;
}

/* 隐私设置头部 */
.uap-privacy-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.uap-privacy-header-text {
    flex: 1;
}

.uap-privacy-header .uap-settings-section-title {
    margin-bottom: 4px;
}

.uap-privacy-header .uap-settings-section-desc {
    margin-bottom: 0;
}

/* 隐私设置列表 */
.uap-privacy-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uap-privacy-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f9fafb;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.uap-privacy-item:hover {
    background: #f3f4f6;
}

.uap-privacy-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.uap-privacy-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* 开关样式 */
.uap-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.uap-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.uap-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: all 0.3s ease;
    border-radius: 24px;
}

.uap-switch-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.uap-switch input:checked+.uap-switch-slider {
    background-color: var(--uap-action-bg, #4f46e5);
}

.uap-switch input:checked+.uap-switch-slider::before {
    transform: translateX(20px);
}

.uap-switch input:focus+.uap-switch-slider {
    box-shadow: 0 0 0 3px rgba(var(--uap-primary-rgb), 0.15);
}

/* 隐私设置底部 */
.uap-privacy-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* 隐私设置空状态 */
.uap-privacy-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: #9ca3af;
    text-align: center;
}

.uap-privacy-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.uap-privacy-empty p {
    margin: 0;
    font-size: 14px;
}

/* 公开主页链接框 */
.uap-profile-url-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.uap-profile-url-box .uap-input {
    flex: 1;
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #6b7280;
}

.uap-profile-url-box .uap-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.uap-profile-url-box .uap-button svg {
    flex-shrink: 0;
}

/* 私信隐私设置选项 */
.uap-message-privacy-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uap-message-privacy-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.uap-message-privacy-option:hover {
    background: #f3f4f6;
}

.uap-message-privacy-option.active {
    background: var(--uap-primary-bg);
    border-color: var(--uap-primary);
}

.uap-message-privacy-option input[type="radio"] {
    display: none;
}

.uap-privacy-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 1px;
}

.uap-message-privacy-option.active .uap-privacy-option-radio {
    border-color: var(--uap-primary);
}

.uap-message-privacy-option.active .uap-privacy-option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--uap-action-bg, #4f46e5);
    border-radius: 50%;
}

.uap-privacy-option-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    flex: 1;
}

.uap-privacy-option-hint {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    margin-top: 2px;
}

/* 响应式 */
@media (max-width: 640px) {
    .uap-settings-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .uap-settings-tab {
        padding: 8px 14px;
        font-size: 13px;
        flex: 1;
        justify-content: center;
        min-width: calc(50% - 4px);
    }

    .uap-settings-tab svg {
        display: none;
    }

    .uap-settings-section {
        padding: 20px 16px;
    }

    .uap-privacy-item {
        padding: 14px 16px;
    }

    .uap-profile-url-box {
        flex-direction: column;
    }

    .uap-profile-url-box .uap-input {
        width: 100%;
    }

    .uap-profile-url-box .uap-button {
        width: 100%;
        justify-content: center;
    }

    /* 私信隐私设置移动端 */
    .uap-message-privacy-option {
        padding: 12px 14px;
    }

    .uap-privacy-option-label {
        font-size: 13px;
    }

    .uap-privacy-option-hint {
        font-size: 11px;
    }
}

/* --------------------------------------------------------------------------
   8.2 404 Page - 用户主页 404 页面
   -------------------------------------------------------------------------- */

/* ==================== 用户主页 404 页面 ==================== */
.uap-profile-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 60px 20px;
    text-align: center;
}

.uap-profile-404-icon {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 50%;
    margin-bottom: 24px;
    color: #9ca3af;
}

.uap-profile-404-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px;
}

.uap-profile-404-text {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 32px;
    max-width: 300px;
    line-height: 1.6;
}

.uap-profile-404-actions {
    display: flex;
    gap: 12px;
}

.uap-profile-404-actions .uap-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.uap-profile-404-actions .uap-button svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 480px) {
    .uap-profile-404 {
        min-height: 50vh;
        padding: 40px 20px;
    }

    .uap-profile-404-icon {
        width: 100px;
        height: 100px;
    }

    .uap-profile-404-icon svg {
        width: 60px;
        height: 60px;
    }

    .uap-profile-404-title {
        font-size: 20px;
    }

    .uap-profile-404-text {
        font-size: 14px;
    }
}

/* --------------------------------------------------------------------------
   8.3 Access Denied - 无权访问提示
   -------------------------------------------------------------------------- */

/* ==================== 无权访问提示 ==================== */
.uap-access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 60px 20px;
    text-align: center;
}

.uap-access-denied-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 50%;
    margin-bottom: 20px;
    color: #d97706;
}

.uap-access-denied-icon svg {
    width: 40px;
    height: 40px;
}

.uap-access-denied-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px;
}

.uap-access-denied-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px;
    max-width: 280px;
    line-height: 1.6;
}

.uap-access-denied .uap-button {
    min-width: 100px;
}

@media (max-width: 480px) {
    .uap-access-denied {
        min-height: 200px;
        padding: 40px 20px;
    }

    .uap-access-denied-icon {
        width: 64px;
        height: 64px;
    }

    .uap-access-denied-icon svg {
        width: 32px;
        height: 32px;
    }

    .uap-access-denied-title {
        font-size: 18px;
    }
}

