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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

h2 {
    margin-bottom: 20px;
    color: #444;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.template-section,
.upload-section {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.template-section:hover,
.upload-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

#template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 10px;
}

.template-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.template-item:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transform: translateY(-4px);
    border-color: #667eea;
}

.template-item h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.template-item p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.template-item button {
    width: 100%;
    padding: 10px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
}

.template-item button:hover {
    background-color: #5a6fd8;
}

#upload-form {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

input[type="file"] {
    flex: 1;
    min-width: 300px;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: #667eea;
    background-color: #f0f0f0;
}

button {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    font-weight: 500;
}

button:hover {
    background-color: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.form-section {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

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

.table-form {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 6px;
    overflow: hidden;
}

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

.table-form th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #444;
}

.table-form tr:hover {
    background-color: #f5f5f5;
}

.add-row-btn {
    margin-bottom: 15px;
    background-color: #667eea;
}

.add-row-btn:hover {
    background-color: #5a6fd8;
}

.action-buttons {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-buttons button {
    flex: 1;
    min-width: 150px;
}

.no-templates {
    text-align: center;
    padding: 40px;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.no-templates p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.no-templates button {
    background-color: #667eea;
}

.no-templates button:hover {
    background-color: #5a6fd8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        margin-bottom: 20px;
        padding: 15px 0;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .template-section, .upload-section {
        padding: 20px;
    }
    
    #template-list {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 5px;
    }
    
    .template-item {
        padding: 15px;
    }
    
    #upload-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    input[type="file"] {
        min-width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }
    
    .template-section, .upload-section {
        padding: 15px;
    }
    
    .template-item h3 {
        font-size: 1.1em;
    }
    
    .template-item button {
        padding: 8px;
        font-size: 0.85em;
    }
}