/**
 * Modern 模版样式表
 * 桌面端风格 - 双栏布局（内容区 + 右侧边栏 315px）
 * 总宽度 1200px，蓝色主色调，卡片式设计
 *
 * 完全独立于默认模版 assets/style.css
 * 所有 class 均以 md- 前缀命名，避免与现有模版冲突
 */

/* ============================================================
   1. CSS Reset & 基础样式
   ============================================================ */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica,
        Arial, sans-serif;
    background-color: #f0f2f5;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 60px; /* 为固定导航栏留出空间 */
}

a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #2563eb;
}

img {
    max-width: 100%;
    display: block;
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

::selection {
    background: rgba(59, 130, 246, 0.15);
    color: #1e40af;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 通用工具类 */
.md-text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.md-text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.md-hidden {
    display: none !important;
}

.md-clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================================================
   2. 布局
   ============================================================ */

/* 1200px 居中容器 */
.md-wrap {
    width: 1200px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 主区域：内容 + 侧边栏弹性布局 */
.md-main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 0 40px;
}

/* 内容区：弹性宽度 */
.md-content {
    flex: 1;
    min-width: 0; /* 防止 flex 子项溢出 */
}

/* 右侧边栏：315px 固定宽度，不使用 sticky，与内容栏同时滚动 */
.md-sidebar {
    width: 315px;
    flex-shrink: 0;
}

/* 非首页页面：直接子元素全宽（非 md-content / md-sidebar 的元素） */
/* 使用 flex: 0 0 100% 让广告等元素独占一行，不与内容栏/侧边栏争夺空间 */
.md-main > *:not(.md-content):not(.md-sidebar):not(script) {
    flex: 0 0 100%;
    min-width: 0;
}

/* 侧边栏内部粘性定位 */
.md-sidebar-sticky {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 单栏页面（无侧边栏时） */
.md-main.md-single .md-content {
    max-width: 100%;
}

/* 页面标题区 */
.md-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.md-page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.3px;
}

.md-page-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 2px;
}

/* 面包屑 */
.md-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.md-breadcrumb a {
    color: #6b7280;
}

.md-breadcrumb a:hover {
    color: #3b82f6;
}

.md-breadcrumb-sep {
    color: #d1d5db;
}

/* ============================================================
   3. 顶部导航栏
   ============================================================ */

.md-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    transition: box-shadow 0.2s ease;
}

.md-nav.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* 导航栏内部容器 */
.md-nav-inner {
    width: 1200px;
    max-width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo 区 */
.md-nav-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    color: #1f2937;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.md-nav-logo:hover {
    color: #3b82f6;
}

.md-nav-logo .md-logo-dot {
    color: #3b82f6;
}

.md-nav-logo img {
    max-height: 36px;
    max-width: 160px;
    width: auto;
    height: auto;
}

/* 导航项 */
.md-nav-items {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: flex-start;
    margin-left: 30px;
}

.md-nav-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    border-radius: 8px;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
}

.md-nav-item:hover {
    color: #3b82f6;
    background: #eff6ff;
}

.md-nav-item.active {
    color: #3b82f6;
    background: #eff6ff;
    font-weight: 600;
}

.md-nav-item svg {
    width: 16px;
    height: 16px;
}

/* 导航项小红点 */
.md-nav-item .md-nav-dot {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    border: 1.5px solid #fff;
}

/* 搜索框 */
.md-nav-search {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    width: 220px;
    height: 36px;
    background: #f3f4f6;
    border-radius: 18px;
    padding: 0 14px;
    gap: 8px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.md-nav-search:focus-within {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.md-nav-search svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    flex-shrink: 0;
}

.md-nav-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    width: 100%;
    color: #1f2937;
    -webkit-appearance: none;
    appearance: none;
}

.md-nav-search input::placeholder {
    color: #9ca3af;
}

/* 用户区 */
.md-nav-user {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* 签到按钮（导航栏内） */
.md-nav-signin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border-radius: 8px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.md-nav-signin:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
}

.md-nav-signin svg {
    width: 14px;
    height: 14px;
}

/* 消息铃铛 */
.md-nav-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #6b7280;
    transition: all 0.15s ease;
}

.md-nav-bell:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.md-nav-bell svg {
    width: 20px;
    height: 20px;
}

/* 消息数字徽标 */
.md-nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    border: 1.5px solid #fff;
}

/* 导航栏发帖按钮 */
.md-nav-post {
    margin-right: 4px;
}

/* 头像按钮 */
.md-nav-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 20px;
    background: #f3f4f6;
    transition: background 0.15s ease;
}

.md-nav-avatar-btn:hover {
    background: #e5e7eb;
}

.md-nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.md-nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-nav-avatar-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.md-nav-avatar-arrow {
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.md-nav-avatar-btn.open .md-nav-avatar-arrow {
    transform: rotate(180deg);
}

/* 登录/注册链接 */
.md-nav-login {
    font-size: 14px;
    font-weight: 500;
    color: #3b82f6;
    padding: 6px 16px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.md-nav-login:hover {
    background: #eff6ff;
    color: #2563eb;
}

/* 下拉菜单 */
.md-dropdown {
    position: absolute;
    top: 52px;
    right: 0;
    width: 240px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    z-index: 1100;
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.md-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.md-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border-bottom: 1px solid #f0f0f0;
}

.md-dropdown-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.md-dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.md-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.md-dropdown-uid {
    font-size: 12px;
    color: #9ca3af;
}

.md-dropdown-section {
    padding: 6px;
}

.md-dropdown-section + .md-dropdown-section {
    border-top: 1px solid #f3f4f6;
}

.md-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    transition: background 0.12s ease;
}

.md-dropdown-item:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.md-dropdown-item svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    flex-shrink: 0;
}

.md-dropdown-item-text {
    flex: 1;
}

.md-dropdown-item.danger {
    color: #ef4444;
}

.md-dropdown-item.danger svg {
    color: #ef4444;
}

/* ============================================================
   4. 帖子列表
   ============================================================ */

.md-thread-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 帖子卡片 */
.md-thread-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* 帖子作者头像 */
.md-thread-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #e5e7eb;
}
.md-thread-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.md-thread-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    background: #e5e7eb;
}

.md-thread-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* 置顶帖左边条 */
.md-thread-item.md-pinned {
    background: linear-gradient(to right, #fffbeb 0%, #ffffff 40%);
}

.md-thread-item.md-pinned::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #f59e0b;
}

/* 帖子头像 */
.md-thread-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.md-thread-avatar:hover {
    transform: scale(1.05);
}

.md-thread-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 帖子主体 */
.md-thread-body {
    flex: 1;
    min-width: 0;
}

/* 帖子标签行（置顶、精华等） */
.md-thread-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

/* 帖子标题 */
.md-thread-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.md-thread-item:hover .md-thread-title {
    color: #3b82f6;
}

.md-thread-title .md-image-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 10px;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: 2px;
    font-weight: 600;
}

/* 帖子元信息 */
.md-thread-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #9ca3af;
    flex-wrap: wrap;
}

.md-thread-meta a {
    color: #6b7280;
    font-weight: 500;
}

.md-thread-meta a:hover {
    color: #3b82f6;
}

.md-thread-meta .md-meta-forum {
    color: #3b82f6;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.md-thread-meta .md-meta-sep {
    color: #d1d5db;
}

.md-thread-meta .md-meta-time {
    color: #9ca3af;
}

/* 帖子统计区（右侧） */
.md-thread-stats {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 60px;
    padding: 8px 0;
    border-left: 1px solid #f3f4f6;
    padding-left: 16px;
    align-self: center;
}

.md-thread-stats .md-stats-num {
    font-size: 18px;
    font-weight: 700;
    color: #9ca3af;
    line-height: 1.2;
}

.md-thread-stats .md-stats-num.md-hot {
    color: #ef4444;
}

.md-thread-stats .md-stats-label {
    font-size: 11px;
    color: #9ca3af;
}

/* 帖子摘要 */
.md-thread-excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 帖子缩略图 */
.md-thread-thumb {
    width: 100px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* 空状态 */
.md-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
}

.md-empty svg {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.md-empty-text {
    font-size: 14px;
}

/* 分区分隔线 */
.md-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 4px 8px;
}

.md-section-divider::before,
.md-section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.md-section-divider span {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================================
   5. 帖子标签页（Tabs）
   ============================================================ */

.md-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.md-tabs::-webkit-scrollbar {
    display: none;
}

.md-tab {
    flex-shrink: 0;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
}

.md-tab:hover {
    color: #3b82f6;
}

.md-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

.md-tab .md-tab-count {
    font-size: 12px;
    color: #9ca3af;
    margin-left: 4px;
    font-weight: 400;
}

.md-tab.active .md-tab-count {
    color: #3b82f6;
}

/* 标签页右侧操作区 */
.md-tabs-extra {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

/* 筛选标签（小标签横排） */
.md-filter-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.md-filter-tab {
    flex-shrink: 0;
    padding: 6px 16px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: all 0.15s ease;
}

.md-filter-tab:hover {
    color: #3b82f6;
    border-color: #93c5fd;
    background: #eff6ff;
}

.md-filter-tab.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    font-weight: 600;
}

/* ============================================================
   6. 侧边栏小部件（Widget）
   ============================================================ */

.md-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 16px;
}

.md-widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
}

.md-widget-title svg {
    width: 18px;
    height: 18px;
    color: #3b82f6;
}

.md-widget-title .md-widget-more {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
    transition: color 0.15s ease;
}

.md-widget-title .md-widget-more:hover {
    color: #3b82f6;
}

.md-widget-body {
    padding: 16px 18px;
}

/* ============================================================
   7. 论坛统计网格（2x2）
   ============================================================ */

.md-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.md-stats-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: #f9fafb;
    border-radius: 10px;
    text-align: center;
    transition: background 0.15s ease;
}

.md-stats-grid-item:hover {
    background: #eff6ff;
}

.md-stats-grid-num {
    font-size: 22px;
    font-weight: 700;
    color: #3b82f6;
    line-height: 1.2;
    margin-bottom: 4px;
}

.md-stats-grid-label {
    font-size: 12px;
    color: #9ca3af;
}

/* 统计列表（竖排） */
.md-stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.md-stats-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.md-stats-list-item .md-stats-list-label {
    color: #6b7280;
}

.md-stats-list-item .md-stats-list-value {
    font-weight: 600;
    color: #1f2937;
}

/* 论坛信息部件 */
.md-forum-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.md-forum-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.md-forum-info-label {
    color: #6b7280;
}

.md-forum-info-value {
    font-weight: 600;
    color: #1f2937;
}

.md-forum-info-value.md-online {
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 6px;
}

.md-forum-info-value.md-online::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* ============================================================
   8. 签到部件
   ============================================================ */

.md-signin {
    text-align: center;
}

.md-signin-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.md-signin-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.md-signin-desc {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.md-signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border-radius: 10px;
    transition: all 0.15s ease;
}

.md-signin-btn:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.md-signin-btn:disabled,
.md-signin-btn.md-signed {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.md-signin-btn svg {
    width: 16px;
    height: 16px;
}

/* 签到连续天数 */
.md-signin-streak {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 12px;
    color: #9ca3af;
}

.md-signin-streak .md-streak-num {
    font-size: 16px;
    font-weight: 700;
    color: #f59e0b;
}

/* 签到日历网格 */
.md-signin-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 12px;
}

.md-signin-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #9ca3af;
    border-radius: 4px;
    background: #f9fafb;
}

.md-signin-cal-day.md-signed {
    background: #dbeafe;
    color: #2563eb;
    font-weight: 600;
}

.md-signin-cal-day.md-today {
    background: #3b82f6;
    color: #fff;
    font-weight: 600;
}

/* ============================================================
   9. 排行榜部件
   ============================================================ */

.md-rank-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.md-rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    transition: background 0.12s ease;
}

.md-rank-item:hover {
    background: #f9fafb;
}

.md-rank-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 50%;
}

.md-rank-item:nth-child(1) .md-rank-num {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
}

.md-rank-item:nth-child(2) .md-rank-num {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
    color: #fff;
}

.md-rank-item:nth-child(3) .md-rank-num {
    background: linear-gradient(135deg, #fdba74 0%, #ea580c 100%);
    color: #fff;
}

.md-rank-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.md-rank-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-rank-info {
    flex: 1;
    min-width: 0;
}

.md-rank-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.md-rank-name:hover {
    color: #3b82f6;
}

.md-rank-value {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.md-rank-value .md-rank-num-big {
    font-size: 14px;
    font-weight: 700;
    color: #f59e0b;
}

/* 排行榜领奖台（前三名突出展示） */
.md-rank-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    padding: 8px 0 16px;
}

.md-rank-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.md-rank-podium-item.md-first {
    flex: 1.2;
}

.md-rank-podium-medal {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    border-radius: 50%;
}

.md-rank-podium-item.md-first .md-rank-podium-medal {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.md-rank-podium-item.md-second .md-rank-podium-medal {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
}

.md-rank-podium-item.md-third .md-rank-podium-medal {
    background: linear-gradient(135deg, #fdba74 0%, #ea580c 100%);
}

.md-rank-podium-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.md-rank-podium-item.md-first .md-rank-podium-avatar {
    width: 60px;
    height: 60px;
    font-size: 22px;
}

.md-rank-podium-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-rank-podium-name {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.md-rank-podium-value {
    font-size: 13px;
    font-weight: 700;
    color: #f59e0b;
}

.md-rank-podium-value span {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
}

/* 热帖部件 */
.md-hot-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.md-hot-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 8px;
    transition: background 0.12s ease;
}

.md-hot-item:hover {
    background: #f9fafb;
}

.md-hot-item:hover .md-hot-title {
    color: #3b82f6;
}

.md-hot-rank {
    flex-shrink: 0;
    width: 18px;
    font-size: 14px;
    font-weight: 700;
    color: #d1d5db;
    text-align: center;
    line-height: 1.5;
}

.md-hot-item:nth-child(1) .md-hot-rank,
.md-hot-item:nth-child(2) .md-hot-rank,
.md-hot-item:nth-child(3) .md-hot-rank {
    color: #ef4444;
}

.md-hot-title {
    flex: 1;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.md-hot-meta {
    font-size: 11px;
    color: #d1d5db;
    margin-top: 4px;
}

/* ============================================================
   10. 分页
   ============================================================ */

.md-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.md-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    color: #4b5563;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.15s ease;
    font-weight: 500;
}

.md-page:hover {
    color: #3b82f6;
    border-color: #93c5fd;
    background: #eff6ff;
}

.md-page.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    font-weight: 600;
}

.md-page.md-disabled {
    color: #d1d5db;
    cursor: not-allowed;
    background: #f9fafb;
}

.md-page.md-disabled:hover {
    color: #d1d5db;
    border-color: #e5e7eb;
    background: #f9fafb;
}

.md-page.md-ellipsis {
    border: none;
    background: transparent;
    cursor: default;
    color: #9ca3af;
}

.md-page.md-ellipsis:hover {
    background: transparent;
    color: #9ca3af;
    border-color: transparent;
}

.md-pagination-info {
    font-size: 13px;
    color: #9ca3af;
    margin-left: 12px;
}

/* ============================================================
   11. 帖子详情页
   ============================================================ */

.md-thread-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 帖子头部信息卡 */
.md-thread-header {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.md-thread-header .md-thread-forum-tag {
    display: inline-block;
    font-size: 12px;
    color: #3b82f6;
    background: #eff6ff;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 500;
    margin-bottom: 12px;
}

.md-thread-header .md-thread-h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 16px;
}

.md-thread-header .md-thread-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #9ca3af;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.md-thread-header .md-thread-header-meta a {
    color: #6b7280;
    font-weight: 500;
}

.md-thread-header .md-thread-header-meta a:hover {
    color: #3b82f6;
}

/* 主帖内容卡 */
.md-post-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* 主帖作者信息 */
.md-post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 20px;
}

.md-post-author .md-post-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.md-post-author .md-post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-post-author-info {
    flex: 1;
    min-width: 0;
}

.md-post-author-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 6px;
}

.md-post-author-name:hover {
    color: #3b82f6;
}

.md-post-author-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-post-author-level {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 楼层号 */
.md-post-floor {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

/* 帖子内容 */
.md-post-content {
    font-size: 15px;
    line-height: 1.8;
    color: #374151;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.md-post-content p {
    margin-bottom: 12px;
}

.md-post-content p:last-child {
    margin-bottom: 0;
}

.md-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.md-post-content a {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.md-post-content blockquote {
    margin: 12px 0;
    padding: 12px 16px;
    background: #f9fafb;
    border-left: 3px solid #3b82f6;
    border-radius: 0 8px 8px 0;
    color: #6b7280;
    font-size: 14px;
}

.md-post-content code {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 13px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    color: #e11d48;
}

.md-post-content pre {
    margin: 12px 0;
    padding: 16px;
    background: #1f2937;
    border-radius: 8px;
    overflow-x: auto;
}

.md-post-content pre code {
    background: transparent;
    color: #e5e7eb;
    padding: 0;
}

.md-post-content h1,
.md-post-content h2,
.md-post-content h3 {
    margin: 20px 0 12px;
    color: #1f2937;
    font-weight: 700;
}

.md-post-content h1 { font-size: 20px; }
.md-post-content h2 { font-size: 18px; }
.md-post-content h3 { font-size: 16px; }

.md-post-content ul,
.md-post-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.md-post-content ul { list-style: disc; }
.md-post-content ol { list-style: decimal; }

.md-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.md-post-content th,
.md-post-content td {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    text-align: left;
    font-size: 14px;
}

.md-post-content th {
    background: #f9fafb;
    font-weight: 600;
}

/* 帖子操作栏（点赞、回复等） */
.md-post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.md-post-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 20px;
    transition: all 0.15s ease;
    font-weight: 500;
}

.md-post-action:hover {
    color: #3b82f6;
    background: #eff6ff;
}

.md-post-action.md-active {
    color: #3b82f6;
    background: #eff6ff;
    font-weight: 600;
}

.md-post-action svg {
    width: 16px;
    height: 16px;
}

/* 回复列表 */
.md-reply-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.md-reply-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-reply-section-title .md-reply-count {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 400;
}

/* 单条回复 */
.md-reply-item {
    display: flex;
    gap: 14px;
    padding: 20px 0;
    border-bottom: 1px solid #f3f4f6;
}

.md-reply-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.md-reply-item:first-child {
    padding-top: 0;
}

.md-reply-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.md-reply-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-reply-body {
    flex: 1;
    min-width: 0;
}

.md-reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.md-reply-author {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.md-reply-author:hover {
    color: #3b82f6;
}

.md-reply-time {
    font-size: 12px;
    color: #9ca3af;
}

.md-reply-floor {
    font-size: 12px;
    color: #9ca3af;
    margin-left: auto;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

.md-reply-content {
    font-size: 14px;
    line-height: 1.8;
    color: #4b5563;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.md-reply-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.md-reply-content p {
    margin-bottom: 8px;
}

.md-reply-content p:last-child {
    margin-bottom: 0;
}

/* 引用回复 */
.md-reply-quote {
    margin-bottom: 10px;
    padding: 10px 14px;
    background: #f9fafb;
    border-left: 3px solid #d1d5db;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #6b7280;
}

.md-reply-quote .md-reply-quote-author {
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 2px;
}

/* 回复操作 */
.md-reply-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.md-reply-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: #9ca3af;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.md-reply-action:hover {
    color: #3b82f6;
    background: #eff6ff;
}

.md-reply-action svg {
    width: 14px;
    height: 14px;
}

/* 回复编辑器区 */
.md-reply-form {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.md-reply-form-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.md-reply-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #1f2937;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.md-reply-textarea:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.md-reply-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.md-reply-form-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}

.md-reply-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #6b7280;
    transition: all 0.12s ease;
    font-size: 16px;
}

.md-reply-tool:hover {
    background: #eff6ff;
    color: #3b82f6;
}

/* ============================================================
   12. 用户资料页
   ============================================================ */

.md-profile-header {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

/* 封面背景 */
.md-profile-cover {
    height: 160px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    position: relative;
}

.md-profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 资料主体 */
.md-profile-body {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 24px 24px;
    margin-top: -48px;
    position: relative;
}

.md-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
    border: 4px solid #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

.md-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-profile-info {
    flex: 1;
    padding-bottom: 4px;
}

.md-profile-name {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.md-profile-uid {
    font-size: 13px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.md-profile-bio {
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
    line-height: 1.6;
}

.md-profile-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
}

/* 资料统计 */
.md-profile-stats {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 20px 24px;
    border-top: 1px solid #f3f4f6;
}

.md-profile-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.md-profile-stat-num {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.md-profile-stat-label {
    font-size: 12px;
    color: #9ca3af;
}

.md-profile-stat:hover .md-profile-stat-num {
    color: #3b82f6;
}

/* 资料页 Tab */
.md-profile-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

/* 资料页内容区布局 */
.md-profile-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.md-profile-main {
    flex: 1;
    min-width: 0;
}

.md-profile-side {
    width: 315px;
    flex-shrink: 0;
}

/* 资料卡片 */
.md-profile-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.md-profile-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
}

.md-profile-detail-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.md-profile-detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.md-profile-detail-item svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    flex-shrink: 0;
}

.md-profile-detail-label {
    color: #9ca3af;
    min-width: 60px;
}

.md-profile-detail-value {
    color: #4b5563;
    font-weight: 500;
}

/* ============================================================
   13. 按钮
   ============================================================ */

.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 8px;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.5;
    border: 1px solid transparent;
}

.md-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.md-btn:active {
    transform: translateY(1px);
}

.md-btn svg {
    width: 16px;
    height: 16px;
}

/* 主按钮 */
.md-btn-primary {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.md-btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 描边按钮 */
.md-btn-outline {
    background: transparent;
    color: #3b82f6;
    border-color: #93c5fd;
}

.md-btn-outline:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #3b82f6;
}

/* 危险按钮 */
.md-btn-danger {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.md-btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

/* 成功按钮 */
.md-btn-success {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

.md-btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

/* 按钮尺寸 */
.md-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.md-btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

/* 块级按钮 */
.md-btn-block {
    display: flex;
    width: 100%;
}

/* 禁用状态 */
.md-btn:disabled,
.md-btn.md-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 按钮组 */
.md-btn-group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

/* ============================================================
   14. 表单
   ============================================================ */

.md-form-group {
    margin-bottom: 20px;
}

.md-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.md-form-label .md-required {
    color: #ef4444;
    margin-left: 2px;
}

.md-form-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

.md-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.md-input::placeholder {
    color: #9ca3af;
}

.md-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.md-input:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.md-input.md-error {
    border-color: #ef4444;
}

.md-input.md-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 文本域 */
.md-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #1f2937;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.md-textarea::placeholder {
    color: #9ca3af;
}

.md-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 下拉选择 */
.md-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    color: #1f2937;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.md-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 表单行（横向排列） */
.md-form-row {
    display: flex;
    gap: 16px;
}

.md-form-row .md-form-group {
    flex: 1;
}

/* 复选框 / 单选框 */
.md-checkbox,
.md-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

.md-checkbox input,
.md-radio input {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* 表单卡片 */
.md-form-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.md-form-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

/* 表单提示消息 */
.md-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.md-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.md-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.md-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.md-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ============================================================
   15. 页脚
   ============================================================ */

.md-footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 32px 0 24px;
    margin-top: auto;
}

.md-footer-inner {
    width: 1200px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 友情链接 + 底部导航 — 各自独占一行 */
.md-footer-top {
    display: block;
}

.md-footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f3f4f6;
}

.md-footer-links-label {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
}

.md-footer-links a {
    font-size: 13px;
    color: #6b7280;
}

.md-footer-links a:hover {
    color: #3b82f6;
}

/* 页脚导航 — 独占一行，靠右对齐 */
.md-footer-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f3f4f6;
    justify-content: flex-end;
}

.md-footer-nav a {
    font-size: 13px;
    color: #6b7280;
}

.md-footer-nav a:hover {
    color: #3b82f6;
}

/* 版权信息 — 使用 .md-footer .copyright 选择器（class="wrap copyright" 不可改，否则触发版权保护） */
.md-footer .copyright {
    text-align: left;
    font-size: 12px;
    color: #9ca3af;
    padding-top: 0;
    border-top: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
}

.md-footer .copyright a {
    color: #6b7280;
    font-weight: 500;
}

.md-footer .copyright a:hover {
    color: #3b82f6;
}

.md-footer .copyright .md-footer-sep {
    margin: 0 6px;
    color: #d1d5db;
}

/* ============================================================
   16. 响应式（1024px 以下折叠侧边栏）
   ============================================================ */

@media (max-width: 1240px) {
    .md-wrap,
    .md-nav-inner,
    .md-footer-inner {
        width: 100%;
    }
}

@media (max-width: 1024px) {
    /* 侧边栏折叠到内容下方 */
    .md-main {
        flex-direction: column;
    }

    .md-sidebar {
        width: 100%;
    }

    .md-sidebar-sticky {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .md-sidebar .md-widget {
        flex: 1;
        min-width: 280px;
    }

    /* 资料页侧栏也折叠 */
    .md-profile-content {
        flex-direction: column;
    }

    .md-profile-side {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    .md-profile-side .md-profile-card {
        flex: 1;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }

    .md-nav {
        height: 56px;
    }

    .md-nav-inner {
        gap: 12px;
    }

    /* 隐藏导航文字，仅保留图标 */
    .md-nav-item span {
        display: none;
    }

    .md-nav-items {
        gap: 2px;
    }

    .md-nav-item {
        padding: 8px 10px;
    }

    /* 搜索框收窄 */
    .md-nav-search {
        width: 140px;
    }

    .md-nav-avatar-name {
        display: none;
    }

    /* 主区域间距减小 */
    .md-main {
        gap: 12px;
        padding: 12px 0 24px;
    }

    .md-wrap {
        padding: 0 12px;
    }

    /* 帖子卡片调整 */
    .md-thread-item {
        padding: 14px;
        gap: 10px;
    }

    .md-thread-avatar {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .md-thread-title {
        font-size: 15px;
    }

    .md-thread-stats {
        min-width: 48px;
        padding-left: 10px;
    }

    .md-thread-stats .md-stats-num {
        font-size: 15px;
    }

    /* 帖子详情 */
    .md-thread-header,
    .md-post-card,
    .md-reply-section,
    .md-reply-form {
        padding: 16px;
    }

    .md-thread-header .md-thread-h1 {
        font-size: 20px;
    }

    /* 资料页 */
    .md-profile-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .md-profile-avatar {
        width: 72px;
        height: 72px;
        font-size: 28px;
    }

    .md-profile-actions {
        width: 100%;
    }

    .md-profile-stats {
        gap: 16px;
        padding: 16px;
        overflow-x: auto;
    }

    /* 侧边栏小部件单列 */
    .md-sidebar-sticky {
        flex-direction: column;
    }

    .md-sidebar .md-widget {
        min-width: 0;
    }

    /* 分页按钮缩小 */
    .md-page {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
        padding: 0 8px;
    }

    /* 表单行竖排 */
    .md-form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ============================================================
   17. 徽章样式（置顶、精华等）
   ============================================================ */

.md-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
}

/* 置顶 - 橙色 */
.md-badge.md-badge-top {
    background: #fffbeb;
    color: #d97706;
}

/* 精华 - 紫色 */
.md-badge.md-badge-essence {
    background: #f3e8ff;
    color: #9333ea;
}

/* 打赏 - 绿色 */
.md-badge.md-badge-reward {
    background: #ecfdf5;
    color: #059669;
}

/* 金币 - 橙红色 */
.md-badge.md-badge-coin {
    background: #fff7ed;
    color: #ea580c;
}

/* 投票 - 蓝紫色 */
.md-badge.md-badge-vote {
    background: #eff6ff;
    color: #2563eb;
}

/* 官方 - 蓝色 */
.md-badge.md-badge-official {
    background: #dbeafe;
    color: #2563eb;
}

/* 热门 - 红色 */
.md-badge.md-badge-hot {
    background: #fef2f2;
    color: #dc2626;
}

/* 新帖 - 绿色 */
.md-badge.md-badge-new {
    background: #f0fdf4;
    color: #16a34a;
}

/* 靓号 - 金色渐变 */
.md-badge.md-badge-liang {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

/* VIP 标签 */
.md-badge.md-badge-vip {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 等级徽章 */
.md-badge.md-badge-level {
    background: #eff6ff;
    color: #3b82f6;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
}

/* 分类标签（普通） */
.md-badge.md-badge-category {
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 500;
}

/* 图片标记 */
.md-badge.md-badge-image {
    background: #dbeafe;
    color: #2563eb;
}

/* 带图标的徽章 */
.md-badge svg {
    width: 12px;
    height: 12px;
}

/* ============================================================
   附录：通用辅助样式
   ============================================================ */

/* 卡片基础类 */
.md-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* 间距工具 */
.md-mt-0 { margin-top: 0 !important; }
.md-mt-8 { margin-top: 8px !important; }
.md-mt-16 { margin-top: 16px !important; }
.md-mt-24 { margin-top: 24px !important; }
.md-mb-0 { margin-bottom: 0 !important; }
.md-mb-8 { margin-bottom: 8px !important; }
.md-mb-16 { margin-bottom: 16px !important; }
.md-mb-24 { margin-bottom: 24px !important; }

/* 文字颜色 */
.md-text-primary { color: #3b82f6; }
.md-text-success { color: #22c55e; }
.md-text-warning { color: #f59e0b; }
.md-text-danger { color: #ef4444; }
.md-text-muted { color: #9ca3af; }
.md-text-gray { color: #6b7280; }

/* 文字大小 */
.md-text-sm { font-size: 12px; }
.md-text-base { font-size: 14px; }
.md-text-lg { font-size: 16px; }
.md-text-xl { font-size: 18px; }
.md-text-2xl { font-size: 22px; }

/* 浮动回顶按钮 */
.md-back-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 900;
}

.md-back-top.show {
    opacity: 1;
    pointer-events: auto;
}

.md-back-top:hover {
    background: #3b82f6;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.md-back-top svg {
    width: 20px;
    height: 20px;
}

/* Toast 提示 */
.md-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 24px;
    background: rgba(31, 41, 55, 0.92);
    color: #fff;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.md-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 加载动画 */
.md-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 14px;
}

.md-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: md-spin 0.6s linear infinite;
    margin-right: 10px;
}

@keyframes md-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 分隔线 */
.md-divider {
    height: 1px;
    background: #e5e7eb;
    border: none;
    margin: 20px 0;
}

/* 标签云 */
.md-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.md-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.md-tag:hover {
    color: #3b82f6;
    background: #eff6ff;
}

/* ============================================================
   17. 首页视图补充样式（views/index_style5.php 专用）
   与上方已有样式互补，使用 md- 前缀，不影响其他模版
   ============================================================ */

/* 发帖按钮栏 */
.md-post-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 12px;
}

/* Widget 标题别名（md-widget-header = md-widget-title） */
.md-widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
}
.md-widget-header h3 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

/* 统计网格别名（md-stat-grid = md-stats-grid） */
.md-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.md-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: #f9fafb;
    border-radius: 10px;
    text-align: center;
    transition: background 0.15s ease;
}
.md-stat-item:hover { background: #eff6ff; }
.md-stat-num {
    font-size: 22px;
    font-weight: 700;
    color: #3b82f6;
    line-height: 1.2;
    margin-bottom: 4px;
}
.md-stat-label {
    font-size: 12px;
    color: #9ca3af;
}

/* Widget 内注释行 */
.md-widget-note {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.8;
    padding: 4px 0;
}
.md-widget-note strong { color: #3b82f6; }
.md-widget-note a { color: #3b82f6; }
.md-widget-note a:hover { text-decoration: underline; }

/* 签到部件补充 */
.md-signin-widget { text-align: center; }
.md-signin-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 14px;
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
}
.md-signin-info strong { color: #f59e0b; font-size: 15px; }
.md-signin-result {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}
.md-signin-result.md-signin-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.md-signin-result.md-signin-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* 版块列表（侧边栏） */
.md-forum-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.md-forum-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.12s ease;
    font-size: 13px;
    color: #4b5563;
}
.md-forum-item:hover {
    background: #f9fafb;
    color: #3b82f6;
}
.md-forum-name {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.md-forum-count {
    flex-shrink: 0;
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}
.md-forum-section {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 10px 4px;
    margin-top: 4px;
}

/* 排行榜数值别名 */
.md-rank-val {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}
.md-rank-num.md-rank-top {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
}
.md-rank-num.md-rank-normal {
    background: #f3f4f6;
    color: #9ca3af;
}

/* 分页别名 */
.md-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    color: #4b5563;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.15s ease;
    font-weight: 500;
}
.md-page-btn:hover {
    color: #3b82f6;
    border-color: #93c5fd;
    background: #eff6ff;
}
.md-page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    background: #3b82f6;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
}
.md-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #9ca3af;
    font-size: 14px;
}

/* 帖子项主体别名 */
.md-thread-item-body {
    flex: 1;
    min-width: 0;
}

/* 帖子元信息 */
.md-thread-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
    color: #9ca3af;
}
.md-thread-meta a { color: #6b7280; }
.md-thread-meta a:hover { color: #3b82f6; }
.md-thread-sep { color: #d1d5db; }
.md-thread-forum a { font-weight: 500; }
.md-thread-author a { font-weight: 500; }
.md-thread-last-reply { color: #9ca3af; }
.md-thread-time { color: #9ca3af; }

/* 帖子统计列 */
.md-thread-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding-left: 14px;
    border-left: 1px solid #f3f4f6;
    min-width: 56px;
}
.md-thread-stats .md-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #9ca3af;
}
.md-thread-stats .md-stat svg { opacity: 0.6; }

/* 图片/热门标记 */
.md-img-badge { font-size: 12px; }
.md-hot-badge { font-size: 12px; }

/* 标签颜色变体 */
.md-tag.md-tag-red { background: #fef2f2; color: #dc2626; }
.md-tag.md-tag-blue { background: #eff6ff; color: #2563eb; }
.md-tag.md-tag-green { background: #f0fdf4; color: #16a34a; }
.md-tag.md-tag-orange { background: #fff7ed; color: #ea580c; }
.md-tag.md-tag-purple { background: #faf5ff; color: #9333ea; }
.md-tag.md-tag-gray { background: #f3f4f6; color: #6b7280; }
.md-tag.md-tag-new {
    background: #ef4444;
    color: #fff;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* 未读帖子高亮 */
.md-thread-item.md-thread-unread .md-thread-title a {
    color: #3b82f6;
}
.md-thread-item.md-thread-unread .md-thread-title a::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    margin-right: 6px;
    vertical-align: middle;
}

/* ============================================================
   18. 非首页页面适配（论坛/帖子/用户/搜索等页面在 md-wrap 内的样式覆盖）
   当 style5 被选中时，所有桌面页面都通过 templates/modern/header.php
   输出页头，内容区被包裹在 <div class="md-wrap"><div class="md-main"> 中。
   以下样式确保默认模版内容在现代风容器中正确显示。
   ============================================================ */

/* 让默认模版的 .grid 在 md-main 中变为双栏 */
.md-main > .grid {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}
.md-main > .grid > section {
    flex: 1 1 100%;
    min-width: 0;
}
.md-main > .grid > aside {
    width: 300px;
    flex-shrink: 0;
}

/* 默认模版卡片在现代风容器中 */
.md-main .card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: none;
    margin-bottom: 16px;
    flex: 1 1 100%;
    width: 100%;
}

/* 默认模版列表行 */
.md-main .list-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.12s ease;
}
.md-main .list-row:last-child { border-bottom: none; }
.md-main .list-row:hover { background: #f9fafb; }
.md-main .list-main { flex: 1; min-width: 0; }
.md-main .list-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.md-main .list-metrics {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    padding-left: 14px;
}

/* Hero 区域适配 */
.md-main .hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
}

/* 分页适配 */
.md-main .reply-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 20px 0;
    flex-wrap: wrap;
}
.md-main .reply-page-btn,
.md-main .reply-page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    transition: all 0.15s ease;
}
.md-main .reply-page-btn:hover {
    color: #3b82f6;
    border-color: #93c5fd;
    background: #eff6ff;
}
.md-main .reply-page-current {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    font-weight: 600;
}

/* section-title 适配 */
.md-main .section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

/* 标签适配 */
.md-main .tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 500;
    margin-right: 4px;
}
.md-main .tag.red { background: #fef2f2; color: #dc2626; }
.md-main .tag.blue { background: #eff6ff; color: #2563eb; }
.md-main .tag.green { background: #f0fdf4; color: #16a34a; }
.md-main .tag.orange { background: #fff7ed; color: #ea580c; }
.md-main .tag.purple { background: #faf5ff; color: #9333ea; }

/* 帖子详情页适配 */
.md-main .thread-post {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 24px 28px;
    margin-bottom: 16px;
}
.md-main .reply {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 16px 20px;
    margin-bottom: 8px;
}

/* 表单适配 */
.md-main form .btn,
.md-main form button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #3b82f6;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.md-main form .btn:hover,
.md-main form button[type="submit"]:hover {
    background: #2563eb;
    border-color: #2563eb;
}
.md-main form textarea,
.md-main form input[type="text"],
.md-main form input[type="password"],
.md-main form input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.md-main form textarea:focus,
.md-main form input[type="text"]:focus,
.md-main form input[type="password"]:focus,
.md-main form input[type="email"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* alert 适配 */
.md-main .alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.md-main .alert.success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.md-main .alert.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.md-main .alert.info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* 按钮 */
.md-main .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #3b82f6;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.md-main .btn:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
.md-main .btn-light { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.md-main .btn-light:hover { background: #e5e7eb; color: #1f2937; }
.md-main .btn-small { padding: 5px 12px; font-size: 12px; }

/* 论坛版块卡片适配 */
.md-main .forum-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 10px;
    transition: background 0.12s ease;
}
.md-main .forum-card:hover { background: #f9fafb; }
.md-main .forum-card h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.md-main .forum-card p { font-size: 12px; color: #9ca3af; margin: 0; }
.md-main .forum-card .stats { font-size: 12px; color: #6b7280; }
.md-main .forum-card .stats strong { color: #3b82f6; font-weight: 600; margin: 0 2px 0 4px; }

/* 搜索结果适配 */
.md-main .search-result-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}
.md-main .search-result-item:last-child { border-bottom: none; }

/* 用户卡片适配 */
.md-main .user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 10px;
}

/* 标题筛选下拉 */
.md-main .latest-title-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* 移动端：非首页也保持双栏，但侧边栏移到下方 */
@media (max-width: 768px) {
    .md-main > .grid {
        flex-direction: column;
    }
    .md-main > .grid > aside {
        width: 100%;
    }
    .md-thread-stats {
        flex-direction: row;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #f3f4f6;
        padding-top: 8px;
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================================
   19. 网站介绍 + 首页横幅 + 排行榜页面样式
   ============================================================ */

/* 网站介绍卡片（侧边栏顶部） — 紫色渐变设计 */
.md-site-intro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    overflow: hidden;
}
.md-site-intro-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 12px;
}
.md-site-intro-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: color-mix(in srgb, currentColor 20%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.md-site-intro-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.md-site-intro-icon-text {
    font-size: 22px;
    font-weight: 700;
    color: inherit;
}
.md-site-intro-title-area {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.md-site-intro-name {
    font-size: 16px;
    font-weight: 700;
    color: inherit;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.md-site-intro-tag {
    font-size: 11px;
    color: inherit;
    opacity: 0.7;
    font-weight: 400;
}
.md-site-intro-body {
    padding: 0 18px 18px;
}
.md-site-intro-desc {
    font-size: 13px;
    color: inherit;
    opacity: 0.85;
    line-height: 1.7;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 首页横幅图片 — 固定尺寸 */
.md-banner {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    aspect-ratio: 820 / 250;
    background: #f3f4f6;
}
.md-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 排行榜页面适配（现代风） */
.md-main .rank-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.md-main .rank-grid section.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 20px 24px;
}
.md-main .rank-grid h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eff6ff;
}
.md-main .forum-table {
    width: 100%;
    border-collapse: collapse;
}
.md-main .forum-table th {
    text-align: left;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
}
.md-main .forum-table td {
    padding: 10px 8px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #f9fafb;
}
.md-main .forum-table tr:hover td {
    background: #f9fafb;
}
.md-main .forum-table tr:first-child th {
    border-top: none;
}

@media (max-width: 768px) {
    .md-main .rank-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   20. 侧边栏排行榜Tab切换 + 站长推荐列表
   ============================================================ */

/* 侧边栏排行榜Tab导航 */
.md-sidebar-rank-tabs {
    display: flex;
    border-bottom: 1px solid #f3f4f6;
    overflow-x: auto;
}
.md-sidebar-rank-tab {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.md-sidebar-rank-tab:hover {
    color: #6b7280;
}
.md-sidebar-rank-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

/* 侧边栏排行榜Tab内容 */
.md-sidebar-rank-content {
    display: none;
    padding: 8px 14px;
}
.md-sidebar-rank-content.active {
    display: block;
}

/* 排行榜空状态 */
.md-rank-empty-sidebar {
    text-align: center;
    padding: 20px 0;
    color: #d1d5db;
    font-size: 13px;
}

/* 站长推荐列表 */
.md-recommend-list {
    padding: 4px 0;
}
.md-recommend-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 16px;
    border-bottom: 1px solid #f9fafb;
    transition: background 0.12s ease;
}
.md-recommend-item:last-child {
    border-bottom: none;
}
.md-recommend-item:hover {
    background: #f9fafb;
}
.md-recommend-title {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.md-recommend-item:hover .md-recommend-title {
    color: #3b82f6;
}
.md-recommend-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #9ca3af;
}
.md-rec-forum {
    background: #eff6ff;
    color: #3b82f6;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
}

/* ============================================================
   21. 板块页帖子列表头像 + 版块彩色图标
   ============================================================ */

/* 板块页帖子行 — flex 布局带头像 */
.md-forum-thread-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px;
    padding: 16px 20px !important;
}

/* 板块页帖子头像 */
.md-forum-thread-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #e5e7eb;
}
.md-forum-thread-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.md-forum-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    background: #e5e7eb;
}

/* 版块列表页 — 彩色图标 */
.md-forum-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 10px;
    transition: box-shadow 0.2s ease;
}
.md-forum-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.md-forum-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}
.md-forum-list-body {
    flex: 1;
    min-width: 0;
}
.md-forum-list-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px;
}
.md-forum-list-name a {
    color: #1f2937;
}
.md-forum-list-name a:hover {
    color: #3b82f6;
}
.md-forum-list-desc {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}
.md-forum-list-stats {
    font-size: 12px;
    color: #9ca3af;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}
.md-forum-list-stats strong {
    color: #3b82f6;
    font-size: 14px;
}
.md-forum-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin: 20px 0 10px;
    padding: 8px 0;
    border-bottom: 2px solid #f3f4f6;
}

/* ===== 今日话题 - 首页横幅（现代模版） ===== */
.md-topic-banner { margin-bottom: 16px; background: linear-gradient(135deg, #667eea, #764ba2); border-radius: 12px; padding: 14px 18px; }
.md-topic-banner a { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.md-topic-icon { font-size: 20px; }
.md-topic-title { font-size: 15px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-topic-hint { font-size: 12px; background: rgba(255,255,255,0.2); padding: 3px 10px; border-radius: 20px; white-space: nowrap; }

/* ===== 今日话题专页 - 现代模版覆盖 ===== */
.qf-topic-page { flex: 1; min-width: 0; max-width: 100%; }
.qf-topic-hero { border-radius: 14px; padding: 28px 30px; }
.qf-topic-hero::before { width: 160px; height: 160px; }
.qf-topic-hero-title { font-size: 24px; }
.qf-topic-hero-content { font-size: 15px; }
.qf-topic-replies-head h2 { font-size: 17px; font-weight: 700; color: #1a2b3c; }
.qf-topic-reply-list { border: 1px solid #e8edf3; border-radius: 14px; }
.qf-topic-reply { padding: 16px 18px; border-bottom: 1px solid #f0f3f7; }
.qf-topic-reply-avatar img { width: 42px; height: 42px; }
.qf-topic-reply-avatar .avatar-fallback { width: 42px; height: 42px; background: #e8edf3; color: #7a8a9a; font-size: 16px; }
.qf-topic-reply-nick { color: #1a2b3c; }
.qf-topic-reply-floor { background: #f0f3f7; }
.qf-topic-reply-content { color: #2d3748; }
.qf-topic-reply-content img { border-radius: 8px; }
.qf-topic-empty { padding: 50px 20px; }
.qf-topic-pagination { margin: 18px 0; }
.qf-topic-pagination a, .qf-topic-pagination span { min-width: 34px; height: 34px; border-radius: 8px; border-color: #e8edf3; }
.qf-topic-reply-form { border: 1px solid #e8edf3; border-radius: 14px; padding: 18px 20px; }
.qf-topic-reply-form h3 { font-size: 16px; color: #1a2b3c; }
.qf-topic-reply-form textarea { border-radius: 8px; padding: 12px 14px; min-height: 100px; }
.qf-topic-reply-form .form-hint { border-radius: 8px; }
.qf-topic-reply-form .form-actions button { border-radius: 8px; padding: 10px 28px; transition: background 0.15s; }
.qf-topic-login-tip { border: 1px solid #e8edf3; border-radius: 14px; padding: 24px; }
.qf-topic-reward-flash { border-radius: 12px; padding: 16px 20px; }
.qf-topic-alert { border-radius: 12px; padding: 14px 18px; }
.qf-topic-reply-bonus { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: #d69e2e; background: #fffbeb; border: 1px solid #f6e05e; padding: 2px 8px; border-radius: 10px; }
body.theme-dark .qf-topic-reply-bonus { background: #2d2410; border-color: #6b5e1a; color: #ecc94b; }
