/* Co-Rising BBS - 星空主题样式 (深色版) */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: #0A0E1A;
    color: #E5E7EB;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 星空背景 - 真实 NASA 公共域星场（600 颗星 + 星云渐变） */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('/bbs/static/img/starfield.svg?v=3');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}
/* 边角星云笼罩 */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(99,102,241,0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139,92,246,0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(59,130,246,0.06) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

a { color: #818CF8; text-decoration: none; }
a:hover { color: #A78BFA; text-decoration: underline; }

/* ===== 顶部导航（深色玻璃态） ===== */
.top-bar {
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99,102,241,0.2);
    color: #E5E7EB;
    padding: 14px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-logo {
    font-size: 22px;
    font-weight: bold;
    color: #E5E7EB;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.site-logo:hover { text-decoration: none; }
.site-slogan {
    font-size: 12px;
    color: rgba(229,231,235,0.6);
    margin-left: 10px;
}
.top-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
.top-nav a {
    color: #CBD5E1;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
}
.top-nav a:hover {
    background: rgba(99,102,241,0.2);
    color: #E5E7EB;
    text-decoration: none;
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 20px;
}
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
}
.unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 8px rgba(239,68,68,0.6);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== 主容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}
.main-content { min-width: 0; }

/* ===== 板块卡片 ===== */
.boards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.board-card {
    background: rgba(30,41,59,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s;
    border-left: 4px solid #6366F1;
}
.board-card:hover {
    background: rgba(30,41,59,0.8);
    border-color: rgba(99,102,241,0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.2);
    text-decoration: none;
}
.board-icon {
    font-size: 36px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(99,102,241,0.4));
}
.board-info { flex: 1; min-width: 0; }
.board-name {
    font-size: 16px;
    font-weight: 600;
    color: #E5E7EB;
    margin-bottom: 2px;
}
.board-desc {
    font-size: 12px;
    color: #94A3B8;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.board-meta {
    font-size: 11px;
    color: #94A3B8;
    text-align: right;
    flex-shrink: 0;
}
.board-meta .count {
    color: #A78BFA;
    font-weight: 600;
    font-size: 16px;
}

/* ===== Section ===== */
.section {
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    margin-bottom: 16px;
}
.section-header {
    padding: 14px 18px;
    background: rgba(15,23,42,0.4);
    border-bottom: 1px solid rgba(99,102,241,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #E5E7EB;
}
.section-title-icon { margin-right: 6px; }
.section-action { font-size: 12px; color: #818CF8; }

/* ===== 主题列表 ===== */
.thread-list { list-style: none; }
.thread-item {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}
.thread-item:hover { background: rgba(99,102,241,0.05); }
.thread-item:last-child { border-bottom: none; }
.thread-tags { display: flex; gap: 4px; flex-shrink: 0; }
.tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    line-height: 1.2;
}
.tag-pin { background: rgba(245,158,11,0.2); color: #FBBF24; border: 1px solid rgba(245,158,11,0.3); }
.tag-essence { background: rgba(59,130,246,0.2); color: #60A5FA; border: 1px solid rgba(59,130,246,0.3); }
.tag-lock { background: rgba(107,114,128,0.2); color: #9CA3AF; }
.tag-hot { background: rgba(239,68,68,0.2); color: #F87171; border: 1px solid rgba(239,68,68,0.3); }
.tag-announce { background: rgba(245,158,11,0.2); color: #FBBF24; }
.tag-project { background: rgba(16,185,129,0.2); color: #34D399; }
.tag-news { background: rgba(236,72,153,0.2); color: #F472B6; }
.tag-system { background: rgba(99,102,241,0.2); color: #A5B4FC; }

.thread-info { flex: 1; min-width: 0; }
.thread-title {
    font-size: 14px;
    color: #E5E7EB;
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thread-title:hover { color: #A78BFA; }
.thread-meta {
    font-size: 11px;
    color: #94A3B8;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.thread-meta .author { color: #A78BFA; font-weight: 500; }
.thread-stats {
    text-align: right;
    flex-shrink: 0;
    font-size: 11px;
    color: #94A3B8;
    display: flex;
    gap: 12px;
}
.thread-stats .stat-num { color: #A78BFA; font-weight: 600; }

/* ===== 主题详情 ===== */
.thread-detail {
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.thread-header {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(99,102,241,0.15);
    background: rgba(99,102,241,0.05);
}
.thread-h1 {
    font-size: 20px;
    color: #F3F4F6;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}
.thread-meta-bar {
    font-size: 12px;
    color: #94A3B8;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== 楼层 ===== */
.post-floor {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
    display: flex;
    gap: 16px;
}
.post-author {
    width: 140px;
    flex-shrink: 0;
    text-align: center;
    padding: 10px;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 8px;
}
.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 8px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(99,102,241,0.4);
}
.author-name {
    font-size: 13px;
    color: #E5E7EB;
    font-weight: 600;
    margin-bottom: 4px;
}
.author-level {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 4px;
    background: rgba(99,102,241,0.15);
    color: #A5B4FC;
}
.author-stats { font-size: 11px; color: #94A3B8; }

.post-content-wrap { flex: 1; min-width: 0; }
.post-floor-num {
    font-size: 11px;
    color: #94A3B8;
    margin-bottom: 6px;
}
.post-content {
    font-size: 14px;
    color: #D1D5DB;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 12px;
}
.post-actions {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #94A3B8;
    align-items: center;
}
.post-actions a, .post-actions button {
    color: #94A3B8;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    font-family: inherit;
}
.post-actions a:hover, .post-actions button:hover { color: #A78BFA; }
.post-actions .liked { color: #F87171; font-weight: 600; }
.satisfied-mark {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===== 表单 ===== */
.form-section {
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #E5E7EB;
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 6px;
    font-size: 14px;
    color: #E5E7EB;
    font-family: inherit;
    transition: all 0.2s;
}
.form-control::placeholder { color: #6B7280; }
.form-control:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
    background: rgba(15,23,42,0.8);
}
textarea.form-control { min-height: 200px; resize: vertical; }
.form-error { color: #F87171; font-size: 12px; margin-top: 4px; }
.form-hint { color: #94A3B8; font-size: 12px; margin-top: 4px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}
.btn:hover {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    text-decoration: none;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}
.btn-secondary {
    background: rgba(99,102,241,0.15);
    color: #A5B4FC;
    border: 1px solid rgba(99,102,241,0.3);
}
.btn-secondary:hover {
    background: rgba(99,102,241,0.25);
    color: #C4B5FD;
}
.btn-danger { background: linear-gradient(135deg, #EF4444, #DC2626); }
.btn-danger:hover { background: linear-gradient(135deg, #DC2626, #B91C1C); }
.btn-success { background: linear-gradient(135deg, #10B981, #059669); }
.btn-success:hover { background: linear-gradient(135deg, #059669, #047857); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== 侧边栏 ===== */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.widget {
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: #E5E7EB;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #6366F1;
}
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #94A3B8;
}
.stat-row strong { color: #A78BFA; font-size: 16px; }
.online-user {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px;
    background: rgba(99,102,241,0.15);
    border-radius: 10px;
    font-size: 12px;
    color: #A5B4FC;
}

/* ===== Flash ===== */
.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    border-left: 4px solid;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(10px);
}
.flash-success { color: #34D399; border-color: #10B981; }
.flash-error { color: #F87171; border-color: #EF4444; }
.flash-info { color: #60A5FA; border-color: #3B82F6; }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 16px;
    list-style: none;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 4px;
    color: #A5B4FC;
    text-decoration: none;
    font-size: 13px;
    background: rgba(15,23,42,0.4);
}
.pagination a:hover { background: rgba(99,102,241,0.2); color: #C4B5FD; }
.pagination .active span {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    border-color: #6366F1;
}
.pagination .disabled { color: #4B5563; }

/* ===== 错误页 ===== */
.error-page { text-align: center; padding: 80px 20px; }
.error-code {
    font-size: 96px;
    font-weight: bold;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.error-message { font-size: 24px; color: #E5E7EB; margin: 16px 0 8px; }
.error-detail { color: #94A3B8; margin-bottom: 24px; }

/* ===== 用户卡片 ===== */
.user-card-large {
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(139,92,246,0.3));
    border: 1px solid rgba(99,102,241,0.3);
    backdrop-filter: blur(10px);
    color: #E5E7EB;
    padding: 24px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    gap: 20px;
    align-items: center;
}
.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 0 30px rgba(99,102,241,0.5);
}
.user-meta { flex: 1; }
.user-username { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.user-bio { font-size: 13px; opacity: 0.9; margin: 8px 0; color: #CBD5E1; }
.user-stats-row { display: flex; gap: 16px; font-size: 12px; color: #CBD5E1; }
.user-stats-row strong { font-size: 16px; color: #fff; }

/* ===== 消息列表 ===== */
.msg-item {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}
.msg-item:hover { background: rgba(99,102,241,0.05); text-decoration: none; }
.msg-item.unread {
    background: rgba(99,102,241,0.08);
    border-left: 3px solid #6366F1;
}
.msg-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.msg-body { flex: 1; min-width: 0; }
.msg-title {
    font-size: 14px;
    font-weight: 500;
    color: #E5E7EB;
    margin-bottom: 4px;
}
.msg-content-preview {
    font-size: 12px;
    color: #94A3B8;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.msg-time {
    font-size: 11px;
    color: #6B7280;
    white-space: nowrap;
    flex-shrink: 0;
}
.msg-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #EF4444;
    margin-top: 8px;
    box-shadow: 0 0 8px rgba(239,68,68,0.6);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
    .boards-grid { grid-template-columns: 1fr; }
    .post-author { width: 80px; }
    .author-avatar { width: 40px; height: 40px; font-size: 16px; }
    .user-card-large { flex-direction: column; text-align: center; }
}

/* ==================== 富文本渲染样式（thread.html） ==================== */

.post-content { line-height: 1.7; color: #E5E7EB; }
.post-content p { margin: 8px 0; }
.post-content h1 { font-size: 1.6em; margin: 16px 0 8px; color: #FFF !important; font-weight: 700; }
.post-content h2 { font-size: 1.4em; margin: 14px 0 7px; color: #FFF !important; font-weight: 700; }
.post-content h3 { font-size: 1.2em; margin: 12px 0 6px; color: #FFF !important; font-weight: 600; }
.post-content h4 { font-size: 1.1em; margin: 10px 0 5px; color: #FFF !important; font-weight: 600; }
.post-content strong { color: #FCD34D !important; font-weight: 700; }
.post-content em { color: #C4B5FD !important; font-style: italic; }
.post-content s { color: #9CA3AF; text-decoration: line-through; }
.post-content code {
    background: rgba(99,102,241,0.15);
    color: #C4B5FD;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Consolas, Monaco, monospace;
    font-size: 0.9em;
    border: 1px solid rgba(99,102,241,0.3);
}
.post-content pre {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    margin: 12px 0;
}
.post-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #A5B4FC;
    font-size: 0.85em;
    line-height: 1.5;
}
.post-content blockquote {
    border-left: 4px solid #818CF8;
    background: rgba(99,102,241,0.08);
    padding: 8px 16px;
    margin: 12px 0;
    color: #C7D2FE;
    border-radius: 0 8px 8px 0;
}
.post-content ul, .post-content ol { margin: 8px 0 8px 24px; color: #E5E7EB; }
.post-content li { margin: 4px 0; }
.post-content hr {
    border: none;
    border-top: 1px dashed rgba(255,255,255,0.2);
    margin: 16px 0;
}
.post-content a { color: #818CF8; text-decoration: underline; word-break: break-all; }
.post-content a:hover { color: #A78BFA; }
.post-content .mention {
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(139,92,246,0.3));
    color: #C4B5FD !important;
    padding: 1px 6px;
    border-radius: 12px;
    text-decoration: none !important;
    font-weight: 600;
    border: 1px solid rgba(139,92,246,0.4);
}
.post-content .mention:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.5), rgba(139,92,246,0.5));
}

/* ==================== 星标按钮 ==================== */
.btn-star {
    background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(239,68,68,0.1)) !important;
    border: 1px solid rgba(245,158,11,0.4) !important;
    color: #F59E0B !important;
    padding: 4px 12px !important;
    border-radius: 16px !important;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px !important;
    font-weight: 500;
}
.btn-star:hover { 
    background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(239,68,68,0.25)) !important;
    transform: translateY(-1px);
}
.btn-star.starred {
    background: linear-gradient(135deg, #F59E0B, #EF4444) !important;
    color: white !important;
    border-color: transparent !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}
.star-count { color: #F59E0B !important; font-weight: 600; margin-left: 4px; }
