﻿:root {
    --bg: #f4f5f7;
    --bg-soft: #f3fbf6;
    --bg-soft-2: #eef5ef;
    --card: #ffffff;
    --border: #e6e7eb;
    --border-soft: #ececef;
    --text: #1f2328;
    --sub: #6b7280;
    --sub-2: #8a8f98;
    --green: #2fa66a;
    --green-dark: #278c59;
    --green-soft: #eaf8f0;
    --green-soft-2: #f4fbf7;
    --green-line: #cfe9da;
    --red: #e53935;
    --orange: #f59e0b;
    --shadow: 0 8px 24px rgba(20, 24, 32, 0.06);
    --shadow-soft: 0 4px 14px rgba(20, 24, 32, 0.04);
    --radius: 4px;
    --radius-sm: 4px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(255, 164, 122, 0.28), transparent 34%), linear-gradient(180deg, #fff7f0 0%, var(--bg) 32%, #f2ede7 100%);
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
    font: inherit;
}

.wrap {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 12px 18px;
}

/* 顶部主卡 */
.hero {
    margin-bottom: 14px;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-top {
    background: linear-gradient(135deg, #35b572, #2fa66a);
    border-radius: var(--radius);
    padding: 14px;
    color: #fff;
    box-shadow: var(--shadow);
}

.hero-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.hero-kicker {
    font-size: 12px;
    opacity: .92;
    margin-bottom: 6px;
}

.hero-main-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.hero-subtitle {
    margin-top: 6px;
    font-size: 12px;
    opacity: .92;
    line-height: 1.6;
}

/* 白色筛选卡 */
.filter-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.filter-label {
    font-size: 12px;
    color: var(--sub);
    font-weight: 700;
    line-height: 1.2;
}

/* tabs */
.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex: 0 0 auto;
    min-width: 104px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fafafb;
    padding: 10px 10px;
    cursor: pointer;
    user-select: none;
    transition: .18s ease;
}

.tab:hover {
    background: #f7faf8;
    border-color: #dce8e0;
}

.tab.active {
    background: var(--green-soft);
    border-color: #bfe1cd;
    box-shadow: 0 4px 10px rgba(47,166,106,.10);
}

.tab .d {
    font-weight: 800;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
}

.tab .s {
    margin-top: 6px;
    color: var(--sub);
    font-size: 12px;
    line-height: 1.2;
}

.tab.active .d {
    color: var(--green-dark);
}

.tab.active .s {
    color: #4f7d63;
}

/* 按钮区 */
.common-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.action-btn {
    appearance: none;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
}

.action-btn:hover {
    background: #f8f9fb;
}

.action-btn.primary {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.action-btn.primary:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
}

/* 列表 */
.list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
}

.match.good {
    border-color: red;
    box-shadow: 0 8px 18px rgba(217,48,37,.10);
}

.match:active {
    transform: scale(.996);
}

.match-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 10px;
}

.left {
    min-width: 0;
    flex: 1;
}

.topline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.jid {
    letter-spacing: .2px;
    font-size: 12px;
    color: var(--sub);
    font-weight: 700;
}

.date {
    color: var(--sub);
    font-size: 12px;
}

.league {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 800;
}

.l-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(47,166,106,.08);
    flex: 0 0 auto;
}

.teams {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.teams .vs {
    padding: 4px 8px;
    border-radius: var(--radius);
    background: #f7f8fa;
    color: var(--sub);
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
}

.teams .t {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teams .t.away {
    text-align: right;
}

.right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: 34%;
}

.status {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--sub);
    white-space: nowrap;
    font-weight: 800;
}

.badge.hit {
    border-color: #f2b8b5;
    background: #fff1f0;
    color: #d93025;
}

.badge.miss {
    border-color: #e5e7eb;
    background: #f7f7f8;
    color: #6b7280;
}

.badge.pending {
    border-color: #f7ddb1;
    background: #fff5df;
    color: #b76e00;
}

/* 推荐区域 */
.recommend {
    margin: 0 12px 12px;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(180deg, #fbfcfc 0%, #f8fbf9 100%);
    border-radius: var(--radius);
    border: 1px solid #edf0f1;
}

.recommend-title {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: var(--sub);
    line-height: 1.2;
    margin-top: 2px;
}

.recommend-line {
    flex: 1;
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.forecast {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e8ebee;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.shoted {
    color: #d93025 !important;
    border-color: #f2b8b5 !important;
    background: #fff1f0 !important;
    font-weight: 800;
}

.fullscore {
    font-weight: 800;
    color: var(--text);
}

.halfscore {
    margin-left: 4px;
    color: var(--sub);
    font-size: 12px;
    font-weight: 600;
}

/* 命中比赛整卡淡绿色 */

.match.good .teams .vs {
    background: #edf7f0;
}

.match.good .jid,
.match.good .date {
    color: #4f7d63;
}

/* 空状态 */
.empty {
    text-align: center;
    color: var(--sub);
    font-size: 13px;
    padding: 18px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(255,255,255,.72);
}

/* footer */
.site-footer {
    margin-top: 22px;
    padding: 16px 10px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--sub);
}

.law-note {
    margin-bottom: 10px;
    color: var(--red);
    font-weight: 700;
}

.footer-inner {
    max-width: 760px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.8;
}

.footer-links a {
    color: var(--sub);
    padding: 2px 4px;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-links .sep {
    color: #c4c7cc;
}

.footer-meta {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.6;
}

.footer-meta .slogan {
    margin-top: 2px;
    color: var(--sub-2);
}

/* 回到顶部 */
#backToTop {
    position: fixed;
    right: 18px;
    bottom: 24px;
    width: 42px;
    height: 42px;
    line-height: 42px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    background: #fff;
    border: 1px solid #cfe9da;
    color: var(--green);
    box-shadow: 0 8px 20px rgba(20,24,32,.10);
    font-size: 18px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

#backToTop.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 导出弹窗 */
.export-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
}

.export-mask {
    position: absolute;
    inset: 0;
    background: rgba(31,35,40,.22);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.export-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    overflow: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 18px 48px rgba(20,24,32,.12);
}

.export-header,
.export-footer {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.export-header {
    border-bottom: 1px solid var(--border);
}

.export-footer {
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.export-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.export-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--sub);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.export-body {
    padding: 16px;
}

.export-section + .export-section {
    margin-top: 18px;
}

.export-label {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.template-item {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius);
    padding: 8px;
    cursor: pointer;
    transition: .18s ease;
}

.template-item:hover {
    border-color: #cfe9da;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(47,166,106,.06);
}

.template-item.active {
    border-color: #bfe1cd;
    box-shadow: 0 0 0 1px rgba(47,166,106,.08), 0 8px 18px rgba(47,166,106,.08);
    background: #f7fdf9;
}

.template-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
    background: #f7f7f8;
}

.template-name {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.wechat-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    outline: none;
    font-size: 14px;
}

.wechat-input::placeholder {
    color: #a0a6ad;
}

.export-tip {
    font-size: 12px;
    line-height: 1.7;
    color: var(--sub);
}

.poster-sandbox {
    position: fixed;
    left: -20000px;
    top: 0;
    width: 1080px;
    min-height: 10px;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    background: #fff;
}

.poster-render-root {
    width: 1080px;
    background: #fff;
    overflow: hidden;
}

.poster-qrcode-img {
    display: block;
    width: 100%;
    height: 100%;
}

@media (min-width: 721px) {
    .wrap {
        padding: 16px 16px 22px;
    }
}

@media (max-width: 640px) {
    .wrap {
        padding: 10px 10px 16px;
    }

    .hero-top {
        padding: 12px;
    }

    .hero-main-title {
        font-size: 18px;
    }

    .filter-card {
        padding: 10px;
        gap: 10px;
    }

    .match-header {
        gap: 10px;
    }

    .right {
        max-width: 40%;
    }

    .recommend-line {
        font-size: 12px;
    }

    .action-btn {
        text-align: center;
    }

    .tab {
        min-width: 96px;
    }

    .export-panel {
        width: calc(100vw - 14px);
    }

    .template-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
