/* =========================================================
   03-components · 通用组件
   承载范围：原 style.css 第 423-935 行
   本节包含：
     - 卡片
     - 首页 hero-section
     - 按钮
     - 统计卡片
     - 博客列表
     - 文章搜索框
     - 文章筛选栏
   ========================================================= */

/* ============= 卡片 ============= */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2 {
    color: var(--pink-700);
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--pink-400), var(--pink-500));
}

.card p {
    line-height: 1.9;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============= 首页 ============= */
.hero-section {
    text-align: center;
    padding: 40px 20px 32px;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, var(--surface-highlight) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.hero-section .greeting {
    font-size: 12px;
    letter-spacing: 5px;
    color: var(--pink-500);
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 40px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--pink-400), var(--pink-600), var(--pink-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 28px;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* ============= 按钮 ============= */
.btn {
    padding: 11px 26px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.5px;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
    color: var(--white);
    box-shadow: 0 4px 16px var(--accent-shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-shadow-strong);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--pink-400);
    color: var(--pink-600);
}

.btn-outline:hover {
    background: var(--accent-soft);
    border-color: var(--pink-500);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 30px;
}

.btn-danger-sm {
    background: var(--danger-soft);
    border: 1px solid var(--danger-border);
    color: var(--danger);
    padding: 5px 12px;
    font-size: 11px;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-danger-sm:hover {
    background: var(--danger-soft-strong);
}

/* ============= 统计卡片 ============= */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    padding: 0 4px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px 16px 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--pink-300), var(--pink-500));
    transition: width 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
    width: 60px;
}

.stat-num {
    font-size: 34px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
}

/* ============= 博客列表 ============= */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.blog-item {
    display: flex;
    gap: 16px;
    background: var(--surface-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

/* ============= 文章搜索框 ============= */
.post-search {
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    max-width: 420px;
    padding: 10px 16px;
    font-size: 14px;
    border: 2px solid var(--border-light);
    border-radius: 14px;
    outline: none;
    background: var(--surface-control);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.search-input:focus {
    border-color: var(--pink-400);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface-input);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.blog-item.hidden-by-search {
    display: none;
}




/* ============= 文章筛选栏 ============= */
.post-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 16px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--surface-soft);
    border-radius: 14px;
    border: 1.5px solid var(--border-light);
}


.filter-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}


.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    border: 1.5px solid var(--border-light);
    background: var(--surface-control);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-tag:hover {
    border-color: var(--pink-300);
    color: var(--pink-500);
}

.filter-tag.active {
    background: var(--pink-100);
    border-color: var(--pink-400);
    color: var(--pink-700);
    font-weight: 600;
}




.filter-clear {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--accent-border);
    background: transparent;
    color: var(--pink-500);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    align-self: center;
}

.filter-clear:hover {
    background: var(--accent-soft);
    border-color: var(--pink-400);
}



@media (max-width: 768px) {
    .post-filter-bar {
        flex-direction: column;
        gap: 8px;
    }
    .filter-tag {
        font-size: 11px;
        padding: 3px 10px;
    }
}

.blog-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-soft), transparent);
    transition: width 0.3s ease;
    z-index: 0;
}

.blog-item:hover {
    border-color: var(--pink-300);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.blog-item:hover::before {
    width: 100%;
}

.blog-date {
    flex-shrink: 0;
    text-align: center;
    width: 50px;
    padding-top: 2px;
    position: relative;
    z-index: 1;
}

.blog-date .day {
    font-size: 24px;
    font-weight: 800;
    color: var(--pink-500);
    line-height: 1;
}

.blog-date .month {
    font-size: 11px;
    color: var(--text-muted);
}

.blog-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.blog-info h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 5px;
    word-break: break-word;
}

.blog-preview {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.blog-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    background: var(--accent-soft);
    color: var(--pink-600);
    font-weight: 500;
}

.blog-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

/* 文章表单 */
.blog-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-form input,
.blog-form textarea {
    background: var(--surface-input);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.blog-form input:focus,
.blog-form textarea:focus {
    border-color: var(--pink-400);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.blog-form textarea {
    min-height: 130px;
    resize: vertical;
}

.blog-form input::placeholder,
.blog-form textarea::placeholder {
    color: var(--text-muted);
}
