/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* 头部样式 */
header {
    background-color: #4CAF50;
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 24px;
    font-weight: bold;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #e8f5e8;
}

/* 表单样式 */
.form-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 50px auto;
}

.form-container h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background-color: #45a049;
}

.login-link {
    text-align: center;
    margin-top: 20px;
}

.login-link a {
    color: #4CAF50;
    text-decoration: none;
}

.login-link a:hover {
    text-decoration: underline;
}

/* 错误和成功信息 */
.error {
    background-color: #f44336;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 首页样式 */
.welcome-section {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.features-section {
    margin-top: 30px;
}

.features-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.feature-card h4 {
    margin-bottom: 10px;
    color: #4CAF50;
}

.feature-card p {
    margin-bottom: 20px;
    color: #666;
}

/* 作品管理样式 */
.works-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.works-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.works-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

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

.works-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

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

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background-color: #2196F3;
}

.btn-secondary:hover {
    background-color: #0b7dda;
}

.btn-danger {
    background-color: #f44336;
}

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

/* 编辑器样式 */
.editor-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.editor-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.editor-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.model-select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.prompt-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    resize: vertical;
    min-height: 100px;
}

.editor-content {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    resize: vertical;
    min-height: 300px;
}

/* 个人中心样式 */
.profile-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.profile-info {
    margin-bottom: 30px;
}

.profile-info p {
    margin-bottom: 10px;
}

/* 管理员后台样式 */
.admin-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.admin-menu-item {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.admin-menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.admin-menu-item a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav ul {
        margin-top: 10px;
        flex-wrap: wrap;
    }
    
    nav ul li {
        margin-left: 0;
        margin-right: 10px;
        margin-bottom: 5px;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
    }
    
    .admin-menu {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    margin-top: 50px;
}

footer p {
    text-align: center;
}