
/* 自定义字体 */
@font-face {
    font-family: 'HYLLHJ';
    src: url('/static/fonts/HYLLHJ.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-color: #ff2442;
    --primary-light: #ff6b81;
    --text-color: #333;
    --text-light: #999;
    --text-lighter: #bbb;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --border-color: #eee;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* 主页容器 */
#mainPage {
    min-height: 100vh;
    padding-bottom: 58px;
}

/* 顶部导航 */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
}

.logo {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;
}

.logo i { font-size: 15px; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    border: none;
    cursor: pointer;
}

.nav-btn-ghost {
    background: transparent;
    color: var(--text-color);
}

.nav-btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
}

/* 搜索框 */
.search-wrapper {
    padding: 8px 12px;
    background: #fff;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 18px;
    padding: 8px 14px;
}

.search-box i {
    color: var(--text-light);
    font-size: 16px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    margin-left: 8px;
}

/* 搜索框 */

/* 滚动字幕 */
.marquee-wrapper {
    background: linear-gradient(90deg, #fff9f9, #fff);
    padding: 2px 12px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    font-size: 11px;
}
.marquee-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.marquee-text {
    display: inline-block;
    white-space: nowrap;
    font-size: 11px;
    color: #666;
    animation: marqueeScroll 20s linear infinite;
    padding-left: 100%;
}
@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
.marquee-wrapper:hover .marquee-text {
    animation-play-state: paused;
}

/* 排序选择器 */
/* old sort-wrapper removed */

.sort-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.action-btn-wrap span {
    font-size: 9px;
    color: var(--text-light);
    margin-top: 1px;
}

.refresh-btn, .search-btn, .app-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.refresh-btn:hover, .search-btn:hover {
    background: var(--primary-light);
    color: #fff;
}

.refresh-btn i, .search-btn i, .app-btn i {
    font-size: 16px;
}

.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

.search-btn.active {
    background: var(--primary-color);
    color: #fff;
}

/* APP按钮醒目动画 */
.app-btn {
    background: linear-gradient(135deg, #ff2442, #ff6b81);
    color: #fff;
    animation: appBtnGlow 2s ease-in-out infinite, appBtnBounce 1s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(255, 36, 66, 0.4);
    position: relative;
}

.app-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #ff2442, #ff6b81, #ff2442);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    animation: appBtnRing 2s ease-in-out infinite;
}

.app-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 20px rgba(255, 36, 66, 0.6);
    animation: none;
}

@keyframes appBtnGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 36, 66, 0.4);
    }
    50% {
        box-shadow: 0 2px 20px rgba(255, 36, 66, 0.9), 0 0 30px rgba(255, 36, 66, 0.4), 0 0 40px rgba(255, 36, 66, 0.2);
    }
}

@keyframes appBtnBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes appBtnRing {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.action-btn-wrap.app-wrap span {
    color: var(--primary-color);
    font-weight: 600;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 搜索框关闭按钮 */
.search-close {
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    margin-left: 8px;
}

/* 美化Toast提示 */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
}

.toast-item {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 10px;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast-item.success {
    background: linear-gradient(135deg, rgba(82, 196, 26, 0.9), rgba(56, 158, 13, 0.9));
}

.toast-item.error {
    background: linear-gradient(135deg, rgba(255, 77, 79, 0.9), rgba(207, 19, 34, 0.9));
}

.toast-item.warning {
    background: linear-gradient(135deg, rgba(250, 173, 20, 0.9), rgba(212, 136, 6, 0.9));
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* 美化确认弹窗 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.confirm-modal.active {
    opacity: 1;
    visibility: visible;
}

.confirm-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 280px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s;
}

.confirm-modal.active .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.confirm-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.confirm-modal-message {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-modal-buttons {
    display: flex;
    gap: 12px;
}

.confirm-modal-buttons button {
    flex: 1;
    padding: 12px 0;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn-cancel {
    background: var(--bg-color);
    border: none;
    color: var(--text-color);
}

.confirm-btn-cancel:hover {
    background: #e8e8e8;
}

.confirm-btn-ok {
    background: var(--primary-color);
    border: none;
    color: #fff;
}

.confirm-btn-ok:hover {
    background: var(--primary-light);
}

.confirm-btn-danger {
    background: #ff4d4f;
}

.confirm-btn-danger:hover {
    background: #ff7875;
}

/* 下载弹窗 */
.download-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.download-modal.active {
    display: flex;
}

.download-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 320px;
    overflow: hidden;
    animation: modalPopIn 0.3s ease;
}

@keyframes modalPopIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.download-modal-header {
    background: linear-gradient(135deg, #ff2442, #ff6b81);
    color: #fff;
    padding: 24px 20px;
    text-align: center;
    position: relative;
}

.download-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}

.download-modal-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.download-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.download-modal-body {
    padding: 20px;
    text-align: center;
}

.download-modal-body p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.download-modal-body ul {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0;
}

.download-modal-body li {
    padding: 8px 0;
    color: var(--text-color);
    border-bottom: 1px solid #f0f0f0;
}

.download-modal-body li:last-child {
    border-bottom: none;
}

.download-modal-footer {
    padding: 0 20px 20px;
    text-align: center;
}

.download-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ff2442, #ff6b81);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-btn:active {
    transform: scale(0.98);
}

.download-tip {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-light);
}

.sort-selector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-color);
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    position: relative;
}

.sort-selector i {
    font-size: 12px;
    transition: transform 0.2s;
}

.sort-selector.open i {
    transform: rotate(180deg);
}

.sort-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 120px;
    display: none;
    z-index: 50;
    overflow: hidden;
}

.sort-dropdown.show { display: block; }

.sort-option {
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-option:hover { background: var(--bg-color); }
.sort-option.active { color: var(--primary-color); }
.sort-option.active::after { content: '✓'; }

/* 瀑布流卡片 - 真正的瀑布流 */
.waterfall {
    position: relative;
    padding: 6px;
    min-height: 200px;
}

.waterfall-column {
    position: absolute;
    width: calc(50% - 9px);
    top: 6px;
}

.waterfall-column:first-child {
    left: 6px;
}

.waterfall-column:last-child {
    right: 6px;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.3s ease forwards;
    cursor: pointer;
}

.card:active {
    transform: scale(0.98);
}

/* 优质帖子样式 */
.card.quality-card {
    position: relative;
    border: 2px solid #ffd54f;
    box-shadow: 0 2px 12px rgba(255,193,7,0.15);
}

.card-quality-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff9800, #ffc107);
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    z-index: 10;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(255,152,0,0.3);
}

/* 置顶帖子样式 */
.card.top-card {
    position: relative;
    border: 2px solid #ff6b81;
}

.card-top-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ff2442, #ff6b81);
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    z-index: 10;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(255,36,66,0.3);
}

/* 同时有置顶和优质 */
.card.quality-card.top-card {
    border: 2px solid #ff2442;
    box-shadow: 0 2px 12px rgba(255,36,66,0.2);
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 图片加载容器 */
.card-image-wrap {
    position: relative;
    width: 100%;
    background: #f5f5f5;
    min-height: 80px;
}

.card-image-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.card-image-progress {
    width: 60%;
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.card-image-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
}

.card-image-loading-text {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

.card-image {
    width: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.3s;
}

.card-image.loaded {
    opacity: 1;
}

/* 纯文字卡片艺术背景 - 使用自定义字体 */
.card-text-bg {
    min-height: 120px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-text-bg::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 10px;
    font-size: 120px;
    font-family: Georgia, serif;
    opacity: 0.08;
    line-height: 1;
}

.text-bg-1 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%); }
.text-bg-2 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.text-bg-3 { background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%); }
.text-bg-4 { background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%); }
.text-bg-5 { background: linear-gradient(135deg, #fddb92 0%, #d1fdff 100%); }
.text-bg-6 { background: linear-gradient(135deg, #c1dfc4 0%, #deecdd 100%); }
.text-bg-7 { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.text-bg-8 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }

.card-text-content {
    font-family: 'HYLLHJ', "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.card-body {
    padding: 8px 10px 10px;
}

.card-title {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.card-to {
    font-size: 12px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-user {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.card-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.card-username {
    font-size: 11px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-like {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--text-light);
    font-size: 11px;
    flex-shrink: 0;
    cursor: pointer;
    padding: 4px;
    border-radius: 12px;
    transition: all 0.2s;
}

.card-like:active { transform: scale(0.9); }
.card-like i { font-size: 16px; transition: all 0.3s; }
.card-like.liked { color: var(--primary-color); }
.card-like.liked i { animation: likeAnim 0.4s ease; }

@keyframes likeAnim {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.like-particles {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

.like-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: particleAnim 0.6s ease-out forwards;
}

@keyframes particleAnim {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 16px;
}

.load-more-btn {
    padding: 10px 32px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.load-more-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #eee;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.load-more-btn.loading .load-more-spinner {
    display: block;
}

.load-more-end {
    color: var(--text-light);
    font-size: 13px;
    padding: 16px;
    text-align: center;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 5px 0 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: var(--text-light);
    text-decoration: none;
    padding: 2px 12px;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active { color: var(--primary-color); }
.bottom-nav-item i { font-size: 20px; margin-bottom: 1px; }
.bottom-nav-item .nav-icon { width: 22px; height: 22px; margin-bottom: 1px; }
.bottom-nav-item.active .nav-icon { color: var(--primary-color); }

.post-btn {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    margin-top: -16px;
    box-shadow: 0 2px 8px rgba(255,36,66,0.4);
}

/* 发帖选择面板 */
.post-action-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.post-action-sheet.active { display: flex; }

.action-sheet-content {
    width: 100%;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.action-sheet-item {
    padding: 16px;
    text-align: center;
    font-size: 16px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-sheet-item:active {
    background: var(--bg-color);
}

.action-sheet-item.cancel {
    color: var(--text-light);
    border-bottom: none;
    margin-top: 8px;
    background: var(--bg-color);
}

/* 消息红点 */
.msg-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(50%);
    min-width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 8px;
    font-size: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.bottom-nav-item {
    position: relative;
}

/* 消息页面 */
#messagesPage {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 200;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
}

#messagesPage.active {
    display: flex;
    transform: translateX(0);
}

.msg-header {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.msg-back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

.msg-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.msg-read-all {
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
}

.msg-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.msg-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
}

.msg-tab.active {
    color: var(--text-color);
    font-weight: 500;
}

.msg-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary-color);
}

.msg-content {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}

.msg-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.msg-item:active {
    background: var(--bg-color);
}

.msg-avatar-wrap {
    position: relative;
    margin-right: 12px;
}

.msg-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.msg-type-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    border: 2px solid #fff;
}

.msg-type-icon.like {
    background: var(--primary-color);
}

.msg-type-icon.comment {
    background: #52c41a;
}

.msg-type-icon.follow {
    background: #1890ff;
}

.msg-type-icon.reject {
    background: #ff4d4f;
}

.msg-system-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4d4f, #ff7875);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}

.msg-unread {
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

.msg-info {
    flex: 1;
    min-width: 0;
}

.msg-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.msg-action {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.msg-preview {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    margin-left: 12px;
    flex-shrink: 0;
}

.msg-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.msg-empty i {
    font-size: 48px;
    margin-bottom: 12px;
}

/* 详情页浏览量 */
.detail-views {
    font-size: 12px;
    color: var(--text-light);
}

.detail-footer {
    position: relative;
}

/* 详情页操作图标放大 */
.detail-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-actions .action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: var(--text-color);
}

.detail-actions .action-item i {
    font-size: 26px;
    margin-bottom: 2px;
}

.detail-actions .action-item span {
    font-size: 11px;
    color: var(--text-color);
}

.detail-actions .action-item.liked,
.detail-actions .action-item.faved {
    color: var(--primary-color);
}

.detail-actions .action-item.liked span,
.detail-actions .action-item.faved span {
    color: var(--primary-color);
}

/* 详情页 */
#detailPage {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.3s;
}

#detailPage.active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
}

.detail-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.detail-back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
}

.detail-user {
    display: flex;
    align-items: center;
    flex: 1;
    margin-left: 8px;
    cursor: pointer;
}

.detail-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.detail-username {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 500;
}

.detail-follow-btn {
    padding: 6px 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.detail-follow-btn.followed {
    background: #f0f0f0;
    color: #999;
}

.detail-share {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-color);
    margin-left: 8px;
    cursor: pointer;
}

.detail-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-report {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.detail-report:hover {
    color: var(--primary-color);
    background: rgba(255,36,66,0.1);
}

.detail-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ff2442;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    background: rgba(255,36,66,0.08);
}

.detail-delete:hover {
    background: rgba(255,36,66,0.15);
}

/* 举报弹窗 */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 600;
    display: none;
    align-items: center;
    justify-content: center;
}
.report-modal.active { display: flex; }
.report-box {
    width: 85%;
    max-width: 320px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
}
.report-title {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
}
.report-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.report-option {
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.report-option:hover, .report-option.selected {
    background: var(--primary-color);
    color: #fff;
}
.report-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    margin-bottom: 16px;
}
.report-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}
.report-btns {
    display: flex;
    gap: 10px;
}
.report-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.report-btn.cancel {
    background: var(--bg-color);
    color: var(--text-color);
}
.report-btn.submit {
    background: var(--primary-color);
    color: #fff;
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 图片轮播 */
.image-swiper {
    position: relative;
    background: #000;
    overflow: hidden;
}

.swiper-container {
    display: flex;
    transition: transform 0.3s ease;
}

.swiper-slide {
    flex-shrink: 0;
    width: 100%;
}

.swiper-slide img {
    width: 100%;
    display: block;
}

.swiper-indicator {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.swiper-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.5);
    transition: all 0.2s;
}

.swiper-dot.active {
    width: 16px;
    background: #fff;
}

.swiper-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.detail-body { padding: 16px; }

.detail-to {
    display: inline-block;
    background: rgba(255,36,66,0.1);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.detail-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-color);
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-meta {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-time {
    font-size: 12px;
    color: var(--text-light);
}

/* 投票区域 */
.detail-vote {
    margin-top: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
}

.vote-question {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
}

.vote-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vote-option {
    position: relative;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
}

.vote-option:active {
    transform: scale(0.98);
}

.vote-option.voted {
    border-color: var(--primary-color);
}

.vote-option.show-result {
    cursor: default;
}

.vote-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255, 36, 66, 0.1);
    transition: width 0.5s ease;
}

.vote-option-content {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1;
}

.vote-check {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    margin-right: 8px;
    flex-shrink: 0;
}

.vote-option-text {
    flex: 1;
    font-size: 14px;
}

.vote-option-percent {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
    margin-left: 8px;
}

.vote-info {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 16px;
}

/* 卡片投票标识 - 放在图片右上角，半透明圆角 */
.card-vote-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.card-vote-badge i {
    font-size: 12px;
}

.card-image-wrap {
    position: relative;
}

.card-text-bg {
    position: relative;
}

/* 卡片话题标签 */
/* 评论区 - 快手风格 */
.comments-section {
    border-top: 8px solid var(--bg-color);
    padding: 16px;
}

.comments-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comments-title span {
    font-size: 13px;
    color: var(--text-light);
    font-weight: normal;
}

.comment-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-item:active {
    background: rgba(0,0,0,0.02);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.comment-main {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.comment-name {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-name .author-tag {
    font-size: 10px;
    background: var(--primary-color);
    color: #fff;
    padding: 1px 4px;
    border-radius: 2px;
}

.comment-text {
    font-size: 15px;
    color: var(--text-color);
    line-height: 1.5;
    word-break: break-word;
    margin-bottom: 8px;
}

.comment-reply-to {
    color: #1890ff;
    margin-right: 4px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-light);
}

.comment-meta .reply-btn {
    cursor: pointer;
}

.comment-meta .reply-btn:hover {
    color: var(--text-color);
}

.comment-like {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.2s;
}

.comment-like:hover {
    background: rgba(0,0,0,0.05);
}

.comment-like.liked {
    color: var(--primary-color);
}

.comment-like i {
    font-size: 16px;
}

/* 回复列表 */
.comment-replies {
    margin-top: 12px;
    margin-left: 52px;
}

.comment-replies .comment-item {
    padding: 10px 0;
}

.comment-replies .comment-avatar {
    width: 28px;
    height: 28px;
}

.comment-replies .comment-main {
    margin-left: 10px;
}

.comment-replies .comment-name {
    font-size: 12px;
    margin-bottom: 4px;
}

.comment-replies .comment-text {
    font-size: 14px;
    margin-bottom: 6px;
}

.comment-replies .comment-meta {
    font-size: 11px;
}

/* 展开更多回复 */
.expand-replies {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 52px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
}

.expand-replies::before {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--border-color);
}

.expand-replies:hover {
    color: var(--text-color);
}

.expand-replies i {
    font-size: 12px;
    transition: transform 0.3s;
}

.expand-replies.expanded i {
    transform: rotate(180deg);
}

.no-comments {
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
    font-size: 14px;
}

.no-comments {
    text-align: center;
    color: var(--text-light);
    padding: 32px 0;
}

/* 回复输入框 */
.reply-input-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 250;
    display: none;
}

.reply-input-bar.active {
    display: flex;
    align-items: center;
}

.reply-input-bar .reply-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-right: 8px;
    white-space: nowrap;
}

.reply-input-bar input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
}

.reply-input-bar input:focus {
    border-color: var(--primary-color);
}

.reply-input-bar .reply-send {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 8px 16px;
    margin-left: 8px;
    font-size: 14px;
    cursor: pointer;
}

.reply-input-bar .reply-cancel {
    color: var(--text-light);
    font-size: 20px;
    margin-left: 8px;
    cursor: pointer;
}

/* 底部操作栏 */
.detail-footer {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    background: #fff;
    gap: 8px;
}

.comment-input-area {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 140px);
}

.comment-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 18px;
    padding: 6px 10px;
    position: relative;
    gap: 6px;
}

.comment-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    min-width: 0;
}

.comment-sticker-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    padding: 2px;
}

.comment-sticker-btn:hover {
    color: var(--primary-color);
}

.comment-send-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 13px;
    cursor: pointer;
}

.comment-send-btn:active {
    opacity: 0.8;
}

.cancel-reply-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: var(--text-light);
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: var(--text-light);
    min-width: 36px;
}

.action-item i { font-size: 22px; }
.action-item span { font-size: 10px; margin-top: 1px; }
.action-item.liked { color: var(--primary-color); }

/* 个人主页 */
#profilePage {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 250;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
}

#profilePage.active {
    display: flex;
    transform: translateX(0);
}

#profilePage.sliding-in { display: flex; }

/* 默认纯色背景 */
.profile-header-bg {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    position: relative;
    overflow: hidden;
}

.profile-header-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-back {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.profile-more {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* 背景图编辑提示 */
.profile-bg-edit {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.4);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    display: none;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.profile-bg-edit i { font-size: 12px; }

.profile-info-card {
    background: #fff;
    margin: -40px 12px 0;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.profile-avatar-wrapper {
    position: absolute;
    top: -40px;
    left: 16px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    cursor: pointer;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.profile-stats {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    margin-bottom: 16px;
}

.profile-stat { text-align: center; }

.profile-stat-num {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.profile-stat-label {
    font-size: 11px;
    color: var(--text-light);
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 4px;
}

.profile-id {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.profile-bio {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 16px;
}

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

.profile-action-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.profile-action-btn.primary {
    background: var(--primary-color);
    color: #fff;
}

.profile-action-btn.secondary {
    background: var(--bg-color);
    color: var(--text-color);
}

.profile-action-btn.followed {
    background: #f0f0f0;
    color: #999;
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-top: 16px;
}

.profile-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
}

.profile-tab.active {
    color: var(--text-color);
    font-weight: 600;
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.profile-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.profile-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
}

.profile-post-item {
    aspect-ratio: 1;
    background: var(--bg-color);
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
}

/* 纯文本帖子背景 */
.profile-post-item.text-bg-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.profile-post-item.text-bg-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.profile-post-item.text-bg-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.profile-post-item.text-bg-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.profile-post-item.text-bg-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.profile-post-item.text-bg-6 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.profile-post-item.text-bg-7 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.profile-post-item.text-bg-8 { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }

.profile-post-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-post-text {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    font-family: 'HYLLHJ', sans-serif;
}

/* 设置页 */
.settings-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 250;
    display: none;
    flex-direction: column;
}

.settings-page.active { display: flex; }

.settings-header {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.settings-back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

.settings-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin-right: 32px;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.settings-group {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.settings-item:last-child { border-bottom: none; }

.settings-item-label {
    flex: 1;
    font-size: 14px;
}

.settings-item-value {
    font-size: 14px;
    color: var(--text-light);
    margin-right: 8px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-item i {
    color: var(--text-lighter);
    font-size: 14px;
}

.settings-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* 弹窗 */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-mask.active { display: flex; }

.modal-box {
    width: 90%;
    max-width: 360px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
}

.modal-body { padding: 20px 16px; }

/* 注册步骤指示器 */
.register-steps {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}
.register-steps .step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
}
.register-steps .step.active {
    background: var(--primary-color);
}

/* 注册头像上传 */
.register-avatar-section {
    text-align: center;
    margin-bottom: 20px;
}
.register-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 8px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.register-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.register-avatar-edit {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 16px;
    padding: 4px 0;
}
.register-avatar-tip {
    font-size: 12px;
    color: var(--text-light);
}

/* 滑动验证 */
.slider-verify {
    position: relative;
    height: 40px;
    background: #f5f5f5;
    border-radius: 20px;
    overflow: hidden;
}
.slider-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.slider-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #67c23a, #95d475);
    border-radius: 20px;
    transition: width 0.1s;
}
.slider-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    user-select: none;
}
.slider-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: left 0.1s;
    z-index: 10;
}
.slider-btn:active { cursor: grabbing; }
.slider-btn i { color: var(--primary-color); }
.slider-verify.success .slider-btn i { color: #67c23a; }
.slider-verify.success .slider-text { color: #67c23a; }

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

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.form-input:focus { border-color: var(--primary-color); }

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 100px;
}

.form-footer {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.btn-default {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.form-checkbox input {
    width: 16px;
    height: 16px;
}

/* 发帖弹窗 */
.post-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 300;
    display: none;
    flex-direction: column;
}

.post-modal.active { display: flex; }

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.post-header-btn {
    font-size: 14px;
    padding: 6px 16px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
}

.post-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.image-preview-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.image-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.upload-btn {
    width: 80px;
    height: 80px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    cursor: pointer;
}

.upload-btn i { font-size: 24px; }
.upload-btn span { font-size: 11px; margin-top: 4px; }

/* 发帖提示 */
.post-tip {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #ad8b00;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

/* 话题选择 */
.topic-select-wrapper {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
}
.topic-select-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.topic-select-item {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}
.topic-select-item:hover, .topic-select-item.selected {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.topic-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topic-hash {
    color: var(--primary-color);
    font-weight: 600;
}
.topic-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 13px;
}
.topic-input:focus {
    outline: none;
    border-color: var(--primary-color);
}
.topic-add-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}
.selected-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* 表白对象缩小 */
.form-group-small {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}
.form-label-inline {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.form-input-inline {
    flex: 1;
    padding: 8px 12px !important;
    font-size: 13px !important;
}

/* 匿名发布 */
.anonymous-warn {
    color: #fa8c16;
    font-size: 12px;
}
.anonymous-tip {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    margin-left: 24px;
}

/* 确认弹窗 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
}
.confirm-modal.active { display: flex; }
.confirm-box {
    width: 85%;
    max-width: 300px;
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
}
.confirm-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.confirm-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}
.confirm-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}
.confirm-btns {
    display: flex;
    gap: 12px;
}
.confirm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    cursor: pointer;
}
.confirm-btn.cancel {
    background: #f0f0f0;
    color: #666;
}
.confirm-btn.submit {
    background: var(--primary-color);
    color: #fff;
}

/* 公告弹窗 */
.notice-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.notice-modal.active { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.notice-box {
    width: 90%;
    max-width: 360px;
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
    animation: noticePopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes noticePopIn {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.notice-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.notice-box h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-weight: 600;
}

.notice-content {
    text-align: left;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
}

.notice-box p {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: 8px;
}

.notice-welcome {
    text-align: center;
    font-size: 15px !important;
    font-weight: 500;
    color: var(--primary-color) !important;
}

.notice-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    margin: 12px 0;
}

.notice-highlight {
    background: linear-gradient(90deg, #fff5f5, #fff);
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    font-size: 12px !important;
}

.notice-purpose {
    font-weight: 600;
    color: #333 !important;
}

.notice-list {
    text-align: center;
    color: var(--primary-color) !important;
    font-weight: 500;
}

.notice-promise {
    background: linear-gradient(90deg, #f0fff0, #fff);
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #52c41a;
    color: #52c41a !important;
    font-size: 12px !important;
}

.notice-btn {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(255,36,66,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.notice-btn:active {
    transform: scale(0.98);
}

.notice-footnote {
    margin-top: 12px;
    font-size: 11px !important;
    color: #999 !important;
    text-align: center;
    line-height: 1.5 !important;
}

/* 图片预览 */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-viewer.active { display: flex; }

.image-viewer img {
    max-width: 100%;
    max-height: 100%;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 140px;
    display: none;
    z-index: 150;
}

.user-dropdown.active { display: block; }

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-color);
    text-decoration: none;
}

.user-dropdown a:hover { background: var(--bg-color); }

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    display: none;
}


/* 帖子加载状态 */
.posts-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.95);
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    z-index: 100;
}
.posts-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
.posts-loading-text {
    font-size: 14px;
    color: var(--text-color);
}

/* Waterfall内部加载状态 */
.waterfall-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    width: 100%;
}
.waterfall-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
.waterfall-loading-text {
    font-size: 14px;
    color: var(--text-light);
}

/* Loading遮罩 */
#loadingMask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.loading-content {
    background: #fff;
    padding: 24px 32px;
    border-radius: 12px;
    text-align: center;
}
.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    color: var(--text-color);
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 60px;
    color: #ddd;
}

.empty-state p {
    margin-top: 16px;
    color: var(--text-light);
}


/* ========== 分类导航栏 ========== */
.category-bar {
    position: sticky;
    top: 0;
    z-index: 80;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.category-scroll {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    padding: 6px 12px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-item {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap !important;
    -webkit-tap-highlight-color: transparent;
}
.category-item .cat-icon {
    color: #999;
    transition: color 0.2s;
}
.category-item.active {
    background: var(--cat-c, var(--primary-color, #ff2442));
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.category-item.active .cat-icon {
    color: #fff;
}
.category-item:not(.active):active {
    transform: scale(0.95);
    background: #eee;
}

/* ========== 卡片内分类标签 ========== */
.card-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--cat-c, #999);
    background: color-mix(in srgb, var(--cat-c, #999) 10%, transparent);
    margin-bottom: 6px;
    line-height: 1.6;
}
.card-cat-badge .cat-svg {
    color: var(--cat-c, #999);
}
/* 回退：不支持 color-mix 的浏览器 */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .card-cat-badge {
        background: #f5f5f5;
    }
}

/* ========== 卡片内标签 ========== */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.card-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--primary-color, #ff2442);
    background: rgba(255,36,66,0.06);
    line-height: 1.7;
}
.card-tag::before {
    content: '#';
    opacity: 0.6;
}

/* ========== 发帖页分类选择器 ========== */
.category-selector {
    padding: 0 0 12px;
}
.category-selector-title {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.category-selector-title .required {
    color: #ff2442;
    font-size: 15px;
}
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
/* toolbar-cat-scroll: see post.css */
.category-pill {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    color: #666;
    background: #f5f5f5;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.category-pill .cat-icon { color: #999; transition: color 0.2s; }
.category-pill.active {
    color: var(--cat-c, #ff2442);
    background: color-mix(in srgb, var(--cat-c, #ff2442) 8%, #fff);
    border-color: var(--cat-c, #ff2442);
    font-weight: 500;
}
.category-pill.active .cat-icon {
    color: var(--cat-c, #ff2442);
}
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .category-pill.active { background: #fff0f1; }
}

/* ========== 发帖页标签输入 ========== */
.tag-input-area {
    padding: 8px 0;
}
.tag-input-area-title {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}
.tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 40px;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: rgba(255,36,66,0.08);
    color: var(--primary-color, #ff2442);
    border-radius: 10px;
    font-size: 12px;
    animation: tagIn 0.2s ease;
}
@keyframes tagIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.tag-chip .tag-remove {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,36,66,0.15);
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    line-height: 1;
}
.tag-input-field {
    flex: 1;
    min-width: 80px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    outline: none;
}
.tag-input-field::placeholder { color: #bbb; }
.tag-suggestions {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-suggest-item {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: background 0.15s;
}
.tag-suggest-item:active { background: #e0e0e0; }
.tag-suggest-item.hot::before {
    content: '🔥 ';
    font-size: 10px;
}

/* ========== 详情页分类标签 ========== */
.detail-cat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px 0 4px;
}

/* ========== 搜索状态指示器 ========== */
.search-active-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff5f5;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #ffe0e0;
}
.search-active-indicator .clear-search {
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 10px;
    background: rgba(255,36,66,0.08);
    -webkit-tap-highlight-color: transparent;
}

/* ========== iOS PWA safe area enhancements ========== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: 0;
    }
    .header {
        padding-top: env(safe-area-inset-top);
    }
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .post-action-sheet .action-sheet-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
    #detailPage .detail-footer {
        padding-bottom: calc(4px + env(safe-area-inset-bottom));
    }
    #mainPage {
        padding-bottom: calc(42px + env(safe-area-inset-bottom));
    }
}

/* iOS standalone (home screen shortcut) 底部安全区 */
@media all and (display-mode: standalone) {
    body { min-height: 100dvh; }
    #mainPage {
        min-height: 100dvh;
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }
    .bottom-nav {
        padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    }
}

/* ========== 发帖页：分类选择栏（底部紧凑横排） ========== */
.post-cat-bar {
    padding: 0 16px 6px;
    overflow: hidden;
}
.post-cat-scroll {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}
.post-cat-scroll::-webkit-scrollbar { display: none; }

/* ========== 发帖页：标签行 ========== */
.post-tag-row {
    padding: 0 16px 8px;
    display: none;
}
.post-tag-row.active { display: block; }
.post-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.post-tag-chips .tag-chip {
    animation: tagIn 0.2s ease;
}
.post-tag-chips .tag-add-input {
    flex: 1;
    min-width: 80px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    outline: none;
    padding: 4px 0;
}
.post-tag-chips .tag-add-input::placeholder { color: #ccc; }
.post-tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.post-tag-suggestions .tag-suggest-item {
    display: inline-block;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 10px;
    font-size: 11px;
    color: #666;
    cursor: pointer;
}
.post-tag-suggestions .tag-suggest-item:active {
    background: rgba(255,36,66,0.08);
    color: var(--primary-color);
}

/* ========== 详情页分类标签 ========== */
.detail-cat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px 0 4px;
}


/* ========== 分类栏内集成排序和操作按钮 ========== */
.category-bar-inner {
    display: flex;
    align-items: center;
    gap: 0;
}
.category-bar-inner .category-scroll {
    flex: 1;
    min-width: 0;
}
.category-bar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px 0 4px;
    flex-shrink: 0;
    border-left: 1px solid #f0f0f0;
}
.cat-sort-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
    background: #f5f5f5;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.cat-sort-btn svg { flex-shrink: 0; }
.cat-action-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cat-action-icon:active { background: #f0f0f0; }
.cat-action-icon.search-active { color: var(--primary-color); }

/* 排序下拉菜单 */
.cat-sort-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    min-width: 100px;
    z-index: 90;
    display: none;
    overflow: hidden;
}
.cat-sort-dropdown.show { display: block; }
.cat-sort-option {
    padding: 10px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
}
.cat-sort-option:active { background: #f5f5f5; }
.cat-sort-option.active { color: var(--primary-color); font-weight: 500; }


/* ========== 合并的分类+排序栏 ========== */
.category-sort-bar {
    position: sticky;
    top: 36px;
    z-index: 80;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}
.category-sort-bar .category-scroll {
    padding: 6px 6px 6px 12px;
}
.bar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 8px;
    flex-shrink: 0;
}
.bar-icon-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    -webkit-tap-highlight-color: transparent;
}
.bar-icon-btn:active { background: #f0f0f0; }
.bar-icon-btn.active { color: var(--primary-color); }

/* 滚动字幕（嵌入header内） */
.header-marquee {
    display: flex;
    align-items: center;
    padding: 3px 12px;
    background: linear-gradient(90deg, #fff9f9, #fff);
    border-top: 1px solid #f8f0f0;
    overflow: hidden;
}
.header-marquee .marquee-text {
    display: inline-block;
    white-space: nowrap;
    color: #999;
    animation: marqueeScroll 20s linear infinite;
    padding-left: 100%;
    font-size: 11px;
}

/* 排序选择器（紧凑版在bar-actions里） */
.bar-actions .sort-selector {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    position: relative;
    background: #f5f5f5;
    white-space: nowrap;
}
.bar-actions .sort-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    display: none;
    z-index: 100;
    min-width: 100px;
    overflow: hidden;
}
.bar-actions .sort-dropdown.show { display: block; }

/* toolbar-cat-scroll: defined in post.css */
