/* ============================================================
   启明成长训练系统 - 全局样式
   复刻自: http://82.156.230.13/wiki
   ============================================================ */

/* ---- CSS变量 ---- */
:root {
    --primary: #6366f1;
    --primary-deep: #4f46e5;
    --report-green: #10b981;
    --bounty-red: #ef4444;
    --bg: #f4f7fb;
    --text-main: #182132;
    --text-sub: #667085;
    --line-soft: rgba(99, 102, 241, 0.10);
    --card-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

/* ---- 基础重置 ---- */
* { box-sizing: border-box; }
body {
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
}

/* ---- 导航栏 ---- */
.navbar {
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--primary) !important;
}
.navbar-nav { gap: 8px; margin-left: 18px; }
.navbar-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #344054 !important;
    padding: 10px 16px !important;
    border-radius: 14px;
    transition: all 0.18s ease;
}
.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}
.navbar-nav .nav-link.active,
.navbar-nav .nav-link.fw-bold {
    color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.12);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.10);
}

/* ---- 等级标签 ---- */
.rank-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
}
.rank-1 { background: linear-gradient(135deg, #a8a29e, #78716c); }
.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); }
.rank-3 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.rank-4 { background: linear-gradient(135deg, #67e8f9, #06b6d4); }
.rank-5 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.rank-6 { background: linear-gradient(135deg, #fb923c, #ea580c); }
.rank-7 { background: linear-gradient(135deg, #f43f5e, #dc2626); }

/* ---- 卡片 ---- */
.card {
    border: 0;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    background: rgba(255, 255, 255, 0.88);
}
.card-report { border-left: 4px solid var(--report-green); }
.card-bounty { border-left: 4px solid var(--bounty-red); }
.badge-report { background: var(--report-green) !important; }
.badge-bounty { background: var(--bounty-red) !important; }
.adopted-badge { background: #10b981; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; }

/* ---- 按钮 ---- */
.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border: none;
    font-weight: 700;
    border-radius: 14px;
    padding: 10px 24px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3); }
.btn-outline-primary {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary);
    border-radius: 14px;
    font-weight: 700;
}
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ---- 表单 ---- */
.form-control, .form-select {
    border-radius: 14px;
    border-color: rgba(148, 163, 184, 0.24);
    padding: 12px 16px;
}
.form-control:focus, .form-select:focus {
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 0 0 0.18rem rgba(79, 70, 229, 0.1);
}

/* ---- AI助手浮动按钮 ---- */
.ai-assistant-entry {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1080;
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 42px rgba(79, 70, 229, 0.35);
    font-size: 1.45rem;
    cursor: pointer;
    transition: all 0.2s;
}
.ai-assistant-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 48px rgba(79, 70, 229, 0.4);
}
.ai-assistant-panel {
    position: fixed;
    right: 24px;
    bottom: 98px;
    z-index: 1081;
    width: min(390px, calc(100vw - 48px));
    height: min(620px, calc(100vh - 140px));
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    display: none;
    flex-direction: column;
}
.ai-assistant-panel.show { display: flex; }
.ai-assistant-head {
    padding: 18px 20px 14px;
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    color: #fff;
}
.ai-assistant-close {
    width: 34px; height: 34px;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff; cursor: pointer;
}
.ai-assistant-body {
    flex: 1; padding: 16px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}
.ai-assistant-msg { display: flex; margin-bottom: 12px; }
.ai-assistant-msg.user { justify-content: flex-end; }
.ai-assistant-bubble {
    max-width: 85%; padding: 12px 14px;
    border-radius: 18px; font-size: 0.92rem;
    line-height: 1.75; white-space: pre-wrap;
    word-break: break-word; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}
.ai-assistant-msg.user .ai-assistant-bubble {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff; border-bottom-right-radius: 6px;
}
.ai-assistant-msg.bot .ai-assistant-bubble {
    background: #fff; color: #1f2937;
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}
.ai-assistant-foot {
    padding: 14px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    background: #fff;
}
.ai-assistant-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.ai-assistant-input {
    border-radius: 16px; border: 1px solid rgba(148, 163, 184, 0.26);
    padding: 12px 14px; min-height: 48px; resize: none;
}
.ai-assistant-input:focus { border-color: rgba(79, 70, 229, 0.35); }
.ai-assistant-send {
    min-width: 92px; border: 0; border-radius: 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff; font-weight: 800; padding: 0 18px;
}
.ai-assistant-send:disabled { opacity: 0.65; }
.ai-assistant-tips {
    margin-top: 10px; color: #98a2b3; font-size: 0.78rem; line-height: 1.6;
}

/* ---- 登录页特殊样式 ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fbff 50%, #f0fdf4 100%);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 48px 40px;
    box-shadow: 0 32px 80px rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.08);
}
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo i {
    font-size: 3rem;
    color: var(--primary);
}
.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-deep);
    margin: 12px 0 4px;
}
.login-logo p {
    color: var(--text-sub);
    font-size: 0.95rem;
    margin: 0;
}
.login-divider {
    text-align: center;
    margin: 24px 0;
    color: var(--text-sub);
    font-size: 0.88rem;
}
.login-divider span {
    background: var(--bg);
    padding: 0 12px;
}

/* ---- 首页引导卡片 ---- */
.guide-shell { max-width: 1040px; margin: 0 auto; }
.guide-hero {
    padding: 32px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.10);
    border-radius: 28px;
    box-shadow: 0 18px 48px rgba(79, 70, 229, 0.10);
    margin-bottom: 24px;
}
.guide-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    background: rgba(79, 70, 229, 0.10);
    color: #4338ca; font-size: 0.92rem; font-weight: 700;
    margin-bottom: 18px;
}
.guide-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900; color: #111827;
    margin-bottom: 14px;
}
.guide-subtitle {
    font-size: 1.05rem; line-height: 1.9;
    color: #475467; max-width: 760px;
}
.intro-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}
.intro-card {
    padding: 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}
.intro-card-title {
    font-size: 1.06rem; font-weight: 800;
    color: #111827; margin-bottom: 10px;
}
.intro-card-desc { color: #475467; line-height: 1.9; }

/* ---- 功能导航卡片 ---- */
.nav-group-title { font-size: 1.02rem; font-weight: 800; color: #111827; margin-bottom: 14px; }
.nav-card {
    padding: 22px; height: 100%;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}
.nav-link-card {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 18px; border-radius: 20px; text-decoration: none;
    color: inherit; background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    min-height: 112px; margin-bottom: 12px;
}
.nav-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(79, 70, 229, 0.10);
    border-color: rgba(99, 102, 241, 0.22);
    color: inherit;
}
.nav-icon {
    width: 48px; height: 48px; border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff; flex-shrink: 0;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}
.nav-icon.plaza { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.nav-icon.knowledge { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.nav-icon.favorite { background: linear-gradient(135deg, #f59e0b, #f97316); }
.nav-icon.report { background: linear-gradient(135deg, #10b981, #059669); }
.nav-icon.bounty { background: linear-gradient(135deg, #ef4444, #dc2626); }
.nav-icon.notice { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.nav-icon.profile { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.nav-icon.wallet { background: linear-gradient(135deg, #ec4899, #db2777); }
.nav-icon.admin { background: linear-gradient(135deg, #111827, #374151); }
.nav-link-title { font-size: 1rem; font-weight: 800; color: #111827; margin-bottom: 5px; }
.nav-link-desc { font-size: 0.92rem; color: #667085; line-height: 1.7; }

/* ---- 广场样式 ---- */
.plaza-shell { max-width: 1040px; margin: 0 auto; }
.plaza-nav {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 16px 20px; margin-bottom: 18px;
    border-radius: 20px; background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.plaza-channel-list { display: flex; flex-wrap: wrap; gap: 10px; }
.plaza-channel-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 42px; padding: 0 16px; border-radius: 999px;
    text-decoration: none; color: #475467; background: #f8fafc;
    border: 1px solid transparent; font-size: 0.95rem; font-weight: 700;
    transition: all 0.18s ease;
}
.plaza-channel-link:hover { color: #1d4ed8; background: #eff6ff; }
.plaza-channel-link.active { color: #1d4ed8; background: rgba(37, 99, 235, 0.10); border-color: rgba(37, 99, 235, 0.18); }
.plaza-action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 999px;
    text-decoration: none; font-size: 0.92rem; font-weight: 800;
    transition: all 0.18s ease;
}
.plaza-action-btn.publish { color: #1d4ed8; background: #eff6ff; border: 1px solid rgba(37, 99, 235, 0.15); }
.plaza-action-btn.bounty { color: #fff; background: linear-gradient(135deg, #ef4444, #f97316); box-shadow: 0 10px 24px rgba(239, 68, 68, 0.22); }
.plaza-action-btn:hover { transform: translateY(-1px); }
.plaza-searchbar {
    padding: 16px 20px; margin-bottom: 18px; border-radius: 18px;
    background: #fff; border: 1px solid rgba(148, 163, 184, 0.16);
}
.plaza-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.plaza-search-input {
    border-radius: 14px; border: 1px solid rgba(148, 163, 184, 0.24);
    padding: 12px 14px;
}

/* ---- 帖子卡片 ---- */
.post-card {
    border-radius: 20px; padding: 22px 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    margin-bottom: 16px;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1); }
.post-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.post-card-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; flex-shrink: 0; }
.post-card-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.post-card-user { flex: 1; }
.post-card-name { font-weight: 800; font-size: 0.97rem; color: #111827; display: flex; align-items: center; gap: 6px; }
.post-card-time { font-size: 0.82rem; color: #98a2b3; }
.post-card-title { font-size: 1.05rem; font-weight: 800; color: #111827; margin-bottom: 10px; line-height: 1.6; }
.post-card-content { color: #374151; font-size: 0.95rem; line-height: 1.85; margin-bottom: 14px; }
.post-card-images { display: grid; gap: 8px; margin-bottom: 14px; }
.post-card-images.cols-1 { grid-template-columns: 1fr; }
.post-card-images.cols-2 { grid-template-columns: repeat(2, 1fr); }
.post-card-images.cols-3 { grid-template-columns: repeat(3, 1fr); }
.post-card-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; cursor: pointer; }
.post-card-footer { display: flex; align-items: center; gap: 20px; }
.post-card-action { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: #667085; cursor: pointer; transition: color 0.15s; background: none; border: none; padding: 0; }
.post-card-action:hover { color: var(--primary); }
.post-card-action.liked { color: #ef4444; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.post-tag { padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: rgba(99, 102, 241, 0.08); color: #4338ca; }

/* ---- 钱包页 ---- */
.wallet-balance-card {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    color: #fff; border-radius: 24px; padding: 32px;
    box-shadow: 0 18px 48px rgba(67, 56, 202, 0.3);
}
.wallet-balance-num { font-size: 2.8rem; font-weight: 900; }
.wallet-section-title { font-size: 1.05rem; font-weight: 800; color: #111827; margin-bottom: 16px; }

/* ---- 标签选择器 ---- */
.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag-option { padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; cursor: pointer; border: 1px solid rgba(148, 163, 184, 0.24); background: #f8fafc; color: #475467; transition: all 0.15s; }
.tag-option:hover { background: rgba(99, 102, 241, 0.08); border-color: rgba(99, 102, 241, 0.2); color: #4338ca; }
.tag-option.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- 知识库 ---- */
.knowledge-card {
    border-radius: 20px; overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.knowledge-card:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08); }
.knowledge-card-link { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.knowledge-card .card-body { padding: 22px 22px 18px; }
.knowledge-title { font-size: 1.08rem; font-weight: 800; margin-bottom: 10px; line-height: 1.6; }
.knowledge-title a { color: #1f2937; }
.knowledge-title a:hover { color: #4f46e5; }
.knowledge-excerpt { color: #667085; font-size: 0.95rem; line-height: 1.85; margin-bottom: 16px; }
.knowledge-meta { font-size: 0.88rem; color: #98a2b3; }

/* ---- 响应式 ---- */
@media (max-width: 767.98px) {
    .ai-assistant-panel { right: 12px; left: 12px; width: auto; bottom: 90px; }
    .ai-assistant-entry { right: 16px; bottom: 16px; }
    .intro-grid { grid-template-columns: 1fr; }
    .login-card { padding: 36px 28px; }
}

/* ---- 辅助类 ---- */
.text-primary { color: var(--primary) !important; }
.text-report { color: var(--report-green) !important; }
.text-bounty { color: var(--bounty-red) !important; }
.fw-extrabold { font-weight: 800 !important; }
.sidebar-tag { cursor: pointer; padding: 10px 14px; border-radius: 12px; transition: all 0.2s; font-size: 0.97rem; font-weight: 600; }
.sidebar-tag:hover, .sidebar-tag.active { background: var(--primary); color: #fff; }
.points-display { font-weight: 600; color: var(--primary); }
.coin-icon { color: #f59e0b; }
