﻿:root {
    --bg: #edf1f5;
    --bg-soft: #eef4ff;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --sub: #6b7280;
    --blue: #3b82f6;
    --blue-dark: #2563eb;
    --blue-soft: #eff6ff;
    --blue-soft-2: #dbeafe;
    --green: #16a34a;
    --orange: #f59e0b;
    --red: #ef4444;
    --red-soft: #fef2f2;
    --shadow: 0 8px 24px rgba(15, 23, 42, .06);
    --radius: 4px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --c1: #60a5fa;
    --c2: #22c55e;
    --c3: #f59e0b;
    --c4: #a78bfa;
    --c5: #8b5cf6;
    --c6: #ef4444;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background: #edf1f5;
    background-color: var(--bg);
    min-height: 100vh;
}

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

.app {
    min-height: 100vh;
}

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 14px 24px;
}

.detailRoot {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hero,
.section,
.summaryCard,
.hint {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 4px;
}

.hero,
.section {
    overflow: hidden;
}

.hero {
    padding: 16px 15px 14px;
    background: linear-gradient(135deg, #5d8fe6, #3f6fd1);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .14);
}

.ratioHero {
    background: linear-gradient(135deg, #5d8fe6, #3f6fd1);
    border-color: rgba(59, 130, 246, .24);
}

.heroTop {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.18);
}

.heroTitle h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.18;
    font-weight: 760;
    letter-spacing: -.02em;
}

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

.teamNameWrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.teamNameWrap.is-away {
    justify-content: flex-end;
}

.teamNameText {
    min-width: 0;
}

.teamVs {
    color: rgba(255,255,255,.78);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.teamLogo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, .18));
}

.heroMetaLine {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.heroMetaItem,
.actionBtn,
.tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.heroMetaItem {
    gap: 6px;
    color: rgba(255,255,255,.9);
    font-size: 12px;
    font-family: var(--mono);
}

.heroMetaSep {
    color: rgba(255,255,255,.48);
    font-size: 12px;
}

.leagueSwatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 0 3px rgba(255,255,255,.10);
}

.topActions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.actionBtn {
    height: 28px;
    padding: 0 0 2px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,.28);
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.heroNarrative {
    margin-top: 14px;
    max-width: 44em;
    font-size: 15px;
    line-height: 1.95;
    color: rgba(255,255,255,.95);
}

.cap {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cap {
    color: rgba(255,255,255,.92);
    margin-bottom: 8px;
}

.val,
.sectionSummary,
.sectionAdvice,
.richText {
    font-size: 13px;
    line-height: 1.85;
}

.val {
    color: #fff;
}

.sectionDesc {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.75;
    color: rgba(255,255,255,.86);
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.ratioHero .inlineLead {
    color: rgba(255,255,255,.78);
}

.ratioHero .heroNarrative,
.ratioHero .sectionDesc {
    color: rgba(255,255,255,.92);
}

.ratioHero .memoTag,
.ratioHero .memoTag-default,
.ratioHero .memoTag-main,
.ratioHero .memoTag-clear,
.ratioHero .memoTag-strong,
.ratioHero .memoTag-key,
.ratioHero .memoTag-brief,
.ratioHero .memoTag-warn,
.ratioHero .memoTag-note,
.ratioHero .memoTag-split,
.ratioHero .memoTag-rhythm,
.ratioHero .memoTag-process,
.ratioHero .memoTag-guide,
.ratioHero .memoTag-rq {
    color: #ffffff;
}

.section {
    background: #fff;
}

.sectionHeader {
    padding: 14px 14px 10px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.sectionHead {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    align-items: center;
}

.sectionHead h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 720;
    color: #0f172a;
    letter-spacing: -.01em;
}

.tip {
    min-height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.sectionDesc.richText {
    margin-top: 8px;
    color: #64748b;
}

.ratioHero .sectionDesc.richText {
    color: rgba(255,255,255,.88);
}

.sectionBody {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
}

.sectionPanel {
    min-width: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.chartPanel {
    background: linear-gradient(180deg, #fbfdff 0%, #f6faff 100%);
    border: 1px solid #e8eef8;
    border-radius: 4px;
    padding: 12px;
}

.chartHead {
    margin-bottom: 10px;
}

.sectionSummary {
    color: #475569;
}

.sectionAdvice {
    color: #7c2d12;
}

.sectionSummary .text-em-main,
.sectionAdvice .text-em-main {
    color: #1d4ed8;
    font-weight: 700;
}

.sectionSummary .text-em-warn,
.sectionAdvice .text-em-warn {
    color: #b45309;
    font-weight: 700;
}

.sectionSummary .text-em-soft,
.sectionAdvice .text-em-soft {
    color: #0f766e;
    font-weight: 700;
}

.sectionBrief {
    font-size: 14px;
    line-height: 1.9;
    color: #334155;
    padding-bottom: 2px;
}

.sectionTextFlow {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 2px;
    border-top: 1px solid #f1f5f9;
}

.sectionTextBlock {
    margin: 0;
    font-size: 13px;
    line-height: 1.85;
    color: #475569;
}

.sectionTextBlock-warm {
    color: #7c2d12;
}

.inlineLead {
    margin-right: 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chartBlock {
    margin-top: 0;
    padding: 10px 0 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.stackRow {
    display: grid;
    grid-template-columns: 98px 1fr;
    gap: 10px;
    align-items: start;
    margin: 10px 0;
}

.rowLabel {
    font-size: 12px;
    color: #374151;
    line-height: 1.55;
}

.rowLabel .pct {
    display: block;
    margin-top: 4px;
    font-family: var(--mono);
    font-size: 11px;
    color: #6b7280;
}

.rowChart {
    min-width: 0;
}

.barWrap {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #edf2f7;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: relative;
}

.barOuter {
    transform-origin: left center;
    height: 100%;
    width: 100%;
}

.bar {
    height: 100%;
    width: 100%;
    display: flex;
}

.seg {
    height: 100%;
    min-width: 0;
    position: relative;
}

.seg::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -.5px;
    width: 1px;
    background: rgba(255,255,255,.55);
}

.seg:last-child::after {
    display: none;
}

.legend {
    margin-top: 10px;
    display: flex;
    gap: 8px 10px;
    color: #64748b;
    font-size: 11px;
    flex-wrap: wrap;
}

.lg {
    display: flex;
    gap: 5px;
    align-items: center;
    min-width: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.sw {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.lg .t,
.lg .v {
    font-family: var(--mono);
}

.lg .t {
    color: #374151;
}

.lg .v {
    color: #111827;
    font-size: 11px;
    font-weight: 700;
}

.memoTag {
    display: inline;
    min-height: 0;
    padding: 0;
    margin-right: 4px;
    margin-bottom: 0;
    border-radius: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    vertical-align: middle;
    border: none;
}

.memoTag-default {
    color: #475569;
    background: transparent;
}

.memoTag-main,
.memoTag-clear,
.memoTag-strong {
    color: #15803d;
    background: transparent;
}

.memoTag-key,
.memoTag-brief {
    color: #b45309;
    background: transparent;
}

.memoTag-warn,
.memoTag-note {
    color: #b91c1c;
    background: transparent;
}

.memoTag-split {
    color: #7c3aed;
    background: transparent;
}

.memoTag-rhythm,
.memoTag-process,
.memoTag-guide,
.memoTag-rq {
    color: var(--blue-dark);
    background: transparent;
}

.hint {
    padding: 14px;
    font-size: 13px;
    color: var(--sub);
}

.site-footer {
    margin-top: 20px;
    padding: 16px 12px calc(20px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 12px;
    color: var(--sub);
}

.law-note {
    margin-bottom: 10px;
    color: #b91c1c;
    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);
    text-decoration: none;
    padding: 2px 4px;
}

.footer-links .sep {
    opacity: .4;
}

.footer-meta {
    margin-top: 10px;
    line-height: 1.6;
}

.footer-meta .slogan {
    margin-top: 3px;
    font-size: 11px;
    color: #8b93a1;
}

#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: var(--blue);
    border: none;
    color: #fff;
    box-shadow: 0 10px 24px rgba(59,130,246,.28);
    font-size: 18px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 20;
}

#backToTop.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media (max-width: 768px) {
    .wrap {
        padding: 12px 12px 24px;
    }

    .topActions {
        width: 100%;
        justify-content: flex-start;
    }

    .stackRow {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .heroTitle h2 {
        font-size: 20px;
    }

    .teamTitle {
        gap: 8px;
    }

    .teamLogo {
        width: 20px;
        height: 20px;
    }

    .sectionHead h3 {
        font-size: 16px;
    }
}

/* footer compact mobile override */
@media (max-width: 640px) {
    .site-footer {
        padding: 12px 8px calc(14px + env(safe-area-inset-bottom));
    }

    .law-note {
        margin-bottom: 6px !important;
        font-size: 11px;
        line-height: 1.25;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .footer-inner {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .footer-links {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        line-height: 1.4;
        padding-bottom: 1px;
    }

    .footer-links a,
    .footer-links .sep {
        flex: 0 0 auto;
    }

    .footer-links a {
        padding: 1px 2px;
        font-size: 11px;
    }

    .footer-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        width: 100%;
        margin-top: 0;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        line-height: 1.3;
        font-size: 11px;
    }

    .footer-meta > div {
        flex: 0 0 auto;
    }

    .footer-meta .slogan {
        margin-top: 0;
        font-size: 10px;
    }

    .law-note::-webkit-scrollbar,
    .footer-links::-webkit-scrollbar,
    .footer-meta::-webkit-scrollbar {
        display: none;
    }

    .login-footer {
        padding: 0 8px calc(env(safe-area-inset-bottom) + 14px);
    }

    .login-footer .footer-links {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        font-size: 11px;
        line-height: 1.4;
    }

    .login-footer .footer-links a,
    .login-footer .sep {
        flex: 0 0 auto;
    }

    .login-footer .footer-note {
        margin-top: 6px;
        font-size: 11px;
        line-height: 1.25;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .login-footer .footer-links::-webkit-scrollbar,
    .login-footer .footer-note::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 720px) {
    .wrap {
        padding: 8px 6px 16px;
        gap: 8px;
    }

    .hero,
    .panel,
    .card,
    .table-wrap,
    .summary-box,
    .result-box {
        padding: 8px;
    }

    .hero h1 {
        font-size: 18px;
        font-weight: 600;
    }

    .desc,
    .muted,
    .panel-sub {
        font-size: 11px;
        line-height: 1.45;
    }
}


