/**
 * DripSafe Widgets - 样式文件
 * 
 * 设计原则：
 * - 科技蓝配色（#0066CC为主色）
 * - 卡片式设计
 * - 轻量级（不影响网站性能）
 * - 响应式布局
 */

/* ==================== 变量定义 ==================== */
:root {
    --dripsafe-primary: #0066CC;
    --dripsafe-primary-dark: #003366;
    --dripsafe-primary-light: #6699CC;
    --dripsafe-secondary: #336699;
    --dripsafe-accent: #FF6B35;
    --dripsafe-bg: #f8fbff;
    --dripsafe-bg-light: #ffffff;
    --dripsafe-text: #333333;
    --dripsafe-text-light: #666666;
    --dripsafe-border: #e0e6ed;
    --dripsafe-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
    --dripsafe-shadow-hover: 0 4px 16px rgba(0, 102, 204, 0.15);
    --dripsafe-radius: 8px;
    --dripsafe-radius-lg: 12px;
    --dripsafe-transition: all 0.3s ease;
}

/* ==================== 基础样式 ==================== */
.dripsafe-widget {
    background: var(--dripsafe-bg-light);
    border-radius: var(--dripsafe-radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--dripsafe-shadow);
    transition: var(--dripsafe-transition);
}

.dripsafe-widget:hover {
    box-shadow: var(--dripsafe-shadow-hover);
}

.dripsafe-widget .widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dripsafe-primary-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--dripsafe-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 点小安早报 ==================== */
.dripsafe-morning-news {
    background: linear-gradient(135deg, var(--dripsafe-bg) 0%, var(--dripsafe-bg-light) 100%);
}

.dripsafe-morning-news .morning-news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--dripsafe-border);
}

.dripsafe-morning-news .news-date {
    font-size: 14px;
    color: var(--dripsafe-text-light);
}

.dripsafe-morning-news .news-weekday {
    display: inline-block;
    background: var(--dripsafe-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.dripsafe-morning-news .news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dripsafe-morning-news .news-item {
    padding: 12px 0;
    border-bottom: 1px dashed var(--dripsafe-border);
    transition: var(--dripsafe-transition);
}

.dripsafe-morning-news .news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dripsafe-morning-news .news-item:hover {
    padding-left: 8px;
}

.dripsafe-morning-news .news-category {
    display: inline-block;
    background: var(--dripsafe-bg);
    color: var(--dripsafe-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

.dripsafe-morning-news .news-item.hot .news-category {
    background: var(--dripsafe-accent);
    color: white;
}

.dripsafe-morning-news .news-title {
    font-size: 14px;
    color: var(--dripsafe-text);
    text-decoration: none;
    display: block;
    margin: 6px 0;
    line-height: 1.5;
}

.dripsafe-morning-news .news-title:hover {
    color: var(--dripsafe-primary);
}

.dripsafe-morning-news .news-summary {
    font-size: 12px;
    color: var(--dripsafe-text-light);
    line-height: 1.6;
    margin: 0;
}

/* ==================== 热门文章 ==================== */
.dripsafe-popular-posts .popular-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dripsafe-popular-posts .popular-post-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--dripsafe-border);
    transition: var(--dripsafe-transition);
}

.dripsafe-popular-posts .popular-post-item:last-child {
    border-bottom: none;
}

.dripsafe-popular-posts .popular-post-item:hover {
    background: var(--dripsafe-bg);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: var(--dripsafe-radius);
}

.dripsafe-popular-posts .post-rank {
    width: 24px;
    height: 24px;
    background: var(--dripsafe-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.dripsafe-popular-posts .popular-post-item:nth-child(1) .post-rank {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.dripsafe-popular-posts .popular-post-item:nth-child(2) .post-rank {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
}

.dripsafe-popular-posts .popular-post-item:nth-child(3) .post-rank {
    background: linear-gradient(135deg, #CD7F32, #B87333);
}

.dripsafe-popular-posts .post-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--dripsafe-radius);
    margin-right: 12px;
}

.dripsafe-popular-posts .post-content {
    flex: 1;
}

.dripsafe-popular-posts .post-title {
    font-size: 14px;
    color: var(--dripsafe-text);
    text-decoration: none;
    display: block;
    line-height: 1.5;
    margin-bottom: 4px;
}

.dripsafe-popular-posts .post-title:hover {
    color: var(--dripsafe-primary);
}

.dripsafe-popular-posts .post-views {
    font-size: 12px;
    color: var(--dripsafe-text-light);
}

.dripsafe-popular-posts .post-views::before {
    content: '👁 ';
}

/* ==================== 相关文章 ==================== */
.dripsafe-related-posts .related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dripsafe-related-posts .related-post-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--dripsafe-border);
}

.dripsafe-related-posts .related-post-item:last-child {
    border-bottom: none;
}

.dripsafe-related-posts .related-post-link {
    display: flex;
    text-decoration: none;
    color: var(--dripsafe-text);
    transition: var(--dripsafe-transition);
}

.dripsafe-related-posts .related-post-link:hover {
    color: var(--dripsafe-primary);
}

.dripsafe-related-posts .related-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--dripsafe-radius);
    margin-right: 12px;
}

.dripsafe-related-posts .related-content {
    flex: 1;
}

.dripsafe-related-posts .related-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.dripsafe-related-posts .related-date {
    font-size: 12px;
    color: var(--dripsafe-text-light);
}

.dripsafe-related-posts .related-excerpt {
    font-size: 12px;
    color: var(--dripsafe-text-light);
    margin-top: 6px;
    line-height: 1.6;
}

/* ==================== 文章目录 ==================== */
.dripsafe-toc .toc-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

.dripsafe-toc .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dripsafe-toc .toc-item {
    padding: 8px 0;
    border-left: 2px solid var(--dripsafe-border);
    transition: var(--dripsafe-transition);
}

.dripsafe-toc .toc-item.level-2 {
    padding-left: 12px;
}

.dripsafe-toc .toc-item.level-3 {
    padding-left: 24px;
}

.dripsafe-toc .toc-item.level-4 {
    padding-left: 36px;
}

.dripsafe-toc .toc-item:hover {
    border-left-color: var(--dripsafe-primary);
    background: var(--dripsafe-bg);
}

.dripsafe-toc .toc-link {
    color: var(--dripsafe-text);
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 2px 8px;
}

.dripsafe-toc .toc-link:hover {
    color: var(--dripsafe-primary);
}

.dripsafe-toc .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.dripsafe-toc .toc-toggle-icon {
    transition: transform 0.3s ease;
}

.dripsafe-toc .toc-collapsed .toc-toggle-icon {
    transform: rotate(180deg);
}

.dripsafe-toc .toc-collapsed .toc-list {
    display: none;
}

/* ==================== 作者信息卡 ==================== */
.dripsafe-author-card .author-wrapper {
    text-align: center;
}

.dripsafe-author-card .author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: block;
    border: 3px solid var(--dripsafe-primary);
    padding: 2px;
}

.dripsafe-author-card .author-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dripsafe-primary-dark);
    margin: 0 0 8px 0;
}

.dripsafe-author-card .author-bio {
    font-size: 13px;
    color: var(--dripsafe-text-light);
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.dripsafe-author-card .author-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.dripsafe-author-card .stat-item {
    text-align: center;
}

.dripsafe-author-card .stat-number {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--dripsafe-primary);
}

.dripsafe-author-card .stat-label {
    font-size: 11px;
    color: var(--dripsafe-text-light);
}

.dripsafe-author-card .author-social {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.dripsafe-author-card .social-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dripsafe-bg);
    border-radius: 50%;
    color: var(--dripsafe-text-light);
    text-decoration: none;
    transition: var(--dripsafe-transition);
}

.dripsafe-author-card .social-link:hover {
    background: var(--dripsafe-primary);
    color: white;
}

/* ==================== 社交分享 ==================== */
.dripsafe-social-share .share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dripsafe-social-share .share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--dripsafe-radius);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--dripsafe-transition);
    cursor: pointer;
    border: none;
}

.dripsafe-social-share .share-btn.wechat {
    background: #07C160;
    color: white;
}

.dripsafe-social-share .share-btn.weibo {
    background: #E6162D;
    color: white;
}

.dripsafe-social-share .share-btn.twitter {
    background: #1DA1F2;
    color: white;
}

.dripsafe-social-share .share-btn.linkedin {
    background: #0077B5;
    color: white;
}

.dripsafe-social-share .share-btn.facebook {
    background: #1877F2;
    color: white;
}

.dripsafe-social-share .share-btn.copy {
    background: var(--dripsafe-bg);
    color: var(--dripsafe-text);
    border: 1px solid var(--dripsafe-border);
}

.dripsafe-social-share .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dripsafe-social-share .share-btn.style-icons {
    width: 36px;
    height: 36px;
    padding: 0;
}

.dripsafe-social-share .share-btn.style-text {
    background: transparent;
    color: var(--dripsafe-text);
}

.dripsafe-social-share .share-btn.style-text:hover {
    color: var(--dripsafe-primary);
}

/* ==================== 标签云 ==================== */
.dripsafe-tag-cloud .tag-cloud-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dripsafe-tag-cloud .tag-link {
    display: inline-block;
    padding: 6px 12px;
    background: var(--dripsafe-bg);
    color: var(--dripsafe-text);
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: var(--dripsafe-transition);
    border: 1px solid var(--dripsafe-border);
}

.dripsafe-tag-cloud .tag-link:hover {
    background: var(--dripsafe-primary);
    color: white;
    border-color: var(--dripsafe-primary);
}

.dripsafe-tag-cloud .tag-link.colorful:nth-child(6n+1) {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #90caf9;
}

.dripsafe-tag-cloud .tag-link.colorful:nth-child(6n+2) {
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #ce93d8;
}

.dripsafe-tag-cloud .tag-link.colorful:nth-child(6n+3) {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

.dripsafe-tag-cloud .tag-link.colorful:nth-child(6n+4) {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffcc80;
}

.dripsafe-tag-cloud .tag-link.colorful:nth-child(6n+5) {
    background: #fce4ec;
    color: #c2185b;
    border-color: #f48fb1;
}

.dripsafe-tag-cloud .tag-link.colorful:nth-child(6n+6) {
    background: #e0f7fa;
    color: #00838f;
    border-color: #80deea;
}

.dripsafe-tag-cloud .tag-link.colorful:hover {
    background: var(--dripsafe-primary) !important;
    color: white !important;
    border-color: var(--dripsafe-primary) !important;
}

.dripsafe-tag-cloud .tag-count {
    display: inline-block;
    background: var(--dripsafe-primary);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 4px;
}

/* ==================== 搜索框 ==================== */
.dripsafe-search .search-form {
    position: relative;
}

.dripsafe-search .search-input-wrapper {
    position: relative;
}

.dripsafe-search .search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--dripsafe-border);
    border-radius: var(--dripsafe-radius);
    font-size: 14px;
    transition: var(--dripsafe-transition);
    outline: none;
}

.dripsafe-search .search-input:focus {
    border-color: var(--dripsafe-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.dripsafe-search .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dripsafe-text-light);
    pointer-events: none;
}

.dripsafe-search .search-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    padding: 0 16px;
    background: var(--dripsafe-primary);
    color: white;
    border: none;
    border-radius: calc(var(--dripsafe-radius) - 2px);
    cursor: pointer;
    transition: var(--dripsafe-transition);
}

.dripsafe-search .search-btn:hover {
    background: var(--dripsafe-primary-dark);
}

.dripsafe-search .search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--dripsafe-border);
    border-top: none;
    border-radius: 0 0 var(--dripsafe-radius) var(--dripsafe-radius);
    box-shadow: var(--dripsafe-shadow);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.dripsafe-search .search-suggestions.active {
    display: block;
}

.dripsafe-search .suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--dripsafe-transition);
    border-bottom: 1px solid var(--dripsafe-border);
}

.dripsafe-search .suggestion-item:last-child {
    border-bottom: none;
}

.dripsafe-search .suggestion-item:hover {
    background: var(--dripsafe-bg);
}

.dripsafe-search .suggestion-title {
    font-size: 14px;
    color: var(--dripsafe-text);
    margin-bottom: 4px;
}

.dripsafe-search .suggestion-excerpt {
    font-size: 12px;
    color: var(--dripsafe-text-light);
}

.dripsafe-search .popular-searches {
    margin-top: 12px;
}

.dripsafe-search .popular-label {
    font-size: 12px;
    color: var(--dripsafe-text-light);
    margin-bottom: 8px;
}

.dripsafe-search .popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dripsafe-search .popular-tag {
    padding: 4px 10px;
    background: var(--dripsafe-bg);
    color: var(--dripsafe-text-light);
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--dripsafe-transition);
}

.dripsafe-search .popular-tag:hover {
    background: var(--dripsafe-primary);
    color: white;
}

.dripsafe-search .search-style-rounded .search-input {
    border-radius: 24px;
}

.dripsafe-search .search-style-rounded .search-btn {
    border-radius: 20px;
}

/* ==================== 最新评论 ==================== */
.dripsafe-recent-comments .comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dripsafe-recent-comments .comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--dripsafe-border);
}

.dripsafe-recent-comments .comment-item:last-child {
    border-bottom: none;
}

.dripsafe-recent-comments .comment-wrapper {
    display: flex;
    gap: 12px;
}

.dripsafe-recent-comments .comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dripsafe-recent-comments .comment-content {
    flex: 1;
}

.dripsafe-recent-comments .comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--dripsafe-primary-dark);
    margin-bottom: 4px;
}

.dripsafe-recent-comments .comment-text {
    font-size: 13px;
    color: var(--dripsafe-text);
    line-height: 1.5;
    margin-bottom: 4px;
}

.dripsafe-recent-comments .comment-meta {
    font-size: 11px;
    color: var(--dripsafe-text-light);
}

.dripsafe-recent-comments .comment-post {
    color: var(--dripsafe-primary);
    text-decoration: none;
}

.dripsafe-recent-comments .comment-post:hover {
    text-decoration: underline;
}

/* ==================== 订阅表单 ==================== */
.dripsafe-subscribe .subscribe-wrapper {
    text-align: center;
}

.dripsafe-subscribe .subscribe-icon {
    font-size: 48px;
    color: var(--dripsafe-primary);
    margin-bottom: 12px;
}

.dripsafe-subscribe .subscribe-description {
    font-size: 14px;
    color: var(--dripsafe-text-light);
    margin-bottom: 16px;
    line-height: 1.6;
}

.dripsafe-subscribe .subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dripsafe-subscribe .subscribe-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--dripsafe-border);
    border-radius: var(--dripsafe-radius);
    font-size: 14px;
    transition: var(--dripsafe-transition);
    outline: none;
}

.dripsafe-subscribe .subscribe-input:focus {
    border-color: var(--dripsafe-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.dripsafe-subscribe .subscribe-btn {
    width: 100%;
    padding: 12px 24px;
    background: var(--dripsafe-primary);
    color: white;
    border: none;
    border-radius: var(--dripsafe-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--dripsafe-transition);
}

.dripsafe-subscribe .subscribe-btn:hover {
    background: var(--dripsafe-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.dripsafe-subscribe .subscribe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.dripsafe-subscribe .subscribe-message {
    padding: 12px;
    border-radius: var(--dripsafe-radius);
    font-size: 13px;
    display: none;
}

.dripsafe-subscribe .subscribe-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    display: block;
}

.dripsafe-subscribe .subscribe-message.error {
    background: #ffebee;
    color: #c62828;
    display: block;
}

.dripsafe-subscribe .subscribe-privacy {
    font-size: 11px;
    color: var(--dripsafe-text-light);
    margin-top: 8px;
}

.dripsafe-subscribe .subscribe-style-rounded .subscribe-input,
.dripsafe-subscribe .subscribe-style-rounded .subscribe-btn {
    border-radius: 24px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .dripsafe-widget {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .dripsafe-morning-news .news-title {
        font-size: 13px;
    }
    
    .dripsafe-popular-posts .post-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .dripsafe-social-share .share-buttons {
        justify-content: center;
    }
    
    .dripsafe-author-card .author-stats {
        gap: 16px;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dripsafe-widget {
    animation: fadeIn 0.3s ease;
}

/* ==================== 深色模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --dripsafe-bg: #1a1a1a;
        --dripsafe-bg-light: #2d2d2d;
        --dripsafe-text: #e0e0e0;
        --dripsafe-text-light: #a0a0a0;
        --dripsafe-border: #404040;
    }
}
