/* =========================================================
   萌口组 kou.moe · 共享 ACG 设计系统（单一风格来源）
   - 主站 moe 模板与 bbs.kou.moe 论坛共用同一套视觉语言
   - bbs 通过 <link> 引用本文件，实现与主站风格统一
   - 本表把 Bootstrap 3 组件粉紫化为萌口组活泼元气风
   ========================================================= */
:root {
    --pink: #ff7eb3;
    --pink-deep: #ff5fa2;
    --cyan: #6ee7ff;
    --purple: #b388ff;
    --yellow: #ffd86b;
    --bg: #fff5fb;
    --bg-soft: #ffffff;
    --surface: #ffffff;
    --surface-2: #fff0f7;
    --text: #3a2b3d;
    --text-soft: #8a7a8e;
    --muted: #b3a6b8;
    --line: #ffe0ee;
    --shadow: 0 8px 24px rgba(255, 126, 179, .14);
    --shadow-lg: 0 14px 40px rgba(179, 136, 255, .20);
    --radius: 18px;
    --radius-sm: 12px;
    --gradient: linear-gradient(135deg, var(--pink), var(--purple));
    --gradient-h: linear-gradient(90deg, var(--pink-deep), var(--purple));
    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
    --maxw: 1180px;
}
[data-theme="dark"] {
    --bg: #1a1325;
    --bg-soft: #241a33;
    --surface: #271d39;
    --surface-2: #2e2245;
    --text: #f3e9fb;
    --text-soft: #c2b0d4;
    --muted: #8c7aa3;
    --line: #3a2c52;
    --shadow: 0 8px 24px rgba(0, 0, 0, .4);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--pink-deep); text-decoration: none; transition: color .2s; }
a:hover { color: var(--purple); text-decoration: none; }
::selection { background: var(--pink); color: #fff; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------------------------------------------------------
   统一导航栏系统（萌口组 · emlog 与 bbs 共用）
   - 顶部渐变彩条 + 毛玻璃 + 粘性定位 + 统一交互
   - emlog 用 .moe-header，bbs 用 .navbar-default
   --------------------------------------------------------- */

/* 粘性定位 */
.moe-header,
.navbar {
    position: sticky !important;
    top: 0;
    z-index: 50;
}

/* 顶部渐变彩条 */
.moe-header::before,
.navbar-default::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--gradient);
}

/* 容器：毛玻璃背景 + 下边框 */
.moe-header,
.navbar-default {
    background: rgba(255, 255, 255, .78) !important;
    -webkit-backdrop-filter: saturate(180%) blur(14px) !important;
    backdrop-filter: saturate(180%) blur(14px) !important;
    border: none !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: 0 2px 14px rgba(255, 126, 179, .08) !important;
}
[data-theme="dark"] .moe-header,
[data-theme="dark"] .navbar-default {
    background: rgba(26, 19, 37, .82) !important;
}

/* Logo 图片：弹跳动画统一 */
.moe-logo,
.navbar-default .navbar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: var(--shadow);
    animation: moe-bounce 3s ease-in-out infinite;
    transition: transform .2s;
}
.moe-logo:hover,
.navbar-default .navbar-brand img:hover {
    transform: scale(1.1) rotate(-3deg);
}

/* 品牌文字：渐变色统一 */
.moe-brand-text b,
.navbar-default .navbar-brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .5px;
    background: linear-gradient(90deg, var(--pink-deep), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity .2s;
}

/* Brand 整体布局（flex row） */
.navbar-default .navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 64px;
    padding: 0;
}
.moe-logo + .moe-brand-text { display: inline-flex; flex-direction: column; line-height: 1.1; }

/* 导航链接：药丸形统一 */
.moe-header .nav-link,
.navbar-default .navbar-nav > li > a {
    display: inline-block;
    padding: 8px 14px;
    margin: 6px 2px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    transition: .2s;
    border: none;
    background: transparent;
}
.moe-header .nav-link:hover,
.navbar-default .navbar-nav > li > a:hover {
    color: var(--pink-deep);
    background: var(--surface-2);
}
.moe-header .nav-link[aria-current="page"],
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
    color: #fff;
    background: var(--gradient);
    box-shadow: var(--shadow);
}

/* ----- 二级导航（bbs 论坛专属） ----- */
.moe-subnav {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    margin-bottom: 22px;
}
.moe-subnav .nav-list {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}
.moe-subnav a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 14px;
    color: var(--text-soft);
    font-weight: 500;
    transition: .2s;
}
.moe-subnav a:hover {
    background: var(--surface);
    color: var(--pink-deep);
}

/* ----- 统一导航布局（供 emlog + bbs 共用） ----- */
.moe-header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 64px;
}
.moe-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.moe-brand-text { line-height: 1.1; }
.moe-brand-text i {
    font-style: normal;
    font-size: 11px;
    color: var(--text-soft);
    display: block;
}
.moe-nav-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    flex-wrap: nowrap;
}
.nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}
.nav-list .list-item {
    position: relative;
    white-space: nowrap;
}
.header-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    border: 2px solid var(--pink);
}
/* ----- 用户下拉菜单（依据 .has-menu 机制：opacity/visibility 替代 display，平滑过渡） ----- */
.has-menu {
    position: relative;
}
.user-menu-trigger {
    display: flex !important;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.has-menu > .dropdown-menus,
.has-menu > .user-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    left: auto;
    min-width: 170px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: .2s;
    z-index: 60;
}
.has-menu:hover > .dropdown-menus,
.has-menu:hover > .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.has-menu li { list-style: none; }
.has-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    transition: .2s;
    white-space: nowrap;
}
.has-menu .nav-link:hover {
    background: var(--surface-2);
    color: var(--pink-deep);
}

/* 小三角 */
.has-menu > .dropdown-menus::before,
.has-menu > .user-dropdown::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--surface);
}

/* 图标 */
.has-menu .nav-link[href*="notification"]::before { content: "🔔"; }
.has-menu .nav-link[href*="profile"]::before { content: "👤"; }
.has-menu .nav-link[href*="logout"]::before { content: "🚪"; }

/* 移动端汉堡菜单 */
.moe-menu-toggle,
.navbar-default .navbar-toggle {
    display: none;
    flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px;
    border-radius: 8px;
    /* 重置 Bootstrap 可能的干扰 */
    margin: 0;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.navbar-default .navbar-toggle { display: none; } /* Bootstrap default off */
.moe-menu-toggle span,
.navbar-default .navbar-toggle .icon-bar {
    display: block;
    width: 24px; height: 2.5px;
    background: var(--text);
    border-radius: 2px;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus { background: var(--surface-2); }

/* 搜索框 */
.moe-nav-search input,
.navbar-form .form-control {
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 7px 14px;
    color: var(--text);
    outline: none;
    box-shadow: none;
    width: 160px;
}
.moe-nav-search input:focus,
.navbar-form .form-control:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(255, 126, 179, .18);
}
.navbar-form { border: none; margin: 0; padding: 0; }
.navbar-form .form-group { margin: 0; }
.navbar-form .form-control { height: auto; } /* Bootstrap 默认高度重置 */

/* 折叠面板边线统一 */
.navbar-default .navbar-collapse,
.navbar-default .navbar-form { border-color: var(--line); }
.navbar { border-radius: 0; margin-bottom: 22px; }

/* 响应式：移动端汉堡菜单 */
@media (max-width: 720px) {
    .moe-menu-toggle { display: flex !important; }
    .moe-nav-wrap {
        position: absolute;
        top: 64px; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        padding: 12px 16px;
        gap: 10px;
        display: none;
        box-shadow: var(--shadow);
        z-index: 40;
    }
    .moe-nav-wrap.open { display: flex; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
    .nav-link { display: block; }
    .moe-nav-search input { width: 100%; }
}

/* ---------- 按钮 ---------- */
.btn {
    border-radius: 999px;
    font-weight: 600;
    padding: 8px 18px;
    border: none;
    transition: .2s;
}
.btn-default { background: var(--surface-2); color: var(--pink-deep); border: 1px solid var(--line); }
.btn-default:hover, .btn-default:focus { background: var(--line); color: var(--purple); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover, .btn-primary:focus { background: var(--gradient-h); color: #fff; transform: translateY(-1px); }
.btn-link { color: var(--pink-deep); }
.btn-link:hover { color: var(--purple); }
.btn-xs, .btn-sm { border-radius: 999px; }

/* ---------- 面板 / 卡片 ---------- */
.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--surface);
}
.panel-default { border-color: var(--line); }
.panel-default > .panel-heading {
    background: var(--surface-2);
    color: var(--text);
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    font-weight: 700;
}
.well {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: none;
}
.list-group-item {
    border-color: var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    background: var(--surface);
}
.list-group-item:first-child,
.list-group-item:last-child { border-radius: var(--radius-sm); }
.list-group-item.active,
.list-group-item.active:hover {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
}

/* ---------- 表单 ---------- */
.form-control {
    border-radius: var(--radius-sm);
    border-color: var(--line);
    box-shadow: none;
}
.form-control:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(255, 126, 179, .18);
}

/* ---------- 标签 / 徽章 ---------- */
.label { border-radius: 999px; padding: .3em .7em; }
.label-primary { background: var(--gradient); }
.label-default { background: var(--surface-2); color: var(--pink-deep); border: 1px solid var(--line); }
.badge { background: var(--pink-deep); border-radius: 999px; }

/* ---------- 分页 ---------- */
.pagination > li > a,
.pagination > li > span { color: var(--pink-deep); border-color: var(--line); background: var(--surface); }
.pagination > li > a:hover { background: var(--surface-2); color: var(--purple); border-color: var(--line); }
.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > span {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
}

/* ---------- 提示框 ---------- */
.alert { border: none; border-radius: var(--radius-sm); }
.alert-info { background: var(--surface-2); color: var(--pink-deep); }
.alert-success { background: #eafaf0; color: #2e9e6b; }
.alert-danger { background: #ffeef2; color: #e2557a; }
.alert-warning { background: #fff6e0; color: #c79330; }

/* ---------- 面包屑 / 下拉 / 表格 / 引用 ---------- */
.breadcrumb { background: var(--surface-2); border-radius: 999px; border: 1px solid var(--line); }
.breadcrumb a { color: var(--pink-deep); }
.breadcrumb > .active { color: var(--text-soft); }
.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.dropdown-menu > li > a:hover { background: var(--surface-2); color: var(--pink-deep); }
.table > thead > tr > th { border-color: var(--line); }
.table > tbody > tr > td { border-color: var(--line); }
.table-striped > tbody > tr:nth-of-type(odd) { background: var(--surface-2); }
blockquote { border-left: 4px solid var(--pink); }

/* ---------- 页脚 ---------- */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    padding: 22px 0;
    margin-top: 30px;
}
.footer a { color: var(--pink-deep); }
.footer a:hover { color: var(--purple); }

/* Logo 弹跳动画 */
@keyframes moe-bounce {
    0%,100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-4px) rotate(4deg); }
}

/* =========================================================
   统一登录卡片（主站弹窗与 bbs 登录页共用同一套 .moe-auth）
   - 主站 style.css 的 .moe-auth* 原样搬来，保证两边字面同款
   - bbs 登录页套用 .moe-auth 结构，由 .moe-login-page 中和 fixed 定位并垂直居中
   ========================================================= */
.moe-login-page {
    min-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.moe-login-page .moe-auth {
    position: static;
    transform: none;
    margin: 0;
    width: 100%;
    max-width: 360px;
    display: block;
}
.moe-auth {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    border: 1px solid var(--line);
}
.moe-auth-head h3 {
    margin: 0 0 14px;
    text-align: center;
    font-size: 20px;
    color: var(--text);
}
.moe-auth-panel input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    margin-bottom: 12px;
    background: var(--surface-2);
    color: var(--text);
    outline: none;
    font-size: 14px;
}
.moe-auth-panel input:focus { border-color: var(--pink); }
.moe-auth-cap { display: flex; gap: 8px; align-items: center; }
.moe-auth-cap input { flex: 1; margin-bottom: 12px; }
.moe-auth-cap img,
.moe-auth-cap span img {
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
}
.moe-auth-ck {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 12px;
}
.moe-auth-submit {
    width: 100%;
    background: var(--gradient);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 11px 22px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: .2s;
}
.moe-auth-submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.moe-auth-switch { text-align: center; margin-top: 12px; font-size: 13.5px; }
.moe-auth-switch a { color: var(--pink-deep); margin: 0 6px; }
.moe-auth-switch a:hover { color: var(--purple); }
.moe-auth-alert {
    color: #e5484d;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
    margin-bottom: 8px;
}

/* ===== 方形头像 ===== */
img[src*="avatar"] {
    object-fit: cover;
    border-radius: 6px;
}
/* 话题列表与详情中的头像：固定方形尺寸 */
.media-left img[src*="avatar"],
.topic-detail-heading img {
    width: 48px;
    height: 48px;
}
.member-detail .member-avatar {
    width: 120px;
    height: 120px;
}

/* ===== 新评论动画 ===== */
.media:target {
    animation: comment-pop 1.2s ease-out;
}
@keyframes comment-pop {
    0%   { background: rgba(255, 126, 179, 0.25); transform: scale(1.02); }
    50%  { background: rgba(255, 126, 179, 0.1); }
    100% { background: transparent; transform: scale(1); }
}
html {
    scroll-behavior: smooth;
}
