﻿:root {
    --bg: #edf1f5;
    --card: #fffdfa;
    --border: #ded2c2;
    --text: #2b241f;
    --sub: #75685d;
    --sub-2: #8f8174;
    --brown: #8a5b35;
    --brown-dark: #6f4728;
    --brown-soft: #f7efe4;
    --red: #c53f37;
    --red-soft: #fff0ed;
    --shadow: 0 8px 24px rgba(60, 42, 28, 0.08);
    --shadow-soft: 0 4px 14px rgba(60, 42, 28, 0.05);
    --radius: 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: #edf1f5;
    padding: 62px 0 calc(92px + env(safe-area-inset-bottom));
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

.hidden {
    display: none !important;
}

.site-app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    width: 100%;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid rgba(229, 231, 235, .88);
    box-shadow: 0 8px 24px rgba(60, 42, 28, .08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.site-app-header-inner {
    max-width: 760px;
    min-height: 62px;
    margin: 0 auto;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-app-logo {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.site-app-logo-box {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--brown);
}

.site-app-logo-box img {
    width: 100%;
    height: 100%;
    display: block;
}

.site-app-logo-text {
    min-width: 0;
    display: block;
}

.site-app-logo-text strong,
.site-app-logo-text small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.site-app-logo-text strong {
    color: var(--text);
    font-size: 16px;
    line-height: 1.1;
    font-weight: 900;
}

.site-app-logo-text small {
    margin-top: 3px;
    color: var(--sub);
    font-size: 11px;
    line-height: 1.2;
}

.site-app-header-actions {
    flex: 0 0 auto;
}

.hero-actions {
    position: relative;
    z-index: 20;
}

.hero-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: var(--radius);
    border: 1px solid #ead9c5;
    background: #fbf2e8;
    color: var(--brown-dark);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.hero-menu-btn:hover {
    background: var(--brown-soft);
}

.hero-menu-icon {
    display: inline-block;
    font-size: 13px;
    line-height: 1;
}

.hero-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: 154px;
    padding: 6px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(222, 210, 194, .95);
    box-shadow: 0 12px 30px rgba(60, 42, 28, .14);
}

.hero-menu-item {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.hero-menu-item:hover {
    background: var(--brown-soft);
    color: var(--brown-dark);
}

.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 {
    border-radius: var(--radius);
    padding: 15px 14px;
    color: #fff8f1;
    background: linear-gradient(135deg, #9b6b42, #7b4d2f);
    box-shadow: var(--shadow);
}

.hero-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.hero-home-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 248, 241, 0.96);
    text-decoration: none;
}

.hero-home-link:hover {
    color: #fff;
}

.hero-kicker {
    font-size: 12px;
    opacity: .9;
}

.hero-title {
    margin: 6px 0 0;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 800;
}

.hero-subtitle {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    opacity: .92;
}

.filter-card,
.summary-strip,
.warning-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.filter-card {
    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;
}

.tabs {
    display: flex;
    gap: 8px;
    overflow-x: scroll;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: auto;
    -ms-overflow-style: auto;
    scrollbar-gutter: stable;
}

.tabs::-webkit-scrollbar {
    height: 10px;
}

.tabs::-webkit-scrollbar-track {
    background: #e9dfd2;
    border-radius: 999px;
}

.tabs::-webkit-scrollbar-thumb {
    background: #b28a67;
    border-radius: 999px;
}

.tabs::-webkit-scrollbar-thumb:hover {
    background: #8a5b35;
}

.tab {
    flex: 0 0 auto;
    min-width: 112px;
    padding: 10px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #faf7f2;
    cursor: pointer;
}

.tab.active {
    background: var(--brown-soft);
    border-color: #cfb69c;
    box-shadow: 0 5px 14px rgba(138, 91, 53, 0.1);
}

.tab .d {
    font-size: 13px;
    font-weight: 800;
}

.tab .s {
    margin-top: 5px;
    font-size: 12px;
    color: var(--sub);
}

.common-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.action-btn.primary {
    color: #fff8f1;
    background: var(--brown);
    border-color: var(--brown);
}

.summary-strip {
    margin-bottom: 12px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.summary-card {
    padding: 10px;
    border-radius: var(--radius);
    background: #faf5ef;
    border: 1px solid #ece0d2;
}

.summary-card span {
    display: block;
    font-size: 12px;
    color: var(--sub);
}

.summary-card strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-lock-card {
    position: relative;
    overflow: hidden;
    min-height: 320px;
    padding: 28px 18px;
    display: grid;
    place-items: center;
    gap: 18px;
    border: 1px solid rgba(201, 164, 74, 0.24);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(225, 186, 89, 0.22), transparent 30%),
        radial-gradient(circle at bottom left, rgba(165, 120, 36, 0.12), transparent 28%),
        linear-gradient(135deg, rgba(255, 251, 239, 0.98) 0%, rgba(249, 239, 206, 0.96) 52%, rgba(255, 252, 244, 0.98) 100%);
    box-shadow: 0 16px 36px rgba(96, 68, 18, 0.10);
    text-align: center;
    cursor: pointer;
}

.login-lock-card::after {
    content: "";
    position: absolute;
    inset: auto -34px -34px auto;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(207, 167, 71, 0.22), rgba(207, 167, 71, 0));
    pointer-events: none;
}

.login-lock-icon {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(202, 164, 72, 0.24);
    background: linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(255, 246, 217, 0.94) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.74), 0 12px 24px rgba(138, 103, 30, 0.12);
}

.login-lock-icon svg {
    width: 48px;
    height: 48px;
    fill: none;
    stroke: #ae8026;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-lock-text {
    font-size: 26px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #8b6520;
}

.warning-card {
    overflow: hidden;
}

.warning-card.is-upset-hit {
    border-color: #e6a6a0;
    box-shadow: 0 10px 26px rgba(197, 63, 55, 0.12);
}

.warning-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 10px;
}

.warning-main {
    min-width: 0;
    flex: 1;
}

.warning-topline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.warning-id,
.warning-date {
    font-size: 12px;
    color: var(--sub);
    font-weight: 700;
}

.warning-league {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 800;
}

.warning-hit-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #d84c42 0%, #bf392f 100%);
    color: #fff4f1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.warning-league-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.warning-teams {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.warning-team {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.warning-team.away {
    text-align: right;
}

.warning-vs {
    padding: 4px 8px;
    border-radius: var(--radius);
    background: #f7f2eb;
    color: var(--sub);
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
}

.warning-side {
    text-align: right;
}

.warning-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--red-soft);
    color: var(--red);
    font-size: 18px;
    font-weight: 800;
}

.warning-level {
    margin-top: 5px;
    font-size: 11px;
    color: var(--sub-2);
}

.warning-body {
    padding: 0 12px 12px;
}

.warning-summary {
    padding: 10px;
    border-radius: var(--radius);
    background: #fbf7f1;
    border: 1px solid #eee3d6;
    font-size: 13px;
    line-height: 1.6;
}

.warning-summary strong {
    color: var(--red);
}

.warning-paths {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.warning-path {
    padding: 9px 10px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px dashed #e3d5c6;
    font-size: 12px;
    line-height: 1.55;
}

.warning-path strong {
    color: var(--brown-dark);
}

.warning-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.warning-state {
    font-size: 12px;
    color: var(--sub);
}

.warning-state.reviewed {
    color: var(--red);
    font-weight: 700;
}

.analysis-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius);
    background: var(--brown);
    color: #fff8f1;
    font-size: 12px;
    font-weight: 700;
}

.empty {
    padding: 18px 14px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.86);
    color: var(--sub);
}

.site-footer {
    margin-top: 18px;
    padding: 18px 14px 22px;
    text-align: center;
    font-size: 12px;
    color: var(--sub);
    border-top: 1px solid #e5ddd4;
}

.law-note {
    margin-bottom: 10px;
    color: #cf2f2f;
    line-height: 1.5;
}

.footer-inner,
.footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
}

.footer-meta {
    font-size: 11px;
    line-height: 1.7;
}

.simple-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(4px);
}

.export-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.export-mask {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.48);
    backdrop-filter: blur(4px);
}

.export-panel {
    position: relative;
    width: min(94vw, 760px);
    max-height: calc(100vh - 32px);
    margin: 16px auto;
    overflow: auto;
    border-radius: 8px;
    background: #fffdfa;
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.24);
}

.export-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #eee3d6;
}

.export-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--text);
}

.export-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #f7efe4;
    color: var(--brown-dark);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.export-body {
    padding: 14px 18px 4px;
}

.export-section {
    margin-bottom: 14px;
}

.export-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.export-label {
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 800;
    color: var(--sub);
}

.export-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd2c4;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.export-input:focus {
    border-color: var(--brown);
    box-shadow: 0 0 0 3px rgba(138, 91, 53, 0.12);
}

.template-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.template-item {
    border: 1px solid #ddd2c4;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
    cursor: pointer;
    transition: .18s ease;
}

.template-item.active {
    border-color: var(--brown);
    box-shadow: 0 0 0 2px rgba(138, 91, 53, 0.12);
    background: #fffaf3;
}

.template-item:hover {
    transform: translateY(-1px);
    border-color: #b28a67;
}

.template-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border: 1px solid #eadfd1;
    border-radius: 6px;
}

.template-sheet {
    position: absolute;
    inset: 0;
    padding: 10px 9px;
}

.template-head {
    height: 34%;
    margin-bottom: 8px;
    border-radius: 4px;
}

.template-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.template-line {
    height: 8px;
    border-radius: 999px;
    opacity: .9;
}

.template-line.short {
    width: 68%;
}

.template-flame .template-preview {
    background: #fff3e8;
}

.template-flame .template-head {
    background: linear-gradient(135deg, #b91c1c, #f97316);
}

.template-flame .template-line {
    background: #d97706;
}

.template-gold .template-preview {
    background: #f8f2e8;
}

.template-gold .template-head {
    background: linear-gradient(135deg, #6f4728, #b7791f);
}

.template-gold .template-line {
    background: #b28a67;
}

.template-night .template-preview {
    background: #eff4fb;
}

.template-night .template-head {
    background: linear-gradient(135deg, #172554, #7f1d1d);
}

.template-night .template-line {
    background: #64748b;
}

.template-name {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.template-desc {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--sub);
}

.export-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px 18px;
}

.export-btn {
    min-width: 96px;
    height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.export-btn-light {
    background: #fff;
    border-color: #ddd2c4;
    color: var(--sub);
}

.export-btn-main {
    background: var(--brown);
    border-color: var(--brown);
    color: #fff8f1;
}

.poster-sandbox {
    position: fixed;
    left: -20000px;
    top: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.loading-circle {
    width: 46px;
    height: 46px;
    border: 3px solid rgba(138, 91, 53, .16);
    border-top: 3px solid var(--brown);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#backToTop {
    position: fixed;
    right: 16px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--brown);
    color: #fff8f1;
    font-size: 20px;
    box-shadow: var(--shadow);
    display: none;
}

#backToTop.show {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    width: 100%;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid rgba(229, 231, 235, .95);
    box-shadow: 0 -12px 30px rgba(60, 42, 28, .10);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.app-tabbar-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
}

.app-tab {
    min-width: 0;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: var(--radius);
    color: #8f8174;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
}

.app-tab svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-tab.active {
    color: var(--brown-dark);
    background: var(--brown-soft);
}

@media (max-width: 640px) {
    .site-app-header-inner {
        min-height: 56px;
        padding: calc(env(safe-area-inset-top, 0px) + 8px) 6px 8px;
        gap: 8px;
    }

    .site-app-logo-box {
        width: 34px;
        height: 34px;
    }

    .site-app-logo-text small {
        max-width: 180px;
    }

    .site-app-header .hero-menu-btn {
        min-height: 36px;
        padding: 0 10px;
    }

    .hero-menu {
        width: 146px;
    }

    .app-tabbar-inner {
        padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
        gap: 2px;
    }

    .app-tab {
        min-height: 50px;
    }

    .login-lock-card {
        min-height: 240px;
        padding: 22px 14px;
        gap: 14px;
    }

    .login-lock-icon {
        width: 80px;
        height: 80px;
    }

    .login-lock-icon svg {
        width: 40px;
        height: 40px;
    }

    .login-lock-text {
        font-size: 20px;
    }

    .summary-strip {
        grid-template-columns: 1fr;
    }

    .warning-header {
        flex-direction: column;
    }

    .warning-side {
        text-align: left;
    }

    .warning-footer,
    .common-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .common-actions,
    .export-grid-2,
    .template-list {
        grid-template-columns: 1fr;
    }

    .export-panel {
        max-height: calc(100vh - 20px);
        margin: 10px auto;
    }

    .analysis-link,
    .action-btn {
        width: 100%;
    }

    .warning-teams {
        font-size: 14px;
    }
}

