/* 表格模板插件前端样式 */

/* 表格容器 */
.ttp-table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
    padding: 20px;
}



/* 表格底部标签 */
.ttp-table-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ttp-table-footer .ttp-table-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ttp-meta-label {
    font-weight: 600;
    color: #666;
    margin-right: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ttp-meta-label i {
    font-size: 0.9rem;
}

.ttp-tag-link {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.ttp-tag-link:hover {
    background: #856404;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(133,100,4,0.3);
}

/* 搜索控件 */
.ttp-table-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.ttp-search-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
}

.ttp-search-container::-webkit-scrollbar {
    height: 6px;
}

.ttp-search-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ttp-search-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ttp-search-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 自定义搜索选择器 */
.ttp-custom-search {
    flex-shrink: 0;
    min-width: 200px;
    max-width: 300px;
}

.ttp-custom-search-select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    height: 38px; /* 确保与搜索框高度一致 */
    box-sizing: border-box;
}

.ttp-custom-search-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* 搜索框 */
.ttp-search-box {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.ttp-search-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
}

.ttp-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* 搜索按钮组 */
.ttp-search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ttp-search-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ttp-search-btn:hover {
    background-color: #0056b3;
}

.ttp-reset-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    background-color: #6c757d;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ttp-reset-btn:hover {
    background-color: #545b62;
}

/* 表格样式 */
.ttp-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ttp-table-responsive::-webkit-scrollbar {
    height: 8px;
}

.ttp-table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ttp-table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.ttp-table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.ttp-data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.ttp-data-table th {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    min-width: 100px;
    cursor: pointer;
}

.ttp-data-table th:hover {
    background-color: #e9ecef;
}

.ttp-data-table th i {
    margin-left: 5px;
    color: #6c757d;
}

.ttp-data-table td {
    border: 1px solid #dee2e6;
    padding: 10px 8px;
    vertical-align: middle;
    word-wrap: break-word;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ttp-data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 分页控件 */
.ttp-table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 20px;
}

.ttp-pagination-info {
    font-size: 14px;
    color: #6c757d;
}

.ttp-pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ttp-prev-btn,
.ttp-next-btn {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ttp-prev-btn:hover:not(:disabled),
.ttp-next-btn:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.ttp-prev-btn:disabled,
.ttp-next-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ttp-page-numbers {
    display: flex;
    gap: 5px;
}

.ttp-page-numbers .ttp-page-btn {
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ttp-page-numbers .ttp-page-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.ttp-page-numbers .ttp-page-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .ttp-table-controls {
        padding: 10px;
    }
    
    .ttp-search-container {
        gap: 10px;
        padding-bottom: 3px;
    }
    
    .ttp-custom-search {
        min-width: 120px;
        max-width: 200px;
    }
    
    .ttp-custom-search-select {
        font-size: 13px;
        padding: 8px 10px;
        height: 36px; /* 移动端稍微小一点 */
    }
    
    .ttp-search-box {
        min-width: 120px;
        max-width: 200px;
    }
    
    .ttp-search-input {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .ttp-search-actions {
        gap: 8px;
    }
    
    .ttp-search-btn,
    .ttp-reset-btn {
        white-space: nowrap;
        font-size: 12px;
        padding: 8px 10px;
        min-width: 50px;
    }
    
    .ttp-data-table th,
    .ttp-data-table td {
        padding: 8px 6px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .ttp-table-pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .ttp-pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .ttp-page-numbers {
        order: -1;
        margin-bottom: 10px;
    }
}

/* 加载状态 */
.ttp-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.ttp-loading i {
    font-size: 2rem;
    margin-bottom: 10px;
    animation: ttp-spin 1s linear infinite;
}

@keyframes ttp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.ttp-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.ttp-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #dee2e6;
}

/* 表格列表样式 */
.ttp-table-list {
    margin: 20px 0;
}

.ttp-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ttp-table-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.ttp-table-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.ttp-table-title {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.ttp-table-title a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ttp-table-title a:hover {
    color: #0056b3;
}

.ttp-table-meta {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.ttp-table-category,
.ttp-table-tags {
    display: inline-block;
    margin-right: 15px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.8rem;
}

.ttp-table-category {
    background: #e7f3ff;
    color: #0056b3;
}

.ttp-table-tags {
    background: #fff3cd;
    color: #856404;
}

.ttp-table-excerpt {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
    font-size: 0.9rem;
}

.ttp-table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ttp-view-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.ttp-view-btn:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.ttp-shortcode {
    font-size: 0.8rem;
    color: #666;
}

.ttp-shortcode code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* 移动端表格列表适配 */
@media screen and (max-width: 768px) {
    .ttp-table-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ttp-table-item {
        padding: 15px;
    }
    
    .ttp-table-title {
        font-size: 1.1rem;
    }
    
    .ttp-table-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ttp-view-btn {
        text-align: center;
    }
    

    
    /* 移动端表格底部标签适配 */
    .ttp-table-footer {
        margin-top: 20px;
        padding-top: 15px;
    }
    
    .ttp-table-footer .ttp-table-tags {
        gap: 6px;
    }
    
    .ttp-tag-link {
        padding: 3px 10px;
        font-size: 0.8rem;
    }
    
    .ttp-meta-label {
        font-size: 0.85rem;
    }
}



/* 小工具样式 */

.ttp-count {
    background: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ttp-tags-widget {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ttp-tag-cloud {
    display: inline-block;
    padding: 4px 8px;
    background: #e7f3ff;
    color: #0056b3;
    text-decoration: none;
    border-radius: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #b3d9ff;
}

.ttp-tag-cloud:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,86,179,0.3);
}

.ttp-tag-cloud .ttp-count {
    margin-left: 4px;
    background: rgba(255,255,255,0.2);
    color: inherit;
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 0.7rem;
}

/* 数据统计样式 */
.ttp-table-statistics {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.ttp-statistics-container {
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
}

.ttp-statistics-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.ttp-statistics-label {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.ttp-statistics-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.ttp-statistics-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.ttp-statistics-total {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 20px;
    border-left: 2px solid #dee2e6;
}

.ttp-total-label {
    font-weight: 600;
    color: #333;
}

.ttp-total-value {
    font-weight: 600;
    color: #007bff;
    font-size: 1.1rem;
}

/* 移动端数据统计适配 */
@media screen and (max-width: 768px) {
    .ttp-statistics-container {
        gap: 15px;
        padding-bottom: 10px;
    }
    
    .ttp-statistics-item {
        min-width: 100px;
    }
    
    .ttp-statistics-input {
        width: 70px;
        font-size: 0.85rem;
    }
    
    .ttp-statistics-total {
        padding-left: 15px;
    }
}
