:root {
    --green-950: #111b29;
    --green-900: #18293d;
    --green-800: #234866;
    --green-700: #2f638a;
    --green-100: #eaf1f6;
    --gold: #f6c75b;
    --orange: #f36b32;
    --red: #d93c2f;
    --blue: #1f5fbf;
    --ink: #17212c;
    --muted: #69737d;
    --line: #dfe4e7;
    --page: #f3f1ed;
    --surface: #ffffff;
    --shadow: 0 10px 26px rgba(22, 36, 50, 0.08);
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page);
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

svg {
    display: block;
}

.site-shell {
    min-height: 100vh;
}

.site-footer {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px max(20px, calc((100% - 1124px) / 2));
    color: #718078;
    background: #ffffff;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.seo-intro {
    margin-top: 22px;
    padding: 24px 28px;
    color: #53635b;
    background: #fff;
    border: 1px solid #e0e7e3;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(8, 48, 30, .05);
}

.seo-intro h2 { margin: 0 0 12px; color: #19382b; font-size: 20px; }
.seo-intro p { margin: 7px 0; font-size: 13px; line-height: 1.8; }
.seo-intro ul { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 0; list-style: none; }
.seo-intro li { color: #287154; font-size: 12px; font-weight: 800; }
.seo-intro li:before { content: "✓"; margin-right: 5px; }

.site-footer nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-footer .support-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #68736e;
    font-weight: 700;
}

.site-footer .support-link strong {
    color: var(--green-800);
    font-weight: 900;
}

.site-footer .support-link span {
    color: #b0b9b4;
}

.site-footer a,
.export-agreement a {
    color: var(--green-800);
    font-weight: 800;
    text-decoration: none;
}

.site-footer a:hover,
.export-agreement a:hover {
    text-decoration: underline;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(14px, 3vw, 28px);
    color: #ffffff;
    background:
        radial-gradient(circle at 16% -48%, rgba(246, 199, 91, 0.24), transparent 36%),
        linear-gradient(135deg, var(--green-950), var(--green-900) 58%, #294f70);
    box-shadow: 0 8px 24px rgba(17, 27, 41, 0.18);
}

.brand-lockup {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.site-header-nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.site-header-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .11);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
}

.site-header-link:hover,
.site-header-link:focus-visible {
    background: rgba(255, 255, 255, .2);
    outline: none;
}

.brand-mark {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
}

.brand-mark svg {
    width: 100%;
    height: 100%;
    fill: none;
}

.brand-mark path:first-child {
    fill: rgba(246, 199, 91, 0.18);
    stroke: var(--gold);
    stroke-width: 1.8;
}

.brand-mark circle,
.brand-mark path:not(:first-child) {
    stroke: #ffffff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-field svg,
.primary-download svg,
.download-btn svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.workspace {
    width: min(1260px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 18px;
    padding: 18px clamp(12px, 2.4vw, 28px) 32px;
}

.side-nav {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 106px);
    overflow: auto;
}

.side-nav-panel {
    padding: 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(19, 38, 53, 0.08);
}

.nav-group {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e7ebee;
}

.nav-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.nav-group-title {
    margin: 0 7px 7px;
    color: #89939a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.sport-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: #eef2f5;
    border: 0;
    border-radius: 8px;
}

.sport-tab,
.category-tab,
.plain-action,
.download-btn,
.primary-download {
    border: 0;
    -webkit-tap-highlight-color: transparent;
}

.sport-tab {
    height: 38px;
    color: #5e6864;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 900;
}

.sport-tab.active {
    color: #ffffff;
    background: #245474;
    box-shadow: 0 4px 10px rgba(36, 84, 116, 0.18);
}

.category-nav {
    display: grid;
    gap: 2px;
}

.category-tab {
    position: relative;
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px;
    color: #33414a;
    background: transparent;
    border: 0;
    border-radius: 7px;
    box-shadow: none;
    font-size: 14px;
    font-weight: 900;
    text-align: left;
}

.category-tab span {
    min-width: 22px;
    padding: 2px 6px;
    color: #74828b;
    background: #edf1f3;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.category-tab.active {
    color: #164b6d;
    background: #e3eff6;
    box-shadow: none;
}

.category-tab.active::before {
    content: "";
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 3px;
    background: #2f78a4;
    border-radius: 0 3px 3px 0;
}

.category-tab.active span {
    color: #245474;
    background: #ffffff;
}

@media (hover: hover) {
    .category-tab:not(.active):hover {
        background: #f2f5f7;
    }
}

.content-panel {
    min-width: 0;
}

.content-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.content-toolbar h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
    font-weight: 900;
}

.current-category {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .08em;
}

.content-toolbar p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

.search-field {
    flex: 0 1 320px;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    color: #7a8388;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.search-field input {
    min-width: 0;
    width: 100%;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 15px;
}

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

.poster-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #d8dee2;
    border-radius: 12px;
    box-shadow: 0 13px 30px rgba(23, 33, 44, 0.10);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.poster-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(23, 33, 44, 0.15);
}

.poster-art {
    min-height: 258px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 13px 13px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.poster-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 34%),
        radial-gradient(circle at 82% 24%, rgba(255, 255, 255, 0.2), transparent 20%);
    pointer-events: none;
}

.poster-art[data-tone="green"] {
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.52), transparent 11%),
        radial-gradient(circle at 82% 18%, rgba(246, 199, 91, 0.36), transparent 24%),
        linear-gradient(142deg, #03150d, #087443 54%, #031f14);
}

.poster-art[data-tone="blue"] {
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.42), transparent 11%),
        radial-gradient(circle at 78% 24%, rgba(88, 165, 255, 0.38), transparent 24%),
        linear-gradient(142deg, #061126, #1f5fbf 58%, #081221);
}

.poster-art[data-tone="gold"] {
    color: #211809;
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.42), transparent 11%),
        radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.38), transparent 24%),
        linear-gradient(142deg, #f9df93, #f6c75b 54%, #9b6612);
}

.poster-art[data-tone="orange"] {
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.42), transparent 11%),
        radial-gradient(circle at 76% 24%, rgba(255, 255, 255, 0.28), transparent 24%),
        linear-gradient(142deg, #6f140f, #f36b32 56%, #d71920);
}

.poster-art[data-tone="red"] {
    background:
        radial-gradient(circle at 80% 20%, rgba(246, 199, 91, 0.24), transparent 24%),
        linear-gradient(142deg, #300a0a, #9b1c18 58%, #1f0505);
}

.poster-kicker,
.poster-footer {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 800;
    opacity: 0.9;
}

.poster-title {
    position: relative;
    z-index: 1;
    margin: 6px 0 0;
    font-size: 25px;
    line-height: 1.08;
    font-weight: 1000;
}

.poster-art[data-kind="football-schedule"] .poster-title {
    font-size: 28px;
    text-shadow: none;
}

.poster-art[data-kind="football-schedule"] {
    color: #183024;
    background:
        linear-gradient(90deg, rgba(15, 76, 46, 0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(15, 76, 46, 0.08) 1px, transparent 1px),
        #f2f6f3;
    background-size: 18px 18px;
    border: 1px solid rgba(15, 76, 46, 0.16);
}

.poster-art[data-kind="football-schedule"]::before {
    display: none;
}

.poster-art[data-kind="football-schedule"] > div:first-child {
    position: relative;
    z-index: 1;
    margin: -16px -13px 0;
    padding: 13px;
    color: #ffffff;
    background: #0f4c2e;
    border-bottom: 3px solid #d7b35a;
}

.poster-art[data-kind="football-schedule"] .poster-kicker,
.poster-art[data-kind="football-schedule"] .poster-footer {
    color: inherit;
}

.poster-lines {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 6px;
    margin: 14px 0;
    padding: 10px;
    color: #111917;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
}

.poster-line {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 5px;
    align-items: center;
    font-size: 11px;
    font-weight: 800;
}

.poster-line span:nth-child(2),
.poster-line span:nth-child(4) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poster-line strong {
    color: var(--red);
}

.poster-money {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    margin: 18px 0;
    padding: 13px 16px;
    color: #9d230f;
    background: rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    font-size: 34px;
    font-weight: 1000;
    line-height: 1;
}

.poster-body-text {
    position: relative;
    z-index: 1;
    margin: 16px 0;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 900;
}

.schedule-preview {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0;
    margin: 12px 0;
    padding: 0;
    color: #14201b;
    background: #ffffff;
    border: 1px solid rgba(15, 76, 46, 0.22);
    border-radius: 4px;
    box-shadow: none;
    overflow: hidden;
}

.schedule-match,
.schedule-teams,
.schedule-odds span {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.schedule-match {
    padding: 5px 7px;
    color: #ffffff;
    background: #173f2b;
    font-size: 10px;
    font-weight: 900;
}

.schedule-match strong {
    color: #f8df92;
}

.schedule-teams {
    padding: 8px 7px;
    font-size: 15px;
    font-weight: 1000;
    border-bottom: 1px solid rgba(15, 76, 46, 0.16);
}

.schedule-teams span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-teams strong {
    color: var(--green-800);
    font-size: 11px;
}

.schedule-odds {
    display: grid;
    gap: 0;
}

.schedule-odds span {
    min-height: 22px;
    padding: 0 7px;
    color: #26302c;
    background: #ffffff;
    border-bottom: 1px solid rgba(5, 62, 34, 0.12);
    border-radius: 0;
    font-size: 10px;
    font-weight: 900;
}

.poster-info {
    padding: 12px 12px 14px;
}

.poster-info h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 900;
}

.poster-info p {
    min-height: 36px;
    margin: 6px 0 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.poster-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.poster-meta span {
    padding: 4px 7px;
    color: var(--green-800);
    background: #edf7f1;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.download-btn {
    width: 100%;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--green-800);
    background: #ffffff;
    border: 1px solid var(--green-700);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 900;
}

.plain-action {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 12px;
    color: var(--green-800);
    background: var(--green-100);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 900;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 30px 18px;
    color: var(--muted);
    text-align: center;
    background: #ffffff;
    border: 1px dashed #d9e0dc;
    border-radius: 8px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 40;
    max-width: calc(100% - 40px);
    transform: translate(-50%, 18px);
    padding: 11px 15px;
    color: #ffffff;
    background: rgba(5, 36, 23, 0.92);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 1020px) {
    .poster-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .site-header {
        min-height: 66px;
        padding: 12px 12px;
    }

    .brand-lockup {
        font-size: 21px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .workspace {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 10px 24px;
    }

    .side-nav {
        top: 76px;
        max-height: calc(100vh - 86px);
    }

    .side-nav-panel {
        padding: 5px;
        border-radius: 9px;
    }

    .nav-group {
        margin-bottom: 6px;
        padding-bottom: 6px;
    }

    .nav-group-title {
        display: none;
    }

    .sport-switch {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 5px;
    }

    .sport-tab {
        height: 34px;
        font-size: 13px;
    }

    .category-nav {
        gap: 2px;
    }

    .category-tab {
        min-height: 38px;
        justify-content: center;
        padding: 0 6px;
        font-size: 13px;
        text-align: center;
    }

    .category-tab span {
        display: none;
    }

    .content-toolbar {
        display: grid;
        gap: 10px;
        margin-bottom: 10px;
    }

    .content-toolbar h1 {
        font-size: 25px;
    }

    .search-field {
        width: 100%;
        height: 42px;
        flex-basis: auto;
    }

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

    .poster-art {
        min-height: 205px;
        padding: 13px 9px 10px;
    }

    .poster-title {
        font-size: 22px;
    }

    .poster-lines {
        padding: 8px;
    }

    .poster-line {
        grid-template-columns: 30px minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 4px;
        font-size: 10px;
    }

    .poster-info {
        padding: 10px;
    }

    .poster-info h2 {
        font-size: 15px;
    }
}

@media (max-width: 420px) {
    .workspace {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 8px;
        padding-left: 8px;
        padding-right: 8px;
    }

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

    .poster-art {
        min-height: 178px;
        padding: 11px 7px 9px;
    }

    .poster-title {
        font-size: 19px;
    }

    .poster-kicker,
    .poster-footer {
        font-size: 10px;
    }

    .poster-lines {
        gap: 4px;
        margin: 10px 0;
        padding: 7px;
    }

    .poster-line {
        grid-template-columns: 26px minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 3px;
        font-size: 9px;
    }

    .poster-money {
        margin: 12px 0;
        padding: 10px 12px;
        font-size: 28px;
    }

    .poster-body-text {
        margin: 12px 0;
        font-size: 17px;
    }

    .poster-info {
        padding: 9px 8px 10px;
    }

    .poster-info h2 {
        font-size: 14px;
    }

    .poster-info p {
        min-height: 34px;
        margin: 5px 0 10px;
        font-size: 11px;
    }

    .poster-meta {
        gap: 4px;
        margin-bottom: 10px;
    }

    .poster-meta span {
        padding: 3px 5px;
        font-size: 10px;
    }

    .download-btn {
        height: 36px;
        font-size: 14px;
    }
}

body.modal-open { overflow: hidden; }
.designer-modal { position: fixed; inset: 0; z-index: 100; }
.designer-backdrop { position: absolute; inset: 0; background: rgba(3,20,13,.72); backdrop-filter: blur(4px); }
.designer-dialog { position: absolute; inset: 3vh 3vw; display: grid; grid-template-rows:auto auto auto minmax(0,1fr) auto; overflow:hidden; background:#f4f7f5; border-radius:14px; box-shadow:0 30px 90px rgba(0,0,0,.35); }
.designer-head { grid-row:1; min-height:72px; display:flex; align-items:center; justify-content:space-between; padding:14px 22px; color:#fff; background:linear-gradient(135deg,var(--green-950),var(--green-700)); }
.designer-head span { color:#a9d5bc; font-size:12px; font-weight:900; letter-spacing:3px; }
.designer-head h2 { margin:3px 0 0; font-size:22px; }
.designer-close { width:40px; height:40px; color:#fff; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2); border-radius:50%; font-size:28px; line-height:1; }
.business-date-nav { grid-row:2; min-height:58px; display:flex; align-items:center; justify-content:center; gap:18px; padding:8px 20px; background:#fff; border-bottom:1px solid var(--line); }
.business-date-nav>strong { flex:0 0 auto; color:#52616b; font-size:13px; }
.business-date-nav nav { display:flex; align-items:center; gap:5px; padding:4px; background:#eef2f5; border-radius:9px; }
.business-date-nav button { min-width:112px; height:36px; padding:0 14px; color:#54636c; background:transparent; border:0; border-radius:7px; font-size:13px; font-weight:800; }
.business-date-nav button.active { color:#fff; background:#245474; box-shadow:0 4px 10px rgba(36,84,116,.2); }
.match-date-nav { grid-row:3; min-height:62px; display:flex; align-items:center; gap:12px; padding:8px 20px; overflow:hidden; background:#f8fafb; border-bottom:1px solid var(--line); }
.match-date-nav>strong { flex:0 0 auto; color:#52616b; font-size:13px; }
.match-date-nav nav { min-width:0; flex:1; display:flex; gap:7px; overflow-x:auto; padding:2px 2px 5px; scrollbar-width:thin; }
.match-date-nav button { min-width:210px; height:42px; display:flex; align-items:center; justify-content:center; gap:8px; padding:0 14px; color:#40515c; white-space:nowrap; background:#fff; border:1px solid #d8e1e6; border-radius:8px; font-size:12px; }
.match-date-nav button b { color:#245474; font-size:13px; }
.match-date-nav button.active { color:#fff; background:#287154; border-color:#287154; box-shadow:0 4px 10px rgba(40,113,84,.18); }
.match-date-nav button.active b { color:#fff; }
.match-date-nav.notice-mode button { min-width:280px; max-width:420px; justify-content:flex-start; }
.match-date-nav.notice-mode button b { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.match-date-nav>small { flex:0 0 auto; color:var(--muted); font-size:11px; }
.match-nav-empty { align-self:center; padding:0 10px; color:var(--muted); font-size:12px; }
.designer-body { grid-row:4; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) 300px; }
.designer-controls { grid-column:2; grid-row:1; overflow:auto; padding:18px; background:#fff; border-left:1px solid var(--line); }
.designer-field { display:grid; gap:7px; margin-bottom:16px; }
.designer-field>span { color:#25302b; font-size:14px; font-weight:900; }
.designer-field input,.designer-field select,.designer-field textarea { width:100%; padding:10px 11px; color:#17201c; background:#f8faf9; border:1px solid #d9e2dd; border-radius:7px; outline:none; font:inherit; }
.designer-field input:focus,.designer-field select:focus,.designer-field textarea:focus { border-color:var(--green-700); box-shadow:0 0 0 3px rgba(8,116,67,.1); }
.designer-field small { color:var(--muted); font-size:11px; }
.saved-field-state { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.saved-field-state button { padding:2px 7px; color:#245474; background:#e8f1f6; border:0; border-radius:5px; font-size:11px; font-weight:800; }
.designer-error { margin-top:8px; padding:10px; color:#9e1d18; background:#fff0ef; border-radius:7px; font-size:12px; line-height:1.5; }
.preview-stage { grid-column:1; grid-row:1; min-width:0; min-height:0; position:relative; display:grid; grid-template-columns:58px 540px; align-items:start; justify-content:center; gap:18px; overflow:auto; padding:24px; background:#dfe7e2; }
.preview-stage iframe { grid-column:2; width:540px; height:960px; display:block; overflow:hidden; background:#fff; border:0; box-shadow:0 14px 45px rgba(5,36,23,.2); transform-origin:top center; }
.theme-palette { grid-column:1; position:sticky; top:0; z-index:3; width:58px; display:flex; flex-direction:column; align-items:center; gap:8px; padding:10px 8px; background:rgba(255,255,255,.92); border:1px solid rgba(27,70,52,.12); border-radius:14px; box-shadow:0 10px 28px rgba(5,36,23,.16); backdrop-filter:blur(10px); }
.theme-palette strong { color:#53635b; font-size:11px; letter-spacing:2px; }
.theme-swatch { position:relative; width:38px; height:38px; display:grid; place-items:center; padding:3px; background:#fff; border:2px solid transparent; border-radius:11px; box-shadow:none; }
.theme-swatch span { width:28px; height:28px; display:block; background:var(--theme-color); border:1px solid rgba(0,0,0,.08); border-radius:8px; box-shadow:inset 0 1px 1px rgba(255,255,255,.35); }
.theme-swatch.original span { --theme-color:conic-gradient(from 45deg,#075b35 0 25%,#0b5f91 0 50%,#a51620 0 75%,#c99725 0); }
.theme-swatch.green span { --theme-color:#075b35; }
.theme-swatch.blue span { --theme-color:#0b5f91; }
.theme-swatch.red span { --theme-color:#a51620; }
.theme-swatch.gold span { --theme-color:#c99725; }
.theme-swatch:hover { background:#edf4f0; }
.theme-swatch:focus-visible { outline:3px solid rgba(36,84,116,.28); outline-offset:2px; }
.theme-swatch.active { border-color:#245474; box-shadow:0 4px 12px rgba(36,84,116,.22); }
.theme-swatch.active:after { content:"✓"; position:absolute; right:-4px; bottom:-4px; width:17px; height:17px; display:grid; place-items:center; color:#fff; background:#245474; border:2px solid #fff; border-radius:50%; font-size:10px; font-weight:900; }
.preview-loading { position:absolute; z-index:2; padding:12px 18px; color:#fff; background:rgba(3,31,20,.82); border-radius:8px; font-size:13px; }
.designer-actions { grid-row:5; min-height:68px; display:flex; align-items:center; justify-content:flex-end; gap:10px; padding:12px 20px; background:#fff; border-top:1px solid var(--line); }
.export-agreement { margin:0 auto 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.copywriting-button { min-width:140px; height:42px; display:inline-flex; align-items:center; justify-content:center; gap:7px; color:var(--green-800); background:#edf5f1; border:1px solid #cfe0d7; border-radius:8px; font-size:13px; font-weight:900; }
.copywriting-button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.export-button { min-width:140px; height:42px; color:#fff; background:var(--green-700); border:0; border-radius:8px; font-weight:900; }
.export-button:disabled { opacity:.6; cursor:wait; }
@media(max-width:800px){.designer-dialog{inset:0;border-radius:0}.business-date-nav{justify-content:flex-start;gap:10px;padding:7px 12px;overflow-x:auto}.business-date-nav>strong{display:none}.business-date-nav nav{margin:auto}.business-date-nav button{min-width:88px;padding:0 9px;font-size:12px}.match-date-nav{padding:7px 10px}.match-date-nav>strong,.match-date-nav>small{display:none}.match-date-nav button{min-width:190px}.designer-body{grid-template-columns:1fr;grid-template-rows:auto minmax(420px,1fr)}.designer-controls{grid-column:1;grid-row:1;display:grid;grid-template-columns:1fr 1fr;gap:0 12px;max-height:300px;border-left:0;border-bottom:1px solid var(--line)}.preview-stage{grid-column:1;grid-row:2;grid-template-columns:1fr;grid-template-rows:auto auto;justify-items:center;gap:12px;padding:12px 14px 14px}.theme-palette{grid-column:1;grid-row:1;top:0;width:auto;flex-direction:row;padding:7px 10px;border-radius:12px}.theme-palette strong{margin-right:2px}.theme-swatch{width:34px;height:34px}.theme-swatch span{width:25px;height:25px}.preview-stage iframe{grid-column:1;grid-row:2;width:360px;height:640px}.designer-field{margin-bottom:10px}}
@media(max-width:480px){.designer-controls{grid-template-columns:1fr}.preview-stage iframe{width:300px;height:534px}.designer-head{padding:10px 14px}.designer-head h2{font-size:18px}.designer-actions{flex-wrap:wrap}.export-agreement{width:100%;text-align:center}.site-footer{align-items:flex-start;flex-direction:column;gap:8px}.site-footer nav{flex-wrap:wrap;gap:10px 16px}}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .toast {
        transition: none;
    }
}

/* 后端模板目录 */
.main-kind-switch {
    display: grid;
    gap: 5px;
    padding: 5px;
    background: #eef2f5;
    border: 0;
    border-radius: 8px;
}

.main-kind-tab {
    min-height: 38px;
    padding: 0 10px;
    color: #4f5b56;
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 900;
    text-align: left;
}

.main-kind-tab.active {
    color: #ffffff;
    background: #245474;
    box-shadow: 0 4px 10px rgba(36, 84, 116, 0.18);
}

[hidden] {
    display: none !important;
}

.poster-thumb-button {
    width: 100%;
    height: 330px;
    position: relative;
    display: block;
    overflow: hidden;
    padding: 0;
    background: #e7ebee;
    border: 0;
    border-bottom: 1px solid var(--line);
}

.poster-thumb {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.22s ease;
}

.poster-thumb-button:hover .poster-thumb {
    transform: scale(1.025);
}

.thumb-preview-badge {
    position: absolute;
    z-index: 4;
    pointer-events: none;
}

.thumb-preview-badge {
    bottom: 10px;
    left: 10px;
    padding: 6px 10px;
    color: #ffffff;
    background: rgba(20, 31, 45, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2px;
}

.poster-thumb.is-missing {
    display: none;
}

.thumb-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    color: #718078;
    background:
        linear-gradient(135deg, rgba(7, 91, 53, 0.06) 25%, transparent 25%) 0 0 / 22px 22px,
        #eef4f0;
    font-size: 13px;
    font-weight: 800;
}

.poster-info h2 {
    min-height: 0;
    font-size: 18px;
}

.poster-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px 15px 16px;
}

.poster-info .poster-meta {
    margin: 10px 0 14px;
}

.poster-info .download-btn {
    margin-top: auto;
    color: #ffffff;
    background: var(--green-800);
    border-color: var(--green-800);
}

.retry-button {
    margin-top: 14px;
}

@media (max-width: 760px) {
    .main-kind-tab {
        min-height: 34px;
        padding: 0 6px;
        font-size: 12px;
        text-align: center;
    }

    .poster-thumb-button {
        height: auto;
        aspect-ratio: 3 / 4;
    }
}

@media (max-width: 420px) {
    .poster-thumb-button {
        height: auto;
        aspect-ratio: 3 / 4;
    }
}

/* 网站界面响应式布局。templates/ 中的导出画布保持固定尺寸。 */
body { overflow-x: hidden; }

@media (max-width: 760px) {
    .site-header {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .workspace {
        width: 100%;
        display: block;
        padding: 10px 10px 24px;
    }

    .side-nav {
        position: sticky;
        top: 66px;
        z-index: 22;
        max-height: none;
        margin-bottom: 12px;
        overflow: visible;
    }

    .side-nav-panel {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(112px, 2fr);
        gap: 7px;
        padding: 7px;
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 8px 22px rgba(19, 38, 53, .12);
        backdrop-filter: blur(12px);
    }

    .nav-group {
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .main-kind-switch {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        height: 100%;
    }

    .main-kind-tab,
    .sport-tab {
        min-height: 42px;
        padding: 0 7px;
        font-size: 12px;
        text-align: center;
    }

    .sport-switch {
        height: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        padding: 5px;
    }

    .nav-category-group {
        grid-column: 1 / -1;
        overflow: hidden;
    }

    .category-nav {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: 1px 1px 4px;
        scrollbar-width: thin;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .category-tab {
        min-width: max-content;
        min-height: 40px;
        flex: 0 0 auto;
        padding: 0 14px;
        border: 1px solid #e1e6e9;
        border-radius: 7px;
        font-size: 13px;
    }

    .category-tab:before { display: none; }
    .category-tab span { display: inline-grid; }

    .content-toolbar {
        align-items: stretch;
    }

    .content-toolbar h1 { font-size: clamp(23px, 7vw, 29px); }
    .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .seo-intro { padding: 20px; }
    .site-footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

    .designer-dialog {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
    }

    .designer-head {
        min-height: 60px;
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .business-date-nav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .business-date-nav nav {
        width: max-content;
        flex: 0 0 auto;
        margin: 0 auto;
    }

    .match-date-nav nav {
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .designer-body { overflow: hidden; }
    .preview-stage { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .theme-palette { max-width: 100%; overflow-x: auto; }
    .designer-field input,
    .designer-field textarea { font-size: 16px; }
}

@media (max-width: 600px) {
    .poster-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .poster-thumb-button {
        height: auto;
        min-height: 0;
        aspect-ratio: 3 / 4;
    }

    .poster-info { padding: 14px; }
    .poster-info h2 { font-size: 18px; }
    .download-btn { min-height: 44px; }

    .designer-head h2 {
        max-width: calc(100vw - 90px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .business-date-nav {
        min-height: 54px;
        padding: 6px 8px;
    }

    .business-date-nav button {
        min-width: 78px;
        height: 40px;
        padding: 0 8px;
    }

    .match-date-nav {
        min-height: 56px;
        padding: 6px 8px;
    }

    .match-date-nav button { min-width: 176px; height: 44px; }
    .match-date-nav.notice-mode button { min-width: 250px; max-width: 82vw; }

    .designer-body {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .designer-controls {
        display: flex;
        gap: 10px;
        max-height: 174px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .designer-field,
    .designer-error {
        flex: 0 0 min(78vw, 290px);
        margin: 0;
        scroll-snap-align: start;
    }

    .designer-field textarea { min-height: 76px; max-height: 76px; }
    .preview-stage { padding: 10px 8px 14px; }
    .preview-stage iframe { width: min(360px, calc(100vw - 20px)); height: 640px; }

    .designer-actions {
        min-height: 64px;
        display: grid;
        grid-template-columns: minmax(0, .65fr) minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    }

    .export-agreement {
        grid-column: 1 / -1;
        width: 100%;
        text-align: center;
        font-size: 10px;
    }

    .designer-actions .plain-action,
    .designer-actions .copywriting-button,
    .export-button {
        width: 100%;
        min-width: 0;
        height: 44px;
    }
}

body.copywriting-open { overflow: hidden; }
body.app-download-prompt-open { overflow: hidden; }
.copywriting-mask[hidden],
.copywriting-sheet[hidden] { display: none; }
.copywriting-mask { position:fixed; inset:0; z-index:202; width:100%; height:100%; padding:0; background:rgba(5,24,16,.58); border:0; backdrop-filter:blur(3px); }
.copywriting-sheet { position:fixed; left:50%; bottom:0; z-index:205; width:min(560px,calc(100% - 24px)); max-height:min(86dvh,760px); display:grid; grid-template-rows:auto minmax(0,1fr); color:#20382e; background:#f4f8f6; border-radius:8px 8px 0 0; box-shadow:0 -18px 45px rgba(4,30,18,.24); overflow:hidden; transform:translateX(-50%); }
.copywriting-head { min-height:68px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; background:#fff; border-bottom:1px solid #dbe5df; }
.copywriting-head h2 { margin:0; color:#173d2f; font-size:18px; }
.copywriting-head span { display:block; margin-top:3px; color:#738179; font-size:12px; }
.copywriting-head button { flex:0 0 38px; width:38px; height:38px; padding:0; color:#52675d; background:#eef3f0; border:1px solid #dce5df; border-radius:50%; font-size:23px; }
.copywriting-list { min-height:0; display:grid; grid-auto-rows:max-content; align-content:start; gap:10px; padding:12px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; scrollbar-width:thin; scrollbar-color:#9ab3a7 #e7eeea; }
.copywriting-list::-webkit-scrollbar { width:6px; }
.copywriting-list::-webkit-scrollbar-track { background:#e7eeea; }
.copywriting-list::-webkit-scrollbar-thumb { background:#9ab3a7; border-radius:3px; }
.copywriting-card { overflow:hidden; background:#fff; border:1px solid #d8e4dd; border-radius:7px; }
.copywriting-card-head { min-height:46px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px 8px 13px; border-bottom:1px solid #e5ece8; }
.copywriting-card-head strong { color:#174a36; font-size:14px; }
.copywriting-copy { min-width:82px; height:34px; padding:0 13px; color:#fff; background:#126542; border:0; border-radius:5px; font-size:12px; font-weight:850; }
.copywriting-copy.copied { color:#126542; background:#e3f1ea; }
.copywriting-text { margin:0; padding:12px 13px 14px; color:#34483f; font-family:inherit; font-size:13px; line-height:1.65; white-space:pre-wrap; overflow-wrap:anywhere; user-select:text; }
@media (max-width:760px) { .copywriting-sheet { width:100%; max-height:88dvh; } }

.app-download-prompt[hidden] { display:none; }
.app-download-prompt { position:fixed; inset:0; z-index:300; display:grid; place-items:center; padding:16px; }
.app-download-prompt-mask { position:absolute; inset:0; width:100%; height:100%; padding:0; background:rgba(4,25,16,.64); border:0; backdrop-filter:blur(5px); }
.app-download-prompt-card { position:relative; width:min(410px,100%); padding:22px; color:#20382e; background:#fff; border:1px solid #d8e4dd; border-radius:8px; box-shadow:0 24px 64px rgba(3,28,17,.34); }
.app-download-prompt-close { position:absolute; top:12px; right:12px; width:36px; height:36px; padding:0; color:#52675d; background:#eef3f0; border:1px solid #dce5df; border-radius:50%; font-size:22px; }
.app-download-prompt-head { display:flex; align-items:center; gap:13px; padding-right:38px; }
.app-download-prompt-head img { width:58px; height:58px; padding:7px; object-fit:contain; background:#0a5b38; border-radius:8px; }
.app-download-prompt-head span { color:#17724c; font-size:12px; font-weight:850; }
.app-download-prompt-head h2 { margin:3px 0 0; color:#153d2e; font-size:21px; line-height:1.25; }
.app-download-prompt-intro { margin:16px 0 13px; color:#607269; font-size:13px; line-height:1.6; }
.app-download-benefits { margin:0; padding:0; list-style:none; border-top:1px solid #e2eae6; }
.app-download-benefits li { min-height:60px; display:flex; align-items:center; gap:11px; border-bottom:1px solid #e2eae6; }
.app-download-benefits i { flex:0 0 27px; width:27px; height:27px; display:grid; place-items:center; color:#126542; background:#e5f1eb; border-radius:50%; font-size:12px; font-style:normal; font-weight:900; }
.app-download-benefits span,.app-download-benefits strong,.app-download-benefits small { display:block; min-width:0; }
.app-download-benefits strong { color:#254638; font-size:14px; }
.app-download-benefits small { margin-top:3px; color:#78877f; font-size:12px; }
.app-download-prompt-actions { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:9px; margin-top:17px; }
.app-download-prompt-actions button,.app-download-prompt-actions a { height:44px; display:flex; align-items:center; justify-content:center; padding:0 12px; border-radius:6px; font-size:14px; font-weight:850; text-decoration:none; }
.app-download-later { color:#4f675c; background:#edf2ef; border:1px solid #d7e1dc; }
.app-download-primary { color:#fff; background:#126542; border:1px solid #126542; }
.app-download-primary[aria-disabled="true"] { color:#6f7e76; background:#e6ece9; border-color:#d9e1dd; cursor:default; }
.app-download-prompt-note { display:block; margin-top:10px; color:#89958f; font-size:11px; text-align:center; }

@media (max-width:480px) {
    .app-download-prompt { align-items:end; padding:0; }
    .app-download-prompt-card { width:100%; padding:20px 16px max(16px,env(safe-area-inset-bottom)); border-width:1px 0 0; border-radius:8px 8px 0 0; }
    .app-download-prompt-head img { width:52px; height:52px; }
    .app-download-prompt-head h2 { font-size:19px; }
}

@media (max-width: 420px) {
    .site-header { min-height: 60px; }
    .brand-lockup { font-size: 19px; }
    .site-header-link { min-height: 38px; padding: 0 12px; font-size: 12px; }
    .side-nav { top: 60px; }
    .side-nav-panel { grid-template-columns: 1fr; }
    .nav-category-group { grid-column: 1; }
    .main-kind-tab,
    .sport-tab { min-height: 40px; }
    .content-toolbar { gap: 8px; }
    .search-field { height: 44px; }
    .poster-thumb-button { height: auto; min-height: 0; aspect-ratio: 3 / 4; }
    .seo-intro { padding: 18px 16px; }
    .seo-intro h2 { font-size: 18px; }
    .seo-intro ul { display: grid; }
    .preview-stage iframe { width: calc(100vw - 16px); }
}
