/* --- 1. 基础样式 --- */
:root { --bg-color: #f5f5f5; --card-bg: #ffffff; --border-color: #f0f0f0; --text-main: #333333; --text-sub: #999999; --accent-color: #333333; --danger-color: #ff4757; --comment-bg: #f9f9f9; --shadow: 0 4px 12px rgba(0, 0, 0, 0.05); --radius: 12px; --anno-bg: #fffbf0; --anno-text: #d97706; --anno-border: #fef3c7; }
[data-theme="dark"] { --bg-color: #1a1a1a; --card-bg: #262626; --border-color: #333; --text-main: #e5e5e5; --text-sub: #777777; --accent-color: #ffffff; --comment-bg: #303030; --shadow: 0 4px 12px rgba(0, 0, 0, 0.3); --anno-bg: #3a3a3a; --anno-text: #fbbf24; --anno-border: #4a4a4a; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'DouyinSans', -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-color); color: var(--text-main); line-height: 1.6; padding: 20px; max-width: 700px; margin: 0 auto; transition: background-color 0.3s, color 0.3s; padding-bottom: 50px; }

/* Header */
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.brand { display: flex; align-items: center; gap: 15px; } .site-logo { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid var(--card-bg); box-shadow: var(--shadow); } h1 { font-size: 1.6rem; font-weight: 600; color: var(--text-main); letter-spacing: 1px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { cursor: pointer; padding: 8px; border-radius: 50%; background: var(--card-bg); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; transition: transform 0.2s; } .theme-toggle:active { transform: scale(0.95); } .theme-toggle svg { width: 22px; height: 22px; fill: currentColor; display: block; }

/* 公告 */
.announcement-wrapper { margin-bottom: 25px; display: none; } .announcement-box { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; border: 1px solid var(--border-color); cursor: pointer; } .anno-close { position: absolute; top: 8px; right: 8px; z-index: 10; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.05); display: flex; justify-content: center; align-items: center; font-size: 16px; color: var(--text-sub); cursor: pointer; transition: 0.2s; } .anno-close:hover { background: var(--danger-color); color: #fff; } .anno-item { display: none; padding: 20px; animation: fadeIn 0.5s ease; padding-right: 40px; } .anno-item.active { display: block; } .anno-badge { display: inline-block; background: var(--accent-color); color: var(--card-bg); font-size: 12px; padding: 2px 8px; border-radius: 4px; margin-bottom: 10px; font-weight: bold; } .anno-title { font-size: 16px; font-weight: bold; margin-bottom: 5px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} .anno-content { font-size: 14px; color: var(--text-main); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .anno-progress { height: 3px; background: var(--accent-color); width: 0%; opacity: 0.3; }

/* 发帖表单 */
.post-form { background-color: var(--card-bg); border-radius: var(--radius); padding: 20px; margin-bottom: 30px; box-shadow: var(--shadow); transition: 0.3s; } .post-form:focus-within { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.post-type-switch { display: flex; gap: 10px; margin-bottom: 15px; } .type-btn { flex: 1; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; text-align: center; cursor: pointer; font-size: 14px; color: var(--text-sub); background: var(--bg-color); } .type-btn.active { background: var(--accent-color); color: var(--card-bg); border-color: var(--accent-color); font-weight: bold; }

.card-fields { display: none; gap: 10px; margin-bottom: 10px; animation: fadeIn 0.3s; } .card-input { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-color); color: var(--text-main); outline:none; } .avatar-upload { width: 60px; height: 60px; border-radius: 50%; background: var(--border-color); display: flex; justify-content: center; align-items: center; cursor: pointer; overflow: hidden; flex-shrink: 0; } .avatar-preview { width: 100%; height: 100%; object-fit: cover; display: none; }
textarea { width: 100%; height: 100px; padding: 10px; border: none; background: transparent; resize: none; font-size: 16px; color: var(--text-main); outline: none; margin-bottom: 10px; } textarea::placeholder { color: var(--text-sub); }
.form-tools { display: flex; justify-content: space-between; align-items: center; } .file-label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; background-color: var(--bg-color); border-radius: 20px; color: var(--text-sub); font-size: 13px; cursor: pointer; transition: 0.2s; } .file-label svg { width: 16px; height: 16px; fill: currentColor; }
.submit-btn { background-color: var(--accent-color); color: var(--card-bg); border: none; padding: 8px 24px; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; } .submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 音乐/PK相关 */
.music-search-box { display: flex; gap: 10px; margin-bottom: 15px; } .music-result-card { display: none; background: var(--bg-color); padding: 10px; border-radius: 8px; align-items: center; gap: 10px; border: 1px solid var(--accent-color); margin-bottom: 15px; cursor: pointer; transition: 0.2s; } .music-result-card:hover { opacity: 0.9; } .m-cover { width: 50px; height: 50px; border-radius: 4px; object-fit: cover; background: #ddd; } .m-info { flex: 1; overflow: hidden; } .m-title { font-size: 14px; font-weight: bold; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .m-artist { font-size: 12px; color: var(--text-sub); } .m-select-btn { background: var(--accent-color); color: var(--card-bg); border: none; padding: 5px 12px; border-radius: 15px; font-size: 12px; cursor: pointer; }
.post-music-preview { display: none; align-items: center; gap: 10px; background: var(--bg-color); padding: 8px 12px; border-radius: 8px; margin-top: 10px; margin-bottom: 10px; position: relative; border: 1px dashed var(--border-color); } .p-m-del { position: absolute; right: -5px; top: -5px; width: 18px; height: 18px; background: var(--danger-color); color: #fff; border-radius: 50%; text-align: center; line-height: 18px; font-size: 12px; cursor: pointer; }
.feed-music-card { display: flex; align-items: center; gap: 12px; background: var(--bg-color); border: 1px solid var(--border-color); padding: 10px; border-radius: 8px; margin-top: 10px; text-decoration: none; transition: 0.2s; } .feed-music-card:active { transform: scale(0.98); } .feed-m-cover { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; }

/* 抖音预览卡片 (发布前) */
.douyin-preview-card { display: none; background: #161823; padding: 12px; border-radius: 8px; margin-bottom: 15px; color: #fff; display: flex; gap: 12px; position: relative; overflow: hidden; margin-top:10px; }
.dy-cover { width: 60px; height: 80px; object-fit: cover; border-radius: 4px; background: #333; flex-shrink: 0; }
.dy-info { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.dy-title { font-size: 13px; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; color: #fff; }
.dy-author { font-size: 11px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 5px; }
.dy-author img { width: 16px; height: 16px; border-radius: 50%; }

/* 抖音分享卡片展示 (发布后) */
.douyin-share-card { display: block; margin-top: 10px; border-radius: 8px; overflow: hidden; position: relative; text-decoration: none; background: #000; color: #fff; cursor: pointer; }
.douyin-share-bg { position: relative; padding-bottom: 56.25%; /* 16:9 比例 */ background-size: cover; background-position: center; }
.douyin-share-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%); display: flex; flex-direction: column; justify-content: flex-end; padding: 15px; box-sizing: border-box; }
.douyin-share-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; background: rgba(0,0,0,0.5); border-radius: 50%; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.douyin-share-icon svg { width: 20px; height: 20px; fill: #fff; margin-left: 2px; }
.douyin-share-title { font-size: 14px; font-weight: bold; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,0.5); color:#fff; }
.douyin-share-author { font-size: 12px; display: flex; align-items: center; gap: 6px; opacity: 0.9; color:#fff; }
.douyin-share-author img { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.5); }

/* PK 功能样式 */
.pk-container { margin-top: 10px; margin-bottom: 10px; } .pk-actions { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; } .pk-btn { flex: 1; padding: 12px 5px; border-radius: 8px; border: none; color: #fff; font-weight: bold; cursor: pointer; position: relative; overflow: hidden; transition: 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50px; } .pk-btn.red { background: #ff4757; box-shadow: 0 4px 10px rgba(255, 71, 87, 0.3); } .pk-btn.blue { background: #2e86de; box-shadow: 0 4px 10px rgba(46, 134, 222, 0.3); } .pk-btn:active { transform: scale(0.98); } .pk-result-bar { width: 100%; height: 40px; background: #eee; border-radius: 20px; position: relative; overflow: hidden; margin-bottom: 15px; display: flex; } .pk-progress-red { background: #ff4757; height: 100%; display: flex; align-items: center; padding-left: 10px; color: #fff; font-size: 12px; white-space: nowrap; transition: width 1s ease-out; } .pk-progress-blue { background: #2e86de; height: 100%; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: #fff; font-size: 12px; white-space: nowrap; transition: width 1s ease-out; } .pk-vs-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; color: #333; font-weight: bold; font-style: italic; width: 24px; height: 24px; border-radius: 50%; text-align: center; line-height: 24px; font-size: 10px; border: 2px solid #fff; z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.2); } .pk-label-overlay { position: absolute; width: 100%; height: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0 15px; font-size: 13px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); pointer-events: none; z-index: 1; } #pk-fields { display: none; gap: 10px; margin-bottom: 10px; animation: fadeIn 0.3s; } .pk-input { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-main); outline: none; } .pk-input.red { border-left: 3px solid #ff4757; } .pk-input.blue { border-left: 3px solid #2e86de; }

/* 帖子样式 */
.post { background-color: var(--card-bg); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); animation: slideUp 0.5s forwards; transition: background-color 0.5s; position: relative; overflow: hidden; } 
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.post.official { border: 2px solid #fbbf24; background: linear-gradient(to bottom right, var(--card-bg), #fffbeb); }
[data-theme="dark"] .post.official { border-color: #b45309; background: linear-gradient(to bottom right, var(--card-bg), #3a2205); }
.official-badge { position: absolute; top: 0; right: 0; background: #fbbf24; color: #78350f; font-size: 12px; font-weight: bold; padding: 4px 12px; border-bottom-left-radius: 12px; z-index: 5; display: flex; align-items: center; gap: 4px; box-shadow: -1px 2px 4px rgba(0,0,0,0.1); }
.official-badge svg { width: 14px; height: 14px; fill: currentColor; }
.post.official .time-badge { display: none; }

.friend-card { background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-color) 100%); border: 1px solid var(--accent-color); position: relative; } 
.friend-card::before { content: "扩列"; position: absolute; top: 0; right: 0; background: var(--accent-color); color: var(--card-bg); font-size: 10px; padding: 2px 8px; border-bottom-left-radius: 8px; font-weight: bold; z-index: 1; }

.fc-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; } .fc-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-color); } .fc-info { flex: 1; } .fc-name { font-weight: bold; font-size: 16px; color: var(--text-main); } .fc-contact { font-size: 12px; color: var(--text-sub); background: rgba(0,0,0,0.05); padding: 2px 6px; border-radius: 4px; display: inline-block; margin-top: 4px; } [data-theme="dark"] .fc-contact { background: rgba(255,255,255,0.1); }
.post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; } .location-badge { font-size: 12px; background: var(--bg-color); color: var(--text-sub); padding: 4px 8px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; } .time-badge { font-size: 12px; color: var(--text-sub); }
.post-content { font-size: 16px; color: var(--text-main); white-space: pre-wrap; margin-bottom: 12px; line-height: 1.7; word-break: break-all; } 
.post-image { width: 100%; border-radius: 8px; margin-top: 5px; display: block; object-fit: cover; max-height: 500px; cursor: zoom-in; }
.divider { height: 1px; background-color: var(--border-color); margin: 15px 0; }
.post-actions { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; } .action-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--text-sub); font-size: 14px; transition: color 0.2s; } .action-btn:hover { color: var(--accent-color); } .action-btn.active { color: var(--danger-color); } .action-btn svg { width: 20px; height: 20px; fill: currentColor; } .report-btn { margin-left: auto; opacity: 0.5; }

/* 外链样式 */
.external-link { color: #2e86de; text-decoration: none; border-bottom: 1px dotted #2e86de; }
.external-link:hover { opacity: 0.8; }

/* 加载更多按钮 */
.load-more-container { text-align: center; margin: 20px 0; }
.btn-load-more { background: var(--card-bg); color: var(--text-sub); border: 1px solid var(--border-color); padding: 10px 30px; border-radius: 25px; cursor: pointer; font-size: 14px; transition: 0.2s; box-shadow: var(--shadow); }
.btn-load-more:hover { color: var(--accent-color); border-color: var(--accent-color); }

/* 页脚样式 */
footer { 
    text-align: center; 
    padding: 30px 20px; 
    color: var(--text-sub); 
    font-size: 12px; 
    margin-top: 30px; 
    border-top: 1px dashed var(--border-color); 
}
footer a { 
    color: var(--text-sub); 
    text-decoration: none; 
    margin: 0 5px; 
    transition: 0.2s;
}
footer a:hover { 
    color: var(--accent-color); 
    text-decoration: underline; 
}

/* 评论与弹窗 */
.comments-wrapper { display: none; margin-top: 15px; padding-top: 15px; border-top: 1px dashed var(--border-color); } .comments-list { margin-bottom: 15px; max-height: 300px; overflow-y: auto; } .comment-item { padding: 10px; margin-bottom: 8px; background: var(--comment-bg); border-radius: 8px; font-size: 14px; } .comment-meta { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12px; color: var(--text-sub); } .comment-text { color: var(--text-main); word-break: break-all; } .comment-form-box { display: flex; gap: 10px; } .comment-input { flex: 1; border: 1px solid var(--border-color); background: var(--bg-color); border-radius: 20px; padding: 8px 15px; font-size: 14px; color: var(--text-main); outline: none; } .comment-send { background: var(--accent-color); color: var(--card-bg); border: none; padding: 0 16px; border-radius: 20px; font-size: 13px; cursor: pointer; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(3px); animation: fadeInOverlay 0.3s ease; } 
.modal-box { background: var(--card-bg); width: 85%; max-width: 320px; padding: 25px; border-radius: 16px; box-shadow: var(--shadow); position: relative; animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { transform: scale(0.85) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

/* --- 核心修复：Toast 层级必须高于 Modal --- */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: rgba(0,0,0,0.85); color: #fff; padding: 10px 24px; border-radius: 50px; font-size: 14px; transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 3000; box-shadow: 0 5px 15px rgba(0,0,0,0.2); } 
.toast.show { transform: translateX(-50%) translateY(0); }

.img-viewer { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.9); z-index:2000; justify-content:center; align-items:center; cursor:zoom-out; } .img-viewer img { max-width:95%; max-height:95%; object-fit:contain; border-radius:4px; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border-color); cursor: pointer; transition: 0.2s; } .rank-item:last-child { border-bottom: none; } .rank-item:hover { background-color: var(--bg-color); border-radius: 8px; padding-left: 5px; padding-right: 5px;} .rank-num { font-size: 18px; font-weight: bold; width: 24px; text-align: center; font-style: italic; color: var(--text-sub); } .rank-item:nth-child(1) .rank-num { color: #ff4757; font-size: 22px; } .rank-item:nth-child(2) .rank-num { color: #ff7675; } .rank-item:nth-child(3) .rank-num { color: #ffa502; } .rank-content { flex: 1; font-size: 14px; color: var(--text-main); } .rank-score { font-size: 12px; color: var(--text-sub); display:flex; align-items:center; gap:3px; } .rank-thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; }
.anno-detail-box { width: 90%; max-width: 400px; max-height: 80vh; overflow-y: auto; } .anno-detail-title { font-size: 1.2rem; font-weight: bold; margin-bottom: 15px; color: var(--text-main); border-bottom: 1px solid var(--border-color); padding-bottom: 10px; } .anno-detail-content { font-size: 15px; line-height: 1.8; color: var(--text-main); white-space: pre-wrap; margin-bottom: 15px; } .anno-detail-img { width: 100%; border-radius: 8px; margin-bottom: 15px; display: none; }

/* App风格大屏搜索 */
#searchModal .modal-box { width: 100%; max-width: 600px; height: 90vh; border-radius: 20px 20px 0 0; position: absolute; bottom: 0; margin: 0; display: flex; flex-direction: column; animation: slideUpBig 0.3s ease-out; padding: 20px; background: var(--card-bg); }
@media (min-width: 700px) { #searchModal .modal-box { bottom: auto; top: 50px; height: 80vh; border-radius: 16px; } }
@keyframes slideUpBig { from { transform: translateY(100%); } to { transform: translateY(0); } }
.search-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.big-search-input-wrapper { position: relative; flex: 1; }
.big-search-input { width: 100%; height: 50px; background: var(--bg-color); border: 2px solid transparent; border-radius: 25px; padding-left: 45px; padding-right: 15px; font-size: 16px; color: var(--text-main); transition: 0.2s; outline: none; }
.big-search-input:focus { background: var(--card-bg); border-color: var(--accent-color); box-shadow: 0 0 0 4px rgba(0,0,0,0.05); }
.search-icon-inside { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: var(--text-sub); pointer-events: none; }
#searchResults { flex: 1; overflow-y: auto; padding-right: 5px; display: flex; flex-direction: column; gap: 15px; }
.btn-cancel { background: none; border: none; font-size: 15px; color: var(--text-sub); padding: 0 5px; cursor: pointer; font-weight: 500; }

/* 维护模式锁动画 */
@keyframes lockShake { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
.lock-shake { animation: lockShake 0.5s ease-in-out; }

/* 管理员标签样式 */
.badge-admin { 
    background-color: #3b82f6; 
    color: white; 
    font-size: 10px; 
    padding: 1px 5px; 
    border-radius: 4px; 
    margin-right: 5px; 
    vertical-align: 1px;
    display: inline-block;
    font-weight: normal;
}

/* --- 修改：分享弹窗样式 --- */
.share-card-preview {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px dashed var(--border-color);
}
.share-preview-title { font-size: 12px; color: var(--text-sub); margin-bottom: 8px; display: block; }
.share-text-area {
    width: 100%; height: 80px; padding: 0; background: transparent;
    border: none; font-size: 14px; line-height: 1.5;
    color: var(--text-main); outline: none; resize: none;
}
.share-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 10px;
}
.share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: var(--bg-color);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}
.share-item:active { transform: scale(0.95); background: var(--border-color); }
.share-item svg { width: 32px; height: 32px; margin-bottom: 8px; }
.share-item span { font-size: 13px; font-weight: 500; color: var(--text-main); }
.share-icon-wechat { fill: none; }
.share-icon-copy { fill: var(--text-sub); }
.btn-close-share {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 14px;
    cursor: pointer;
}