/* ============================================
   我的模板页专用样式 (my-templates.html)
   版本  : 2.0
   更新日期: 2026-06-02
   
   三区设计：精选模板 + 我的模板 + 分类筛选
   ============================================ */

/* --- 页面标题栏（合并搜索） --- */
.template-header-bar {
    display        : flex;
    justify-content: space-between;
    align-items    : flex-start;
    margin-bottom  : 16px;
    flex-wrap      : wrap;
    gap            : 12px;
}

.template-header-bar .page-title {
    font-size  : 20px;
    font-weight: 700;
    color      : var(--text-primary);
    margin     : 0;
}

.template-header-bar .page-subtitle {
    font-size: 13px;
    color    : var(--text-secondary);
    margin   : 4px 0 0;
}

.template-toolbar {
    display    : flex;
    align-items: center;
    gap        : 8px;
}

.template-toolbar .search-input {
    width        : 240px;
    padding      : 8px 12px;
    background   : var(--bg-darker);
    border       : 1px solid var(--border-color);
    border-radius: 8px;
    color        : var(--text-primary);
    font-size    : 13px;
    outline      : none;
    transition   : all 0.2s;
}

.template-toolbar .search-input:focus {
    border-color: var(--primary-color);
    box-shadow  : 0 0 0 2px rgba(255, 107, 53, 0.12);
}

.template-toolbar .search-input::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

/* --- 分类筛选标签栏 --- */
.template-genre-bar {
    display      : flex;
    align-items  : center;
    gap          : 8px;
    padding      : 12px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap    : wrap;
}

.genre-tag {
    padding      : 5px 14px;
    border-radius: 16px;
    font-size    : 13px;
    font-weight  : 500;
    color        : var(--text-secondary);
    background   : var(--bg-darker);
    border       : 1px solid var(--border-color);
    cursor       : pointer;
    transition   : all 0.2s;
    user-select  : none;
}

.genre-tag:hover {
    border-color: var(--primary-color);
    color       : var(--primary-color);
}

.genre-tag.active {
    background  : rgba(255, 107, 53, 0.12);
    color       : #FF6B35;
    border-color: #FF6B35;
}

/* --- 分区标签 --- */
.section-label {
    font-size     : 14px;
    font-weight   : 600;
    color         : var(--text-secondary);
    margin-bottom : 12px;
    padding-bottom: 6px;
    border-bottom : 1px solid var(--border-color);
    display       : flex;
    align-items   : center;
    gap           : 6px;
}

/* --- 精选模板（3列网格） --- */
.featured-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap                  : 16px;
    margin-bottom        : 28px;
}

.featured-card {
    position     : relative;
    overflow     : hidden;
    background   : var(--bg-card);
    border       : 1px solid var(--border-color);
    border-radius: 14px;
    padding      : 20px;
    transition   : all 0.3s ease;
    cursor       : pointer;
}

.featured-card::before {
    content   : '';
    position  : absolute;
    left      : 0;
    top       : 0;
    width     : 5px;
    height    : 100%;
    background: linear-gradient(180deg, #FF6B35, #ff8a5c);
}

.featured-card:hover {
    transform : translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 0 1px rgba(255, 107, 53, 0.1);
}

.featured-card .fc-name {
    font-size    : 17px;
    font-weight  : 700;
    color        : var(--text-primary);
    margin-bottom: 4px;
}

.featured-card .fc-desc {
    font-size    : 13px;
    color        : var(--text-secondary);
    margin-bottom: 12px;
    line-height  : 1.4;
}

.featured-card .fc-tags {
    display      : flex;
    gap          : 6px;
    flex-wrap    : wrap;
    margin-bottom: 12px;
}

.featured-card .fc-tag {
    padding      : 2px 8px;
    background   : rgba(255, 107, 53, 0.08);
    color        : #FF6B35;
    border-radius: 10px;
    font-size    : 11px;
    font-weight  : 500;
}

.featured-card .fc-row {
    display      : flex;
    align-items  : center;
    gap          : 6px;
    font-size    : 12px;
    color        : var(--text-secondary);
    margin-bottom: 4px;
    line-height  : 1.5;
}

.featured-card .fc-row i {
    font-size: 13px;
    color    : #FF6B35;
}

.featured-card .fc-divider {
    height    : 1px;
    background: var(--border-color);
    margin    : 12px 0;
}

.featured-card .fc-meta {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
}

.featured-card .fc-usage {
    font-size: 12px;
    color    : var(--text-secondary);
}

.featured-card .fc-usage strong {
    color: #f59e0b;
}

/* --- 我的模板（网格） --- */
.template-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap                  : 14px;
    margin-bottom        : 0;
}

.template-card {
    position     : relative;
    overflow     : hidden;
    background   : var(--bg-card);
    border       : 1px solid var(--border-color);
    border-radius: 12px;
    padding      : 16px 18px;
    transition   : all 0.3s ease;
}

.template-card::before {
    content   : '';
    position  : absolute;
    left      : 0;
    top       : 0;
    width     : 4px;
    height    : 100%;
    background: var(--primary-color);
    opacity   : 0.5;
}

.template-card:hover {
    transform : translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2), 0 0 0 1px rgba(255, 107, 53, 0.06);
}

.tc-name {
    font-size    : 15px;
    font-weight  : 600;
    color        : var(--text-primary);
    margin-bottom: 2px;
}

.tc-desc {
    font-size    : 12px;
    color        : var(--text-secondary);
    margin-bottom: 10px;
    line-height  : 1.4;
}

.tc-row {
    display      : flex;
    align-items  : center;
    gap          : 5px;
    font-size    : 12px;
    color        : var(--text-secondary);
    margin-bottom: 3px;
    line-height  : 1.5;
}

.tc-row i {
    font-size: 12px;
    color    : #FF6B35;
}

.tc-divider {
    height    : 1px;
    background: var(--border-color);
    margin    : 10px 0;
}

.tc-meta {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    font-size      : 12px;
    color          : var(--text-secondary);
}

.tc-meta .source-info {
    color: #818cf8;
}

.tc-actions {
    display   : flex;
    gap       : 8px;
    margin-top: 10px;
}

.tc-actions .btn-sm {
    padding      : 5px 12px;
    font-size    : 12px;
    border-radius: 6px;
    border       : none;
    cursor       : pointer;
    font-weight  : 500;
    transition   : all 0.2s;
}

.tc-actions .btn-use {
    background: rgba(255, 107, 53, 0.12);
    color     : #FF6B35;
}

.tc-actions .btn-use:hover {
    background: #FF6B35;
    color     : white;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.tc-actions .btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color     : #ef4444;
}

.tc-actions .btn-delete:hover {
    background: #ef4444;
    color     : white;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* --- 空状态 --- */
.empty-state {
    grid-column: 1 / -1;
    text-align : center;
    padding    : 48px 20px;
}

.empty-state i {
    font-size    : 36px;
    color        : #475569;
    display      : block;
    margin-bottom: 12px;
}

.empty-state p {
    color    : #94a3b8;
    font-size: 14px;
    margin   : 0;
}

.empty-state .btn-primary-custom {
    margin-top: 16px;
}

/* --- 分页（复用） --- */
.pagination-center {
    display        : flex;
    justify-content: center;
    padding        : 20px 0 32px;
}

.pagination-center .pagination {
    display    : flex;
    align-items: center;
    gap        : 6px;
}

.pagination-center .page-btn {
    padding      : 8px 14px;
    min-width    : 36px;
    border-radius: 8px;
    font-size    : 13px;
    font-weight  : 500;
    border       : 1px solid var(--border-color);
    background   : var(--bg-card);
    color        : var(--text-secondary);
    cursor       : pointer;
    transition   : all 0.2s;
}

.pagination-center .page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color       : var(--primary-color);
    background  : rgba(255, 107, 53, 0.08);
}

.pagination-center .page-btn.active {
    background  : var(--primary-color);
    color       : white;
    border-color: var(--primary-color);
    font-weight : 600;
}

.pagination-center .page-btn:disabled {
    opacity: 0.4;
    cursor : not-allowed;
}

.pagination-center .page-ellipsis {
    padding: 0 4px;
    color  : var(--text-secondary);
}

.pagination-center .page-info {
    margin-left: 12px;
    font-size  : 12px;
    color      : var(--text-secondary);
}