/* ===== 基础 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --orange: #ff6b00;
    --orange-light: #ff8c00;
    --bean-red: #e02020;
    --bean-red-light: #ff4444;
    --gold: #ffd700;
    --bg-cream: #fff9e5;
    --white: #ffffff;
    --text-dark: #333;
    --text-gray: #888;
    --radius: 16px;
    --radius-sm: 12px;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ===== 头部 ===== */
.header {
    background: linear-gradient(160deg, #ff5500 0%, #ff8c00 40%, #ffb347 100%);
    padding: 24px 16px 48px;
    position: relative;
    overflow: hidden;
}

.header::before,
.header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: .15;
    background: #fff;
}

.header::before {
    width: 120px; height: 120px;
    top: -30px; right: -20px;
}

.header::after {
    width: 80px; height: 80px;
    bottom: 10px; left: -20px;
}

.header-deco {
    position: absolute;
    font-size: 28px;
    opacity: .6;
    animation: float 3s ease-in-out infinite;
}

.header-deco:nth-child(1) { top: 15px; right: 30px; animation-delay: 0s; }
.header-deco:nth-child(2) { top: 50px; right: 80px; font-size: 22px; animation-delay: .5s; }
.header-deco:nth-child(3) { top: 30px; left: 20px; font-size: 20px; animation-delay: 1s; }

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

.header-content {
    position: relative;
    z-index: 1;
}

.header-title {
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.header-subtitle {
    font-size: clamp(12px, 3.2vw, 14px);
    color: rgba(255,255,255,.9);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* ===== 横幅 ===== */
.banner-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(90deg, #ff7700, #ff9500);
    border: 2px solid var(--gold);
    border-radius: 24px;
    padding: 10px 16px;
    margin-top: 4px;
}

.banner-bar .banner-icon { font-size: 22px; }
.banner-bar .banner-text {
    font-size: clamp(14px, 3.8vw, 16px);
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
}

/* ===== 内容区 ===== */
.main-content {
    background: var(--bg-cream);
    border-radius: 24px 24px 0 0;
    margin-top: -24px;
    position: relative;
    z-index: 2;
    padding: 20px 12px 32px;
    min-height: 50vh;
}

/* ===== 首页 2 列网格 ===== */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 2.5vw, 14px);
    max-width: 480px;
    margin: 0 auto;
}

.card-grid {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px 12px 12px;
    position: relative;
    box-shadow: 0 2px 12px rgba(255,107,0,.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform .15s;
    overflow: hidden;
}

.card-grid:active { transform: scale(.97); }

.card-tag {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: block;
    box-sizing: border-box;
    padding: 0 8px;
    height: 26px;
    line-height: 26px;
    background: linear-gradient(90deg, #ff9500, #ff6b00);
    color: #ffffff !important;
    font-size: 10px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    border-radius: var(--radius) 0 14px 0;
}

.card-grid .card-tag {
    width: 50%;
    padding-left: 8px;
}

.card-list .card-tag {
    width: 33.33%;
    padding-left: 8px;
    height: 24px;
    line-height: 24px;
    font-size: 9px;
}

.card-grid .card-icon {
    font-size: clamp(36px, 10vw, 48px);
    margin: 8px 0 10px;
    line-height: 1;
}

.card-icon-img {
    object-fit: contain;
    display: block;
}

.card-icon-img.card-icon-grid {
    width: clamp(36px, 10vw, 48px);
    height: clamp(36px, 10vw, 48px);
    margin: 8px 0 10px;
}

.card-list .card-icon-img.card-icon-list {
    width: clamp(32px, 8vw, 40px);
    height: clamp(32px, 8vw, 40px);
    flex-shrink: 0;
    margin-left: 4px;
}

.banner-icon-img {
    width: clamp(20px, 5vw, 24px);
    height: clamp(20px, 5vw, 24px);
    object-fit: contain;
    flex-shrink: 0;
}

.card-grid .card-name {
    font-size: clamp(14px, 3.8vw, 16px);
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

/* ===== 二级页 ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    color: var(--white);
    font-size: 18px;
    flex-shrink: 0;
}

.page-title {
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 800;
    color: var(--white);
}

.page-subtitle {
    font-size: clamp(12px, 3.2vw, 13px);
    color: rgba(255,255,255,.85);
    margin-top: 4px;
    padding-left: 44px;
}

/* ===== 1 列列表 ===== */
.list-1col {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2.5vw, 14px);
    max-width: 480px;
    margin: 0 auto;
}

.card-list {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 14px 14px;
    position: relative;
    box-shadow: 0 2px 12px rgba(255,107,0,.08);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform .15s;
    overflow: hidden;
}

.card-list:active { transform: scale(.98); }

.card-list .card-icon {
    font-size: clamp(32px, 8vw, 40px);
    flex-shrink: 0;
    margin-left: 4px;
}

.card-list .card-info {
    flex: 1;
    min-width: 0;
}

.card-list .card-title {
    font-size: clamp(14px, 3.8vw, 16px);
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-list .card-desc {
    font-size: clamp(11px, 3vw, 13px);
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 按钮 ===== */
.btn-claim {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bean-red-light), var(--bean-red));
    color: var(--white);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: clamp(12px, 3.2vw, 14px);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity .15s;
}

.btn-claim:active { opacity: .8; }

.card-grid .btn-claim {
    width: 100%;
    padding: 10px;
    margin-top: auto;
}

.btn-home-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 16px 32px;
    max-width: 480px;
    margin: 0 auto;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--orange-light), var(--orange));
    color: var(--white);
    border: none;
    border-radius: 24px;
    font-size: clamp(14px, 3.8vw, 16px);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25);
    transition: opacity .15s;
}

.btn-home:active { opacity: .85; }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
    font-size: 14px;
}

/* ===== 大屏适配 ===== */
@media (min-width: 481px) {
    .main-content { padding: 24px 16px 40px; }
    .grid-2col, .list-1col { max-width: 420px; }
}

@media (max-width: 320px) {
    .header { padding: 20px 12px 40px; }
    .card-grid { padding: 28px 8px 10px; }
    .card-grid .card-tag { width: 50%; height: 24px; line-height: 24px; font-size: 9px; }
    .card-list { padding: 26px 10px 12px; gap: 8px; }
    .card-list .card-tag { width: 33.33%; height: 22px; line-height: 22px; font-size: 8px; }
    .btn-claim { padding: 6px 12px; font-size: 12px; }
}
