/* 可爱绿色风格UI样式 */
:root {
    --primary-color: #4CD964; /* 可爱绿色 */
    --primary-color-dark: #34C759; /* 深绿色 */
    --primary-color-light: rgba(76, 217, 100, 0.15);
    --background-color: #F8FFF9; /* 浅绿色背景 */
    --card-background: #FFFFFF;
    --text-color: #2C3E50; /* 深青色文本 */
    --text-color-secondary: #7F8C8D; /* 次要文本颜色 */
    --border-color: #E8F5E9; /* 浅绿色边框 */
    --border-radius: 16px; /* 更圆润的边角 */
    --box-shadow: 0 4px 12px rgba(76, 217, 100, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --font-family: "Comic Sans MS", "Marker Felt", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--background-color);
}

main {
    padding: 0 16px 80px; /* 增加底部padding，为底部导航栏留出空间 */
}

/* 头部导航栏 */
.app-header {
    background-color: var(--primary-color);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: none;
    box-shadow: 0 2px 10px rgba(76, 217, 100, 0.2);
    border-radius: 0 0 20px 20px;
}

.logo {
    color: white;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* 搜索栏 */
.search-bar {
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    flex: 1;
    margin: 0 15px;
    transition: var(--transition);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-bar:focus-within {
    box-shadow: 0 4px 12px rgba(76, 217, 100, 0.25);
    transform: translateY(-2px);
}

.search-bar input {
    border: none;
    flex: 1;
    padding: 12px 8px;
    font-size: 16px;
    background: transparent;
    outline: none;
    color: var(--text-color);
    font-family: var(--font-family);
}

.search-bar input::placeholder {
    color: var(--text-color-secondary);
    opacity: 0.8;
}

.search-icon-simple {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 卡片容器 */
.card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 2px solid var(--border-color);
}

/* 返利查询区域 */
.main-rebate-section {
    margin-top: 24px;
    background: none;
    box-shadow: none;
    padding: 0;
}

.main-rebate-content {
    background-color: var(--card-background);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 2px solid var(--primary-color-light);
    position: relative;
    overflow: hidden;
}

.main-rebate-content::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background-color: var(--primary-color-light);
    border-radius: 50%;
    opacity: 0.5;
    z-index: 0;
}

.paste-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.paste-instructions {
    display: flex;
    align-items: center;
    flex: 1;
}

.paste-icon {
    font-size: 24px;
    margin-right: 16px;
    color: white;
    background: var(--primary-color);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(76, 217, 100, 0.3);
    transition: transform 0.3s ease;
    padding: 10px;
}

.paste-icon svg {
    width: 32px;
    height: 32px;
}

.paste-instructions:hover .paste-icon {
    transform: scale(1.1) rotate(10deg);
}

.paste-text h3 {
    margin: 0 0 6px 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.paste-text p {
    margin: 0;
    color: var(--text-color-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-left: -50px; /* 向左移动，使图标更靠近中间 */
}

.platform-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 0;
    padding: 10px 0;
}

.platform-icons img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    background-color: var(--primary-color);
    padding: 10px;
    box-shadow: 0 4px 8px rgba(76, 217, 100, 0.3);
    transition: all 0.3s ease;
}

.platform-icons img:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 16px rgba(76, 217, 100, 0.5);
    background-color: var(--primary-color-dark);
}

.instructions-btn {
    background-color: rgba(76, 217, 100, 0.1);
    border: 1px solid var(--primary-color-light);
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
    gap: 5px;
}

.instructions-btn span {
    display: inline-block;
    margin-top: 2px;
}

.instructions-btn:hover {
    background-color: rgba(76, 217, 100, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 217, 100, 0.2);
}

.rebate-area {
    background-color: var(--primary-color-light);
    padding: 20px;
    border-radius: 16px;
    margin-top: 16px;
    box-shadow: 0 4px 12px rgba(76, 217, 100, 0.2);
    animation: pulse 3s infinite;
}

.paste-input-area {
    display: flex;
    margin-bottom: 16px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-link-input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    font-size: 16px;
    background-color: white;
    color: var(--text-color);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-link-input:focus {
    outline: none;
    box-shadow: inset 0 1px 3px rgba(76, 217, 100, 0.2);
}

.paste-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    border-radius: 0 10px 10px 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(76, 217, 100, 0.3);
}

.paste-btn:hover {
    background: var(--primary-color-dark);
    transform: translateX(2px);
    box-shadow: 0 6px 12px rgba(76, 217, 100, 0.4);
}

.rebate-tip {
    text-align: center;
    margin-top: 16px;
    color: var(--primary-color-dark);
    font-size: 15px;
    font-weight: 600;
    padding: 8px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* 区块标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin: 24px 0 16px 0;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--primary-color-light);
    border-radius: 12px;
    transition: var(--transition);
}

.view-all:hover {
    background-color: var(--primary-color);
    color: white;
}

.section-header .view-all {
    font-size: 14px;
}

/* 服务网格 */
.services-section {
    margin: 24px 0;
    background: none;
    padding: 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 2px solid var(--primary-color-light);
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 8px;
    transition: var(--transition);
    border-radius: 16px;
    cursor: pointer;
}

.service-item:hover {
    background-color: rgba(76, 217, 100, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(76, 217, 100, 0.15);
}

.service-item img {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
    object-fit: contain;
    border-radius: 14px;
    padding: 8px;
    background-color: transparent;
    box-shadow: 0 4px 8px rgba(76, 217, 100, 0.1);
    transition: all 0.3s ease;
}

.service-item:hover img {
    transform: scale(1.1);
    background-color: var(--primary-color-light);
    box-shadow: 0 6px 12px rgba(76, 217, 100, 0.2);
}

.service-item span {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
    margin-top: 5px;
    transition: var(--transition);
}

.service-item:hover span {
    color: var(--primary-color-dark);
}

.coming-soon-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px 0 10px 0;
    border-top: 2px solid var(--primary-color-light);
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(76, 217, 100, 0.05);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* 简单消息样式，没有绿色背景 */
.simple-message {
    background-color: transparent;
    border-top: 1px solid #eee;
    padding: 15px 0 5px 0;
}

.coming-soon-message p {
    font-size: 15px;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.coming-soon-message .view-all {
    display: inline-block;
    padding: 6px 14px;
    background-color: var(--primary-color-light);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    margin-left: 15px;
    box-shadow: 0 2px 6px rgba(76, 217, 100, 0.2);
}

.coming-soon-message .view-all:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(76, 217, 100, 0.4);
}

/* 平台标签 */
.platform-tabs {
    display: flex;
    overflow-x: auto;
    margin-bottom: 16px;
    background-color: var(--card-background);
    border-radius: 30px;
    padding: 8px;
    box-shadow: var(--box-shadow);
    border: 2px solid var(--border-color);
}

.platform-tab {
    padding: 10px 20px;
    margin: 0 4px;
    font-size: 15px;
    color: var(--text-color-secondary);
    background: none;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.platform-tab:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.platform-tab.active {
    color: white;
    background-color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(76, 217, 100, 0.3);
    padding: 10px 24px;
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 20px;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 2px solid var(--primary-color-light);
}

.product-card {
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--card-background);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--border-color);
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 24px rgba(76, 217, 100, 0.25);
    border-color: var(--primary-color);
}

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(76, 217, 100, 0) 70%, rgba(76, 217, 100, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 20px;
}

.product-card:hover::after {
    opacity: 1;
}

.product-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background-color: #f8f8f8;
    border-bottom: 1px solid var(--border-color);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-image::before {
    opacity: 1;
}

.product-sales {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    padding: 6px 10px;
    text-align: center;
    font-weight: 500;
    backdrop-filter: blur(2px);
    z-index: 2;
}

.product-coupon {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #FF3B30;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3);
    z-index: 2;
}

.product-info {
    padding: 16px;
    position: relative;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 42px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.product-card:hover .product-title {
    color: var(--primary-color-dark);
}

.product-price {
    display: flex;
    align-items: baseline;
    margin-bottom: 12px;
    position: relative;
}

.current-price {
    font-size: 18px;
    font-weight: 700;
    color: #FF3B30; /* 苹果红色 */
    transition: transform 0.3s ease;
}

.product-card:hover .current-price {
    transform: scale(1.05);
}

.original-price {
    font-size: 13px;
    color: var(--text-color-secondary);
    text-decoration: line-through;
    margin-left: 8px;
    opacity: 0.8;
}

.product-platform {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    position: relative;
}

.platform-icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background-color: var(--primary-color);
    padding: 3px;
    box-shadow: 0 2px 4px rgba(76, 217, 100, 0.2);
    transition: transform 0.3s ease;
}

.product-card:hover .platform-icon {
    transform: scale(1.1);
}

.rebate-amount {
    font-size: 13px;
    font-weight: 700;
    color: white;
    background-color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 3px 6px rgba(76, 217, 100, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.rebate-amount::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.product-card:hover .rebate-amount {
    background-color: var(--primary-color-dark);
    box-shadow: 0 4px 8px rgba(76, 217, 100, 0.4);
    transform: translateY(-2px);
}

.product-card:hover .rebate-amount::before {
    transform: translateX(100%);
}

.product-shop {
    font-size: 12px;
    color: var(--text-color-secondary);
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-shop {
    opacity: 1;
}

/* 商品卡片点击动画 */
.product-card.clicked {
    transform: scale(0.95);
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background-color: white;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-radius: 30px;
    border: 2px solid var(--primary-color-light);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    width: 33.33%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bottom-nav-item:hover {
    transform: translateY(-3px);
}

.bottom-nav-icon {
    font-size: 26px;
    margin-bottom: 6px;
    transition: transform 0.3s ease;
}

.bottom-nav-item:hover .bottom-nav-icon {
    transform: scale(1.2);
}

.bottom-nav-icon svg {
    width: 26px;
    height: 26px;
}

.bottom-nav-text {
    font-size: 12px;
    color: var(--text-color-secondary);
    font-weight: 500;
}

/* 用户操作区域 */
.user-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-direction: row; /* 确保按钮水平排列 */
}

.user-actions .btn {
    padding: 8px 16px;
    min-width: 60px;
    font-size: 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #FF6B6B;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

#userName {
    font-size: 15px;
    font-weight: 500;
    color: white;
    margin-left: 4px;
}

.bottom-nav-item.active {
    position: relative;
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.bottom-nav-item.active .bottom-nav-icon {
    color: var(--primary-color);
}

.bottom-nav-item.active .bottom-nav-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
    color: var(--text-color-secondary);
}

/* 登录和注册模态框样式 */
.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);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modal-pop 0.3s ease;
}

.modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: var(--text-color);
    text-align: center;
}

.modal .close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal .close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-color);
    background-color: var(--card-background);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 15px;
    color: var(--text-color-secondary);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-footer a:hover {
    text-decoration: underline;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 217, 100, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 12px;
    }

    .search-bar {
        margin: 0 10px;
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .platform-icons {
        gap: 12px;
    }

    .platform-icons img {
        width: 36px;
        height: 36px;
    }
}

/* 返利模态框样式 */
.rebate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
}

/* 使用紧凑型样式的动画 */
@keyframes modal-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
