/* 
 * WordPress内置小工具样式优化
 * 参考 themebetter.com/nab 设计
 */

/* 通用小工具样式 - 最重要，放在最前面 */
.sidebar-widgets .widget,
aside .widget,
.widget {
    background: #fff !important;
    padding: 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 20px !important;
}

.sidebar-widgets .widget:last-child {
    margin-bottom: 0 !important;
}

/* 小工具标题通用样式 */
.widget .widget-title,
.widget h2,
.widget h3 {
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: 0 0 15px 0 !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #f0f0f0 !important;
    display: flex !important;
    align-items: center !important;
}

/* 近期文章小工具 */
.widget_recent_entries .widget-title:before {
    content: "\f0c5";
    font-family: "FontAwesome";
    margin-right: 8px;
    color: #5b7cff;
}

.widget_recent_entries ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.widget_recent_entries ul li {
    margin-bottom: 16px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.widget_recent_entries ul li:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.widget_recent_entries ul li a {
    color: #333 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-break: break-word !important;
}

.widget_recent_entries ul li a:hover {
    color: #5b7cff !important;
}

.widget_recent_entries ul li .post-date {
    display: block !important;
    font-size: 12px !important;
    color: #999 !important;
    margin-top: 6px !important;
}

.widget_recent_entries ul li .post-date:before {
    content: "🕐";
    margin-right: 4px;
}

/* 分类小工具 */
.widget_categories .widget-title:before {
    content: "\f07b";
    font-family: "FontAwesome";
    margin-right: 8px;
    color: #5b7cff;
}

.widget_categories ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.widget_categories ul li {
    margin-bottom: 10px !important;
}

.widget_categories ul li a {
    color: #333 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    transition: color 0.3s !important;
}

.widget_categories ul li a:hover {
    color: #5b7cff !important;
}

/* 标签云小工具 */
.widget_tag_cloud .widget-title:before {
    content: "\f02c";
    font-family: "FontAwesome";
    margin-right: 8px;
    color: #5b7cff;
}

.widget_tag_cloud .tagcloud a {
    display: inline-block !important;
    padding: 6px 12px !important;
    margin: 4px !important;
    background: #f5f5f5 !important;
    border-radius: 4px !important;
    color: #666 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    transition: all 0.3s !important;
}

.widget_tag_cloud .tagcloud a:hover {
    background: #5b7cff !important;
    color: #fff !important;
}

/* 搜索小工具 */
.widget_search .widget-title:before {
    content: "\f002";
    font-family: "FontAwesome";
    margin-right: 8px;
    color: #5b7cff;
}

.widget_search .search-form {
    position: relative;
}

.widget_search .search-form input[type="search"] {
    width: 100% !important;
    padding: 10px 40px 10px 15px !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    transition: border-color 0.3s !important;
}

.widget_search .search-form input[type="search"]:focus {
    outline: none !important;
    border-color: #5b7cff !important;
}

.widget_search .search-form button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
}

.widget_search .search-form button:hover {
    color: #5b7cff;
}

/* 日历小工具 */
.widget_calendar table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.widget_calendar th,
.widget_calendar td {
    padding: 8px !important;
    text-align: center !important;
    border: 1px solid #f0f0f0 !important;
}

.widget_calendar caption {
    font-weight: 600 !important;
    margin-bottom: 10px !important;
}

/* 归档小工具 */
.widget_archive ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.widget_archive ul li {
    margin-bottom: 10px !important;
}

.widget_archive ul li a {
    color: #333 !important;
    text-decoration: none !important;
    font-size: 14px !important;
}

.widget_archive ul li a:hover {
    color: #5b7cff !important;
}

/* Meta小工具 */
.widget_meta ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.widget_meta ul li {
    margin-bottom: 10px !important;
}

.widget_meta ul li a {
    color: #333 !important;
    text-decoration: none !important;
    font-size: 14px !important;
}

.widget_meta ul li a:hover {
    color: #5b7cff !important;
}

/* 侧边栏容器 */
.sidebar-widgets {
    padding: 0 !important;
}