/* 商城风格样式优化 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* body {
    background: #f5f7fb;
    min-height: 100vh;
    color: #333;
    margin: 0;
    display: block;
    max-width: 768px;
    margin: 0 auto;
    position: relative;
} */
body {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: url('../images/bg.png') top no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /*! padding: 20px; */
    background-size: 100%;
}

.container {
    width: 100%;
    max-width: 600px;
    position: absolute;
    top: 15%;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    padding: 30px 25px;
    margin: 0 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: #666;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f9f9f9;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: #ff4757;
}

.error-message {
    color: #ff4757;
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.error-message i {
    margin-right: 5px;
}

.button-group {
    display: flex;
    /*! flex-direction: column; */
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: block;
    width: 50%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #f1f3f9;
    color: #667eea;
    border: 2px solid #e1e1e1;
}

.btn-secondary:hover {
    background: #e8eaf6;
}

.message {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
/**********************首页*********************************/
.index-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #f39c12;
    padding: 0;
    margin-bottom: 20px;
    width: 100%;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 768px;
    margin: 0 auto;
}

.shop-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.shop-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shop-logo i {
    font-size: 24px;
    color: #f39c12;
}

.shop-logo h1 {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.shop-slogan {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
}

/* 用户信息区域 - 商城风格 */
.index-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0;
}

.user-welcome-box {
    display: flex;
    align-items: center;
    gap: 10px;
    /*! background: rgba(255, 255, 255, 0.15); */
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    /*! border: 1px solid rgba(255, 255, 255, 0.1); */
}

.user-avatar-box {
    font-size: 24px;
    color: #f39c12;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.user-status {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-status i {
    font-size: 6px;
    color: #2ecc71;
}

.user-actions {
    display: flex;
    align-items: center;
}

.index-btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(231, 76, 60, 0.2);
    color: white;
    border: 1px solid rgba(231, 76, 60, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-weight: 500;
}

.index-btn-logout:hover {
    background: rgba(231, 76, 60, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
}

/* 游客状态 */
.guest-actions {
    display: flex;
}

.index-btn-login {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.index-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

/* 主内容区 */
.index-main {
    position: relative;
    top: 0;
    display: flex;
    justify-content: center;
    padding: 0 10px;
}

/* 商品网格 - 优化布局 */
.index-products-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 0;
    max-width: 768px;
    margin: 0 auto;
}

/* 商品卡片 - 商城风格优化 */
.index-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    flex: 0 0 calc(33.333% - 7px);
    margin-bottom: 10px;
    border: 1px solid #f0f0f0;
}

.index-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.index-product-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    padding: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: transform 0.3s ease;
}

.index-product-card:hover .index-product-image {
    transform: scale(1.05);
}

.index-product-info {
    /*! border-radius: 0 0 12px 12px; */
    /*! padding: 5px; */
    box-sizing: border-box;
    background: white;
    border-top: 1px solid #f5f5f5;
}

/* 购买按钮 - 商城风格 */
.index-btn-buy {
    width: 100%;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.3);
    position: relative;
    overflow: hidden;
}

.index-btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(243, 156, 18, 0.4);
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.index-btn-buy:active {
    transform: translateY(0);
}

/* 为第10个商品添加特殊样式 */
.index-product-card:nth-child(10) {
    flex: 0 0 calc(33.333% - 7px);
    margin-right: 0;
    margin-left: 0;
}


/* 弹框样式优化 */
#customAmountModal > div {
    background: white;
    padding: 25px;
    border-radius: 15px;
    width: 320px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0e0e0;
}

#customAmountModal h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f39c12;
}

#customAmountModal p {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 15px;
}

#customAmountModal input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    box-sizing: border-box;
}

#customAmountModal input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#amountError {
    color: #e74c3c;
    font-size: 13px;
    margin: 5px 0 15px 0;
    display: none;
    padding: 8px 12px;
    background: #fdf2f2;
    border-radius: 6px;
    border-left: 4px solid #e74c3c;
}

#customAmountModal > div > div:last-child {
    text-align: right;
    margin-top: 20px;
}

#cancelAmount {
    padding: 10px 20px;
    margin-right: 10px;
    border: 2px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.3s;
}

#cancelAmount:hover {
    background: #e9ecef;
    border-color: #bdc3c7;
}

#confirmAmount {
    padding: 10px 25px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

#confirmAmount:hover {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.4);
}
.index-body{flex-wrap: wrap;background: top;}

/* 响应式调整 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 25px 20px 15px;
    }
    
    .shop-info {
        width: 100%;
        text-align: center;
    }
    
    .shop-logo {
        justify-content: center;
    }
    
    .index-user-info {
        width: 100%;
        justify-content: right;
    }
    
    .index-product-card {
        flex: 0 0 calc(33.333% - 7px);
    }
}

@media (max-width: 480px) {
    .index-product-card {
        /*! flex: 0 0 100%; */
    }
    
    .user-welcome-box {
        padding: 6px 12px;
    }
    
    .index-btn-login,
    .index-btn-logout {
        padding: 8px 15px;
        font-size: 12px;
    }
}