/* ========== 全局：手机端优先，统一430px宽度 ========== */
* {
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: auto !important;
    min-height: 100% !important;
    background: #eef0f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    font-size: 12px;
    line-height: 1.3;
    background: #F5F7FB;
    color: #1A1E2B;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    padding-top: 0;
    padding-bottom: calc(52px + env(safe-area-inset-bottom));
    word-break: break-word;
    max-width: 430px !important;
    margin: 0 auto !important;
    width: 100% !important;
    position: relative !important;
    box-shadow: 0 0 20px rgba(0,0,0,0.04);
}

/* ========== 全局丝滑过渡 ========== */
@keyframes pageSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.03); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes floatIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
/* 页面切换动画 */
.page-transition {
    animation: pageFadeIn 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* 元素入场动画 */
.fade-in { animation: pageFadeIn 0.3s ease both; }
.slide-down { animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
.slide-up { animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
.bounce-in { animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
.float-in { animation: floatIn 0.4s ease both; }

/* 链接点击反馈 */
a {
    transition: all 0.2s ease;
}
a:active {
    opacity: 0.7;
    transform: scale(0.97);
}

/* 按钮点击反馈 */
button, [role="button"] {
    transition: all 0.15s ease;
}
button:active, [role="button"]:active {
    transform: scale(0.95);
}

/* Toast 提示动画 */
.toast-enter {
    animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-exit {
    animation: slideDown 0.25s ease reverse forwards;
}

/* ========== v2.1 自然设计系统 ========== */

/* ========== CSS 变量体系 ========== */
:root {
    --color-primary: #4E6CF7;
    --color-primary-dark: #3D5DE0;
    --color-primary-light: #6783FF;
    --color-primary-bg: rgba(78,108,247,0.08);
    --bg-page: #F5F7FB;
    --bg-card: #FFFFFF;
    --bg-input: #F8FAFC;
    --text-primary: #1A1E2B;
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    --text-white: #FFFFFF;
    --border-color: rgba(0,0,0,0.06);
    --border-light: #E5E7EB;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-btn: 0 4px 14px rgba(78,108,247,0.25);
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --max-width: 100%;
    --bg-image-height: 350px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s cubic-bezier(0.16,1,0.3,1);
}

/* ========== 统一顶部导航组件 ========== */
/* sticky-topbar：单页面顶部导航 */
.sticky-topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    display: flex; align-items: center; justify-content: space-between;
}
.sticky-topbar .back-btn {
    width: 36px; height: 36px; border-radius: 10px;
    background: #f1f5f9; display: flex; align-items: center; justify-content: center;
    color: #475569; text-decoration: none; transition: all .2s;
    border: 1px solid var(--border-light);
}
.sticky-topbar .back-btn:active { transform: scale(0.95); }
.sticky-topbar .topbar-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.sticky-topbar .topbar-spacer { width: 36px; }

/* top-tab-bar：多Tab页面顶部导航 */
.top-tab-bar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-around;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    padding-top: max(12px, env(safe-area-inset-top));
}
.top-tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 4px 12px;
    font-size: 12px; color: #6b7280; text-decoration: none;
    transition: all .2s; position: relative;
}
.top-tab-item.active { color: #4E6CF7; font-weight: 700; }
.top-tab-item.active::after {
    content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
    width: 24px; height: 3px; border-radius: 2px; background: #4E6CF7;
}
.top-tab-icon { font-size: 18px; margin-bottom: 1px; }

/* ========== 统一卡片组件 ========== */
/* 瀑布流卡片 */
.masonry-card {
    break-inside: avoid; margin-bottom: 10px;
    border-radius: var(--radius-lg); background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm); overflow: hidden;
    transition: transform var(--transition-normal);
}
.masonry-card:active { transform: scale(0.98); }

/* 列表流卡片 */
.feed-card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md); margin-bottom: var(--spacing-md);
    overflow: hidden; transition: transform var(--transition-normal);
}
.feed-card:active { transform: scale(0.98); }

/* 按钮样式 */
.btn-primary {
    background-color: #4E6CF7;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(78, 108, 247, 0.2);
}
.btn-primary:hover {
    background-color: #3D5DE0;
    box-shadow: 0 4px 12px rgba(78, 108, 247, 0.3);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: scale(0.96) translateY(0);
}

.btn-success {
    background-color: #10B981;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
    background-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-warning {
    background-color: #F59E0B;
    color: white;
    border-radius: 12px;
    font-weight: 600;
}
.btn-warning:hover {
    background-color: #D97706;
}

/* 弹窗/模态框统一样式 - 更大、更清晰 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

.modal-content {
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s ease;
}
.modal-close:hover {
    background: #E5E7EB;
    color: #374151;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    color: #4B5563;
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #F3F4F6;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 卡片组件 - 简洁清爽 */
.card {
    background: white;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}
.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* 输入框 - 清晰边框 */
.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    color: #111827;
    background: #FAFBFC;
    transition: all 0.2s ease;
    outline: none;
}
.input-field:focus {
    border-color: #4E6CF7;
    background: white;
    box-shadow: 0 0 0 3px rgba(78, 108, 247, 0.1);
}
.input-field::placeholder {
    color: #9CA3AF;
}

/* 徽章/标签 - 柔和配色 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-primary { background: #EFF6FF; color: #4E6CF7; }
.badge-success { background: #ECFDF5; color: #059669; }
.badge-warning { background: #FFFBEB; color: #D97706; }
.badge-danger { background: #FEF2F2; color: #DC2626; }

/* 进度条 - 单色简洁 */
.progress-bar {
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: #4E6CF7;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* 分割线 - 细腻 */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #E5E7EB, transparent);
    margin: 16px 0;
}

/* 空状态 - 友好提示 */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #9CA3AF;
}
.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}
.empty-text {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}
.empty-subtext {
    font-size: 13px;
}

/* ========== V认证徽章（头像右下角）全局样式 ========== */
.avatar-wrap { position: relative; display: inline-block; }
.v-badge-corner {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 2;
}
.v-badge-corner.blue { background: #3B82F6; }
.v-badge-corner.orange { background: #F97316; }
/* 较大头像（>=40px）时徽章稍大 */
.v-badge-corner.lg { width: 18px; height: 18px; font-size: 10px; bottom: 0; right: 0; }

/* ========== PC端响应式布局：自然自适应 ========== */
@media (min-width: 431px) {
    body {
        padding-bottom: 80px;
        font-size: 14px;
    }
    .container {
        max-width: 768px;
        margin: 0 auto;
        padding: 0 16px;
    }
    body::-webkit-scrollbar { width: 6px; }
    body::-webkit-scrollbar-thumb { background: rgba(78,108,247,0.2); border-radius: 3px; }
    body::-webkit-scrollbar-track { background: transparent; }

    /* PC端导航项间距 */
    .bottom-nav {
        justify-content: center;
        gap: 60px;
    }
    .nav-tab {
        flex: 0 0 auto;
    }
}

/* ========== v2.3 全局交互动画系统 ========== */
@keyframes pageEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-3deg); } 40% { transform: rotate(3deg); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(2deg); } }
html { scroll-behavior: smooth; }
.card-enter { animation: slideInUp 0.45s cubic-bezier(0.16,1,0.3,1) both; }
.card-enter:nth-child(1) { animation-delay: 0s; } .card-enter:nth-child(2) { animation-delay: 0.05s; } .card-enter:nth-child(3) { animation-delay: 0.1s; } .card-enter:nth-child(4) { animation-delay: 0.15s; } .card-enter:nth-child(5) { animation-delay: 0.2s; } .card-enter:nth-child(6) { animation-delay: 0.25s; } .card-enter:nth-child(7) { animation-delay: 0.3s; } .card-enter:nth-child(8) { animation-delay: 0.35s; } .card-enter:nth-child(9) { animation-delay: 0.4s; } .card-enter:nth-child(10) { animation-delay: 0.45s; }
.img-hover-zoom { overflow: hidden; } .img-hover-zoom img { transition: transform 0.4s ease; } .img-hover-zoom:hover img { transform: scale(1.05); }
.card-hover { transition: all 0.3s cubic-bezier(0.4,0,0.2,1); } .card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.06); } .card-hover:active { transform: scale(0.98); }
.btn-ripple { position: relative; overflow: hidden; } .btn-ripple::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%); transform: translateX(-100%); transition: transform 0.5s; } .btn-ripple:hover::after { transform: translateX(100%); } .btn-ripple:active { transform: scale(0.96); }
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
.smooth-transition { transition: all 0.3s cubic-bezier(0.4,0,0.2,1); }
.list-stagger > * { animation: slideInUp 0.4s ease both; }
.list-stagger > *:nth-child(1) { animation-delay: 0s; } .list-stagger > *:nth-child(2) { animation-delay: 0.06s; } .list-stagger > *:nth-child(3) { animation-delay: 0.12s; } .list-stagger > *:nth-child(4) { animation-delay: 0.18s; } .list-stagger > *:nth-child(5) { animation-delay: 0.24s; } .list-stagger > *:nth-child(6) { animation-delay: 0.3s; } .list-stagger > *:nth-child(7) { animation-delay: 0.36s; } .list-stagger > *:nth-child(8) { animation-delay: 0.42s; } .list-stagger > *:nth-child(9) { animation-delay: 0.48s; } .list-stagger > *:nth-child(10) { animation-delay: 0.54s; }

/* ========== v2.4 全局动画补充 ========== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.8); } 70% { transform: scale(1.05); } 100% { opacity: 1; transform: scale(1); } }
@keyframes slideDownFade { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes badgePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
@keyframes floatLoop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 5px rgba(78,108,247,0.2); } 50% { box-shadow: 0 0 20px rgba(78,108,247,0.4); } }
@keyframes borderGlow { 0%,100% { border-color: rgba(78,108,247,0.15); } 50% { border-color: rgba(78,108,247,0.4); } }
@keyframes rotateIn { from { opacity: 0; transform: rotate(-10deg) scale(0.9); } to { opacity: 1; transform: rotate(0) scale(1); } }

/* 页面过渡包装 */
.page-wrapper { animation: pageEnter 0.35s cubic-bezier(0.16,1,0.3,1) both; }
/* 通知徽章 */
.badge-pulse { animation: badgePulse 2s infinite; }
/* 浮动循环 */
.float-loop { animation: floatLoop 3s ease-in-out infinite; }
/* 发光脉冲 */
.glow-pulse { animation: glowPulse 2s ease-in-out infinite; }
/* 边框发光 */
.border-glow { animation: borderGlow 2s ease-in-out infinite; }
/* 弹入 */
.pop-in { animation: popIn 0.35s cubic-bezier(0.175,0.885,0.32,1.275) both; }
/* 旋转进入 */
.rotate-in { animation: rotateIn 0.45s cubic-bezier(0.16,1,0.3,1) both; }
/* 淡入 */
.fade-in-slow { animation: fadeIn 0.6s ease both; }
/* 下滑淡入 */
.slide-down-fade { animation: slideDownFade 0.4s cubic-bezier(0.16,1,0.3,1) both; }
/* 上滑淡入 */
.slide-up-fade { animation: slideUpFade 0.4s cubic-bezier(0.16,1,0.3,1) both; }

/* 链接/按钮全局过渡 */
a, button, input, select, textarea {
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
/* 图片加载渐显 */
img { opacity: 1; transition: opacity 0.4s ease; }
img[loading="lazy"] { opacity: 0; }
img[loading="lazy"].loaded { opacity: 1; }

/* 全局选中文本 */
::selection { background: rgba(78,108,247,0.15); color: #1a1e2b; }

/* ========== v3.0 移动端自适应修复 - 彻底解决布局错位 ========== */

/* 移动端全局容器约束 */
@media (max-width: 430px) {
    html, body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        position: relative;
    }
    
    /* 确保所有图片不超出容器 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 表格可横向滚动 */
    .table-wrap, table {
        max-width: 100%;
        overflow-x: auto;
        display: block;
    }
    
    /* 输入框、按钮不超出屏幕 */
    input, select, textarea, button {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 防止长文本溢出 */
    p, span, div {
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* 固定底部安全区 */
    body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
    
    /* 弹窗适配移动端 */
    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        margin: 0;
    }
    
    /* 表单统一宽度 */
    .form-control, .form-input, .form-textarea {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 卡片不超出屏幕 */
    .card, .feed-card, .masonry-card {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 瀑布流在小屏保持2列 */
    .masonry {
        column-count: 2 !important;
        column-gap: 8px !important;
        padding: 6px !important;
    }
    
    /* 按钮文字不换行 */
    .btn {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 顶部导航适配刘海屏 */
    .sticky-topbar, .top-tab-bar, .header-bg {
        padding-top: calc(12px + env(safe-area-inset-top)) !important;
    }
}

/* 超小屏适配 (iPhone SE 等 375px 以下) */
@media (max-width: 375px) {
    body {
        font-size: 11px;
    }
    
    .masonry {
        column-count: 2 !important;
    }
    
    .nav-label {
        font-size: 9px !important;
    }
    
    .nav-icon {
        font-size: 18px !important;
    }
}

/* 防溢出 - 仅约束媒体和表单元素 */
img, video, iframe, canvas, svg,
input, select, textarea, button,
table, pre, code {
    max-width: 100%;
}

/* 确保 flex 子元素不超出 */
.flex-child {
    min-width: 0;
    min-height: 0;
}

/* 长代码/URL 换行 */
pre, code {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 图片容器不溢出 */
.image-container, .img-wrap, .avatar-wrap {
    overflow: hidden;
}

/* PC端内容居中容器 */
@media (min-width: 431px) {
    .pc-container {
        max-width: 768px;
        margin: 0 auto;
        padding: 0 16px;
    }
}

/* ============================================================
   V2.2 统一用户端头部样式（uni-header）
   适用于所有用户端页面，提供一致的视觉风格
   用法：
   <header class="uni-header">
     <div class="uni-header-row">
       <a href="..." class="uni-back"><i class="fa fa-arrow-left"></i></a>
       <h1 class="uni-title">页面标题</h1>
       <button class="uni-action"><i class="fa fa-ellipsis-h"></i></button>
     </div>
   </header>
   ============================================================ */
.uni-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
    padding-top: env(safe-area-inset-top);
    transition: all 0.25s ease;
}
.uni-header.scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.05);
}
.uni-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    min-height: 48px;
}
.uni-back, .uni-action {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.uni-back:active, .uni-action:active {
    transform: scale(0.92);
    background: #F1F5F9;
}
.uni-title {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1A1E2B;
    text-align: center;
    letter-spacing: -0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}
.uni-title-large {
    font-size: 22px;
    font-weight: 800;
    text-align: left;
    letter-spacing: -0.5px;
}
.uni-placeholder { width: 38px; flex-shrink: 0; }

/* 渐变头部（用于重要页面如个人中心、关于页等） */
.uni-header-gradient {
    background: linear-gradient(135deg, #4E6CF7 0%, #6783FF 100%);
    color: #fff;
    border-bottom: none;
    box-shadow: 0 4px 20px rgba(78,108,247,0.18);
}
.uni-header-gradient .uni-back,
.uni-header-gradient .uni-action {
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(12px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
}
.uni-header-gradient .uni-back:active,
.uni-header-gradient .uni-action:active {
    background: rgba(255,255,255,0.32);
}
.uni-header-gradient .uni-title { color: #fff; }

/* 顶部 Tab 横滑导航 */
.uni-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    align-items: baseline;
    padding: 8px 16px 10px;
}
.uni-tabs::-webkit-scrollbar { display: none; }
.uni-tab {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #94A3B8;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    border-radius: 8px;
}
.uni-tab.current {
    color: #1a1a2e;
    font-size: 26px;
    font-weight: 800;
    padding: 0 14px 0 0;
    letter-spacing: -0.5px;
}
.uni-tab:active { transform: scale(0.96); }

/* 顶部搜索条（统一） */
.uni-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F1F5F9;
    border-radius: 28px;
    padding: 10px 16px;
    margin: 8px 16px 12px;
    border: 2px solid transparent;
    transition: all 0.25s;
}
.uni-search:focus-within {
    border-color: #4E6CF7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(78,108,247,0.06);
}
.uni-search i { color: #94A3B8; font-size: 15px; flex-shrink: 0; }
.uni-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #1E293B;
    outline: none;
    font-family: inherit;
    min-width: 0;
}
.uni-search input::placeholder { color: #94A3B8; }
.uni-search-btn {
    background: linear-gradient(135deg, #4E6CF7, #6783FF);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
.uni-search-btn:active { transform: scale(0.95); }

/* 通用页面容器 */
.uni-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 14px;
}
@media (min-width: 431px) {
    .uni-page { max-width: 768px; }
}

/* 通用卡片 */
.uni-card {
    background: #fff;
    border-radius: 18px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
}
.uni-card-header {
    padding: 14px 18px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.uni-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1F2937;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.uni-card-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, #4E6CF7, #6783FF);
    border-radius: 2px;
}
.uni-card-action {
    font-size: 12px;
    font-weight: 600;
    color: #4E6CF7;
    text-decoration: none;
    padding: 4px 10px;
    background: #EEF2FF;
    border-radius: 10px;
}

/* 空状态统一 */
.uni-empty {
    text-align: center;
    padding: 50px 20px 40px;
}
.uni-empty-icon {
    width: 72px; height: 72px;
    border-radius: 22px;
    margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    background: #F1F5F9;
    color: #94A3B8;
}
.uni-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}
.uni-empty-sub {
    font-size: 12px;
    color: #94A3B8;
}

/* PC端适配（手机框样式） */
@media (min-width: 431px) {
    body {
        max-width: 768px;
        margin: 0 auto;
        border-left: 1px solid rgba(0,0,0,0.04);
        border-right: 1px solid rgba(0,0,0,0.04);
        min-height: 100vh;
        box-shadow: 0 0 40px rgba(0,0,0,0.04);
    }
}

/* 超小屏字体优化 */
@media (max-width: 375px) {
    .uni-title { font-size: 16px; }
    .uni-title-large { font-size: 20px; }
    .uni-tab.current { font-size: 22px; }
    .uni-header-row { padding: 8px 12px; }
    .uni-back, .uni-action { width: 34px; height: 34px; font-size: 14px; }
}

/* 全局按钮统一 */
.uni-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}
.uni-btn:active { transform: scale(0.96); }
.uni-btn-primary {
    background: linear-gradient(135deg, #4E6CF7, #6783FF);
    color: #fff;
    box-shadow: 0 3px 10px rgba(78,108,247,0.3);
}
.uni-btn-ghost {
    background: #F1F5F9;
    color: #475569;
}
.uni-btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #fff;
    box-shadow: 0 3px 10px rgba(239,68,68,0.3);
}

/* 全局徽章统一 */
.uni-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}
.uni-badge-blue { background: #DBEAFE; color: #2563EB; }
.uni-badge-green { background: #DCFCE7; color: #16A34A; }
.uni-badge-orange { background: #FED7AA; color: #EA580C; }
.uni-badge-red { background: #FEE2E2; color: #DC2626; }
.uni-badge-purple { background: #EDE9FE; color: #7C3AED; }
.uni-badge-gray { background: #F1F5F9; color: #64748B; }

/* 滚动隐藏 */
.uni-hide-scroll::-webkit-scrollbar { display: none; }
.uni-hide-scroll { scrollbar-width: none; }

/* 全局加载占位 */
.uni-loading {
    text-align: center;
    padding: 40px 20px;
    color: #94A3B8;
    font-size: 13px;
}
.uni-loading i {
    font-size: 24px;
    color: #CBD5E1;
    display: block;
    margin-bottom: 8px;
}

/* ============================================================
   V2.2 全局头部美化（兼容现有 .top-nav / .top-bar / .header-bg / .nav-back）
   自动应用于所有用户端页面，无需修改单个页面
   ============================================================ */

/* 1. 统一返回按钮样式 - 所有变体 */
.nav-back, .back, .nav-btn, .uni-back,
.back-btn, .header-content .nav-btn, .top-bar .back {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    -webkit-tap-highlight-color: transparent;
}
.nav-back:active, .back:active, .nav-btn:active, .uni-back:active {
    transform: scale(0.88) !important;
}

/* 2. 统一标题字体优化 */
.nav-title, .top-bar h1, .header-content h1,
.uni-title, .top-nav .nav-title {
    letter-spacing: -0.3px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* 3. .header-bg 系列 - 添加更柔和的渐变与光晕 */
.header-bg {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4E6CF7 0%, #6783FF 60%, #818CF8 100%) !important;
    box-shadow: 0 4px 20px rgba(78,108,247,0.18);
}
.header-bg .glow {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
    animation: headerGlow 8s ease-in-out infinite;
}
.header-bg .glow:nth-child(1) {
    top: -60px; right: -40px;
    width: 180px; height: 180px;
    animation-delay: 0s;
}
.header-bg .glow:nth-child(2) {
    bottom: -50px; left: -30px;
    width: 140px; height: 140px;
    animation-delay: 2s;
}
.header-bg .glow:nth-child(3) {
    top: 40%; left: 60%;
    width: 100px; height: 100px;
    animation-delay: 4s;
    opacity: 0.5;
}
@keyframes headerGlow {
    0%,100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(10px, -10px) scale(1.15); opacity: 0.3; }
}
.header-content {
    position: relative;
    z-index: 2;
}

/* 4. .top-bar 系列（客服/反馈页等）- 统一毛玻璃效果 */
.top-bar {
    background: rgba(255,255,255,0.96) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
    transition: box-shadow 0.25s ease;
}
.top-bar.scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.05);
}

/* 5. .top-nav 系列（广场/朋友圈等）- 吸顶优化 */
.top-nav {
    background: rgba(255,255,255,0.97) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: box-shadow 0.25s ease;
}
.top-nav.scrolled {
    box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}
.top-nav-link {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.top-nav-link:active { transform: scale(0.94); }

/* 6. 所有吸顶 header 滚动时添加阴影 */
header.sticky, .sticky > .top-nav, .sticky > .top-bar,
.back-nav, .page-top, .detail-header, .publish-header,
.topbar, .chat-header, .animated-bg {
    transition: box-shadow 0.25s ease;
}
.back-nav.scrolled, .page-top.scrolled,
.detail-header.scrolled, .publish-header.scrolled,
.topbar.scrolled, .chat-header.scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

/* 7. 统一搜索条样式 */
.search-bar, .uni-search {
    transition: all 0.25s ease;
}
.search-bar:focus-within {
    box-shadow: 0 0 0 4px rgba(78,108,247,0.08);
}

/* 8. 卡片统一阴影与圆角 */
.feature-card, .info-card, .version-card,
.uni-card, .card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* 9. 列表项点击反馈 */
.info-item, .feature-item, .contact-item {
    -webkit-tap-highlight-color: transparent;
    transition: background 0.18s ease, transform 0.18s ease;
}
.info-item:active, .feature-item:active, .contact-item:active {
    transform: scale(0.98);
}

/* 10. 安全区全局适配（顶部状态栏）- 已移除全局padding-top，各页面自行处理 */

/* 11. 超小屏头部紧凑化 */
@media (max-width: 375px) {
    .nav-back, .back, .nav-btn, .uni-back, .top-back, .top-action, .cover-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 14px !important;
    }
    .nav-title, .top-bar h1, .uni-title, .top-title {
        font-size: 16px !important;
    }
    .header-content {
        padding: 12px 14px !important;
    }
}

/* 12. PC端头部居中 */
@media (min-width: 431px) {
    header, .top-nav, .top-bar, .header-bg, .uni-header,
    .back-nav, .page-top, .detail-header, .publish-header,
    .topbar, .chat-header, .animated-bg {
        max-width: 768px;
        margin-left: auto;
        margin-right: auto;
    }
    .header-content, .uni-header-row, .top-nav > div, .top-bar {
        max-width: 768px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* 13. 全局按钮点击反馈 */
button, .btn, .submit-btn, a.btn,
.back-btn, .top-back, .top-action, .cover-btn, .top-bar-back {
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
button:active, .btn:active, .submit-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* 14. 全局图片加载渐显 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

/* 15. 统一空状态样式 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #94A3B8;
}
.empty-state i {
    font-size: 40px;
    color: #CBD5E1;
    margin-bottom: 12px;
    display: block;
}
.empty-state p {
    font-size: 13px;
    margin: 4px 0;
}

/* 16. 全局滚动条美化（PC端） */
@media (min-width: 431px) {
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    ::-webkit-scrollbar-track {
        background: transparent;
    }
    ::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.15);
        border-radius: 3px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: rgba(0,0,0,0.25);
    }
}


/* ========== animated-bg 美化渐变头部 ========== */
.animated-bg {
    background: linear-gradient(135deg, #4E6CF7 0%, #6783FF 50%, #5B7FFF 100%);
    background-size: 200% 200%;
    animation: animatedBgShift 6s ease-in-out infinite;
    position: relative;
}
.animated-bg::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBlob 8s ease-in-out infinite;
}
.animated-bg::after {
    content: '';
    position: absolute;
    bottom: -25%;
    left: -10%;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBlob 10s ease-in-out infinite reverse;
}
@keyframes animatedBgShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(15px, -10px) scale(1.05); }
    66% { transform: translate(-10px, 15px) scale(0.95); }
}

/* ========== 性能优化：GPU加速 ========== */
.will-change-transform { will-change: transform; }
.gpu-accelerated { transform: translateZ(0); backface-visibility: hidden; perspective: 1000px; }

/* ========== 全局手机端尺寸限制 ========== */
/* 用户端所有页面统一最大宽度430px，居中显示，PC端不铺满全屏 */
body {
    max-width: 430px !important;
    margin: 0 auto !important;
}
/* 页面内容容器也限制宽度 */
.app-container, .main-content, .page-container, #app {
    max-width: 430px !important;
    margin: 0 auto !important;
    width: 100% !important;
}
/* 底部导航栏限制宽度 */
.bottom-nav, .tabbar, .nav-bar {
    max-width: 430px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}
/* 固定定位的头部也限制宽度 - 仅对fixed/absolute生效，不影响sticky */
.top-nav.fixed, .top-bar.fixed, .uni-header.fixed, .header-bg.fixed, .page-top.fixed {
    max-width: 430px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
}

