/**
 * law-reader.css - 法规阅读页面专用样式
 * 
 * @author BHD Team
 * @version 1.1
 */

/* 阅读工具栏样式 */
.reading-toolbar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 999;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background-color: transparent;
}

.reading-toolbar.hidden {
    opacity: 0.2;
    transform: translateX(10px);
}

.reading-toolbar .toolbar-btn {
    padding: 4px 8px;
    background-color: #ffffff;
    color: #333;
    border: 1px solid #e67e22;
    border-radius: 20px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    min-width: 60px;
}

.reading-toolbar .toolbar-btn i {
    margin-right: 2px;
    font-size: 10px;
    color: #e67e22;
}

.reading-toolbar .toolbar-btn:hover {
    background-color: #f9f9f9;
}

.font-size-buttons {
    display: flex;
    gap: 6px;
}

/* 字号按钮固定宽度和高度 */
.font-size-increase,
.font-size-decrease {
    width: 50px;
    min-width: 50px;
    height: 24px;
    min-height: 24px;
    flex: none;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 页面检索和返回顶部按钮独立成行 */
.page-search,
.back-to-top {
    width: 100%;
    min-width: 80px;
}

/* 搜索框样式 */
.simple-search {
    position: fixed;
    top: 75px;
    right: 10px;
    left: auto;
    background: white;
    border-radius: 15px;
    border: 1px solid #e67e22;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 8px;
    display: none;
    flex-direction: row;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    width: auto;
    min-width: 280px;
}

.simple-search.active {
    opacity: 1;
    transform: translateY(0);
}

.search-input-container {
    display: flex;
    align-items: center;
    margin-right: 8px;
    flex: 1;
    justify-content: flex-end;
}

#search-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 14px;
    width: 120px;
    transition: width 0.2s ease;
    direction: ltr;
}

#search-input:focus {
    width: 160px;
    outline: none;
    border-color: #e67e22;
}

#search-counter {
    margin: 0 8px;
    font-size: 12px;
    color: #555;
    min-width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.search-navigation {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

#search-btn {
    background: #e67e22;
    border: none;
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
    width: 26px;
    height: 26px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

#search-btn:hover {
    background: #d35400;
}

.search-navigation button {
    background: transparent;
    border: none;
    padding: 4px;
    font-size: 14px;
    width: 24px;
    height: 24px;
    color: #e67e22;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}

.search-navigation button:hover {
    background: rgba(230, 126, 34, 0.1);
}

/* 高亮样式 */
.highlighted-text {
    background-color: #ffeb3b;
    color: #000;
}

.highlighted-text.active-match {
    background-color: #ff9800;
    color: #000;
    box-shadow: 0 0 5px rgba(255, 152, 0, 0.5);
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .reading-toolbar {
        bottom: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .reading-toolbar .toolbar-btn {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 60px;
    }
    
    .reading-toolbar .toolbar-btn i {
        font-size: 10px;
        margin-right: 2px;
    }
    
    /* 移动端字号按钮固定宽度和高度 */
    .font-size-increase,
    .font-size-decrease {
        width: 48px;
        min-width: 48px;
        height: 22px;
        min-height: 22px;
        max-height: 22px;
        flex: none;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        box-sizing: border-box;
        vertical-align: top;
        font-size: 10px !important;
    }
    
    .page-search,
    .back-to-top {
        width: 100%;
        min-width: 70px;
    }
    
    /* 移动端搜索框样式 */
    .simple-search {
        top: 60px;
        right: 10px;
        left: auto;
        max-width: 200px;
        width: auto;
        padding: 4px;
        border-radius: 12px;
        display: flex;
        align-items: center;
    }
    
    .search-input-container {
        margin-right: 4px;
        display: flex;
        align-items: center;
    }
    
    #search-input {
        width: 60px;
        padding: 3px 6px;
        font-size: 11px;
        border-radius: 12px;
        border: 1px solid #ddd;
    }
    
    #search-counter {
        margin: 0 4px;
        font-size: 10px;
        min-width: 30px;
        text-align: center;
    }
    
    .search-navigation {
        gap: 2px;
        display: flex;
        align-items: center;
    }
    
    #search-btn {
        background: #e67e22;
        border: none;
        border-radius: 4px;
        padding: 4px;
        font-size: 10px;
        width: 20px;
        height: 20px;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #search-btn:hover {
        background: #d35400;
    }
    
    .search-navigation button {
        background: transparent;
        border: none;
        padding: 2px;
        font-size: 12px;
        width: 18px;
        height: 18px;
        color: #e67e22;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    
    .search-navigation button:hover {
        background: rgba(230, 126, 34, 0.1);
        border-radius: 2px;
    }
}

/* 法规内容样式 */
.law-content {
    padding: 20px;
    line-height: 1.6;
}

/* 字体大小指示器 */
#font-size-indicator {
    opacity: 0;
}

/* 移动端子菜单修复 - 确保正确显示/隐藏 */
.mobile-menu .has-submenu.active .mobile-submenu {
    display: block !important;
} 