/* DIY布局系统样式修复 */

/* 1. 修复文章页右侧边栏样式错位问题 */
.article-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-layout {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.article-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* 修复侧边栏组件样式 */
.sidebar .widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar .widget-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 8px;
}

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

.sidebar .article-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.sidebar .article-list li:last-child {
    border-bottom: none;
}

.sidebar .article-list a {
    text-decoration: none;
    color: #333;
    display: block;
}

.sidebar .article-list h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.sidebar .article-list time {
    font-size: 12px;
    color: #666;
}

.sidebar .article-list a:hover h4 {
    color: #007cba;
}

/* 2. 修复分类页搜索字段样式 - 增强版 */
.search-box {
    position: relative;
    margin-left: auto;
}

.search-form {
    display: flex;
    background: #f5f5f5;
    border-radius: 25px;
    overflow: hidden;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.search-input {
    padding: 8px 15px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 200px;
    transition: width 0.3s ease;
    color: #333;
}

.search-input:focus {
    width: 250px;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    padding: 8px 12px;
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 0 25px 25px 0;
}

.search-btn:hover {
    background: #005a8b;
}

/* 侧边栏搜索框样式优化 */
.sidebar .widget .search-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.sidebar .widget .search-form:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.sidebar .widget .search-form input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
}

.sidebar .widget .search-form input::placeholder {
    color: #999;
}

.sidebar .widget .search-form button {
    padding: 12px 15px;
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 14px;
    min-width: 60px;
}

.sidebar .widget .search-form button:hover {
    background: #005a8b;
}

/* 搜索页面搜索框样式 */
.search-page .search-form-main {
    max-width: 600px;
    margin: 20px auto;
    padding: 0 20px;
}

.search-page .search-input-group {
    display: flex;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-page .search-input-group:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.search-page .search-input-group input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 16px;
    color: #333;
}

.search-page .search-input-group input::placeholder {
    color: #999;
}

.search-page .search-input-group button {
    padding: 15px 25px;
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.search-page .search-input-group button:hover {
    background: #005a8b;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

/* 3. 修复DIY版块样式 - 增强版智能适配 */
.diy-widget, .widget.layout-widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    transition: box-shadow 0.3s ease;
}

.diy-widget:hover, .widget.layout-widget:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 智能标题样式适配 */
.diy-widget-title,
.diy-widget .widget-title,
.widget.layout-widget .widget-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 8px;
    position: relative;
    text-align: left;
}

/* 为不同页面类型的标题提供更好的适配 */
.category-page .widget-title,
.article-page .widget-title,
.search-page .widget-title {
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.diy-widget-content,
.diy-widget .widget-content,
.widget.layout-widget .widget-content {
    line-height: 1.6;
    color: #555;
}

/* 主题自适应样式 */
.theme-adaptive {
    font-family: inherit;
    color: inherit;
}

.theme-adaptive a {
    color: #007cba;
    text-decoration: none;
}

.theme-adaptive a:hover {
    color: #005a8b;
    text-decoration: underline;
}

/* 响应式组件样式 */
.responsive-widget {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 特定组件类型样式适配 */
.article-style .widget-content {
    padding: 0;
}

.article-style .article-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.article-style .article-item:last-child {
    border-bottom: none;
}

.navigation-style .widget-content {
    padding: 0;
}

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

.navigation-style li {
    border-bottom: 1px solid #f0f0f0;
}

.navigation-style li:last-child {
    border-bottom: none;
}

.navigation-style a {
    display: block;
    padding: 10px 0;
    transition: color 0.2s ease;
}

.navigation-style a:hover {
    color: #007cba;
}

.tag-style .widget-content {
    padding: 0;
}

.tag-style .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-style .tag-item {
    display: inline-block;
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.tag-style .tag-item:hover {
    background: #e9ecef;
    border-color: #d0d0d0;
}

.form-style .widget-content {
    padding: 0;
}

.form-style .search-form {
    display: flex;
    gap: 8px;
}

.form-style .search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-style .search-btn {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.form-style .search-btn:hover {
    background: #005a8b;
}

/* 内容类型特定样式 */
.content-widget .article-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.content-widget .article-item {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.content-widget .article-item:last-child {
    border-bottom: none;
}

.content-widget .article-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 5px;
}

.content-widget .article-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.content-widget .article-excerpt {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

/* DIY文章列表样式 */
.diy-article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.diy-article-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.diy-article-item:last-child {
    border-bottom: none;
}

.diy-article-item a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    flex: 1;
    display: block;
    line-height: 1.4;
}

.diy-article-item a:hover {
    color: #007cba;
}

.diy-article-meta {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

/* DIY热门标签样式 */
.diy-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.diy-tag-cloud .tag {
    display: inline-block;
    padding: 4px 8px;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.diy-tag-cloud .tag:hover {
    background: #007cba;
    color: white;
}

/* DIY搜索框样式 */
.diy-search-form {
    display: flex;
    gap: 8px;
}

.diy-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.diy-search-input:focus {
    border-color: #007cba;
}

.diy-search-btn {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.diy-search-btn:hover {
    background: #005a8b;
}

/* DIY分类导航样式 */
.diy-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.diy-category-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.diy-category-item:last-child {
    border-bottom: none;
}

.diy-category-link {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diy-category-link:hover {
    color: #007cba;
}

.diy-category-count {
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 4. 响应式设计 */
@media (max-width: 768px) {
    .content-layout {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .search-input {
        width: 150px;
    }
    
    .search-input:focus {
        width: 180px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        order: 2;
    }
    
    .search-box {
        order: 3;
        margin-left: 0;
    }
}

/* 5. 修复导航菜单样式 */
.nav-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 20px;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #007cba;
    color: white;
}

.nav-link.active {
    background: #007cba;
    color: white;
}

/* 6. 修复头部布局 */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo span {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 7. 修复主内容区域样式 */
.main-content {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* 8. 修复DIY组件在不同位置的样式 */
.diy-component {
    margin-bottom: 20px;
}

.diy-component:last-child {
    margin-bottom: 0;
}

/* 主内容区域的DIY组件 */
.content .diy-component {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

/* 侧边栏的DIY组件 */
.sidebar .diy-component {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

/* 9. 修复分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.pagination .current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* 10. 修复面包屑导航样式 */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #007cba;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

.breadcrumb .current {
    color: #333;
    font-weight: 500;
} 