﻿:root {
    --bg0: #070b14;
    --bg1: #0b1220;
    --card: rgba(255,255,255,.06);
    --card2: rgba(255,255,255,.08);
    --stroke: rgba(255,255,255,.12);
    --text: #eaf0ff;
    --muted: rgba(234,240,255,.72);
    --muted2: rgba(234,240,255,.52);
    --brand: #7c5cff;
    --brand2: #30d5c8;
    --good: #37d67a;
    --warn: #ffb020;
    --danger: #ff5c7a;
    --vip: #ffcc66;
    --shadow: 0 18px 40px rgba(0,0,0,.45);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "PingFang SC","Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: var(--bg1);
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 14px 14px 18px;
}

/* 顶部 */
.hero {
    border: 1px solid var(--stroke);
    background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(48,213,200,.10));
    box-shadow: var(--shadow);
    border-radius: calc(var(--radius));
    overflow: hidden;
    position: relative;
}

.hero:before {
    content: "";
    position: absolute;
    inset: -2px;
    background: var(--bg1);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    padding: 14px 14px 12px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand-left {
    min-width: 0;
    width: 100%;
}

.expert-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    flex: 0 0 auto;
}

.avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.expert-info {
    min-width: 0;
    flex: 1;
}

.brand h1 {
    margin: 0;
    font-size: 18px;
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expert-sub {
    margin-top: 7px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.brand p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.55;
}

.tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: calc(var(--radius));
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.82);
    flex: 0 0 auto;
}

/* 日期 tabs */
.tabs {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: rgba(124,92,255,.65) rgba(255,255,255,.08);
}

.tabs::-webkit-scrollbar {
    height: 8px;
}

.tabs::-webkit-scrollbar-track {
    background: rgba(255,255,255,.06);
    border-radius: 999px;
}

.tabs::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(124,92,255,.9), rgba(48,213,200,.85));
    border-radius: 999px;
}

.tab {
    flex: 0 0 auto;
    min-width: 106px;
    border-radius: calc(var(--radius));
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.10);
    padding: 10px 10px;
    cursor: pointer;
    user-select: none;
}

.tab.active {
    background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(48,213,200,.12));
    border-color: rgba(255,255,255,.16);
}

.tab .d {
    font-weight: 900;
    font-size: 13px;
    white-space: nowrap;
}

.tab .s {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(234,240,255,.66);
    font-size: 12px;
}

/* 按钮区 */
.common-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.92);
    border-radius: calc(var(--radius));
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    transition: .2s ease;
}

.action-btn:hover {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.20);
}

.action-btn.primary {
    background: linear-gradient(135deg, rgba(124,92,255,.28), rgba(48,213,200,.18));
    border-color: rgba(124,92,255,.40);
    box-shadow: 0 10px 24px rgba(124,92,255,.18);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, rgba(124,92,255,.36), rgba(48,213,200,.22));
}

/* 列表 */
.list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item {
    border-radius: calc(var(--radius));
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.10));
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
    overflow: hidden;
    position: relative;
}

.item.good {
    border: 2px solid rgba(255, 120, 120, 0.85);
    box-shadow: 0 14px 32px rgba(255, 80, 110, 0.18), 0 12px 30px rgba(0,0,0,.35);
}

.itemTop {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 10px;
}

.leftInfo {
    min-width: 0;
    flex: 1;
}

.row1 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lotteryId {
    letter-spacing: .3px;
    font-size: 12px;
    padding: 4px 0;
    color: var(--muted);
}

.time {
    color: rgba(234,240,255,.70);
    font-size: 12px;
}

.leagueWrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(234,240,255,.88);
    font-size: 12.5px;
    font-weight: 850;
}

.leagueDot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255,255,255,.06);
    flex: 0 0 auto;
}

.versus {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .2px;
    line-height: 1.25;
}

.team {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team.away {
    text-align: right;
}

.handicap {
    font-size: 12px;
    color: rgba(234,240,255,.72);
    font-weight: 800;
    margin-left: 4px;
}

.midScore {
    padding: 4px 6px;
    border-radius: calc(var(--radius));
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.72);
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
    text-align: center;
}

.midScore .ft {
    font-weight: 900;
    font-size: 12px;
    line-height: 1.2;
}

.midScore .ht {
    margin-top: 2px;
    font-size: 11px;
    color: rgba(234,240,255,.62);
    font-weight: 600;
    line-height: 1.2;
}

.midScore.vsOnly {
    padding: 4px 8px;
    font-size: 12px;
}

.rightStatus {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: 35%;
}

.status {
    font-size: 11px;
    padding: 4px 9px;
    border-radius: calc(var(--radius));
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.82);
    white-space: nowrap;
    font-weight: 800;
}

.status.good {
    border-color: rgba(255,92,122,.50);
    background: rgba(255,92,122,.80);
    color: rgba(255,220,228,1);
}

.status.bad {
    border-color: rgba(55,214,122,.54);
    background: rgba(55,214,122,.80);
    color: rgba(220,255,235,1);
}

.status.mid {
    border-color: rgba(255,176,32,.55);
    background: rgba(255,176,32,.80);
    color: rgba(255,230,200,1);
}

.status.err {
    color: var(--danger);
    border-color: rgba(255,120,120,.30);
}

/* 推荐区 */
.recommend {
    margin: 0 12px 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(48,213,200,.10)), rgba(255,255,255,.04);
    border-radius: calc(var(--radius));
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.recommend-title {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: rgba(234,240,255,.72);
    line-height: 1; /* 关键 */
    margin: 0;
}

.recommend-line {
    flex: 1;
    font-size: 12px;
    color: rgba(234,240,255,.96);
    line-height: 1; /* 关键 */
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.forecast {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 5px;
    margin-right: 2px;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    font-size: 12px;
}

.forecast.shoted {
    color: red !important;
    font-weight: 950;
}

.noteRow {
    margin: 0 12px 12px;
    padding: 10px 12px;
    color: rgba(234,240,255,.68);
    font-size: 12px;
    line-height: 1.65;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: calc(var(--radius));
    background: rgba(255,255,255,.03);
    white-space: pre-wrap;
    word-break: break-word;
}

.empty {
    text-align: center;
    color: rgba(234,240,255,.60);
    font-size: 13px;
    padding: 18px 12px;
    border: 1px dashed rgba(255,255,255,.16);
    border-radius: calc(var(--radius));
    background: rgba(0,0,0,.10);
}

/* footer */
.site-footer {
    margin-top: 22px;
    padding: 18px 12px calc(22px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 12px;
    color: rgba(234,240,255,.55);
}

.footer-inner {
    max-width: 980px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.8;
}

.footer-links a {
    color: rgba(234,240,255,.70);
    text-decoration: none;
    padding: 2px 4px;
}

.footer-links a:hover {
    color: rgba(234,240,255,.95);
}

.footer-links .sep {
    opacity: .35;
}

.footer-meta {
    margin-top: 10px;
    line-height: 1.6;
}

.footer-meta .slogan {
    margin-top: 4px;
    font-size: 11px;
    opacity: .65;
}

/* 导出弹窗 */
.export-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
}

.export-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.56);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.export-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: linear-gradient(180deg, rgba(17,22,35,.98), rgba(11,18,32,.98));
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
}

.export-header,
.export-footer {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.export-header {
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.export-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    justify-content: flex-end;
}

.export-title {
    font-size: 16px;
    font-weight: 950;
    color: rgba(234,240,255,.96);
}

.export-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(234,240,255,.72);
    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: 900;
    color: rgba(234,240,255,.84);
}

.template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.template-item {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.05);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: .2s ease;
}

.template-item:hover {
    border-color: rgba(255,255,255,.22);
    transform: translateY(-1px);
}

.template-item.active {
    border-color: rgba(124,92,255,.65);
    box-shadow: 0 0 0 1px rgba(124,92,255,.35), 0 10px 20px rgba(124,92,255,.16);
    background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(48,213,200,.08));
}

.template-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    background: rgba(255,255,255,.04);
}

.template-name {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 800;
    color: rgba(234,240,255,.88);
}

.wechat-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: var(--text);
    outline: none;
    font-size: 14px;
}

.wechat-input::placeholder {
    color: rgba(234,240,255,.42);
}

.export-tip {
    font-size: 12px;
    line-height: 1.7;
    color: rgba(234,240,255,.66);
}

.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: 720px) {
    .wrap {
        padding: 18px 18px 22px;
    }

    .brand h1 {
        font-size: 20px;
    }
}

@media (max-width: 640px) {
    .common-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .action-btn {
        text-align: center;
    }

    .export-panel {
        width: calc(100vw - 16px);
    }

    .template-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .recommend-line {
        gap: 4px;
    }
}
