﻿/* ===== 前台样式 ===== */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #222;
    /* 浅灰纸质纹理背景（SVG fractalNoise，与参考图同质感） */
    background-color: #ececec;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.55  0 0 0 0 0.55  0 0 0 0.13 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-attachment: fixed;
    background-size: 220px 220px;
    line-height: 1.7;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; }

/* 顶部导航 */
.site-header { background: #16a34a; box-shadow: 0 2px 8px rgba(0,0,0,.1); max-width: 780px; margin: 0 auto; }
.site-header.fixed { position: sticky; top: 0; z-index: 100; }
.topbar { border-bottom: none; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.main-nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; width: 100%; justify-content: space-between; }
.nav-logo { display: inline-flex; align-items: center; margin-right: 6px; }
.nav-logo img { height: 38px; width: auto; max-width: 100%; display: block; object-fit: contain; }
.main-nav-spacer,
.main-nav-right { all: unset; }
.main-nav a {
    color: #fbbf24; text-decoration: none; font-size: 17px; font-weight: 700;
    padding: 4px 0; transition: opacity .15s;
    text-shadow:
        0.2px  0.2px 0 #1f2937,
       -0.2px  0.2px 0 #1f2937,
        0.2px -0.2px 0 #1f2937,
       -0.2px -0.2px 0 #1f2937,
        2px    2px   2px rgba(0, 0, 0, 0.5);
    -webkit-text-stroke: 0.2px #1f2937;
}
.main-nav a:hover { opacity: 0.8; }
.main-nav a.active { opacity: 1; }
.banner img { width: 100%; max-height: 280px; object-fit: cover; display: block; }

/* 主体 */
.site-main { padding: 4px 0 48px; }
.cat-nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.cat-nav a {
    padding: 6px 16px; background: #fff; border-radius: 20px; text-decoration: none;
    color: #555; font-size: 14px; border: 1px solid #eee;
}
.cat-nav a.active, .cat-nav a:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

/* 文章网格 */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.card-link { text-decoration: none; color: inherit; display: block; }
.card-cover { height: 160px; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 18px; }
.card-body h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.4; }
.card-sum { margin: 0 0 12px; color: #777; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; justify-content: space-between; font-size: 12px; color: #999; }
.cat-tag { background: #eef2ff; color: #2563eb; padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* 列表页 */
.page-h1 { font-size: 24px; margin: 8px 0 18px; }
.article-list { display: flex; flex-direction: column; gap: 14px; }
.list-item { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.li-link { display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; text-decoration: none; color: inherit; }
.li-cover { width: 160px; height: 110px; flex: 0 0 160px; overflow: hidden; border-radius: 6px; }
.li-cover img { width: 100%; height: 100%; object-fit: cover; }
.li-body { flex: 1; min-width: 0; }
.li-title { margin: 0; font-size: 18px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-title .hot-icon { display: inline-block; margin-right: 4px; font-size: 16px; transform-origin: center bottom; animation: hot-pulse 1.4s ease-in-out infinite; }
@keyframes hot-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.li-sum { margin: 0 0 10px; color: #777; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li-meta { font-size: 13px; color: #999; flex: 0 0 auto; white-space: nowrap; }

/* 推荐到首页（首页内联表格） */
.featured-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.featured-table thead th { background: #fde68a; color: #92400e; font-size: 14px; font-weight: 700; text-align: left; padding: 10px 14px; border-bottom: 2px solid #f59e0b; white-space: nowrap; }
.featured-table tbody td { padding: 8px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; vertical-align: middle; }
.featured-table tbody tr:last-child td { border-bottom: 0; }
.featured-table tbody tr:hover { background: #f9fafb; }
.featured-table .ft-no { width: 44px; text-align: right; color: #9ca3af; }
.featured-table .ft-title { min-width: 0; width: auto; }
.featured-table .ft-link { color: #111827; text-decoration: none; display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 700; }
.featured-table .ft-link:hover { color: #2563eb; }
.featured-table .ft-link .hot-icon { display: inline-block; margin-right: 4px; font-size: 16px; transform-origin: center bottom; animation: hot-pulse 1.4s ease-in-out infinite; }
.featured-table .ft-cat { width: 110px; color: #6b7280; font-size: 13px; white-space: nowrap; }
@media (max-width: 768px) {
    .featured-table .ft-cat { display: none; }
    .featured-table .ft-no  { display: none; }
    .featured-table thead th.ft-cat,
    .featured-table thead th.ft-no  { display: none; }
}

/* 文章详情 */
.article-wrap { max-width: 780px; }
.post { background: #fff; border-radius: 12px; padding: 28px 32px; box-shadow: 0 2px 10px rgba(0,0,0,.05); overflow: hidden; }
.post-head h1 { margin: 0 0 12px; font-size: 28px; line-height: 1.35; word-break: break-word; overflow-wrap: break-word; }
.post-meta { display: flex; gap: 14px; align-items: center; color: #999; font-size: 13px; margin-bottom: 18px; flex-wrap: wrap; }
.post-cover { margin: -8px -8px 20px; overflow: hidden; border-radius: 8px; }
.post-cover img { width: 100%; border-radius: 8px; display: block; }
.post-content { font-size: 16px; line-height: 1.9; word-break: break-word; overflow-wrap: break-word; max-width: 100%; }
.post-content img { max-width: 100%; height: auto; border-radius: 6px; }
.post-content iframe,
.post-content video,
.post-content embed,
.post-content object { max-width: 100%; height: auto; }
.post-content iframe[src*="youtube"],
.post-content iframe[src*="vimeo"] { aspect-ratio: 16/9; height: auto; }
.post-content pre { background: #f4f4f5; padding: 14px; border-radius: 8px; overflow-x: auto; max-width: 100%; white-space: pre; word-break: break-word; }
.post-content code { word-break: break-word; overflow-wrap: anywhere; }
.post-content h2, .post-content h3 { margin: 1.2em 0 .6em; word-break: break-word; }
.post-content a { word-break: break-all; overflow-wrap: anywhere; }

/* 文章内表格：CSS 强制 100% 宽防换行 + 极小字号兜底 + JS 按需再缩字号 */
.post-content table { width: 100% !important; max-width: 100% !important; border-collapse: collapse; margin: 14px 0; font-size: clamp(9px, 2.5vw, 13px); line-height: 1.35; word-break: break-word; overflow-wrap: anywhere; }
.post-content table th,
.post-content table td { width: auto !important; padding: clamp(2px, 0.8vw, 5px) clamp(3px, 1.2vw, 7px); box-sizing: border-box; word-break: break-word; overflow-wrap: anywhere; white-space: normal; }
.post-content table img { max-width: 100%; height: auto; }

/* 一肖一码 / 期号发布区：专用样式（撞色表头 + 中奖高亮 + 自适应） */
.post-content table.yxym { background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; }
.post-content table.yxym th[colspan] { background: #429a94; color: #fff; font-size: 15px; padding: 10px; }
.post-content table.yxym td:first-child { background: #429a94; color: #fff; font-weight: 600; font-size: 13px; width: 32%; }
.post-content table.yxym td { color: #111; font-size: 14px; vertical-align: middle; }
.post-content table.yxym span[style*="background: rgb(255, 255, 0)"] { color: #b91c1c !important; font-weight: 700; padding: 0 2px; }

/* 移动端：表格进一步压缩（JS 会自动缩放，CSS 仅作辅助） */
@media (max-width: 768px) {
    .post-content { font-size: 15px; line-height: 1.75; }
    .post-content table.yxym th[colspan] { font-size: 13px; padding: 7px 6px; }
    .post-content table.yxym td:first-child { font-size: 11px; width: 30%; }
    .post-content table.yxym td { font-size: 12px; }
}

/* 文章返回键 */
.post-back { margin-top: 30px; padding-top: 18px; border-top: 1px dashed #e5e7eb; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.post-back a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 7px; text-decoration: none; font-size: 14px; }
.post-back .btn-back { background: #2563eb; color: #fff; }
.post-back .btn-back:hover { background: #1d4ed8; }
.post-back .btn-home { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.post-back .btn-home:hover { border-color: #2563eb; color: #2563eb; }
.related { background: #fff; border-radius: 12px; padding: 18px 24px; margin-top: 22px; }
.rel-title { font-size: 18px; margin: 0 0 10px; }
.related ul { margin: 0; padding-left: 20px; }
.related li { margin: 6px 0; }
.related a { color: #2563eb; text-decoration: none; }
.back { margin-top: 22px; }
.back a { color: #666; text-decoration: none; }

/* 广告位 */
.ad { display: block; margin: 18px auto; border-radius: 8px; overflow: hidden; max-width: 780px; }
.ad-text { background: #fff7e6; border: 1px dashed #ffd591; padding: 14px 18px; color: #8a6d3b; text-decoration: none; }
.ad-text .ad-title { font-weight: 700; margin-bottom: 4px; }
.ad-image img { width: 100%; display: block; }

/* 页脚 */
.site-footer { background: #1f2937; color: #cbd5e1; padding: 28px 0; margin-top: 40px; text-align: center; font-size: 13px; }
.site-footer .icp { color: #94a3b8; margin-top: 6px; }
.empty { text-align: center; color: #999; padding: 60px 0; }

@media (max-width: 768px) {
    .article-grid { grid-template-columns: 1fr; }
    .li-cover { width: 100%; height: 180px; flex: none; }
    .post { padding: 18px 16px; }
    .post-cover { margin: -4px -4px 16px; }
    /* H5 全屏 */
    .wrap { max-width: 100%; padding: 0 12px; }
    .site-header { max-width: 100%; }
    .article-wrap { max-width: 100%; }
    .topbar-inner { height: 48px; padding: 0 4px; }
    .main-nav {
        gap: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
    }
    .main-nav::-webkit-scrollbar { display: none; }
    .main-nav a { font-size: 14px; flex-shrink: 0; padding: 2px 0; }
  .nav-logo img { height: 30px; }
    .post-head h1 { font-size: 22px; }
    .post-meta { font-size: 12px; gap: 10px; }
    .banner img { max-height: 160px; }
}
@media (max-width:768px){
  .main-nav-spacer,
  .main-nav-right { display: none; }
}

/* 开奖公告器 */
.lottery { background: linear-gradient(135deg, #fff7ed, #fffbeb); border: 1px solid #fde68a; border-radius: 14px; padding: 18px 22px; margin: 14px 0; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.04); position: relative; }
.lottery-refresh { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #fcd34d; background: rgba(255,255,255,.7); color: #b45309; font-size: 18px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background .15s; }
.lottery-refresh:hover { background: #fff; }
.lottery-refresh.spinning { animation: lottery-spin 0.8s linear infinite; }
@keyframes lottery-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.lottery-event { font-size: 22px; font-weight: 800; color: #b45309; letter-spacing: 1px; }
.lottery-round { font-size: 15px; color: #92400e; margin-top: 4px; }
.lottery-round .lottery-tag { background: #f59e0b; color: #fff; border-radius: 4px; padding: 1px 8px; font-size: 12px; margin-left: 6px; text-decoration: none; }
.lottery-round .lottery-tag:hover { background: #d97706; }
.lottery-heads { display: grid; grid-template-columns: repeat(7, 46px); gap: 8px; justify-content: center; margin: 14px 0 8px; font-size: 13px; color: #78350f; }
.lottery-heads span:last-child { color: #dc2626; font-weight: 800; font-style: italic; letter-spacing: 1px; }
.lottery-balls { display: grid; grid-template-columns: repeat(7, 46px); gap: 10px; justify-content: center; }

/* 号码球（公基础类）*/
.ball { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; box-shadow: inset 0 -3px 6px rgba(0,0,0,.2), 0 2px 5px rgba(0,0,0,.15); flex-shrink: 0; line-height: 1; }
.lottery-balls .ball { width: 46px; height: 46px; font-size: 19px; }
.history-balls .ball { width: 38px; height: 38px; font-size: 15px; }
.lc-red { background: #e11d48 url('ball-hong.png') center center / cover no-repeat; color: #2f2c2b; }
.lc-blue { background: #2563eb url('ball-lan.png') center center / cover no-repeat; color: #2f2c2b; }
.lc-green { background: #16a34a url('ball-lv.png') center center / cover no-repeat; color: #2f2c2b; }
.ball-empty { background: transparent; border: 2px dashed #c4b5fd; color: #b45309; font-size: 12px; box-shadow: none; }
.history-balls .ball-empty { font-size: 10px; }

.lottery-next { margin-top: 14px; font-size: 14px; color: #a16207; text-align: center; line-height: 1.9; }
.lottery-next .lottery-next-row { display: block; }
.lottery-next .lottery-refresh,
.lottery-next .lottery-refresh:hover,
.lottery-next .lottery-refresh.spinning { all: unset; }
.lottery-next .cd-time { display: inline-block; padding: 2px 8px; background: #fde68a; color: #92400e; border: 1px solid #f59e0b; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 13px; margin-left: 4px; }
.lottery-next .cd-time { display: inline-block; padding: 1px 8px; margin: 0 4px; background: #fef3c7; border: 1px solid #fde68a; border-radius: 4px; color: #b45309; font-weight: 700; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* 号码球单元（号码 + 下方属性标签） */
.ball-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ball-meta {
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 1px 4px;
    line-height: 1.4;
    letter-spacing: 0;
    white-space: nowrap;
    min-height: 18px;
    box-sizing: border-box;
}
.ball-meta .sx { color: #2f2c2b; }
.ball-meta .wx { font-weight: 800; }
.ball-meta .wx-jin  { color: #ffcc00; }
.ball-meta .wx-mu   { color: #33cc33; }
.ball-meta .wx-shui { color: #3399ff; }
.ball-meta .wx-huo  { color: #ff6600; }
.ball-meta .wx-tu   { color: #cc9900; }
.history-balls .ball-cell { gap: 3px; }
.history-balls .ball-meta  { font-size: 11px; padding: 1px 3px; }

/* 历史开奖页面 */
.history-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.history-row { background: #fff; border-radius: 10px; padding: 14px 18px; box-shadow: 0 1px 5px rgba(0,0,0,.05); }
.history-head { text-align: center; font-size: 16px; font-weight: 700; color: #b45309; margin-bottom: 12px; }
.history-balls { display: grid; grid-template-columns: repeat(7, 38px); gap: 8px; justify-content: center; align-items: center; }

@media (max-width: 768px) {
    .lottery-event { font-size: 18px; }
    .lottery-heads { grid-template-columns: repeat(7, 38px); gap: 6px; font-size: 11px; }
    .lottery-balls { grid-template-columns: repeat(7, 38px); gap: 6px; }
    .lottery-balls .ball { width: 38px; height: 38px; font-size: 16px; }
}

.featured-full{margin:18px 0;}
.ff-item{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:18px 20px;margin-bottom:16px;}
.ff-title{
    background: #fde68a;
    margin: -18px -20px 14px;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    border-bottom: 1px solid #f59e0b;
    text-align: center;
}
.ff-title a{color:#1f2937;text-decoration:none;}
.ff-title a:hover{color:#16a34a;}
.ff-cover{margin:0 0 12px;}
.ff-cover img{max-width:100%;height:auto;border-radius:6px;display:block;}
.ff-content{font-size:15px;line-height:1.75;color:#374151;}
.ff-content p{margin:8px 0;}
.ff-content img{max-width:100%;height:auto;border-radius:4px;}
.ff-content h1,.ff-content h2,.ff-content h3{margin:14px 0 8px;}
.ff-content a{color:#2563eb;text-decoration:underline;}
.ff-meta{display:flex;gap:14px;align-items:center;margin-top:14px;padding-top:12px;border-top:1px dashed #e5e7eb;font-size:13px;color:#6b7280;}
.ff-meta .ff-more{margin-left:auto;color:#16a34a;text-decoration:none;font-weight:500;}
.ff-meta .ff-more:hover{text-decoration:underline;}
@media (max-width:768px){
  .ff-item{padding:14px 14px;}
  .ff-title{margin:-14px -14px 12px;padding:10px 14px;font-size:17px;}
  .ff-content{font-size:14px;}
}