* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e1e5e9;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

/* 标签内容 */
.tab-content {
    display: none;
    padding: 40px;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

/* 搜索部分 */
.search-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.search-results {
    margin-top: 20px;
}

.certificate-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.certificate-card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.certificate-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.certificate-info span {
    font-weight: 600;
    color: #333;
}

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

.certificate-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.download-btn {
    background: #28a745;
    color: white;
}

.download-btn:hover {
    background: #218838;
}

.edit-btn {
    background: #ffc107;
    color: #333;
}

.edit-btn:hover {
    background: #e0a800;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

/* 管理页面 */
.manage-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.manage-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.manage-actions button:first-child {
    background: #17a2b8;
    color: white;
}

.manage-actions button:first-child:hover {
    background: #138496;
}

.manage-actions button:last-child {
    background: #dc3545;
    color: white;
}

.manage-actions button:last-child:hover {
    background: #c82333;
}

/* 预览操作 */
.preview-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

form {
    padding: 40px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    margin: 30px auto 0;
    min-width: 200px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

button:active {
    transform: translateY(0);
}

.preview-section {
    padding: 40px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.preview-section h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

#certificatePreview {
    background: white;
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 40px;
    margin: 20px 0;
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.certificate-border {
    border: 8px solid #667eea;
    border-radius: 15px;
    padding: 30px;
    background: linear-gradient(45deg, #f8f9fa 0%, #ffffff 100%);
    box-shadow: inset 0 0 20px rgba(102, 126, 234, 0.1);
}

.certificate-header {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.certificate-body {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
    margin: 20px 0;
}

.recipient-name {
    font-size: 2rem;
    font-weight: bold;
    color: #764ba2;
    margin: 20px 0;
    text-decoration: underline;
}

.course-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin: 15px 0;
}

.signature-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e1e5e9;
}

.signature-line {
    text-align: center;
    width: 200px;
}

.signature-line::before {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    margin-bottom: 10px;
}

.date-section {
    text-align: center;
    width: 200px;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    
    h1 {
        font-size: 2rem;
        padding: 20px 0;
    }
    
    form {
        padding: 20px;
    }
    
    .preview-section {
        padding: 20px;
    }
    
    .certificate-header {
        font-size: 1.8rem;
    }
    
    .recipient-name {
        font-size: 1.5rem;
    }
    
    .signature-section {
        flex-direction: column;
        gap: 20px;
    }
}