/* css/style.css - 主样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #ff6b6b;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.coin-balance {
    background: linear-gradient(45deg, #ffd700, #ff8c00);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* 主要内容区域 */
.main-content {
    margin-top: 80px;
    padding: 2rem 0;
}

/* 页面标题 */
.page-title {
    text-align: center;
    margin: 2rem 0;
    color: white;
}

.page-title h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-title p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 分类筛选 */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.5rem 1rem;
    border: 2px solid white;
    background: transparent;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.category-btn.active,
.category-btn:hover {
    background: white;
    color: #667eea;
}

/* 商品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* 登录注册表单 */
.auth-container {
    max-width: 400px;
    margin: 5rem auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    text-align: center;
}

.auth-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

/* 购物车样式 */
.cart-container {
    max-width: 800px;
    margin: 0 auto;
}

.cart-item {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.quantity-btn:hover {
    background: #e9ecef;
}

.item-price {
    font-weight: bold;
    color: #ff6b6b;
    font-size: 1.1rem;
}

.cart-summary {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.total-price {
    text-align: center;
    margin-bottom: 1rem;
}

.total-price h3 {
    color: #ff6b6b;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* 订单样式 */
.orders-list {
    max-width: 800px;
    margin: 0 auto;
}

.order-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.order-info h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.order-info p {
    color: #666;
    font-size: 0.9rem;
}

.order-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-amount {
    font-size: 1.2rem;
    color: #ff6b6b;
}

/* 订单状态 */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-paid { background: #d4edda; color: #155724; }
.status-preparing { background: #fff3cd; color: #856404; }
.status-ready { background: #cce5ff; color: #004085; }
.status-completed { background: #d1ecf1; color: #0c5460; }
.status-cancelled { background: #f8d7da; color: #721c24; }

/* 订单详情页面 */
.order-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.qr-section {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.pickup-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ff6b6b;
    margin: 1rem 0;
}

.qr-code {
    width: 150px;
    height: 150px;
    background: #333;
    margin: 1rem auto;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    text-align: center;
}

.order-info-section, .order-items-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.order-info-section h3, .order-items-section h3 {
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 0.5rem;
}

.order-info-table {
    width: 100%;
}

.order-info-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.order-info-table td:first-child {
    font-weight: 500;
    color: #666;
    width: 30%;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.order-item:last-child {
    border-bottom: none;
}

.item-info h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.item-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

/* 个人中心 */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.profile-section h3 {
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 0.5rem;
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.user-details h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.user-details p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.coin-info {
    text-align: center;
}

.coin-balance-large {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(45deg, #ffd700, #ff8c00);
    color: white;
    border-radius: 10px;
}

.balance-amount {
    font-size: 2rem;
    font-weight: bold;
}

.exchange-section {
    max-width: 400px;
    margin: 0 auto;
}

.exchange-section h4 {
    margin-bottom: 1rem;
    color: #333;
}

.exchange-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.exchange-form .form-control {
    flex: 1;
}

.exchange-tips {
    text-align: left;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.exchange-tips h5 {
    margin-bottom: 0.5rem;
    color: #333;
}

.exchange-tips ul {
    list-style-type: none;
    padding: 0;
}

.exchange-tips li {
    padding: 0.2rem 0;
    color: #666;
    font-size: 0.9rem;
}

.tasks-list {
    space-y: 1rem;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.task-info h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.task-info p {
    color: #666;
    font-size: 0.9rem;
}

.task-reward {
    text-align: right;
}

.reward-coins {
    display: block;
    color: #ff8c00;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #333;
}

/* 规格选择 */
#spec-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#spec-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

#spec-options label:hover {
    background: #f8f9fa;
}

#spec-options input[type="radio"] {
    margin: 0;
}

/* 提示框 */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .user-info {
        order: -1;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .page-title h1 {
        font-size: 2rem;
    }
    
    .category-filters {
        gap: 0.5rem;
    }
    
    .category-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
    }
    
    .order-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .order-body {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .user-info-card {
        flex-direction: column;
        text-align: center;
    }
    
    .exchange-form {
        flex-direction: column;
    }
    
    .task-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .auth-container {
        margin: 2rem auto;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .qr-section {
        padding: 1rem;
    }
    
    .pickup-number {
        font-size: 1.5rem;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    animation: fadeIn 0.3s;
}

.close-btn {
    float: right;
    font-size: 24px;
    cursor: pointer;
}

.spec-options {
    margin: 15px 0;
}

.spec-options label {
    display: block;
    margin: 8px 0;
}

.quantity-control {
    margin: 20px 0;
}

.quantity-control button {
    padding: 5px 15px;
    font-size: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}