* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar-logo {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 15px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-logo .logo-img {
    max-width: 160px;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
}

.sidebar-logo .site-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.sidebar-filter {
    width: 240px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-filter .filter-section {
    margin-bottom: 24px;
}

.sidebar-filter .filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding: 0 20px 10px;
    border-bottom: 2px solid #1890ff;
    margin: 0 15px 12px;
}

.sidebar-filter .filter-list {
    list-style: none;
}

.sidebar-filter .filter-list li {
    padding: 6px 20px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-filter .filter-list li:hover {
    color: #1890ff;
    background: #e6f7ff;
}

.sidebar-filter .filter-list li.active {
    color: #1890ff;
    background: #e6f7ff;
    border-left-color: #1890ff;
    font-weight: 500;
}

.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 24px;
    min-height: 100vh;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.main-header h2 {
    font-size: 20px;
    color: #333;
}

.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 8px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    outline: none;
    width: 240px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #1890ff;
}

.search-box button {
    padding: 8px 16px;
    background: #1890ff;
    color: #fff;
    border: 1px solid #1890ff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #40a9ff;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.template-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.template-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.template-card .card-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.template-card:hover .card-image img {
    transform: scale(1.05);
}

.template-card .card-image .no-image {
    color: #bbb;
    font-size: 14px;
}

.template-card .card-info {
    padding: 14px 16px;
}

.template-card .card-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-card .card-industry {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.template-card .card-code {
    font-size: 12px;
    color: #1890ff;
    background: #e6f7ff;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
}

.template-detail {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.template-detail .detail-image {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-detail .detail-image img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.template-detail .detail-info {
    padding: 24px 30px;
}

.template-detail .detail-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.template-detail .detail-code {
    font-size: 14px;
    color: #1890ff;
    background: #e6f7ff;
    display: inline-block;
    padding: 3px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.template-detail .detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.template-detail .detail-tag {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #666;
}

.template-detail .detail-tag.color-tag {
    background: #fff7e6;
    color: #d48806;
}

.template-detail .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    color: #1890ff;
    font-size: 14px;
    transition: color 0.3s;
}

.template-detail .back-link:hover {
    color: #40a9ff;
}

@media (max-width: 1200px) {
    .sidebar-logo {
        width: 160px;
        padding: 20px 10px;
    }

    .sidebar-filter {
        width: 200px;
        left: 160px;
    }

    .main-content {
        margin-left: 360px;
    }
}

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar-logo {
        position: relative;
        width: 100%;
        flex-direction: row;
        padding: 15px;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
    }

    .sidebar-logo .logo-img {
        max-width: 80px;
        max-height: 60px;
        margin-bottom: 0;
        margin-right: 15px;
    }

    .sidebar-filter {
        position: relative;
        width: 100%;
        left: 0;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
        display: flex;
        flex-wrap: wrap;
        padding: 15px;
    }

    .sidebar-filter .filter-section {
        margin-bottom: 0;
        margin-right: 20px;
    }

    .sidebar-filter .filter-title {
        margin: 0 0 8px;
        padding: 0;
        border-bottom: none;
    }

    .sidebar-filter .filter-list {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .sidebar-filter .filter-list li {
        padding: 4px 10px;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        font-size: 12px;
    }

    .sidebar-filter .filter-list li.active {
        border-color: #1890ff;
    }

    .main-content {
        margin-left: 0;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 24px 0;
    border-top: 1px solid #f0f0f0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pagination a:hover {
    color: #1890ff;
    border-color: #1890ff;
    background: #fff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
    transform: translateY(-1px);
}

.pagination .current {
    color: #fff;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
    font-weight: 500;
}

.pagination .disabled {
    color: #d9d9d9;
    background: #fafafa;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.pagination .page-info {
    margin-left: 16px;
    font-size: 13px;
    color: #999;
    border: none;
    background: transparent;
    box-shadow: none;
    min-width: auto;
    height: auto;
    padding: 0;
}

.pagination .ellipsis {
    color: #999;
    background: transparent;
    border: none;
    box-shadow: none;
    min-width: auto;
    padding: 0 4px;
    cursor: default;
}

.pagination .nav-btn {
    padding: 0 16px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
    
    .pagination .page-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 8px;
    }
}
