/**
 * DripSafe Main Styles - Components & Pages
 * Version: 1.0.0
 * Requires: variables.css, base.css
 */

/* ============================
   Header
   ============================ */

.ds-header {
    background-color: var(--ds-bg-primary);
    border-bottom: 1px solid var(--ds-border);
    position: sticky;
    top: 0;
    z-index: var(--ds-z-sticky);
}

.ds-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ds-spacing-4) 0;
}

.ds-header__logo {
    display: flex;
    align-items: center;
    gap: var(--ds-spacing-2);
}

.ds-header__logo img {
    height: 40px;
    width: auto;
}

.ds-header__logo-text {
    font-size: var(--ds-text-xl);
    font-weight: var(--ds-font-bold);
    color: var(--ds-brand);
}

.ds-header__nav {
    display: flex;
    align-items: center;
    gap: var(--ds-spacing-6);
}

.ds-header__menu {
    display: flex;
    gap: var(--ds-spacing-4);
}

.ds-header__menu-item {
    color: var(--ds-text-secondary);
    font-weight: var(--ds-font-medium);
    transition: color var(--ds-transition) var(--ds-ease);
}

.ds-header__menu-item:hover,
.ds-header__menu-item.current {
    color: var(--ds-primary);
}

/* ============================
   Hero Section
   ============================ */

.ds-hero {
    background: linear-gradient(135deg, var(--ds-brand) 0%, var(--ds-primary) 100%);
    padding: var(--ds-spacing-16) 0;
    min-height: 480px;
    display: flex;
    align-items: center;
    color: var(--ds-text-inverse);
}

.ds-hero__container {
    width: 100%;
}

.ds-hero__content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.ds-hero__title {
    font-size: var(--ds-text-5xl);
    font-weight: var(--ds-font-bold);
    margin-bottom: var(--ds-spacing-4);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ds-hero__subtitle {
    font-size: var(--ds-text-lg);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto var(--ds-spacing-8);
}

.ds-hero__search {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255,255,255,0.95);
    border-radius: var(--ds-radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.ds-hero__search input {
    flex: 1;
    padding: var(--ds-spacing-4) var(--ds-spacing-6);
    border: none;
    background: transparent;
    font-size: var(--ds-text-base);
    color: var(--ds-text-primary);
}

.ds-hero__search input::placeholder {
    color: var(--ds-gray-500);
}

.ds-hero__search input:focus {
    outline: none;
}

.ds-hero__search button {
    padding: var(--ds-spacing-4) var(--ds-spacing-6);
    background: var(--ds-primary);
    border: none;
    color: white;
    cursor: pointer;
    transition: background var(--ds-transition);
}

.ds-hero__search button:hover {
    background: var(--ds-primary-dark);
}

/* 响应式 */
@media (max-width: 768px) {
    .ds-hero {
        min-height: 400px;
        padding: var(--ds-spacing-8) 0;
    }
    .ds-hero__title {
        font-size: var(--ds-text-4xl);
    }
    .ds-hero__search {
        flex-direction: column;
        border-radius: var(--ds-radius-lg);
    }
    .ds-hero__search input {
        padding: var(--ds-spacing-3) var(--ds-spacing-4);
    }
    .ds-hero__search button {
        padding: var(--ds-spacing-3);
    }
}

/* ============================
   Content Area
   ============================ */

.ds-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: var(--ds-spacing-8);
    padding: var(--ds-spacing-8) 0;
}

.ds-content--no-sidebar {
    grid-template-columns: 1fr;
}

.ds-main {
    min-width: 0;
}

.ds-sidebar {
    min-width: var(--ds-sidebar-width);
}

/* ============================
   Post Card - Multi Layout
   ============================ */

/* 列表布局 */
.ds-post-list--list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ds-post-list--list .ds-post-card {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0;
}

.ds-post-list--list .ds-post-card__thumbnail {
    flex-shrink: 0;
    width: 280px;
    height: 180px;
    border-radius: 8px 0 0 8px;
}

.ds-post-list--list .ds-post-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ds-post-list--list .ds-post-card:hover .ds-post-card__thumbnail img {
    transform: scale(1.05);
}

.ds-post-list--list .ds-post-card__content {
    padding: 20px 24px;
}

/* 网格布局 */
.ds-post-list--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.ds-post-list--cols-1.ds-post-list--grid {
    grid-template-columns: 1fr;
}

.ds-post-list--cols-3.ds-post-list--grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .ds-post-list--grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ds-post-list--cols-3.ds-post-list--grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .ds-post-list--grid {
        grid-template-columns: 1fr;
    }
}

.ds-post-list--grid .ds-post-card {
    flex-direction: column;
    padding: 0;
}

.ds-post-list--grid .ds-post-card__thumbnail {
    width: 100%;
    height: 200px;
    border-radius: 8px 8px 0 0;
}

.ds-post-list--grid .ds-post-card__content {
    padding: 16px;
}

/* 杂志布局 */
.ds-post-list--magazine {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.ds-post-list--magazine .ds-post-card--featured {
    grid-column: span 2;
    display: flex;
    flex-direction: row;
}

.ds-post-list--magazine .ds-post-card--featured .ds-post-card__thumbnail {
    width: 400px;
    height: 280px;
    flex-shrink: 0;
}

.ds-post-list--magazine .ds-post-card--featured .ds-post-card__content {
    padding: 24px 32px;
}

.ds-post-list--magazine .ds-post-card--featured .ds-post-card__title {
    font-size: 24px;
}

.ds-post-list--magazine .ds-post-card:not(.ds-post-card--featured) {
    flex-direction: column;
    padding: 0;
}

.ds-post-list--magazine .ds-post-card:not(.ds-post-card--featured) .ds-post-card__thumbnail {
    width: 100%;
    height: 160px;
}

@media (max-width: 768px) {
    .ds-post-list--magazine {
        grid-template-columns: 1fr;
    }
    .ds-post-list--magazine .ds-post-card--featured {
        grid-column: span 1;
        flex-direction: column;
    }
    .ds-post-list--magazine .ds-post-card--featured .ds-post-card__thumbnail {
        width: 100%;
        height: 200px;
    }
}

/* 卡片样式变体 */
.ds-post-card--default {
    background: #fff;
    border: 1px solid var(--ds-border);
    border-radius: 8px;
}

.ds-post-card--modern {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ds-post-card--modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.2);
}

.ds-post-card--minimal {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ds-border);
    border-radius: 0;
    padding-bottom: 24px;
}
.ds-post-card--minimal:last-child {
    border-bottom: none;
}
.ds-post-card--minimal .ds-post-card__thumbnail {
    display: none;
}

/* 默认(post-card)样式 */
.ds-post-card {
    background-color: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    border: 1px solid var(--ds-border);
    overflow: hidden;
    transition: all var(--ds-transition) var(--ds-ease);
}

.ds-post-card:hover {
    border-color: var(--ds-primary);
    box-shadow: var(--ds-shadow-lg);
    transform: translateY(-4px);
}

.ds-post-card__thumbnail {
    flex-shrink: 0;
    width: 200px;
    height: 130px;
    border-radius: var(--ds-radius-md);
    overflow: hidden;
}

.ds-post-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ds-post-card__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ds-post-card__category {
    display: inline-block;
    font-size: var(--ds-text-xs);
    font-weight: var(--ds-font-semibold);
    color: var(--ds-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--ds-spacing-2);
}

.ds-post-card__title {
    font-size: var(--ds-text-lg);
    font-weight: var(--ds-font-semibold);
    margin-bottom: var(--ds-spacing-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ds-post-card__title a {
    color: var(--ds-text-primary);
    text-decoration: none;
}

.ds-post-card__title a:hover {
    color: var(--ds-primary);
}

.ds-post-card__excerpt {
    font-size: var(--ds-text-sm);
    color: var(--ds-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.ds-post-card__meta {
    display: flex;
    align-items: center;
    gap: var(--ds-spacing-4);
    font-size: var(--ds-text-xs);
    color: var(--ds-text-muted);
    margin-top: var(--ds-spacing-2);
}

.ds-post-card__meta a {
    color: inherit;
    text-decoration: none;
}

.ds-post-card__meta a:hover {
    color: var(--ds-primary);
}

/* 标签样式 */
.ds-post-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ds-post-card__tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--ds-bg);
    color: var(--ds-secondary);
    font-size: 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ds-post-card__tag:hover {
    background: var(--ds-primary);
    color: #fff;
}

/* ============================
   Post List
   ============================ */

.ds-post-list {
    display: flex;
    flex-direction: column;
    gap: var(--ds-spacing-4);
}

/* ============================
   Sidebar Widget
   ============================ */

.ds-widget {
    background-color: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    border: 1px solid var(--ds-border);
    padding: var(--ds-spacing-4);
    margin-bottom: var(--ds-spacing-4);
}

.ds-widget__title {
    font-size: var(--ds-text-lg);
    font-weight: var(--ds-font-semibold);
    color: var(--ds-text-primary);
    padding-bottom: var(--ds-spacing-3);
    margin-bottom: var(--ds-spacing-3);
    border-bottom: 2px solid var(--ds-primary);
}

.ds-widget__content {
    font-size: var(--ds-text-sm);
}

/* ============================
   Footer
   ============================ */

.ds-footer {
    background-color: var(--ds-gray-900);
    color: var(--ds-gray-300);
    padding: var(--ds-spacing-12) 0 var(--ds-spacing-6);
    margin-top: var(--ds-spacing-12);
}

.ds-footer .container {
    max-width: 1400px;
}

/* Footer四栏Grid布局 */
.ds-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: var(--ds-spacing-10);
    margin-bottom: var(--ds-spacing-8);
}

/* 品牌区 */
.ds-footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--ds-spacing-4);
}

.ds-footer-logo {
    display: flex;
    align-items: center;
    gap: var(--ds-spacing-2);
}

.ds-footer-logo img {
    height: 36px;
    width: auto;
}

.ds-footer-site-name {
    font-size: var(--ds-text-xl);
    font-weight: var(--ds-font-bold);
    color: var(--ds-text-inverse);
}

.ds-footer-desc {
    font-size: var(--ds-text-sm);
    color: var(--ds-gray-400);
    line-height: 1.6;
    max-width: 280px;
}

.ds-footer-social {
    margin-top: var(--ds-spacing-2);
}

.ds-footer-social-links {
    display: flex;
    gap: var(--ds-spacing-3);
}

.ds-footer-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--ds-gray-800);
    border-radius: var(--ds-radius-md);
    color: var(--ds-gray-400);
    transition: all var(--ds-transition) var(--ds-ease);
}

.ds-footer-social-links a:hover {
    background: var(--ds-primary);
    color: var(--ds-text-inverse);
}

.ds-footer-email {
    display: inline-flex;
    align-items: center;
    gap: var(--ds-spacing-2);
    font-size: var(--ds-text-sm);
    color: var(--ds-gray-400);
    margin-top: var(--ds-spacing-2);
    transition: color var(--ds-transition) var(--ds-ease);
}

.ds-footer-email:hover {
    color: var(--ds-primary);
}

/* 链接区域 */
.ds-footer-links-section {
    display: flex;
    flex-direction: column;
}

.ds-footer-links-toggle {
    display: none;
}

.ds-footer-links-area {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--ds-spacing-6);
}

.ds-footer-col {
    display: flex;
    flex-direction: column;
    gap: var(--ds-spacing-3);
}

.ds-footer-col h4 {
    font-size: var(--ds-text-sm);
    font-weight: var(--ds-font-semibold);
    color: var(--ds-text-inverse);
    margin-bottom: var(--ds-spacing-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ds-footer-col a {
    font-size: var(--ds-text-sm);
    color: var(--ds-gray-400);
    transition: color var(--ds-transition) var(--ds-ease);
}

.ds-footer-col a:hover {
    color: var(--ds-primary);
}

/* 底部栏 */
.ds-footer-bottom {
    border-top: 1px solid var(--ds-gray-700);
    padding-top: var(--ds-spacing-6);
    display: flex;
    flex-direction: column;
    gap: var(--ds-spacing-4);
    font-size: var(--ds-text-sm);
}

.ds-footer-friends {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--ds-spacing-4);
}

.ds-footer-friends-label {
    color: var(--ds-gray-500);
}

.ds-footer-friends a {
    color: var(--ds-gray-400);
    transition: color var(--ds-transition) var(--ds-ease);
}

.ds-footer-friends a:hover {
    color: var(--ds-primary);
}

.ds-footer-copyright {
    text-align: center;
    color: var(--ds-gray-500);
}

.ds-footer-copyright p {
    margin: 0;
}

/* Footer响应式 */
@media (max-width: 1024px) {
    .ds-footer-grid {
        grid-template-columns: 1fr;
        gap: var(--ds-spacing-8);
    }
    
    .ds-footer-links-area {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ds-footer-links-area {
        grid-template-columns: 1fr;
    }
    
    .ds-footer-links-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: var(--ds-spacing-3) var(--ds-spacing-4);
        background: var(--ds-gray-800);
        border: none;
        border-radius: var(--ds-radius-md);
        color: var(--ds-text-inverse);
        font-size: var(--ds-text-sm);
        cursor: pointer;
        margin-bottom: var(--ds-spacing-4);
    }
    
    .ds-footer-links-toggle svg {
        transition: transform var(--ds-transition) var(--ds-ease);
    }
    
    .ds-footer-links-toggle[aria-expanded="true"] svg {
        transform: rotate(180deg);
    }
    
    .ds-footer-links-area {
        display: none;
    }
    
    .ds-footer-links-area.ds-footer-links-expanded {
        display: grid;
    }
    
    .ds-footer-friends {
        flex-direction: column;
        gap: var(--ds-spacing-2);
    }
}

/* ============================
   Single Post
   ============================ */

.ds-single__header {
    margin-bottom: var(--ds-spacing-6);
}

.ds-single__category {
    display: inline-block;
    font-size: var(--ds-text-xs);
    font-weight: var(--ds-font-semibold);
    color: var(--ds-primary);
    text-transform: uppercase;
    margin-bottom: var(--ds-spacing-2);
}

.ds-single__title {
    font-size: var(--ds-text-4xl);
    font-weight: var(--ds-font-bold);
    line-height: 1.2;
    margin-bottom: var(--ds-spacing-4);
}

.ds-single__meta {
    display: flex;
    align-items: center;
    gap: var(--ds-spacing-4);
    font-size: var(--ds-text-sm);
    color: var(--ds-text-muted);
}

.ds-single__content {
    font-size: var(--ds-text-lg);
    line-height: 1.8;
}

.ds-single__content p {
    margin-bottom: var(--ds-spacing-4);
}

.ds-single__content h2 {
    font-size: var(--ds-text-2xl);
    margin: var(--ds-spacing-8) 0 var(--ds-spacing-4);
}

.ds-single__content h3 {
    font-size: var(--ds-text-xl);
    margin: var(--ds-spacing-6) 0 var(--ds-spacing-3);
}

.ds-single__content img {
    border-radius: var(--ds-radius-lg);
    margin: var(--ds-spacing-4) 0;
}

.ds-single__content code {
    background-color: var(--ds-gray-100);
    padding: 2px 6px;
    border-radius: var(--ds-radius-sm);
    font-family: var(--ds-font-mono);
    font-size: 0.9em;
}

.ds-single__content pre {
    background-color: var(--ds-gray-800);
    color: var(--ds-gray-100);
    padding: var(--ds-spacing-4);
    border-radius: var(--ds-radius-lg);
    overflow-x: auto;
    margin: var(--ds-spacing-4) 0;
}

.ds-single__content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ============================
   Comments
   ============================ */

.ds-comments {
    margin-top: var(--ds-spacing-8);
    padding-top: var(--ds-spacing-8);
    border-top: 1px solid var(--ds-border);
}

.ds-comments__title {
    font-size: var(--ds-text-xl);
    margin-bottom: var(--ds-spacing-6);
}

.ds-comment {
    display: flex;
    gap: var(--ds-spacing-3);
    padding: var(--ds-spacing-4) 0;
    border-bottom: 1px solid var(--ds-border-light);
}

.ds-comment__avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--ds-radius-full);
    overflow: hidden;
    flex-shrink: 0;
}

.ds-comment__body {
    flex: 1;
}

.ds-comment__header {
    display: flex;
    align-items: center;
    gap: var(--ds-spacing-2);
    margin-bottom: var(--ds-spacing-2);
}

.ds-comment__author {
    font-weight: var(--ds-font-semibold);
}

.ds-comment__date {
    font-size: var(--ds-text-xs);
    color: var(--ds-text-muted);
}

.ds-comment__content {
    font-size: var(--ds-text-sm);
    line-height: 1.6;
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 1024px) {
    .ds-content {
        grid-template-columns: 1fr;
    }
    
    .ds-sidebar {
        display: none;
    }
    
    .ds-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ds-header__nav {
        display: none;
    }
    
    .ds-hero__title {
        font-size: var(--ds-text-3xl);
    }
    
    .ds-post-card {
        flex-direction: column;
    }
    
    .ds-post-card__thumbnail {
        width: 100%;
        height: 180px;
    }
    
    .ds-footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 侧边栏小工具样式 ==================== */

.ds-sidebar-area {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    padding: 20px;
    box-shadow: var(--ds-shadow-sm);
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ds-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ds-primary);
}

/* 搜索小工具 */
.ds-widget--search .ds-search-form {
    display: flex;
    gap: 8px;
}

.ds-widget--search input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ds-widget--search input[type="search"]:focus {
    border-color: var(--ds-primary);
}

.ds-widget--search button[type="submit"] {
    padding: 10px 16px;
    background: var(--ds-primary);
    color: #fff;
    border: none;
    border-radius: var(--ds-radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.ds-widget--search button[type="submit"]:hover {
    background: var(--ds-primary-dark);
}

/* 分类目录小工具 */
.ds-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ds-categories-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--ds-border);
}

.ds-categories-list li:last-child {
    border-bottom: none;
}

.ds-categories-list a {
    color: var(--ds-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.ds-categories-list a:hover {
    color: var(--ds-primary);
}

/* 最新文章小工具 */
.ds-recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ds-recent-post-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ds-border);
}

.ds-recent-post-item:last-child {
    border-bottom: none;
}

.ds-recent-post-thumbnail {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: var(--ds-radius-sm);
    overflow: hidden;
}

.ds-recent-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ds-recent-post-title {
    flex: 1;
    font-size: 14px;
    color: var(--ds-text-primary);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ds-recent-post-title:hover {
    color: var(--ds-primary);
}

/* ============================
   Sidebar Widgets Styles
   ============================ */

/* Widget容器通用样式 */
.widget-dripsafe {
    background-color: var(--ds-bg-card, #fff);
    border: 1px solid var(--ds-border, #e2e8f0);
    border-radius: var(--ds-radius-lg, 0.75rem);
    padding: var(--ds-spacing-4, 1rem);
    margin-bottom: var(--ds-spacing-4, 1rem);
    transition: box-shadow var(--ds-transition-normal, 0.25s ease);
}

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

.widget-dripsafe .widget-title {
    font-size: var(--ds-text-lg, 1.125rem);
    font-weight: var(--ds-font-semibold, 600);
    color: var(--ds-text-primary, #0f172a);
    padding-bottom: var(--ds-spacing-3, 0.75rem);
    margin-bottom: var(--ds-spacing-3, 0.75rem);
    border-bottom: 2px solid var(--ds-primary, #0ea5e9);
}

/* 热门文章Widget样式 */
.widget-popular-posts {
    background-color: var(--ds-bg-card, #fff);
    border: 1px solid var(--ds-border, #e2e8f0);
    border-radius: var(--ds-radius-lg, 0.75rem);
    padding: var(--ds-spacing-4, 1rem);
    margin-bottom: var(--ds-spacing-4, 1rem);
}

.widget-popular-posts .widget-title {
    font-size: var(--ds-text-lg, 1.125rem);
    font-weight: var(--ds-font-semibold, 600);
    color: var(--ds-text-primary, #0f172a);
    padding-bottom: var(--ds-spacing-3, 0.75rem);
    margin-bottom: var(--ds-spacing-3, 0.75rem);
    border-bottom: 2px solid var(--ds-primary, #0ea5e9);
}

.popular-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.popular-post-item {
    display: flex;
    align-items: center;
    gap: var(--ds-spacing-3, 0.75rem);
    padding: var(--ds-spacing-3, 0.75rem) 0;
    border-bottom: 1px solid var(--ds-border-light, #f1f5f9);
    transition: all var(--ds-transition-fast, 150ms ease);
}

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

.popular-post-item:hover {
    background-color: var(--ds-primary-alpha-10, rgba(14, 165, 233, 0.1));
    border-radius: var(--ds-radius-md, 0.5rem);
    padding-left: var(--ds-spacing-2, 0.5rem);
}

.popular-post-item .post-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: var(--ds-text-xs, 0.75rem);
    font-weight: var(--ds-font-bold, 700);
    color: var(--ds-text-inverse, #fff);
    background: linear-gradient(135deg, var(--ds-primary, #0ea5e9), var(--ds-primary-dark, #0284c7));
    border-radius: var(--ds-radius-sm, 0.25rem);
}

.popular-post-item:nth-child(1) .post-rank {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.popular-post-item:nth-child(2) .post-rank {
    background: linear-gradient(135deg, #64748b, #475569);
}

.popular-post-item:nth-child(3) .post-rank {
    background: linear-gradient(135deg, #b45309, #92400e);
}

.popular-post-item .post-link {
    flex: 1;
    font-size: var(--ds-text-sm, 0.875rem);
    color: var(--ds-text-primary, #0f172a);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--ds-transition-fast, 150ms ease);
}

.popular-post-item .post-link:hover {
    color: var(--ds-primary, #0ea5e9);
}

.popular-post-item .post-views {
    font-size: var(--ds-text-xs, 0.75rem);
    color: var(--ds-text-tertiary, #64748b);
    white-space: nowrap;
}

/* 标签云Widget样式 */
.widget-tag-cloud {
    background-color: var(--ds-bg-card, #fff);
    border: 1px solid var(--ds-border, #e2e8f0);
    border-radius: var(--ds-radius-lg, 0.75rem);
    padding: var(--ds-spacing-4, 1rem);
    margin-bottom: var(--ds-spacing-4, 1rem);
}

.widget-tag-cloud .widget-title {
    font-size: var(--ds-text-lg, 1.125rem);
    font-weight: var(--ds-font-semibold, 600);
    color: var(--ds-text-primary, #0f172a);
    padding-bottom: var(--ds-spacing-3, 0.75rem);
    margin-bottom: var(--ds-spacing-3, 0.75rem);
    border-bottom: 2px solid var(--ds-primary, #0ea5e9);
}

.widget-tag-cloud .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-spacing-2, 0.5rem);
}

.widget-tag-cloud .tag-cloud a {
    display: inline-flex;
    align-items: center;
    padding: var(--ds-space-1-5, 6px) var(--ds-spacing-3, 0.75rem);
    font-size: var(--ds-text-xs, 0.75rem);
    font-weight: var(--ds-font-medium, 500);
    color: var(--ds-text-secondary, #334155);
    background-color: var(--ds-gray-100, #f1f5f9);
    border-radius: var(--ds-radius-full, 9999px);
    text-decoration: none;
    transition: all var(--ds-transition-fast, 150ms ease);
}

.widget-tag-cloud .tag-cloud a:hover {
    color: var(--ds-text-inverse, #fff);
    background: linear-gradient(135deg, var(--ds-primary, #0ea5e9), var(--ds-primary-dark, #0284c7));
    transform: translateY(-2px);
    box-shadow: var(--ds-shadow-md);
}

/* 彩色标签云变体 */
.widget-tag-cloud .tag-cloud.colorful a:nth-child(6n+1):hover { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.widget-tag-cloud .tag-cloud.colorful a:nth-child(6n+2):hover { background: linear-gradient(135deg, #10b981, #059669); }
.widget-tag-cloud .tag-cloud.colorful a:nth-child(6n+3):hover { background: linear-gradient(135deg, #f59e0b, #d97706); }
.widget-tag-cloud .tag-cloud.colorful a:nth-child(6n+4):hover { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.widget-tag-cloud .tag-cloud.colorful a:nth-child(6n+5):hover { background: linear-gradient(135deg, #ec4899, #db2777); }
.widget-tag-cloud .tag-cloud.colorful a:nth-child(6n+6):hover { background: linear-gradient(135deg, #06b6d4, #0891b2); }

/* 默认WordPress标签云样式增强 */
.tag-cloud {
    font-size: var(--ds-text-sm, 0.875rem);
}

.tag-cloud a {
    display: inline-block;
    padding: var(--ds-space-1, 4px) var(--ds-spacing-2, 0.5rem);
    margin: 2px;
    color: var(--ds-text-secondary, #334155);
    background-color: var(--ds-gray-100, #f1f5f9);
    border-radius: var(--ds-radius-sm, 0.25rem);
    text-decoration: none;
    transition: all var(--ds-transition-fast, 150ms ease);
}

.tag-cloud a:hover {
    color: var(--ds-text-inverse, #fff);
    background-color: var(--ds-primary, #0ea5e9);
    transform: translateY(-1px);
}

/* ============================
   Dark Mode Support
   ============================ */

@media (prefers-color-scheme: dark) {
    :root {
        --ds-bg-primary: var(--ds-bg-dark);
        --ds-bg-secondary: var(--ds-gray-800);
        --ds-bg-card: var(--ds-gray-800);
        --ds-text-primary: var(--ds-gray-100);
        --ds-text-secondary: var(--ds-gray-400);
        --ds-text-muted: var(--ds-gray-500);
        --ds-border: var(--ds-gray-700);
        --ds-border-light: var(--ds-gray-800);
    }
}

/* ============================
   Related Posts Section
   ============================ */
.ds-related-posts {
    margin: 40px 0;
    padding: 24px;
    background: var(--ds-bg-card, #fff);
    border-radius: var(--ds-radius-lg, 12px);
    border: 1px solid var(--ds-border-light, #e2e8f0);
}

.ds-related-posts__title {
    font-size: var(--ds-font-size-xl, 1.25rem);
    font-weight: var(--ds-font-weight-bold, 700);
    color: var(--ds-text-primary, #1e293b);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ds-primary, #0ea5e9);
}

.ds-related-posts .ds-post-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .ds-related-posts .ds-post-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .ds-related-posts .ds-post-list {
        grid-template-columns: 1fr;
    }
    
    .ds-related-posts {
        margin: 24px 0;
        padding: 16px;
    }
}

/* ==================== 404页面样式 ==================== */
.ds-404 {
    text-align: center;
    padding: var(--ds-spacing-16) 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ds-404__content {
    max-width: 600px;
    margin: 0 auto;
}

.ds-404__title {
    font-size: 8rem;
    font-weight: var(--ds-font-bold);
    color: var(--ds-primary);
    line-height: 1;
    margin-bottom: var(--ds-spacing-4);
}

.ds-404__subtitle {
    font-size: var(--ds-text-2xl);
    color: var(--ds-text-primary);
    margin-bottom: var(--ds-spacing-4);
}

.ds-404__message {
    font-size: var(--ds-text-lg);
    color: var(--ds-text-secondary);
    margin-bottom: var(--ds-spacing-8);
}

.ds-404__search {
    margin-bottom: var(--ds-spacing-8);
}

.ds-404__search p {
    font-size: var(--ds-text-sm);
    color: var(--ds-text-muted);
    margin-bottom: var(--ds-spacing-3);
}

.ds-404__search form {
    max-width: 400px;
    margin: 0 auto;
}

.ds-404__search input {
    width: 100%;
    padding: var(--ds-spacing-3) var(--ds-spacing-4);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-size: var(--ds-text-base);
    background: var(--ds-bg-card);
    color: var(--ds-text-primary);
}

.ds-404__search input:focus {
    outline: none;
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.ds-404__links {
    display: flex;
    gap: var(--ds-spacing-4);
    justify-content: center;
}

.ds-404__links .btn {
    padding: var(--ds-spacing-3) var(--ds-spacing-6);
    border-radius: var(--ds-radius-md);
    text-decoration: none;
    font-size: var(--ds-text-base);
    font-weight: var(--ds-font-medium);
    transition: all var(--ds-transition);
}

.ds-404__links .btn--primary {
    background: var(--ds-primary);
    color: white;
}

.ds-404__links .btn--primary:hover {
    background: var(--ds-primary-dark);
}

.ds-404__links .btn--secondary {
    background: var(--ds-bg-card);
    color: var(--ds-text-primary);
    border: 1px solid var(--ds-border);
}

.ds-404__links .btn--secondary:hover {
    border-color: var(--ds-primary);
    color: var(--ds-primary);
}

@media (max-width: 640px) {
    .ds-404__title {
        font-size: 5rem;
    }
    .ds-404__links {
        flex-direction: column;
    }
}

/* ============================
   Archive Page Styles
   ============================ */

.ds-archive {
    padding: var(--ds-spacing-6) 0;
}

.ds-archive__header {
    margin-bottom: var(--ds-spacing-6);
    padding-bottom: var(--ds-spacing-4);
    border-bottom: 1px solid var(--ds-border);
}

.ds-archive__title {
    font-size: var(--ds-text-2xl);
    color: var(--ds-text-primary);
    font-weight: var(--ds-font-bold);
    margin-bottom: var(--ds-spacing-2);
}

.ds-archive__description {
    color: var(--ds-text-muted);
    font-size: var(--ds-text-base);
}

/* 分页样式 */
.ds-pagination {
    display: flex;
    justify-content: center;
    gap: var(--ds-spacing-2);
    margin-top: var(--ds-spacing-6);
    padding-top: var(--ds-spacing-4);
    border-top: 1px solid var(--ds-border);
}

.ds-pagination a,
.ds-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--ds-spacing-3);
    background: var(--ds-bg-card);
    color: var(--ds-text-primary);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    text-decoration: none;
    font-size: var(--ds-text-sm);
    transition: all 0.2s ease;
}

.ds-pagination a:hover {
    background: var(--ds-primary);
    color: #fff;
    border-color: var(--ds-primary);
}

.ds-pagination .current {
    background: var(--ds-primary);
    color: #fff;
    border-color: var(--ds-primary);
}

.ds-pagination .prev,
.ds-pagination .next {
    padding: 0 var(--ds-spacing-4);
}

/* 无结果样式 */
.ds-no-results {
    text-align: center;
    padding: var(--ds-spacing-8);
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    border: 1px solid var(--ds-border);
}

.ds-no-results h2 {
    font-size: var(--ds-text-xl);
    color: var(--ds-text-primary);
    margin-bottom: var(--ds-spacing-2);
}

.ds-no-results p {
    color: var(--ds-text-muted);
}

/* ============================
   Author Page
   ============================ */

.ds-author {
    position: relative;
}

.ds-author__bg {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--ds-primary);
    position: relative;
}

.ds-author__bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, var(--ds-bg-primary));
}

.ds-author__avatar {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--ds-bg-primary);
    background: var(--ds-bg-card);
    z-index: 10;
}

.ds-author__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ds-author__info {
    text-align: center;
    padding: var(--ds-spacing-8) var(--ds-spacing-4);
    padding-top: var(--ds-spacing-12);
}

.ds-author__name {
    font-size: var(--ds-text-2xl);
    font-weight: var(--ds-font-bold);
    color: var(--ds-text-primary);
    margin-bottom: var(--ds-spacing-2);
}

.ds-author__desc {
    font-size: var(--ds-text-base);
    color: var(--ds-text-secondary);
}

.ds-author__posts {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-spacing-6);
    margin-top: var(--ds-spacing-4);
    border: 1px solid var(--ds-border);
}

.ds-author__tab-header {
    display: flex;
    gap: var(--ds-spacing-6);
    border-bottom: 1px solid var(--ds-border);
    margin-bottom: var(--ds-spacing-6);
}

.ds-author__tab-item {
    padding: var(--ds-spacing-3) var(--ds-spacing-4);
    color: var(--ds-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--ds-transition);
}

.ds-author__tab-item:hover,
.ds-author__tab-item.cur {
    color: var(--ds-primary);
    border-bottom-color: var(--ds-primary);
}

/* ============================
   Archive Page (ds- prefix)
   ============================ */

.ds-archive-content {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-spacing-6);
    border: 1px solid var(--ds-border);
}
