/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: #4a90e2;
    color: #fff;
}

.btn-primary:hover {
    background-color: #357abd;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #218838;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

/* 输入框带图标的样式 */
.input-group {
    position: relative;
}

.input-group .form-control {
    padding-left: 36px;
}

.input-group .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #fafafa;
}

.file-upload-area:hover {
    border-color: #4a90e2;
    background-color: #f0f7ff;
}

.file-upload-area input[type="file"] {
    display: none;
}

.file-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ccc;
}

.file-upload-text {
    color: #666;
    font-size: 16px;
}

/* 状态消息样式 */
.status-message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    z-index: 1001;
}

.status-message.info {
    background-color: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1565c0;
}

.status-message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.status-message.warning {
    background-color: #fff3e0;
    color: #e65100;
    border-left: 4px solid #e65100;
}

.status-message.error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-icon {
    font-size: 24px;
    color: #4a90e2;
    margin-right: 8px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.navbar-menu {
    display: flex;
    list-style: none;
}

.navbar-item {
    margin-left: 30px;
}

.navbar-link {
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-link:hover {
    color: #4a90e2;
}

.navbar-user {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #4a90e2;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 14px;
    margin-right: 8px;
}

.user-name {
    font-size: 14px;
    color: #333;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    align-items: center;
    background-color: #f5f7fa;
    border-radius: 20px;
    padding: 6px 16px;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
    width: 200px;
}

.search-icon {
    color: #999;
    margin-right: 8px;
}

/* 列表样式 */
.list-container {
    margin-top: 20px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.list-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.list-actions {
    display: flex;
    gap: 10px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.table td {
    font-size: 14px;
    color: #666;
}

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

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    list-style: none;
}

.pagination-item {
    margin: 0 4px;
}

.pagination-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 90px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination-page-number {
    width: 36px;
}

.pagination-link:hover {
    border-color: #4a90e2;
    color: #4a90e2;
}

.pagination-link.active {
    background-color: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
}

.pagination-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
}

.tag-primary {
    background-color: #e3f2fd;
    color: #1976d2;
}

.tag-success {
    background-color: #e8f5e9;
    color: #388e3c;
}

.tag-warning {
    background-color: #fff3e0;
    color: #f57c00;
}

.tag-danger {
    background-color: #ffebee;
    color: #d32f2f;
}

/* 提示信息样式 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 加载状态样式 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        padding: 12px 16px;
    }
    
    .navbar-menu {
        margin-top: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .navbar-item {
        margin: 8px 16px;
    }
    
    .card {
        padding: 16px;
    }
    
    .search-input {
        width: 150px;
    }
    
    .table {
        display: block;
        overflow-x: auto;
    }
    
    .modal-content {
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .form-control {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .logo-text {
        font-size: 16px;
    }
}

/* 模板卡片网格布局 */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.template-preview {
    position: relative;
    height: 180px;
    border-radius: 4px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    overflow: hidden;
}

.template-icon {
    font-size: 48px;
    color: #ccc;
}

/* 预览图片样式 - 尽可能放大显示 */
.template-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: 0;
    padding: 0;
    display: block;
}
.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card:hover .template-overlay {
    opacity: 1;
}

.card-action-btn {
    background-color: #fff;
    color: #333;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 0 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.card-action-btn:hover {
    background-color: #4a90e2;
    color: #fff;
    transform: scale(1.1);
}

.template-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.template-meta-item {
    display: flex;
    align-items: center;
}

.template-meta-item i {
    margin-right: 4px;
}

.template-tags {
    display: flex;
    flex-wrap: wrap;
}

.template-tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: #f0f7ff;
    color: #4a90e2;
    border-radius: 16px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 4px;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .template-preview {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }