/**
 * Moedes UI组件样式
 * 专注于用户界面交互组件
 */

/* ============================================
   下拉菜单和交互组件
   ============================================ */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 120px;
    margin-top: 2px;
}

.dropdown.show .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: #ff9800;
}

/* 右侧按钮区域 */
.forum-header .more-btns {
    position: absolute;
    top: 8px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 25;
}

/* 关注按钮 */
.forum-header .more-btns .btn-follow {
    color: #333;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 4px 8px;
    transition: all 0.3s ease;
    font-size: 11px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.forum-header .more-btns .btn-follow:hover {
    background: #e9ecef;
    color: #000;
    border-color: #adb5bd;
}

/* 下拉菜单按钮 */
.forum-header .more-btns .dropdown > a {
    color: #333;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 4px 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.forum-header .more-btns .dropdown > a:hover {
    background: #e9ecef;
    color: #000;
    border-color: #adb5bd;
}

/* ============================================
   视图切换按钮
   ============================================ */

.moedes-view-toggle-wrapper {
    margin-left: 10px;
}

.moedes-view-toggle-group {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.moedes-view-btn {
    background: #fff;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #ddd;
}

.moedes-view-btn:last-child {
    border-right: none;
}

.moedes-view-btn:hover {
    background: #f5f5f5;
}

.moedes-view-btn.active {
    background: #ff9800;
    color: white;
}

.moedes-view-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ============================================
   返回顶部按钮
   ============================================ */

#move-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #ff9800;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

#move-to-top:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

/* ============================================
   目录功能样式
   ============================================ */

.toc-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    position: relative;
}

.toc-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 5px 0;
    padding-left: 15px;
    position: relative;
}

.toc-list li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #ff9800;
    font-size: 12px;
}

.toc-list a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.toc-list a:hover {
    color: #ff9800;
}

/* ============================================
   确保层级显示正确
   ============================================ */

.dropdown-menu,
.forum-header-dropdown {
    z-index: 1000;
}

.forum-toolbar {
    z-index: 100;
}

/* 过渡动画优化 */
.forum-header * {
    transition: all 0.3s ease;
}

/* 鼠标悬停整体效果 */
.forum-header:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}