/**
 * BQ Builder — Widget 模块样式
 *
 * 包含 Widget 容器样式、网格布局、空状态提示、
 * 以及常见 WordPress 原生 Widget 的兼容样式。
 */

/* ============ Widget 容器 ============ */

.bq-widget-area-container {
    width: 100%;
    box-sizing: border-box;
}

/* ============ Widget 标题 ============ */

.bq-widget-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #1e293b;
    line-height: 1.4;
}

/* ============ 单个 Widget 容器 ============ */

.bq-widget {
    margin-bottom: 0;
    break-inside: avoid;
    box-sizing: border-box;
}

/* ============ 网格容器 ============ */

.bq-widget-area-grid {
    display: grid;
    width: 100%;
}

/* ============ 移动端单列 ============ */

@media (max-width: 768px) {
    .bq-widget-area-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============ 空状态提示 ============ */

.bq-widget-empty-hint {
    padding: 24px;
    text-align: center;
    background: #f8fafc;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
}

.bq-widget-empty-hint a {
    color: #e8784a;
    text-decoration: underline;
}

.bq-widget-empty-hint a:hover {
    color: #d06a3a;
}

/* ============ 搜索框 Widget ============ */

.bq-widget-area-grid .widget_search .search-form {
    display: flex;
    gap: 8px;
}

.bq-widget-area-grid .widget_search label {
    flex: 1;
}

.bq-widget-area-grid .widget_search input[type="search"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
    box-sizing: border-box;
}

.bq-widget-area-grid .widget_search input[type="search"]:focus {
    border-color: #e8784a;
    box-shadow: 0 0 0 3px rgba(232, 120, 74, 0.1);
}

.bq-widget-area-grid .widget_search input[type="submit"],
.bq-widget-area-grid .widget_search button {
    padding: 10px 16px;
    background: #e8784a;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.bq-widget-area-grid .widget_search input[type="submit"]:hover,
.bq-widget-area-grid .widget_search button:hover {
    background: #d06a3a;
}

/* ============ 列表 Widget（文章、分类、页面、归档、评论、菜单） ============ */

.bq-widget-area-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bq-widget-area-grid ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    line-height: 1.5;
}

.bq-widget-area-grid ul li:last-child {
    border-bottom: none;
}

.bq-widget-area-grid ul li a {
    color: #334155;
    text-decoration: none;
    transition: color 0.15s ease;
}

.bq-widget-area-grid ul li a:hover {
    color: #e8784a;
}

/* 子分类/子菜单缩进 */
.bq-widget-area-grid ul.children,
.bq-widget-area-grid ul.sub-menu {
    margin: 4px 0 0 12px;
}

.bq-widget-area-grid ul.children li:first-child,
.bq-widget-area-grid ul.sub-menu li:first-child {
    border-top: 1px solid #f1f5f9;
    margin-top: 4px;
}

/* ============ 标签云 Widget ============ */

.bq-widget-area-grid .tagcloud {
    line-height: 1.8;
}

.bq-widget-area-grid .tagcloud a {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 6px 6px 0;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 13px !important;
    text-decoration: none;
    transition: all 0.15s ease;
}

.bq-widget-area-grid .tagcloud a:hover {
    background: #e8784a;
    color: #fff;
}

/* ============ 日历 Widget ============ */

.bq-widget-area-grid .widget_calendar table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bq-widget-area-grid .widget_calendar caption {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
}

.bq-widget-area-grid .widget_calendar th,
.bq-widget-area-grid .widget_calendar td {
    text-align: center;
    padding: 6px;
}

.bq-widget-area-grid .widget_calendar th {
    color: #64748b;
    font-weight: 500;
}

.bq-widget-area-grid .widget_calendar td a {
    color: #e8784a;
    font-weight: 600;
    text-decoration: none;
}

.bq-widget-area-grid .widget_calendar #today {
    background: #fef3ee;
    border-radius: 4px;
}

/* ============ RSS Widget ============ */

.bq-widget-area-grid .widget_rss .rss-widget-icon {
    display: none;
}

.bq-widget-area-grid .widget_rss ul li {
    padding: 12px 0;
}

.bq-widget-area-grid .widget_rss .rsswidget {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
}

.bq-widget-area-grid .widget_rss .rsswidget:hover {
    color: #e8784a;
}

.bq-widget-area-grid .widget_rss .rss-date {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.bq-widget-area-grid .widget_rss .rssSummary {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.5;
}

.bq-widget-area-grid .widget_rss cite {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
    font-style: normal;
}

/* ============ 文本/HTML Widget ============ */

.bq-widget-area-grid .widget_text {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

.bq-widget-area-grid .widget_text p {
    margin: 0 0 8px 0;
}

.bq-widget-area-grid .widget_text p:last-child {
    margin-bottom: 0;
}

.bq-widget-area-grid .widget_text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ============ 最新评论 Widget ============ */

.bq-widget-area-grid .widget_recent_comments ul li {
    font-size: 13px;
    color: #64748b;
}

.bq-widget-area-grid .widget_recent_comments .comment-author-link a {
    color: #334155;
    font-weight: 500;
}

.bq-widget-area-grid .widget_recent_comments a {
    color: #e8784a;
    text-decoration: none;
}
