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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

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

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

header h1 {
    font-size: 24px;
    font-weight: 600;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover,
nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 主要内容区域 */
main {
    padding: 40px 0;
}

.generator-section {
    background-color: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.generator-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a68d1;
    font-size: 32px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a68d1;
    box-shadow: 0 0 0 2px rgba(26, 104, 209, 0.1);
}

#generate-btn {
    width: 100%;
    padding: 16px;
    background-color: #ff7a00;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
}

#generate-btn:hover {
    background-color: #e66e00;
}

.usage-info {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.usage-info a {
    color: #1a68d1;
    text-decoration: none;
}

.usage-info a:hover {
    text-decoration: underline;
}

/* 结果展示区域 */
.result-section {
    background-color: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a68d1;
    font-size: 32px;
}

.logo-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

#generated-logo {
    max-width: 100%;
    max-height: 400px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    padding: 20px;
}

.logo-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.logo-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

#download-btn {
    background-color: #1a68d1;
    color: white;
}

#download-btn:hover {
    background-color: #1657ad;
}

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

#save-btn:hover {
    background-color: #218838;
}

#generate-another {
    background-color: #6c757d;
    color: white;
}

#generate-another:hover {
    background-color: #5a6268;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #1a68d1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 登录注册页面样式 */
.auth-section {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.auth-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a68d1;
}

.auth-switch {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.auth-tab {
    padding: 10px 30px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
}

.auth-tab.active {
    color: #1a68d1;
    border-bottom-color: #1a68d1;
}

#login-form, #register-form {
    display: none;
}

#login-form.active, #register-form.active {
    display: block;
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background-color: #1a68d1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
}

.auth-btn:hover {
    background-color: #1657ad;
}

/* 按钮加载状态 */
.auth-btn.loading {
    background-color: #6699cc;
    cursor: wait;
    position: relative;
    overflow: hidden;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    margin-top: -7px;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 用户中心样式 */
.user-center-section {
    background-color: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.user-details h3 {
    color: #1a68d1;
    margin-bottom: 10px;
}

.user-details p {
    color: #666;
    margin-bottom: 5px;
}

.upgrade-btn {
    padding: 12px 30px;
    background-color: #ff7a00;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upgrade-btn:hover {
    background-color: #e66e00;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

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

.records-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

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

.record-logo {
    max-width: 80px;
    max-height: 80px;
}

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

.record-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* 后台管理页面样式 */
.admin-section {
    background-color: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.admin-section h2 {
    margin-bottom: 30px;
    color: #1a68d1;
}

.search-bar {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
}

.search-bar input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.search-btn {
    padding: 12px 24px;
    background-color: #1a68d1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.admin-actions {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.admin-actions label {
    display: inline-block;
    margin-right: 15px;
    font-weight: 500;
}

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

footer .container {
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 20px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .generator-section,
    .result-section,
    .auth-section,
    .user-center-section,
    .admin-section {
        padding: 20px;
    }

    .logo-actions {
        flex-direction: column;
        width: 100%;
    }

    .logo-actions button {
        width: 100%;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .records-table {
        font-size: 14px;
    }

    .records-table th,
    .records-table td {
        padding: 10px;
    }

    .record-logo {
        max-width: 60px;
        max-height: 60px;
    }

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

/* 错误提示样式 */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* 成功提示样式 */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}