/* assets/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    font-weight: 600;
}

.credits {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.3);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #6a11cb;
    color: #6a11cb;
}

.btn-outline:hover {
    background: #6a11cb;
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 首页样式 */
.hero-section {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0 0 20px 20px;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    color: #6a11cb;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

.recent-creations {
    margin-bottom: 4rem;
}

.recent-creations h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    font-size: 2.5rem;
}

.creations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.creation-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.creation-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.creation-media {
    position: relative;
    background: #f8f9fa;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creation-media::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 70%, rgba(0,0,0,0.3));
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
}

.creation-card:hover .creation-media::before {
    opacity: 1;
}

.creation-media img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.creation-media video {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.creation-card:hover .creation-media video,
.creation-card:hover .creation-media img {
    transform: scale(1.05);
}

.creation-stats {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    gap: 0.75rem;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.creation-stats .likes,
.creation-stats .views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.creation-info {
    padding: 1.5rem;
    position: relative;
}

.creation-info .prompt {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.5em;
    font-weight: 500;
}

.creation-info .author {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.creation-info .author::before {
    content: "by ";
    color: #999;
}

.creation-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.view-more {
    text-align: center;
    margin-top: 2rem;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5ee;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #6a11cb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.875rem;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #8e2de2;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s;
    background: #f8f6ff;
}

.upload-area:hover {
    background: #f0edff;
}

.upload-area i {
    font-size: 3rem;
    color: #8e2de2;
    margin-bottom: 1rem;
    display: block;
}

.upload-area p {
    color: #666;
    margin-bottom: 0.5rem;
}

#file-name {
    margin-top: 1rem;
    font-weight: 600;
    color: #6a11cb;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 3rem;
    display: none;
}

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

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

/* 警告框 */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-error {
    background: #ffeaea;
    color: #dc3545;
    border-color: #dc3545;
}

.alert-success {
    background: #e8f5e8;
    color: #28a745;
    border-color: #28a745;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

/* 状态标签 */
.status {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #cce7ff;
    color: #004085;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-available {
    background: #d4edda;
    color: #155724;
}

.status-used {
    background: #f8d7da;
    color: #721c24;
}

/* 个人中心样式 */
.profile-header {
    text-align: center;
    margin-bottom: 3rem;
}

.profile-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.profile-header p {
    color: #666;
    font-size: 1.1rem;
}

.profile-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.user-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1rem;
    font-weight: bold;
}

.user-card h3 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.5rem;
}

.user-email {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.card-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 0.5rem;
    font-size: 1.5rem;
}

.redeem-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.redeem-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.transactions-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.3s;
}

.transaction-item:hover {
    background: #f8f9fa;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.type-recharge {
    background: #d4edda;
    color: #155724;
}

.type-consume {
    background: #fff3cd;
    color: #856404;
}

.type-reward {
    background: #cce7ff;
    color: #004085;
}

.type-refund {
    background: #e2e3e5;
    color: #383d41;
}

.type-admin_adjust {
    background: #f8d7da;
    color: #721c24;
}

.transaction-desc {
    color: #333;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.transaction-time {
    color: #666;
    font-size: 0.8rem;
}

.transaction-amount {
    font-weight: bold;
    font-size: 1.1rem;
    font-weight: 600;
}

.transaction-amount.positive {
    color: #27ae60;
}

.transaction-amount.negative {
    color: #e74c3c;
}

.account-info {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    align-items: center;
}

.info-item label {
    font-weight: 600;
    color: #333;
}

.info-item span {
    color: #666;
    font-weight: 500;
}

/* 创作记录样式 */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.records-container {
    margin-top: 2rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.records-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.record-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    display: grid;
    grid-template-columns: 200px 1fr;
    transition: transform 0.3s;
}

.record-card:hover {
    transform: translateY(-2px);
}

.record-image {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.record-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    color: #666;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

.record-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.record-info h4 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.1rem;
}

.prompt {
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.record-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.meta-item {
    font-size: 0.9rem;
}

.meta-item strong {
    color: #333;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.record-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.processing-text {
    color: #3498db;
    font-size: 0.9rem;
    font-style: italic;
}

.error-text {
    color: #e74c3c;
    font-size: 0.9rem;
    font-style: italic;
}

/* 生成页面样式 */
.generate-container {
    max-width: 800px;
    margin: 0 auto;
}

.generate-container h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 2.5rem;
}

.credits-info {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #666;
}

.credits-info span {
    font-weight: bold;
    color: #6a11cb;
}

.template-notice {
    background: #e8f5e8;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #28a745;
}

.template-notice h3 {
    color: #155724;
    margin-bottom: 0.5rem;
}

.template-notice p {
    color: #155724;
    margin-bottom: 0.5rem;
}

.form-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-group {
    margin-bottom: 0;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.recharge-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    text-align: center;
    margin-top: 2rem;
}

.recharge-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.recharge-section p {
    color: #666;
    margin-bottom: 1.5rem;
}

.recharge-form {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: flex-end;
    max-width: 400px;
    margin: 0 auto;
}

.recharge-form input {
    flex: 1;
    min-width: 200px;
}

/* 响应式设计 - 增强移动端支持 */
@media (max-width: 768px) {
    /* 导航栏优化 */
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }
    
    .nav-user {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        width: 100%;
    }
    
    /* 英雄区优化 */
    .hero-section {
        padding: 3rem 1rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-section p {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        padding: 0 1rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    /* 布局优化 */
    .features-section {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .feature-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .creations-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    .creation-card {
        margin-bottom: 1.5rem;
    }
    
    .creation-media video,
    .creation-media img {
        height: 180px;
    }
    
    /* 个人中心优化 */
    .profile-content {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .profile-header h1 {
        font-size: 2rem;
    }
    
    .user-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    /* 记录卡片优化 */
    .record-card {
        grid-template-columns: 1fr;
        margin-bottom: 1.5rem;
    }
    
    .record-image {
        height: 150px;
    }
    
    .record-info {
        padding: 1rem;
    }
    
    .record-meta {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    /* 表单优化 */
    .form-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    
    .redeem-form,
    .form-actions,
    .success-actions,
    .recharge-form,
    .creation-actions,
    .record-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .record-actions {
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* 容器优化 */
    .container {
        padding: 0 15px;
    }
    
    /* 卡片优化 */
    .card-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* 统计信息优化 */
    .page-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    /* 小屏幕进一步优化 */
    .container {
        padding: 0 12px;
    }
    
    .hero-section {
        padding: 2.5rem 1rem;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .feature-card {
        padding: 1.25rem;
    }
    
    .user-stats {
        grid-template-columns: 1fr;
    }
    
    .record-meta {
        grid-template-columns: 1fr;
    }
    
    .card-section {
        padding: 1.25rem;
    }
    
    /* 按钮优化 */
    .btn {
        padding: 0.75rem 0.9rem;
        font-size: 0.95rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    /* 标题优化 */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* 文本优化 */
    p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* 创作卡片优化 */
    .creation-media video,
    .creation-media img {
        height: 160px;
    }
    
    .creation-info {
        padding: 1.25rem;
    }
    
    /* 警告框优化 */
    .alert {
        padding: 1rem;
        margin-bottom: 1.25rem;
    }
}