:root {
    --primary-color: #ff5722;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --secondary-text: #666666;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding-bottom: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 350px; /* 修改为350px */
    margin: 0 auto;
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 12px;
}

header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

header p {
    font-size: 12px;
    color: var(--secondary-text);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
    padding-left: 6px;
    border-left: 3px solid var(--primary-color);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column; /* 恢复为上下结构 */
    align-items: center;
    padding: 0; /* 移除内边距 */
}

.card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 9/16; /* 改为竖屏长图比例 */
    border-radius: 0;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 0;
}

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

.card-content {
    padding: 8px; /* 恢复内容内边距 */
    text-align: center; /* 居中对齐 */
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 15px; /* 稍微增大字号 */
    font-weight: 600;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 12px;
    color: var(--secondary-text);
    margin-bottom: 6px;
}

.card-btn {
    margin-top: 0;
    background-color: #fff5f2;
    color: var(--primary-color);
    border: 1px solid rgba(255, 87, 34, 0.2);
    padding: 4px 12px; /* 稍微增大按钮 */
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    align-self: center; /* 按钮居中 */
}

footer {
    text-align: center;
    margin-top: auto;
    font-size: 10px;
    color: #999;
    padding-top: 10px;
}

/* Toast Notification */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 12px 24px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 80px; /* 避开底部按钮 */
}

/* 针对不同平台的颜色微调 */
.card[data-type="meituan"] .card-title { color: #FFC300; }
.card[data-type="eleme"] .card-title { color: #0085FF; }
.card[data-type="jd"] .card-title { color: #E1251B; }
.card[data-type="taobao"] .card-title { color: #FF5000; }

/* 底部加群按钮容器 */
.group-btn-container {
    margin: 15px 0 10px;
    text-align: center;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 加群按钮样式 - 增强版 */
.group-btn {
    background: linear-gradient(45deg, #FF512F 0%, #DD2476 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 6px 12px rgba(221, 36, 118, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 280px;
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 按钮微光动画 */
.group-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    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: rotate(30deg);
    animation: shine 3s infinite;
}

/* 弹窗中的保存按钮 */
.save-qr-btn {
    background-color: #07c160;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin: 10px auto;
    cursor: pointer;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(7, 193, 96, 0.2);
}

.save-qr-btn:active {
    transform: scale(0.95);
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(30deg); }
    20% { transform: translateX(100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

/* 呼吸效果 */
.group-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 10px 20px rgba(221, 36, 118, 0.3); }
    50% { transform: scale(1.03); box-shadow: 0 15px 30px rgba(221, 36, 118, 0.5); }
    100% { transform: scale(1); box-shadow: 0 10px 20px rgba(221, 36, 118, 0.3); }
}

.group-btn:active {
    transform: scale(0.95);
    box-shadow: 0 5px 10px rgba(221, 36, 118, 0.2);
    animation: none; /* 点击时暂停呼吸动画 */
}

/* 弹窗样式 */
.fixed-bottom-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #07c160; /* 微信绿 */
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
    font-weight: 600;
    cursor: pointer;
    z-index: 999;
    width: 80%;
    max-width: 400px;
    text-align: center;
    transition: transform 0.2s;
}

.fixed-bottom-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    width: 85%;
    max-width: 320px;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h3 {
    margin-bottom: 8px;
    font-size: 18px;
    color: #333;
}

.modal-content p {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.qr-placeholder {
    margin: 16px 0;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    display: inline-block;
}

.qr-placeholder img {
    width: 200px;
    height: 200px;
    display: block;
}

.modal-tip {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}
