/* 基础变量与重置 */
:root {
  --bg: #ffffff; /* 白色主题背景 */
  --card: #faf7f2; /* 浅米白卡片 */
  --muted: #7c6b5f; /* 低饱和褐灰 */
  --text: #2b241f; /* 深棕正文 */
  --accent: #c27f3d; /* 琥珀金高亮 */
  --accent-2: #a15c38; /* 焦糖铜 */
  --danger: #b24b3f; /* 暖红褐 */
  --border: #e6dccf; /* 浅米描边 */
  --yellow: #b8892e; /* 复古金 */
  --paper: #fffaf2; /* 纸张底纹 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.03);
  --shadow-md: 0 6px 16px rgba(194,127,61,0.08), 0 2px 6px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  background-image: radial-gradient(20% 20% at 20% 10%, rgba(194,127,61,0.06) 0%, rgba(194,127,61,0) 60%),
    radial-gradient(25% 25% at 80% 0%, rgba(161,92,56,0.05) 0%, rgba(161,92,56,0) 60%),
    linear-gradient(0deg, var(--paper), var(--paper));
  color: var(--text);
}

/* 顶部错误提示 */
.notice { position: sticky; top: 0; z-index: 60; width: 100%; background: #fff7ec; color: #7a4a14; border-bottom: 1px solid var(--border); padding: 10px 16px; display: none; }
.notice.is-visible { display: block; }

/* 语言自动适配提示 */
.language-tip {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  display: none;
}

.language-tip.show {
  display: block !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  pointer-events: auto;
}

.language-tip-content {
  background: linear-gradient(135deg, rgba(194,127,61,0.95), rgba(161,92,56,0.95));
  backdrop-filter: blur(12px);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 
    0 8px 32px rgba(194,127,61,0.3),
    0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  min-width: 200px;
  border: 1px solid rgba(255,255,255,0.2);
}

.language-tip-icon {
  font-size: 16px;
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.language-tip-text {
  flex: 1;
  white-space: nowrap;
}

.language-tip-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.language-tip-close:hover {
  background-color: rgba(255,255,255,0.2);
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* 顶部栏 - 现代化设计 */
.topbar { 
  border-bottom: 1px solid var(--border); 
  background: 
    linear-gradient(135deg, rgba(194,127,61,0.12), rgba(194,127,61,0.06)),
    radial-gradient(circle at 20% 50%, rgba(194,127,61,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(161,92,56,0.06) 0%, transparent 50%);
  backdrop-filter: blur(12px); 
  position: sticky; 
  top: 0; 
  z-index: 50; 
  box-shadow: 
    0 2px 20px rgba(194,127,61,0.1),
    0 1px 3px rgba(0,0,0,0.05);
  min-height: 60px;
  transition: all 0.3s ease;
}

.topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(194,127,61,0.3) 20%, 
    rgba(194,127,61,0.5) 50%, 
    rgba(194,127,61,0.3) 80%, 
    transparent);
  opacity: 0.6;
}

.topbar__content { 
  display: grid;
  grid-template-areas: "lang source contact";
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  min-height: 60px;
}

/* 语言下拉选择器 */
.lang-dropdown {
  grid-area: lang;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-dropdown__label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.topbar-source { 
  grid-area: source;
  display: flex; 
  gap: 8px; 
  justify-content: center;
  flex-shrink: 0;
}

/* 数据源按钮样式统一 */
.topbar-source .lang-switch__btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(194,127,61,0.3);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(194,127,61,0.1);
  position: relative;
  overflow: hidden;
}

.topbar-source .lang-switch__btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(194,127,61,0.15), transparent);
  transition: left 0.6s ease;
}

.topbar-source .lang-switch__btn:hover:before {
  left: 100%;
}

.topbar-source .lang-switch__btn:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(194,127,61,0.15);
}

.topbar-source .lang-switch__btn.is-active {
  background: linear-gradient(135deg, rgba(194,127,61,0.25), rgba(194,127,61,0.15));
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
  box-shadow: 
    0 4px 12px rgba(194,127,61,0.2),
    inset 0 1px 0 rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.topbar-source .lang-switch__btn:active {
  transform: translateY(0);
  transition-duration: 0.1s;
}

.topbar__contact {
  grid-area: contact;
  justify-self: end;
  text-align: right;
}
/* 下拉触发按钮 */
.lang-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(194,127,61,0.3);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(194,127,61,0.1);
  min-width: 120px;
  justify-content: space-between;
}

.lang-dropdown__trigger:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(194,127,61,0.15);
}

.lang-dropdown__trigger[aria-expanded="true"] {
  background: rgba(194,127,61,0.1);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(194,127,61,0.2);
}

.lang-dropdown__trigger[aria-expanded="true"] .lang-dropdown__arrow {
  transform: rotate(180deg);
}

.lang-dropdown__current {
  flex: 1;
  text-align: left;
}

.lang-dropdown__arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--muted);
}

/* 下拉菜单 */
.lang-dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  width: max-content;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(194,127,61,0.2);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  box-shadow: 
    0 8px 32px rgba(194,127,61,0.15),
    0 4px 16px rgba(0,0,0,0.1);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.lang-dropdown__menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* 下拉菜单项 */
.lang-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: calc(100% - 8px);
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 4px;
  white-space: nowrap;
}

.lang-dropdown__item:first-child {
  margin-top: 8px;
}

.lang-dropdown__item:last-child {
  margin-bottom: 8px;
}

.lang-dropdown__item:hover {
  background: rgba(194,127,61,0.1);
  transform: translateX(4px);
}

.lang-dropdown__item.is-active {
  background: linear-gradient(135deg, rgba(194,127,61,0.15), rgba(194,127,61,0.08));
  color: var(--accent);
  font-weight: 600;
}

.lang-dropdown__item.is-active::after {
  content: '✓';
  margin-left: auto;
  color: var(--accent);
  font-weight: bold;
}

.lang-dropdown__flag {
  font-size: 16px;
  flex-shrink: 0;
}

.lang-dropdown__name {
  flex: 1;
}
.topbar__contact { color: var(--muted); font-size: 14px; }
.topbar__contact a { color: var(--accent); text-decoration: none; }

/* 头部 */
.header { padding: 24px 0; border-bottom: 1px solid var(--border); }
.header__content { display: flex; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.site-title { margin: 0; font-size: 32px; letter-spacing: .5px; }
.site-subtitle { margin: 8px 0 0; color: var(--text); opacity: .85; font-weight: 600; }
.source-switch { margin-top: 6px; margin-bottom: 10px; display: inline-flex; gap: 10px; padding: 4px; background: rgba(194,127,61,0.06); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-sm); }
.source-btn { cursor: pointer; padding: 6px 14px; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: 999px; font-size: 14px; }
.source-btn.is-active { border-color: var(--accent); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.next-timer { font-size: 16px; color: var(--text); white-space: nowrap; border: 1px solid var(--border); background: #fff7ec; padding: 6px 10px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.btn-refresh { margin-left: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; transition: transform .08s ease, background .2s ease, border-color .2s ease; }
.btn-refresh:hover { background: rgba(194,127,61,0.1); border-color: var(--accent); }
.btn-refresh:active { transform: translateY(1px); }
.last-updated { margin-left: 8px; color: var(--muted); font-size: 12px; }

/* 主体：最新区块 */
.main { padding: 20px 0 60px; }
.latest { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.latest__left { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-md); text-align: center; }
.latest__title-group { display: flex; align-items: baseline; gap: 10px; justify-content: center; }
.latest__title { margin: 0; font-size: 20px; }
.latest__issue { color: var(--muted); }
.latest__result { margin-top: 8px; font-size: 34px; font-weight: 800; letter-spacing: 0.5px; color: #5a3e22; }
.latest__result--inline { margin: 0 12px 0 0; }
.latest__left .next-timer { 
  margin-top: 10px; 
  display: flex; /* 垂直布局容器 */
  flex-direction: column;
  align-items: center; 
  gap: 8px; 
  padding: 8px 12px; 
  background: linear-gradient(180deg, rgba(194,127,61,0.06), rgba(194,127,61,0.02)), var(--paper); 
  border: 1px solid var(--border); 
  border-radius: 14px; 
  box-shadow: var(--shadow-sm);
}
.latest__left .next-timer strong { 
  font-variant-numeric: tabular-nums; 
  font-size: 20px; 
  color: var(--text);
}

/* 开奖中状态样式 */
.latest__left .next-timer strong.drawing-status {
  color: var(--accent);
  font-weight: 700;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.latest__left .next-timer #next-label { color: var(--muted); font-weight: 600; }
.latest__left .next-timer #next-min-label,
.latest__left .next-timer #next-sec-label { color: var(--muted); font-weight: 600; }
.latest__left .next-timer .btn-refresh { padding: 4px 10px; border-radius: 999px; }
.latest__left .next-timer .last-updated { color: var(--muted); font-size: 12px; }
.timer-row { display: inline-flex; align-items: center; gap: 12px; }
.latest__actions { margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.tags-group { 
  margin-top: 6px; 
  display: flex; 
  align-items: baseline; 
  justify-content: center; 
  gap: 8px; 
  flex-wrap: wrap;
  line-height: 1;
}
.latest__extra { 
  display: flex; 
  align-items: center;
  gap: 8px; 
  flex-wrap: wrap; 
}

/* 最新标题更协调 */
.latest__title-group { display: flex; align-items: baseline; gap: 8px; }
.latest__issue { color: var(--muted); font-size: 18px; font-weight: 600; }
.latest__tags { 
  margin-top: 8px; 
  display: flex; 
  align-items: center;
  justify-content: center;
  gap: 8px; 
  flex-wrap: wrap; 
}
.tag { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  padding: 6px 12px; 
  border-radius: 999px; 
  font-size: 12px; 
  font-weight: 500;
  line-height: 1;
  height: 28px;
  min-height: 28px;
  border: 1px solid var(--border); 
  background: #fff7ec; 
  box-shadow: inset 0 1px 0 #ffffffcc, 0 1px 2px rgba(0,0,0,0.04);
  transition: transform .15s ease;
  white-space: nowrap;
  vertical-align: top;
  box-sizing: border-box;
}
.tag:active { transform: translateY(1px); }
.tag--big { color: #d9a441; border-color: #d9a44133; }
.tag--small { color: #b98b5f; border-color: #b98b5f33; }
.tag--odd { color: #c87c68; border-color: #c87c6833; }
.tag--even { color: #a87955; border-color: #a8795533; }

/* 特殊标签样式 */
.tag--extreme-big { color: #d25454; border-color: #d2545433; background: #fff5f5; }
.tag--extreme-small { color: #2ea6ff; border-color: #2ea6ff33; background: #f0f9ff; }
.tag--leopard { color: #e74f87; border-color: #e74f8733; background: #fef7f7; }
.tag--straight { color: #3ac07a; border-color: #3ac07a33; background: #f0fdf4; }
.tag--pair { color: #d2843a; border-color: #d2843a33; background: #fffbf0; }

.latest__right { text-align: center; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.latest + .tabs, .tabs { margin-top: 8px; }
.tab { cursor: pointer; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--muted); transition: all .2s ease; }
.tab:hover { color: var(--text); border-color: var(--accent); background: rgba(194,127,61,0.08); }
.tab.is-active { color: var(--text); border-color: var(--accent); background: linear-gradient(180deg, rgba(194,127,61,0.18), rgba(194,127,61,0.06)); box-shadow: var(--shadow-sm); }

/* 面板与表格 */
.panel { display: none; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-md); }
.panel.is-active { display: block; }
.table-wrap { 
  width: 100%; 
  overflow-x: auto; 
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* 走势图表格容器特殊处理 */
.panel[data-panel="trend"] .table-wrap {
  overflow: visible;
  width: 100%;
  max-width: 100%;
  position: relative;
}

/* 移动端完整文字显示 - 终极自适应方案 */
@media (max-width: 768px) {
  .panel[data-panel="trend"] .table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  
  .trend-table {
    width: 100%;
    min-width: 450px;
    table-layout: fixed;
    font-size: 11px;
  }
  
  .trend-table th,
  .trend-table td {
    padding: 6px 3px;
    font-size: 11px;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
  }
  
  .trend-badge-cell {
    vertical-align: middle;
    height: auto;
    min-height: 32px;
  }
  
  .trend-table th {
    font-size: 10px;
    padding: 6px 3px;
    line-height: 1.2;
  }
  
  /* 固定像素列宽 - 基于600px */
  .trend-table th:nth-child(1), .trend-table td:nth-child(1) { width: 80px; }
  .trend-table th:nth-child(2), .trend-table td:nth-child(2) { width: 40px; }
  .trend-table th:nth-child(3), .trend-table td:nth-child(3) { width: 50px; }
  .trend-table th:nth-child(4), .trend-table td:nth-child(4) { width: 50px; }
  .trend-table th:nth-child(5), .trend-table td:nth-child(5) { width: 50px; }
  .trend-table th:nth-child(6), .trend-table td:nth-child(6) { width: 50px; }
  .trend-table th:nth-child(7), .trend-table td:nth-child(7) { width: 70px; }
  .trend-table th:nth-child(8), .trend-table td:nth-child(8) { width: 70px; }
  .trend-table th:nth-child(9), .trend-table td:nth-child(9) { width: 70px; }
  .trend-table th:nth-child(10), .trend-table td:nth-child(10) { width: 70px; }
  
  .cell-badge {
    font-size: 8px;
    padding: 3px 4px;
    min-width: 18px;
    min-height: 16px;
    height: auto;
    border-radius: 8px;
    line-height: 1.1;
    white-space: normal;
    overflow: hidden;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

.trend-table {
  width: 600px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}
  
  /* 固定列宽 - 500px基准 */
  .trend-table th:nth-child(1), .trend-table td:nth-child(1) { width: 70px; }
  .trend-table th:nth-child(2), .trend-table td:nth-child(2) { width: 35px; }
  .trend-table th:nth-child(3), .trend-table td:nth-child(3) { width: 45px; }
  .trend-table th:nth-child(4), .trend-table td:nth-child(4) { width: 45px; }
  .trend-table th:nth-child(5), .trend-table td:nth-child(5) { width: 45px; }
  .trend-table th:nth-child(6), .trend-table td:nth-child(6) { width: 45px; }
  .trend-table th:nth-child(7), .trend-table td:nth-child(7) { width: 52.5px; }
  .trend-table th:nth-child(8), .trend-table td:nth-child(8) { width: 52.5px; }
  .trend-table th:nth-child(9), .trend-table td:nth-child(9) { width: 52.5px; }
  .trend-table th:nth-child(10), .trend-table td:nth-child(10) { width: 52.5px; }
  
  .cell-badge {
    font-size: 8px;
    padding: 2px 4px;
    min-width: 18px;
    height: 16px;
    border-radius: 8px;
    line-height: 1;
  }
}

.trend-table {
  width: 600px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th { position: sticky; top: 0; background: #f7efe6; color: var(--muted); text-align: center; font-weight: 600; padding: 12px 10px; border-bottom: 1px solid var(--border); }

/* 走势图表头特殊样式 */
.trend-table thead th {
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}
.table tbody td { text-align: center; }
.table thead th:first-child { border-top-left-radius: 12px; }
.table thead th:last-child { border-top-right-radius: 12px; }
.table tbody td { padding: 12px 10px; border-bottom: 1px solid var(--border); }
.table tbody tr:nth-child(odd) { background: #fffdf8; }
.table tbody tr:hover { background: #fff6e9; }

/* 时间单元格样式统一 */
.time-cell {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  text-align: center;
  line-height: 1.2;
  padding: 6px 4px !important;
  vertical-align: middle;
  white-space: nowrap;
}

.time-compact {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  font-family: 'Courier New', monospace;
  display: inline-block;
  line-height: 1.2;
}
.hit-ok { color: #d25454; font-weight: 600; }
.hit-miss { color: #7c6b5f; }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 10px; justify-content: center; padding-top: 12px; color: var(--muted); }
.page-btn { padding: 6px 12px; border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 10px; cursor: pointer; transition: all .2s ease; }
.page-btn:hover { background: rgba(194,127,61,0.08); border-color: var(--accent); }
.page-info { min-width: 80px; text-align: center; }

/* 走势图 */
.chart-wrap { position: relative; }
.chart-legend { display: flex; gap: 12px; color: var(--muted); padding-top: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { width: 18px; height: 2px; background: var(--accent); display: inline-block; border-radius: 2px; }
.legend-line--sum { background: #a15c38; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-dot--big { background: #d9a441; }
.legend-dot--small { background: #b98b5f; }
/* 桌面端走势图表格默认样式 */
.trend-table { 
  table-layout: fixed; 
  font-size: 13px;
  width: 100%;
  border-collapse: collapse;
}

.trend-table td, .trend-table th { 
  text-align: center; 
  padding: 6px 4px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trend-table th {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 4px;
  line-height: 1.2;
}

/* 桌面端列宽设置 */
.trend-table th:first-child, .trend-table td:first-child { width: 96px; }
.trend-table th:nth-child(2), .trend-table td:nth-child(2) { width: 70px; }
.cell-badge { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 6px; 
  border-radius: 999px; 
  color: #fff; 
  font-size: 10px; 
  font-weight: 500;
  line-height: 1;
  min-width: 22px;
  max-width: 100%;
  height: 18px;
  box-sizing: border-box;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-big { background: #d25454; }
.badge-small { background: #2ea6ff; }
.badge-odd { background: #e74f87; }
.badge-even { background: #3ac07a; }
.badge-big-odd { background: #d2843a; }
.badge-big-even { background: #b4552d; }
.badge-small-odd { background: #5c85d6; }
.badge-small-even { background: #3aa7c0; }



/* 预测卡片 */
.predict-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.predict-cards .card { display: flex; flex-direction: column; gap: 6px; }
.predict-title { font-weight: 600; color: #5a3e22; }
.predict-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.predict-tag { padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 12px; }

/* 子标签（算法1/2/3） */
.subtabs { display: flex; gap: 8px; margin-bottom: 8px; justify-content: center; }
.subtab { cursor: pointer; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text); }
.subtab.is-active { border-color: var(--accent); background: rgba(194,127,61,0.08); }
.subpanel { display: none; }
.subpanel.is-active { display: block; }

@media (max-width: 960px) {
  .predict-cards { grid-template-columns: 1fr; }
}

/* 加载占位 */
.placeholder { display: grid; place-items: center; padding: 40px 0; gap: 12px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid #ffffff22; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 卡片与网格 */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-sm); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; color: var(--muted); }

/* 页脚 */
.footer { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); text-align: center; }
.footer a { color: var(--accent); text-decoration: none; }

/* 现代响应式设计 - 下拉选择器优化 */

/* 中等屏幕及以下 (768px以下) */
@media (max-width: 768px) {
  .topbar__content {
    grid-template-areas: 
      "lang source"
      "contact contact";
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .topbar-source {
    justify-content: flex-end;
  }
  
  .topbar__contact {
    justify-self: center;
    text-align: center;
    font-size: 13px;
  }
  
  /* 中等屏幕下的数据源按钮优化 */
  .topbar-source .lang-switch__btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* 小屏幕 (480px以下) */
@media (max-width: 480px) {
  .container { 
    padding: 0 12px; 
  }
  
  .topbar__content {
    grid-template-areas: 
      "lang source"
      "contact contact";
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 12px;
  }
  
  .lang-dropdown__trigger {
    min-width: 100px;
    font-size: 13px;
    padding: 6px 10px;
  }
  
  .lang-dropdown__label {
    font-size: 13px;
  }
  
  .topbar-source {
    justify-content: flex-end;
    gap: 6px;
  }
  
  /* 小屏幕下的数据源按钮优化 */
  .topbar-source .lang-switch__btn {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 60px;
  }
  
  .topbar__contact {
    font-size: 12px;
  }
  
  .topbar__contact span {
    display: block;
    margin-bottom: 2px;
  }
  
  /* 移动端时间显示优化 */
  .time-cell {
    padding: 4px 2px !important;
    font-size: 10px;
  }
  
  .time-compact {
    font-size: 10px;
    line-height: 1.1;
  }
  
  
  /* 下拉菜单在小屏幕上的优化 */
  .lang-dropdown__menu {
    left: -20px;
    right: -20px;
    max-height: 250px;
  }
  
  .lang-dropdown__item {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .lang-dropdown__flag {
    font-size: 14px;
  }
}

/* 通用响应式优化 */
@media (max-width: 960px) {
  .latest { grid-template-columns: 1fr; }
  .header__content { 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
  }
  .next-timer { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
}


