/* Common CSS Styles for Templates */

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
}

.search-modal.active {
    display: block;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.search-modal-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F4F9F8;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-header {
    padding: 15px;
    background-color: #F4F9F8;
    border-bottom: 1px solid #DEDEDE;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    left: 12px;
    color: #999;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    border: 1px solid #DEDEDE;
    border-radius: 4px;
    font-size: 16px;
    background-color: #fff;
    color: #333;
    outline: none;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #072D4B;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.search-clear-btn:hover {
    color: #333;
}

.search-close-btn {
    background: none;
    border: none;
    color: #072D4B;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    white-space: nowrap;
}

.search-close-btn:hover {
    opacity: 0.8;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #F4F9F8;
}

.search-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.search-placeholder svg {
    margin-bottom: 16px;
    color: #999;
}

.search-placeholder p {
    font-size: 14px;
    margin: 0;
}

.search-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.search-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.search-no-results p {
    font-size: 14px;
    margin: 0;
}

/* Search Results News Item Styles (used by both templates) */
.news-item {
    display: flex;
    padding: 16px;
    margin-bottom: 16px;
    gap: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    background-color: #fff;
    border-radius: 0;
    box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.04);
}

.news-item:hover {
    background-color: #fafafa;
}

.news-item:last-child {
    margin-bottom: 0;
}

/* 类型1：无缩略图，标题+内容+底部 */
.news-item.type-1 {
    flex-direction: column;
    gap: 0;
}

/* 类型2：有缩略图，左侧封面+右侧内容 */
.news-item.type-2 {
    flex-direction: row;
}

.news-thumbnail {
    flex-shrink: 0;
    width: 118px;
    height: 132px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.news-item.type-1 .news-thumbnail {
    display: none;
}

.news-item.type-2 .news-thumbnail {
    display: block;
}

.news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-thumbnail.empty {
    background-color: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-thumbnail.empty::after {
    content: '📰';
    font-size: 32px;
    opacity: 0.3;
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.news-item.type-1 .news-content {
    width: 100%;
}

.news-item.type-2 .news-content {
    flex: 1;
}

.news-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-snippet {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #999;
    margin-top: auto;
}

.news-source {
    font-weight: 500;
}

.news-time {
    color: #999;
}
