/* ==========================================================================
   幸运五分彩 · 视觉系统
   主色 #ff7337（对齐参考站橙调），深色底 + 卡片
   ========================================================================== */

:root {
  --brand:       #ff7337;
  --brand-dark:  #e85c22;
  --brand-light: #ff9a68;
  --brand-glow:  rgba(255, 115, 55, .3);

  --bg:      #14161f;
  --bg-2:    #1b1e29;
  --card:    rgba(255, 255, 255, .048);
  --card-2:  rgba(255, 255, 255, .085);
  --line:    rgba(255, 255, 255, .09);

  --text:    #f2f3f7;
  --text-2:  #a8adbe;
  --text-3:  #6f7488;

  --ok:      #2ecc71;
  --warn:    #f5c04a;
  --danger:  #f2453d;
  --info:    #38bdf8;

  --r:    14px;
  --r-lg: 20px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .38);

  --maxw: 980px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1000px 460px at 50% -8%, rgba(255, 115, 55, .15), transparent 62%),
    radial-gradient(700px 400px at 88% 10%, rgba(56, 189, 248, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--brand-light); text-decoration: none; }
a:hover { color: #ffb894; }
h1, h2, h3, h4 { line-height: 1.35; }
b { font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--text-3); font-size: 13px; }
.dim { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; font-weight: 700; text-align: center; }
.center { text-align: center; }

/* --------------------------------- 头部 --------------------------------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 22, 31, .93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-in {
  max-width: var(--maxw); margin: 0 auto;
  padding: 12px 18px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: grid; place-items: center;
  font-weight: 800; font-size: 19px; color: #fff;
  box-shadow: 0 4px 14px var(--brand-glow);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-txt b { font-size: 17px; letter-spacing: .3px; }
.brand-txt i { font-style: normal; font-size: 11.5px; color: var(--text-3); }

.nav { display: flex; gap: 3px; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: all .18s;
}
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.on { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; }

/* --------------------------------- 主体 --------------------------------- */

.main {
  max-width: var(--maxw); margin: 0 auto;
  padding: 18px 18px 60px;
}

.crumb { margin-bottom: 14px; font-size: 12.5px; color: var(--text-3); }
.crumb a { color: var(--text-2); }
.crumb .sep { margin: 0 7px; color: var(--text-3); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}
.card h1 { font-size: 23px; margin-bottom: 14px; }
.card h2 { font-size: 17.5px; margin: 20px 0 12px; }
.card h2:first-child { margin-top: 0; }
.card h3 { font-size: 14.5px; margin: 16px 0 8px; color: var(--brand-light); }
.card p { margin-bottom: 11px; color: var(--text-2); font-size: 14.5px; }
.card p b { color: var(--text); }

.ul { margin: 0 0 12px 20px; color: var(--text-2); font-size: 14.5px; }
.ul li { margin-bottom: 6px; }
.ul b { color: var(--text); }

/* --------------------------------- Hero --------------------------------- */

.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(255, 115, 55, .16), rgba(255, 255, 255, .03) 58%);
  border: 1px solid rgba(255, 115, 55, .24);
  padding: 20px 22px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.hero::after {
  content: ''; position: absolute; right: -46px; top: -46px;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-glow), transparent 68%);
  pointer-events: none;
}
.hero-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.hero .issue { font-size: 13.5px; color: var(--text-2); }
.hero .issue b { color: var(--brand-light); font-weight: 700; }
.hero .issue2 { font-size: 12.5px; color: var(--text-3); }
.cd {
  font-size: 21px; font-weight: 800; color: var(--brand-light);
  font-variant-numeric: tabular-nums; letter-spacing: .5px;
  text-shadow: 0 0 18px var(--brand-glow);
}

.hero-balls {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-balls .sep { width: 1px; height: 28px; background: var(--line); margin: 0 4px; }
.hero-sum { font-size: 13.5px; color: var(--text-2); }
.hero-sum b { color: var(--brand-light); font-size: 16px; }
.hero-tags { display: inline-flex; gap: 5px; }
.hero-note { font-size: 12.5px; color: var(--text-3); }
.hero-note b { color: var(--text-2); }

/* --------------------------------- 球体 --------------------------------- */

.ball {
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 20px; font-weight: 800; color: #fff;
  box-shadow: inset 0 -3px 8px rgba(0, 0, 0, .3), 0 3px 10px rgba(0, 0, 0, .3);
}
.mini {
  width: 21px; height: 21px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff;
  margin-right: 3px; vertical-align: middle;
}

/* --------------------------------- 标签 --------------------------------- */

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11.5px; font-weight: 700; margin-right: 3px;
}
.tag.big   { background: rgba(255, 140, 90, .17); color: #ff8c5a; }
.tag.small { background: rgba(111, 201, 255, .17); color: #6fc9ff; }
.tag.even  { background: rgba(46, 204, 113, .17); color: var(--ok); }
.tag.odd   { background: rgba(245, 192, 74, .17); color: var(--warn); }
.tag.dragon{ background: rgba(255, 140, 90, .17); color: #ff8c5a; }
.tag.tiger { background: rgba(111, 201, 255, .17); color: #6fc9ff; }
.tag.flat  { background: rgba(255, 255, 255, .09); color: var(--text-3); }
.tagcell { white-space: nowrap; }

/* --------------------------------- 表格 --------------------------------- */

.table-scroll { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--text-3);
  font-size: 12px; padding: 9px 8px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 9px 8px; border-bottom: 1px solid rgba(255, 255, 255, .045); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .03); }
.tbl tr.cur { background: rgba(255, 115, 55, .1); }
.tbl .b { color: var(--brand-light); font-weight: 700; }
.tbl .nb { white-space: nowrap; }

/* 窄屏：次要列让位，保证核心列（期号/号码/和值）可读 */
@media (max-width: 720px) {
  .tbl .col-opt { display: none; }
  .tbl td, .tbl th { padding: 8px 6px; }
  .tbl .num { text-align: left; }
}

.tbl.kv th {
  width: 168px; color: var(--text-2); font-weight: 600;
  background: rgba(255, 255, 255, .025);
}
.tbl.cmp th:nth-child(2) { color: #6fc9ff; }
.tbl.cmp th:nth-child(3) { color: var(--brand-light); }
.tbl.cmp td:nth-child(3) { color: var(--text); }

.more { margin-top: 14px; text-align: center; font-size: 13.5px; }

/* ------------------------------- 链接网格 -------------------------------- */

.link-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px;
}
.link-grid a {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--line);
  transition: all .18s;
}
.link-grid a:hover {
  border-color: rgba(255, 115, 55, .4);
  background: rgba(255, 115, 55, .09);
  transform: translateY(-2px);
}
.link-grid b { font-size: 14.5px; color: var(--text); }
.link-grid span { font-size: 12px; color: var(--text-3); }

/* ------------------------------- 统计块 --------------------------------- */

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 8px; text-align: center;
}
.stat b {
  display: block; font-size: 21px; font-weight: 800; color: var(--brand-light);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.stat span { font-size: 11.5px; color: var(--text-3); }

/* ------------------------------- 条形图 --------------------------------- */

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-lb { width: 30px; flex: none; text-align: center; font-size: 13px; }
.bar-bg { flex: 1; height: 9px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar-bg i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-light)); }
.bar-n { width: 100px; flex: none; font-size: 12px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------- 位置网格 ------------------------------- */

.pos-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-bottom: 16px; }
.pos-cell {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 3px; text-align: center;
}
.pos-cell.hot { border-color: rgba(255, 115, 55, .5); background: rgba(255, 115, 55, .1); }
.pos-cell b { display: block; font-size: 12.5px; margin-top: 3px; color: var(--text-2); }

/* --------------------------------- 走势 --------------------------------- */

.road { display: flex; flex-direction: column; gap: 5px; }
.lane { display: flex; align-items: center; gap: 8px; }
.lane-lb {
  width: 24px; flex: none; font-size: 12px; font-weight: 700; color: var(--text-3);
}
.lane-cells { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; padding-bottom: 3px; }
.lane-cells::-webkit-scrollbar { display: none; }
.cell {
  width: 23px; height: 23px; flex: none; border-radius: 5px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, .07); color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.cell.hot  { background: linear-gradient(135deg, #f2453d, #c62f28); color: #fff; }
.cell.cold { background: rgba(56, 189, 248, .28); color: #9fdcfb; }
.cell.sum  { background: rgba(255, 115, 55, .18); color: var(--brand-light); width: auto; padding: 0 6px; }

.lg { display: inline-flex; align-items: center; gap: 5px; margin-left: 14px; font-size: 12px; color: var(--text-3); }
.lg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.lg-hot { background: #f2453d; }
.lg-cold { background: rgba(56, 189, 248, .5); }

/* ------------------------------ 微信导流 -------------------------------- */

.wx-bar {
  border-radius: var(--r); margin-bottom: 16px;
  background: linear-gradient(120deg, rgba(37, 199, 96, .16), rgba(255, 255, 255, .03));
  border: 1px solid rgba(37, 199, 96, .3);
  padding: 14px 18px;
}
.wx-bar-in { display: flex; align-items: center; gap: 13px; }
.wx-ico { font-size: 26px; flex: none; }
.wx-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wx-txt b { font-size: 14.5px; color: var(--text); }
.wx-txt span { font-size: 12.5px; color: var(--text-2); }
.wx-id { color: #4ade80; font-weight: 800; letter-spacing: .5px; }
.wx-copy, .btn-copy {
  flex: none; padding: 9px 16px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none; cursor: pointer; transition: transform .15s;
}
.wx-copy:active, .btn-copy:active { transform: scale(.95); }

.wx-block {
  text-align: center; padding: 26px 22px;
  border-radius: var(--r); margin-bottom: 16px;
  background: linear-gradient(150deg, rgba(37, 199, 96, .13), rgba(255, 255, 255, .03));
  border: 1px solid rgba(37, 199, 96, .28);
}
.wx-block h2 { margin: 0 0 8px; font-size: 19px; }
.wx-desc { color: var(--text-2); font-size: 13.5px; margin-bottom: 16px; }
.wx-main {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.wx-big {
  font-size: 26px; font-weight: 900; color: #4ade80;
  letter-spacing: 1px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.wx-main.big-mode { flex-direction: column; gap: 14px; }
.wx-tip { font-size: 12.5px; color: var(--text-3); margin: 0; }

.wx-float {
  position: fixed; right: 16px; bottom: 20px; z-index: 90;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 13px; border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff; box-shadow: 0 8px 24px rgba(34, 197, 94, .34);
  transition: transform .18s;
}
.wx-float:hover { transform: translateY(-2px); color: #fff; }
.wx-float-ico { font-size: 20px; }
.wx-float-txt { font-size: 11px; line-height: 1.3; }
.wx-float-txt b { font-size: 13px; letter-spacing: .5px; }

/* -------------------------------- 声明 ---------------------------------- */

.disclaimer {
  padding: 14px 16px; border-radius: 12px;
  background: rgba(245, 192, 74, .07); border: 1px solid rgba(245, 192, 74, .2);
  margin-top: 18px;
}
.disclaimer b { display: block; font-size: 13px; color: var(--warn); margin-bottom: 6px; }
.disclaimer p { font-size: 12.5px; color: var(--text-3); line-height: 1.75; margin: 0; }

/* -------------------------------- 页脚 ---------------------------------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, .22);
  padding: 26px 18px 34px;
}
.foot-in { max-width: var(--maxw); margin: 0 auto; }
.foot-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 22px; margin-bottom: 18px;
}
.foot-cols h4 { font-size: 13.5px; color: var(--brand-light); margin-bottom: 9px; }
.foot-cols p { font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.foot-cols a { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.foot-cols a:hover { color: var(--brand-light); }
.copyright { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 16px; }

/* ------------------------------ 响应式适配 ------------------------------- */

@media (max-width: 720px) {
  .head-in { flex-direction: column; align-items: flex-start; gap: 11px; padding: 11px 14px; }
  .nav {
    gap: 2px; width: 100%; overflow-x: auto; scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 5px 10px; font-size: 12.5px; white-space: nowrap; flex: none; }
  .main { padding: 14px 14px 72px; }
  .card { padding: 16px 15px; }
  .card h1 { font-size: 20px; }
  .table-scroll { margin: 0 -15px; padding: 0 15px; }
  .ball { width: 40px; height: 40px; font-size: 17px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .pos-grid { grid-template-columns: repeat(5, 1fr); }
  /* 悬浮微信收成圆形，避免遮挡表格 */
  .wx-float {
    right: 12px; bottom: 14px; padding: 11px;
    width: 48px; height: 48px; justify-content: center;
  }
  .wx-float-txt { display: none; }
  .wx-big { font-size: 22px; }
  .tbl.kv th { width: 120px; }
  .link-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- 历史开奖视图切换（/p5/data/） ---- */
.viewtabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.viewtabs button {
  padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--text-2); font-size: 14px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.viewtabs button:hover { color: var(--text); border-color: var(--brand); }
.viewtabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.viewtabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tag.bao  { background: rgba(242, 69, 61, .17); color: var(--danger); }
.tag.dui  { background: rgba(255, 140, 90, .17); color: #ff8c5a; }
.tag.shun { background: rgba(46, 204, 113, .17); color: var(--ok); }
.tag.ban  { background: rgba(245, 192, 74, .17); color: var(--warn); }
.tag.za   { background: rgba(255, 255, 255, .09); color: var(--text-3); }

/* ---- 历史开奖一行式排列（对照竞品样式） ---- */
.ball-md {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 14px; font-weight: 800; color: #fff;
  margin-right: 4px; vertical-align: middle;
}
.c-big, .c-long  { color: #ff8c5a; font-weight: 700; }
.c-small, .c-tiger { color: #6fc9ff; font-weight: 700; }
.c-odd   { color: var(--warn); font-weight: 700; }
.c-even  { color: var(--ok); font-weight: 700; }
.c-flat  { color: var(--text-3); font-weight: 700; }
.his-sum { font-weight: 800; }
@media (max-width: 640px) {
  .ball-md { width: 24px; height: 24px; font-size: 12px; margin-right: 3px; }
}

/* 历史开奖表：紧凑靠左排列，列距随内容收缩（不铺满整行） */
#hisTable { width: auto; max-width: 100%; }
#hisTable td { padding: 10px 14px 10px 0; }
#hisTable th { padding: 9px 14px 9px 0; }

/* 紧凑排列扩展到首页/各彩种主页的开奖表（.tbl-his） */
.tbl-his { width: auto; max-width: 100%; }
.tbl-his td { padding: 10px 14px 10px 0; }
.tbl-his th { padding: 9px 14px 9px 0; }

/* ---- 期号详情页 上期/下期导航 ---- */
.pn-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.pn-nav a {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; color: var(--text-2); font-size: 14px; text-decoration: none;
  transition: all .15s;
}
.pn-nav a:hover { color: var(--brand); border-color: var(--brand); }
