:root {
    --primary: #1f6feb;
    --primary-dark: #1557c0;
    --text: #1f2937;
    --muted: #6b7280;
    --bg-alt: #f3f6fb;
    --border: #e5e7eb;
    --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    line-height: 1.7;
    background: #fff;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-logo { height: 40px; width: auto; }
.brand-name { font-size: 20px; font-weight: 600; }

.hero {
    background: linear-gradient(135deg, var(--primary), #4f8ff7);
    color: #fff;
    text-align: center;
    padding: 72px 0;
}
.hero h1 { margin: 0 0 12px; font-size: 34px; }
.hero-slogan { margin: 0; font-size: 18px; opacity: .9; }

.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section h2 { margin-top: 0; font-size: 26px; }

.content-block + .content-block { margin-top: 40px; }
.content-body { color: #374151; word-break: break-word; flex: 1; min-width: 0; }
.content-body p { margin: 0 0 1em; }
.content-body p:last-child { margin-bottom: 0; }
.content-inner { display: flex; gap: 28px; align-items: flex-start; }
.content-figure { margin: 0; flex: 0 0 38%; max-width: 420px; }
.content-figure img { display: block; width: 100%; height: auto; border-radius: 8px; }
@media (max-width: 720px) {
    .content-inner { flex-direction: column; gap: 16px; }
    .content-figure { flex-basis: auto; max-width: 100%; width: 100%; }
}

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { padding: 8px 0; border-bottom: 1px dashed var(--border); word-break: break-all; }
.contact-label { color: var(--muted); }
.contact-wrap { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.contact-wrap .contact-list { flex: 1; min-width: 240px; }
.contact-list a { color: var(--primary); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
.contact-qrcode { margin: 0; text-align: center; }
.contact-qrcode img { display: block; width: 160px; height: 160px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px; }
.contact-qrcode figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.footer-contacts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.footer-contact-item { word-break: break-all; }

.site-footer {
    background: #111827;
    color: #9ca3af;
    text-align: center;
    padding: 24px 0;
    font-size: 14px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: #9ca3af; }

.btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
}
.btn:hover { background: var(--primary-dark); color: #fff; }

.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}
.error-page h1 { font-size: 64px; margin: 0; color: var(--primary); }
.error-debug {
    max-width: 90vw;
    overflow: auto;
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px;
    border-radius: var(--radius);
    text-align: left;
}

@media (max-width: 640px) {
    .hero { padding: 48px 0; }
    .hero h1 { font-size: 26px; }
    .hero-slogan { font-size: 15px; }
    .section { padding: 36px 0; }
    .section h2 { font-size: 22px; }
}
/* ---------- 顶部导航 ---------- */

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 76px; }

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

.site-nav { display: flex; align-items: center; gap: 4px; }
.nav-link { display: block; padding: 8px 14px; border-radius: 6px; color: var(--text); font-size: 15px; white-space: nowrap; }
.nav-link:hover { color: var(--primary); background: var(--bg-alt); }
.nav-link.is-active { color: var(--primary); font-weight: 600; }

.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; padding: 8px; border: 0; background: transparent; cursor: pointer; border-radius: 6px; flex-shrink: 0; }
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 720px) {
    .header-inner { gap: 12px; min-height: 56px; }
    .brand-logo { height: 32px; }
    .brand-name { font-size: 17px; }
    /* 无 JS 时菜单直接换行显示，启用 JS 后折叠为下拉菜单 */
    .site-nav { flex-wrap: wrap; justify-content: flex-end; }
    .js .nav-toggle { display: flex; }
    .js .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 12px; background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 8px 16px rgba(15, 23, 42, .08); }
    .js .site-nav.is-open { display: flex; }
    .js .nav-link { padding: 12px 8px; border-bottom: 1px solid var(--border); border-radius: 0; }
    .js .nav-link:last-child { border-bottom: 0; }
    [id] { scroll-margin-top: 64px; }
}

/* ---------- 轮播图 ---------- */

.carousel { position: relative; background: #111827; overflow: hidden; outline: none; }
.carousel-viewport { overflow-x: auto; scroll-snap-type: x mandatory; }
.carousel-track { display: flex; }
.carousel-slide { position: relative; flex: 0 0 100%; min-width: 0; margin: 0; scroll-snap-align: start; }
.carousel-slide img { display: block; width: 100%; height: 420px; object-fit: cover; }
.carousel-link { display: block; }
.carousel-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 24px 40px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.carousel.is-static .carousel-slide figcaption { padding-bottom: 18px; }
.carousel-title { display: block; font-size: 20px; font-weight: 600; }
.carousel-desc { display: block; margin-top: 4px; font-size: 14px; opacity: .9; }
.carousel.is-ready .carousel-viewport { overflow: hidden; }
.carousel.is-ready .carousel-track { transition: transform .5s ease; will-change: transform; }

.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; font-size: 30px; line-height: 44px; text-align: center; cursor: pointer; padding: 0; transition: background .2s; }
.carousel-btn:hover, .carousel-btn:focus-visible { background: rgba(0, 0, 0, .6); }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.carousel-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 5px; background: rgba(255, 255, 255, .55); cursor: pointer; transition: width .2s, background .2s; }
.carousel-dot.is-active { width: 26px; background: #fff; }
/* 无 JS 时横向滑动浏览，隐藏依赖脚本的控件 */
.carousel:not(.is-ready) .carousel-btn, .carousel:not(.is-ready) .carousel-dots { display: none; }

/* ---------- 栏目 ---------- */

.section-title { text-align: center; margin-bottom: 28px; }
.content-block h2 a.content-title-link { color: var(--text); }
.content-block h2 a.content-title-link:hover { color: var(--primary); }
.content-more { margin-top: 8px; }
.link-more { font-weight: 500; }

.container-narrow { max-width: 860px; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 20px; word-break: break-all; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { margin: 0 6px; }
.breadcrumb-current { color: var(--text); }
.page-title { margin: 0 0 8px; font-size: 30px; line-height: 1.4; word-break: break-word; }
.page-meta { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.page-figure { margin: 0 0 24px; }
.page-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.page-body { font-size: 16px; }
.page-back { margin-top: 40px; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.empty-state { text-align: center; padding: 48px 16px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.empty-state-title { margin: 0 0 6px; font-size: 18px; color: var(--text); }
.empty-state-desc { margin: 0; }

/* ---------- 图文区二（白色圆角卡片） ---------- */

.section-featured { background: #eef1f6; }
.feature-list { display: flex; flex-direction: column; gap: 20px; }
.feature-card { background: #fff; border: 1px solid #e8ebf1; border-radius: 14px; box-shadow: 0 2px 10px rgba(15, 23, 42, .06); padding: 22px 24px; min-width: 0; }
.feature-card-title { margin: 0 0 12px; font-size: 19px; font-weight: 700; line-height: 1.45; word-break: break-word; }
.section .feature-card-title { font-size: 19px; }
.feature-card-title a { color: var(--text); }
.feature-card-title a:hover { color: var(--primary); }
.feature-card-figure { margin: 0 0 14px; }
.feature-card-figure img { display: block; width: 100%; height: auto; max-width: 100%; border-radius: 10px; }
.feature-card-body { color: #4b5563; font-size: 16px; line-height: 1.85; word-break: break-word; }
.feature-card-body p { margin: 0 0 .9em; }
.feature-card-body p:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
    .section-featured .container { padding-left: 12px; padding-right: 12px; }
    .feature-list { gap: 14px; }
    .feature-card { padding: 16px 16px 18px; border-radius: 12px; }
    .section .feature-card-title { font-size: 17px; margin-bottom: 8px; }
    .feature-card-body { font-size: 15px; line-height: 1.8; }
}

/* ---------- 图片展示 ---------- */

.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.gallery-item { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; min-width: 0; }
.gallery-link { position: relative; display: block; background: #f3f4f6; cursor: zoom-in; }
.gallery-item img { display: block; width: 100%; height: auto; object-fit: contain; transition: opacity .2s; }
.gallery-link:hover img { opacity: .92; }
@media (max-width: 960px) {
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
.gallery-zoom { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 16px; line-height: 30px; text-align: center; opacity: 0; transition: opacity .2s; }
.gallery-link:hover .gallery-zoom, .gallery-link:focus-visible .gallery-zoom { opacity: 1; }
.gallery-item figcaption { padding: 8px 12px; font-size: 14px; color: #374151; word-break: break-all; }

/* ---------- 大图预览 ---------- */

.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 56px 64px; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 16, .94); }
.lightbox-figure { position: relative; margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox-img { display: block; max-width: 100%; max-height: calc(100vh - 180px); width: auto; height: auto; object-fit: contain; border-radius: 4px; background: #111; }
.lightbox-caption { margin-top: 12px; color: #e5e7eb; text-align: center; font-size: 14px; max-width: 720px; word-break: break-word; }
.lightbox-title { display: block; color: #fff; font-size: 16px; }
.lightbox-desc { display: block; margin-top: 4px; }
.lightbox-link { display: inline-block; margin-top: 6px; color: #93c5fd; }
.lightbox-link[hidden] { display: none; }
.lightbox-counter { display: block; margin-top: 6px; color: #9ca3af; font-size: 13px; }
.lightbox-btn { position: absolute; z-index: 2; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 30px; line-height: 44px; text-align: center; cursor: pointer; }
.lightbox-btn:hover, .lightbox-btn:focus-visible { background: rgba(255, 255, 255, .3); }
.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
body.lightbox-open { overflow: hidden; }

/* ---------- 返回顶部 / 错误页 ---------- */

.back-to-top { position: fixed; right: 20px; bottom: 24px; z-index: 20; width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 20px; line-height: 42px; text-align: center; box-shadow: 0 4px 12px rgba(31, 111, 235, .35); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.back-to-top.is-visible { opacity: 1; visibility: visible; }
.back-to-top:hover { color: #fff; background: var(--primary-dark); }
.error-title { margin: 12px 0 4px; font-size: 18px; }
.error-desc { margin: 0 0 24px; color: var(--muted); }

@media (max-width: 640px) {
    .carousel-slide img { height: 220px; }
    .carousel-slide figcaption { padding: 12px 16px 32px; }
    .carousel-title { font-size: 16px; }
    .carousel-desc { font-size: 13px; }
    .carousel-btn { width: 34px; height: 34px; font-size: 24px; line-height: 34px; }
    .carousel-prev { left: 8px; }
    .carousel-next { right: 8px; }
    .gallery-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .gallery-zoom { opacity: 1; }
    .lightbox { padding: 56px 8px; }
    .lightbox-img { max-height: calc(100vh - 200px); }
    .lightbox-prev, .lightbox-next { top: auto; bottom: 12px; transform: none; }
    .lightbox-prev { left: calc(50% - 56px); }
    .lightbox-next { right: calc(50% - 56px); }
    .page-title { font-size: 24px; }
    .back-to-top { right: 14px; bottom: 16px; }
}

/* ---------- 在线留言 ---------- */

.message-intro { text-align: center; color: var(--muted); margin: -16px 0 24px; }
.message-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.message-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field { min-width: 0; }
.field-span-2 { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 15px; }
.field input,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 111, 235, .15); }
.field.has-error input,
.field.has-error textarea { border-color: #dc2626; }
.field-error { margin: 6px 0 0; color: #dc2626; font-size: 13px; }
.field-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.field-counter { margin-top: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.field-counter.is-over { color: #dc2626; font-weight: 600; }
.required { color: #dc2626; }
.optional { color: var(--muted); font-weight: 400; font-size: 13px; }
.message-actions { margin-top: 20px; text-align: center; }
.message-actions .btn { min-width: 160px; }
.message-actions .btn[disabled] { opacity: .6; cursor: not-allowed; }
.form-notice { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 15px; }
.form-notice-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.form-notice-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
/* 蜜罐字段：移出可视区域而不是 display:none，部分机器人会跳过隐藏字段 */
.message-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) {
    .message-grid { grid-template-columns: 1fr; }
    .message-form { padding: 18px 14px; }
    .message-actions .btn { width: 100%; }
}

/* ---------- 历史数据专栏（比赛结果卡片） ---------- */

.section-history { background: #eef1f6; }
.match-list { display: flex; flex-direction: column; gap: 14px; }
.match-card { background: #fff; border: 1px solid #e8ebf1; border-radius: 14px; box-shadow: 0 2px 10px rgba(15, 23, 42, .06); padding: 14px 20px 16px; min-width: 0; }
.match-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--muted); }
.match-card-league { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-card-time { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.match-card-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 10px; }
.match-card-team { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.4; word-break: break-word; }
.match-card-home { text-align: right; }
.match-card-away { text-align: left; }
.match-card-team.is-winner { color: #dc2626; }
.match-card-score { min-width: 72px; padding: 4px 12px; border-radius: 8px; background: #f3f4f6; font-size: 18px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.match-card-score.is-pending { font-size: 15px; font-weight: 500; color: var(--muted); }
.match-card-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; }
.match-card-outcome { padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.match-outcome-home { background: #fef2f2; color: #dc2626; }
.match-outcome-draw { background: #f3f4f6; color: #4b5563; }
.match-outcome-away { background: #eff6ff; color: #1d4ed8; }
.match-card-note { color: #15803d; background: #f0fdf4; padding: 2px 10px; border-radius: 999px; word-break: break-word; max-width: 100%; }
.match-empty { background: #fff; border: 1px dashed #d1d5db; border-radius: 14px; padding: 40px 16px; text-align: center; color: var(--muted); font-size: 16px; }
.history-more { margin: 24px 0 0; text-align: center; }
.page-history .page-back { text-align: center; }
.history-title { margin-bottom: 18px; }
.league-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.league-tab { padding: 5px 14px; border: 1px solid #d1d5db; border-radius: 999px; background: #fff; color: var(--text); font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.league-tab:hover { border-color: var(--primary); color: var(--primary); }
.league-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.section-history .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 22px; }
.section-history .pagination a, .section-history .pagination span { min-width: 36px; padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; text-align: center; font-size: 14px; color: var(--text); }
.section-history .pagination a:hover { border-color: var(--primary); color: var(--primary); }
.section-history .pagination .is-current { background: var(--primary); border-color: var(--primary); color: #fff; }
.section-history .pagination .is-disabled { color: #9ca3af; }
.section-history .pagination .pagination-gap { border-color: transparent; background: transparent; }
.pagination-info { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
    .section-history .container { padding-left: 12px; padding-right: 12px; }
    .match-list { gap: 12px; }
    .match-card { padding: 12px 14px 14px; border-radius: 12px; }
    .match-card-head { font-size: 13px; }
    .match-card-teams { gap: 8px; }
    .match-card-team { font-size: 15px; }
    .match-card-score { min-width: 60px; padding: 3px 8px; font-size: 16px; }
    .match-card-foot { font-size: 13px; }
}
