/* ========== SeekYou 前端样式 ========== */

/* CSS 变量 - 浅色主题（默认） */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f9f9;
    --bg-hover: rgba(0, 0, 0, 0.03);
    --text-primary: #0f1419;
    --text-secondary: #536471;
    --border-color: #eff3f4;
    --accent-color: #1d9bf0;
    --accent-hover: #1a8cd8;
    --card-bg: #ffffff;
    --danger: #f4212e;
    --success: #00ba7c;
    --warning: #ffd400;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 深色主题 */
body.dark-theme {
    --bg-primary: #000000;
    --bg-secondary: #16181c;
    --bg-hover: rgba(255, 255, 255, 0.03);
    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --border-color: #2f3336;
    --accent-color: #1d9bf0;
    --accent-hover: #1a8cd8;
    --card-bg: #000000;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background 0.3s, color 0.3s;
    margin: 0;
    padding: 0;
}

a {
    color: var(--text-primary);
    text-decoration: none;
}

/* ========== 两栏布局 - 居中 ========== */
.two-column-layout {
    display: flex;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 24px;
}

.main-content {
    flex: 1;
    max-width: calc(100% - 280px);
    min-width: 0;
    overflow-x: hidden;
}

.sidebar-right {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0;
    background: var(--bg-secondary);
}

.sidebar-right::-webkit-scrollbar {
    width: 4px;
}
.sidebar-right::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}
.sidebar-right::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
body.dark-theme .sidebar-right::-webkit-scrollbar-track {
    background: #1a1a1a;
}
body.dark-theme .sidebar-right::-webkit-scrollbar-thumb {
    background: #333;
}

/* ========== LOGO 区域 ========== */
.logo-area {
    text-align: left;
    padding: 8px 0;
    border-bottom: 1px solid #eff3f4;
    margin-bottom: 12px;
}
body.dark-theme .logo-area {
    border-bottom-color: #2f3336;
}
.logo-area span {
    font-size: 20px;
}

/* ========== 搜索框 ========== */
.search-box {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 30px;
    padding: 8px 14px;
    margin-bottom: 16px;
}
.search-box input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
}
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #eff3f4;
    border-radius: 16px;
    margin-top: 8px;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}
body.dark-theme .search-results {
    background: #000;
    border-color: #2f3336;
}
.search-result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #eff3f4;
}
.search-result-item:hover {
    background: #f5f5f5;
}

/* ========== 导航菜单 ========== */
.nav-menu {
    margin-bottom: 16px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 30px;
    font-size: 14px;
    margin: 2px 0;
    transition: 0.2s;
    color: var(--text-primary);
}
.nav-item:hover,
.nav-item.active {
    background: rgba(29, 155, 240, 0.1);
    color: #1d9bf0;
}
.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* ========== 快捷按钮 ========== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0;
}
.quick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}
.quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.quick-icon {
    font-size: 16px;
}
.quick-text {
    font-size: 12px;
}
.quick-btn-article {
    background: linear-gradient(135deg, #8a2be2, #9b59b6);
    color: white;
}
.quick-btn-video {
    background: linear-gradient(135deg, #1d9bf0, #0d8be0);
    color: white;
}
.quick-btn-disk {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}
.quick-btn-app {
    background: linear-gradient(135deg, #ff9800, #f44336);
    color: white;
}

/* ========== 消息入口 ========== */
.chat-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 30px;
    margin: 8px 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    font-size: 13px;
}
.chat-entry:hover {
    background: var(--bg-hover);
}
.unread-badge {
    margin-left: auto;
    background: #f44336;
    color: white;
    border-radius: 30px;
    padding: 2px 6px;
    font-size: 10px;
}

/* ========== 主题语言 ========== */
.theme-language-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}
.theme-btn-full,
.lang-select-full {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 11px;
    flex: 1;
    color: var(--text-primary);
}
.lang-select-full {
    padding: 6px 8px;
}

/* ========== 版权 ========== */
.copyright {
    text-align: center;
    font-size: 9px;
    color: #888;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* ========== 聊天面板 ========== */
.chat-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: none;
    flex-direction: column;
    border: 1px solid var(--border-color);
}
.chat-panel.show {
    display: flex;
}
.chat-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    background: var(--bg-primary);
    border-radius: 20px 20px 0 0;
}
.chat-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}
.chat-panel-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.chat-conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.chat-conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}
.chat-conversation-item:hover {
    background: var(--bg-hover);
}
.chat-conversation-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1d9bf0, #8a2be2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}
.chat-conversation-name {
    font-weight: 600;
    font-size: 14px;
}
.chat-conversation-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-unread {
    background: #f44336;
    color: white;
    border-radius: 30px;
    padding: 2px 6px;
    font-size: 10px;
    margin-left: 8px;
}
.chat-message-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}
.chat-back-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}
.chat-follow-btn {
    margin-left: auto;
    background: #1d9bf0;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
}
.chat-follow-btn.followed {
    background: #28a745;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-message {
    display: flex;
    max-width: 80%;
}
.chat-message-sent {
    justify-content: flex-end;
    align-self: flex-end;
}
.chat-message-received {
    justify-content: flex-start;
    align-self: flex-start;
}
.chat-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 13px;
    word-break: break-word;
}
.chat-message-sent .chat-message-bubble {
    background: #1d9bf0;
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-message-received .chat-message-bubble {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}
.chat-input-area textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    resize: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
}
.chat-send-btn {
    background: #1d9bf0;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
}

/* ========== 瀑布流网格 ========== */
.waterfall-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 20px 0;
}
.content-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}
.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.card-image {
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #1a1a2e;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.content-info {
    padding: 10px;
}
.author-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}
.author-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.author-level {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 20px;
    background: #e8f5fe;
    color: #1d9bf0;
}
.author-level.vip {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: white;
}
.content-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 36px;
}
.category-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-hover);
    border-radius: 20px;
    font-size: 9px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
}
.price-gold {
    color: #ff9800;
    font-weight: 700;
    font-size: 13px;
}
.price-free {
    color: #28a745;
    font-size: 12px;
}
.vip-free {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: white;
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 9px;
}
.article-tag {
    background: #8a2be2;
    color: white;
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 9px;
    margin-left: 6px;
}
.stats-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 10px;
    color: var(--text-secondary);
}
.loading, .no-more {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: #1d9bf0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 手机端底部导航 ========== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 500px;
    background: var(--bg-secondary);
    border-radius: 20px 20px 20px 20px;
    padding: 8px 16px 14px;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}
.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 30px;
    font-weight: 500;
}
.mobile-nav-item.active {
    color: #1d9bf0;
    background: rgba(29, 155, 240, 0.1);
}
.mobile-nav-icon {
    font-size: 22px;
}
.mobile-nav-item.post-center {
    background: linear-gradient(135deg, #1d9bf0, #8a2be2);
    color: white !important;
    padding: 8px 22px;
    border-radius: 40px;
    margin-top: -18px;
    box-shadow: 0 6px 15px rgba(29, 155, 240, 0.4);
}

/* ========== RTL 阿拉伯语支持 ========== */
[dir="rtl"] {
    direction: rtl;
}
[dir="rtl"] .two-column-layout {
    flex-direction: row-reverse;
}
[dir="rtl"] .sidebar-right {
    order: -1;
}
[dir="rtl"] .nav-item {
    flex-direction: row-reverse;
}
[dir="rtl"] .quick-btn {
    flex-direction: row-reverse;
}
[dir="rtl"] .member-buttons {
    flex-direction: row-reverse;
}
[dir="rtl"] .theme-language-row {
    flex-direction: row-reverse;
}
[dir="rtl"] .mobile-nav-items {
    flex-direction: row-reverse;
}
[dir="rtl"] .search-box input {
    text-align: right;
}
[dir="rtl"] .nav-icon {
    margin-left: 12px;
    margin-right: 0;
}
[dir="rtl"] .quick-icon {
    margin-left: 6px;
    margin-right: 0;
}
[dir="rtl"] .chat-icon {
    margin-left: 6px;
    margin-right: 0;
}
[dir="rtl"] .unread-badge {
    margin-left: 0;
    margin-right: auto;
}
[dir="rtl"] .chat-follow-btn {
    margin-left: 0;
    margin-right: auto;
}
@media (max-width: 768px) {
    [dir="rtl"] .mobile-nav-items {
        flex-direction: row-reverse;
    }
    [dir="rtl"] .menu-toggle-btn {
        right: auto;
        left: 12px;
    }
}

/* ========== 响应式布局 ========== */
@media (max-width: 1200px) {
    .waterfall-grid { grid-template-columns: repeat(4, 1fr); }
    .two-column-layout { gap: 16px; }
}
@media (max-width: 900px) {
    .waterfall-grid { grid-template-columns: repeat(3, 1fr); }
    .two-column-layout { flex-direction: column; }
    .main-content { max-width: 100%; }
    .sidebar-right { 
        width: 100%; 
        position: static; 
        height: auto; 
        padding: 0;
    }
}
@media (max-width: 700px) {
    .waterfall-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 500px) {
    .waterfall-grid { grid-template-columns: 1fr; }
    .mobile-bottom-nav { display: block; }
    body { padding-bottom: 70px; }
}