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

body {
    font-family: Arial, sans-serif;
    background-color: white;
    color: black;
    line-height: 1.6;
}

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

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.back-arrow {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 10px;
    color: black;
    transition: transform 0.3s ease;
}

.back-arrow:hover {
    transform: translateX(-5px);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    animation: flow 3s ease-in-out infinite;
}

@keyframes flow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.user-section {
    position: relative;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: scale(1.1);
}

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

/* 个人中心 */
.user-center {
    display: none;
    margin-top: 40px;
    min-height: calc(100vh - 40px);
}

.user-center.active {
    display: block;
}

.user-center-container {
    display: flex;
    min-height: 100%;
}

/* 左侧导航栏 */
.user-sidebar {
    width: 250px;
    background-color: #333;
    color: white;
    padding: 20px 0;
    flex-shrink: 0;
}

.user-sidebar h3 {
    text-align: center;
    margin: 0 0 30px 0;
    font-size: 20px;
    padding: 0 20px;
}

.user-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-nav li {
    margin: 10px 0;
}

.user-nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    transition: background-color 0.3s ease;
}

.user-nav a:hover {
    background-color: #555;
}

.user-nav a.active {
    background-color: #000;
    font-weight: bold;
}

/* 右侧内容区域 */
.user-content {
    flex: 1;
    padding: 30px;
    background-color: #f5f5f5;
    overflow-y: auto;
}

/* 登录/注册区域 */
.auth-section {
    max-width: 400px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.auth-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.auth-switch a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* 用户内容区域 */
.user-section {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

/* 钱包卡片 */
.balance {
    font-size: 16px;
}

.amount {
    font-weight: bold;
    font-size: 24px;
    margin-left: 10px;
    color: #ff4000;
}

/* 充值卡片 */
.recharge-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 300px;
}

.recharge-btn {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.recharge-btn:hover {
    background-color: #f0f0f0;
}

/* 模型密钥卡片 */
.generate-key-btn {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: black;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.generate-key-btn:hover {
    background-color: #333;
}

.key-display {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f9f9f9;
    font-family: monospace;
    word-break: break-all;
}

/* 表单样式 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-form input {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.auth-form button {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: black;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-form button:hover {
    background-color: #333;
}

/* 模型列表 */
#modelList {
    margin-top: 20px;
}

.model-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.model-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.model-item h5 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.model-item p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.model-item button {
    margin-top: 10px;
    padding: 5px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: black;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.model-item button:hover {
    background-color: #333;
}

/* 主页面内容 */
.main-content {
    margin-top: 60px;
    text-align: center;
}

.main-content h2 {
    font-size: 32px;
    margin-bottom: 30px;
}

/* 模型网格 */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.model-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-align: left;
}

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

.model-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.model-card p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.model-card .price {
    font-weight: bold;
    color: #000;
    margin-top: 10px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    text-align: left;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

#modelDetail h3 {
    margin-top: 0;
    font-size: 24px;
    margin-bottom: 20px;
}

#modelDetail p {
    margin: 10px 0;
    line-height: 1.6;
}

#modelDetail .price {
    font-weight: bold;
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 20px;
}

#modelDetail button {
    padding: 10px 20px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#modelDetail button:hover {
    background-color: #333;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .model-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .recharge-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .model-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .recharge-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .model-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .recharge-options {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .main-content {
        margin-top: 80px;
        padding: 10px;
    }
    
    .main-content h2 {
        font-size: 24px;
    }
    
    .card {
        padding: 15px;
    }
    
    .card h3 {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .model-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 30% auto;
        padding: 20px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .main-content {
        margin-top: 70px;
    }
    
    .main-content h2 {
        font-size: 20px;
    }
    
    .card {
        padding: 10px;
    }
    
    .card h3 {
        font-size: 16px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
    }
}

