:root {
      --bg: #0b1020;
      --bg-card: #151a2c;
      --accent: #ffcc33;
      --accent-soft: rgba(255, 204, 51, 0.12);
      --accent-strong: rgba(255, 204, 51, 0.2);
      --danger: #ff5c7a;
      --text-main: #f5f7ff;
      --text-muted: #9ea3c0;
      --border-subtle: #252b3f;
      --chip-front: #5b8def;
      --chip-back: #ff8a5c;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      padding: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
      background: radial-gradient(circle at top, #202a44 0, #050816 40%, #02030a 100%);
      color: var(--text-main);
      min-height: 100vh;
    }

    .page {
      max-width: 1100px;
      margin: 0 auto;
      padding: 20px 14px 40px;
    }

    .header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 20px;
    }

    .title-wrap {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    h1 {
      font-size: 22px;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .badge {
      font-size: 11px;
      padding: 2px 8px;
      border-radius: 999px;
      background: linear-gradient(135deg, var(--accent-soft), transparent);
      color: var(--accent);
      border: 1px solid rgba(255, 204, 51, 0.3);
    }

    .subtitle {
      margin: 0;
      font-size: 13px;
      color: var(--text-muted);
    }

    .header-right {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
    }

    .user-nav {
      font-size: 12px;
      color: var(--text-muted);
    }
    .game-switch {
      margin-top: 8px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
    }

    .game-switch-label {
      font-size: 12px;
      color: var(--text-muted);
    }

    .game-switch-btn {
      font-size: 12px;
      padding: 4px 10px;
      border-radius: 999px;
      border: 1px solid rgba(119, 140, 255, 0.6);
      background: rgba(11, 16, 40, 0.9);
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.15s ease-out;
    }

    .game-switch-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
      box-shadow: 0 0 0 1px rgba(255, 204, 51, 0.25);
    }

    .game-switch-btn.active {
      background: var(--accent-soft);
      color: var(--accent);
      border-color: var(--accent);
      box-shadow: 0 0 0 1px rgba(255, 204, 51, 0.35);
    }


    .user-nav a {
      color: var(--accent);
      text-decoration: none;
      margin-left: 4px;
    }

    .user-nav a:hover {
      text-decoration: underline;
    }

    .pill-notice {
      background: rgba(46, 213, 115, 0.08);
      border: 1px solid rgba(46, 213, 115, 0.3);
      color: #a6ffcf;
      font-size: 12px;
      padding: 6px 10px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
    }

    .pill-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #2ed573;
      box-shadow: 0 0 8px rgba(46, 213, 115, 0.8);
    }

    .layout-main {
      display: grid;
      grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
      gap: 16px;
    }

    .card {
      background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 60%),
                  linear-gradient(145deg, #161a2b, #0b101f);
      border-radius: 18px;
      border: 1px solid rgba(119, 140, 255, 0.16);
      padding: 16px 16px 14px;
      box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(255, 255, 255, 0.02);
    }

    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 10px;
    }

    .card-title {
      font-size: 15px;
      font-weight: 600;
      letter-spacing: 0.01em;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .card-title span.icon {
      font-size: 18px;
    }

    .card-subtitle {
      margin: 0;
      font-size: 12px;
      color: var(--text-muted);
    }

    .card-main {
      font-size: 13px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .field-group {
      margin-bottom: 10px;
    }

    .field-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 4px;
    }

    .field-label span:first-child {
      color: var(--text-main);
      font-size: 13px;
      font-weight: 500;
    }

    textarea,
    input[type="text"],
    input[type="number"] {
      width: 100%;
      border-radius: 10px;
      background: rgba(10, 12, 24, 0.9);
      border: 1px solid rgba(112, 122, 180, 0.6);
      padding: 7px 9px;
      font-size: 13px;
      color: var(--text-main);
      outline: none;
      resize: vertical;
      min-height: 48px;
    }

    /* 票号输入框：自动高度（取消右侧滚动条） */
    #ticket-input{
      resize: none;
      overflow-y: hidden;
      scrollbar-width: none; /* Firefox */
      -ms-overflow-style: none; /* IE/Edge legacy */
      min-height: 260px;
    }
    #ticket-input::-webkit-scrollbar{ width:0; height:0; }

    textarea:focus,
    input[type="text"]:focus,
    input[type="number"]:focus {
      border-color: rgba(255, 204, 51, 0.9);
      box-shadow: 0 0 0 1px rgba(255, 204, 51, 0.35);
    }

    input[type="number"] {
      min-height: 0;
    }

    /* 去掉数字输入框右侧上下箭头（倍数/追加） */
    input[type="number"]::-webkit-outer-spin-button,
    input[type="number"]::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    input[type="number"] {
      -moz-appearance: textfield;
      appearance: textfield;
    }


    textarea::placeholder,
    input::placeholder {
      color: #5f6586;
    }

    .code-row {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
      gap: 6px;
    }

    .btn-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin-top: 10px;
    }

    button {
      border-radius: 999px;
      border: none;
      padding: 7px 14px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.16s ease;
      white-space: nowrap;
    }

    button.primary {
      background: linear-gradient(135deg, #ffcc33, #ff9f1a);
      color: #1b1300;
      box-shadow: 0 6px 18px rgba(255, 180, 0, 0.35);
    }

    button.primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 24px rgba(255, 180, 0, 0.5);
    }

    button.secondary {
      background: rgba(19, 27, 63, 0.9);
      color: var(--text-main);
      border: 1px solid rgba(118, 134, 255, 0.45);
    }

    button.secondary:hover {
      background: rgba(33, 46, 104, 0.9);
    }

    button.ghost {
      background: transparent;
      color: var(--text-muted);
      border: 1px solid rgba(255, 255, 255, 0.09);
    }

    button.ghost:hover {
      background: rgba(255, 255, 255, 0.03);
    }

    .small-tip {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.5;
      white-space: pre-line;
    }

    .pill-input {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 4px 8px;
      border-radius: 999px;
      background: rgba(8, 13, 30, 0.96);
      border: 1px solid rgba(92, 106, 196, 0.7);
    }

    
    .ssq-extra-autoff {
      font-size: 12px;
      color: var(--text-muted);
      display: inline-flex;
      align-items: center;
      padding: 4px 10px;
      border-radius: 999px;
      background: rgba(8, 13, 30, 0.96);
      border: 1px dashed rgba(92, 106, 196, 0.55);
      white-space: nowrap;
    }

.pill-input span {
      font-size: 11px;
      color: var(--text-muted);
    }

    .pill-input input {
      border: none;
      background: transparent;
      padding: 3px 4px;
      min-width: 0;
      text-align: center;
    }

    
    .pill-toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      width: 100%;
      cursor: pointer;
    }

    .pill-toggle-label {
      font-size: 11px;
      color: var(--text-muted);
    }

    .pill-toggle-input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .pill-toggle-switch {
      width: 30px;
      height: 16px;
      border-radius: 999px;
      border: 1px solid rgba(119, 140, 255, 0.8);
      background: rgba(9, 14, 35, 0.9);
      display: inline-flex;
      align-items: center;
      padding: 1px;
      box-sizing: border-box;
      transition: all 0.15s ease-out;
    }

    .pill-toggle-knob {
      width: 12px;
      height: 12px;
      border-radius: 999px;
      background: #ffffff;
      box-shadow: 0 0 4px rgba(0, 0, 0, 0.45);
      transform: translateX(0);
      transition: transform 0.15s ease-out;
    }

    .pill-toggle-input:checked + .pill-toggle-switch {
      background: var(--accent-soft);
      border-color: var(--accent);
    }

    .pill-toggle-input:checked + .pill-toggle-switch .pill-toggle-knob {
      transform: translateX(12px);
    }
.numbers-guide {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      font-size: 12px;
      color: var(--text-muted);
      padding: 6px 8px;
      border-radius: 10px;
      background: rgba(8, 11, 26, 0.9);
      border: 1px dashed rgba(116, 127, 184, 0.6);
    }

    .numbers-guide strong {
      color: var(--accent);
      font-weight: 500;
    }

    .errors {
      margin-top: 10px;
      border-radius: 12px;
      background: rgba(255, 92, 122, 0.08);
      border: 1px solid rgba(255, 92, 122, 0.4);
      padding: 8px 10px;
      font-size: 12px;
      color: #ffd9e0;
      display: none;
    }

    .errors ul {
      padding-left: 18px;
      margin: 6px 0 0;
    }

    .errors li {
      margin-bottom: 2px;
    }

    .notice-box {
      margin-top: 10px;
      border-radius: 12px;
      background: rgba(10, 189, 96, 0.08);
      border: 1px solid rgba(10, 189, 96, 0.35);
      padding: 8px 10px;
      font-size: 12px;
      color: #b9f6ca;
      display: none;
    }

    .results {
      margin-top: 10px;
      padding-top: 6px;
      border-top: 1px dashed rgba(106, 115, 175, 0.7);
      display: none;
    }

    .results-summary {
      font-weight: 500;
      font-size: 13px;
      margin-bottom: 4px;
    }

    /* 盈利/亏损高亮区域 */
    .results-profit {
      margin: 2px 0 6px;
      font-size: 12px;
    }
    .results-profit span {
      font-weight: 600;
    }
    .results-profit .profit-positive {
      color: #2ed573;
    }
    .results-profit .profit-negative {
      color: #ff5c7a;
    }
    .results-profit .profit-zero {
      color: #ffcc33;
    }

    .prize-list {
      font-size: 12px;
      line-height: 1.7;
    }

    .prize-list strong {
      color: var(--accent);
      font-weight: 600;
    }

    .history-section {
      margin-top: 0;
    }

    /* 这里改了：去掉 max-height 和 overflow-y，全部展开显示 */
    .history-list {
      margin-top: 8px;
      padding-right: 0;
    }

    .history-item {
      border-radius: 12px;
      padding: 8px 10px;
      background: rgba(16, 22, 48, 0.9);
      border: 1px solid rgba(78, 90, 170, 0.65);
      margin-bottom: 6px;
      transition: all 0.15s;
    }

    .history-item:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
      border-color: rgba(255, 204, 51, 0.65);
    }

    .history-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 4px;
    }

    .history-issue {
      font-size: 12px;
      font-weight: 500;
    }

    .history-time {
      font-size: 11px;
      color: var(--text-muted);
    }

    .history-nums {
      font-size: 12px;
      color: #dde4ff;
    }
    .history-nums-balls {
      margin-top: 4px;
    }

    .history-balls-group {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px;
      margin-top: 2px;
    }

    .history-label {
      font-size: 11px;
      color: var(--text-muted);
      margin-right: 4px;
    }

    .history-ball {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      font-size: 11px;
      font-weight: 500;
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    }

    .history-ball-red {
      background: #ff4d4f;
      color: #fff;
    }

    .history-ball-blue {
      background: #4096ff;
      color: #fff;
    }


    


    /* 最新/选定期开奖号码：红球 + 蓝球展示 */
.winning-balls-preview {
  margin-top: 6px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
}
.winning-balls-preview .history-balls-group {
  margin-top: 0;
  width: 100%;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(3px, 1.2vw, 8px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.winning-balls-preview .history-balls-group::-webkit-scrollbar {
  display: none;
}
.winning-balls-preview .history-ball {
  width: clamp(28px, 9vw, 50px);
  height: clamp(28px, 9vw, 50px);
  font-size: clamp(12px, 4vw, 22px);
  flex: 0 0 auto;
}
.winning-display-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.winning-display-row .winning-balls-preview {
  margin-top: 0;
}

/* 手动输入框：下移避免与号码球重叠 */
.winning-display-row{margin-bottom:10px;}
#winning-input-row{margin-top:10px;}

/* 开奖号区域：把“手动输入”按钮放到标题旁边，并在窄屏让说明换行 */
.field-label.winning-label {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}
.winning-label-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-label.winning-label #btn-winning-toggle {
  padding: 4px 10px;
  font-size: 12px;
}
.field-label.winning-label .small-tip {
  flex: 1 1 100%;
  line-height: 1.35;
}


.history-remark {
      margin-top: 2px;
      font-size: 11px;
      color: var(--text-muted);
    }

    .footer-tip {
      margin-top: 12px;
      font-size: 11px;
      color: var(--text-muted);
      text-align: right;
    }

    .footer-tip strong {
      color: rgba(255, 204, 51, 0.9);
    }

    /* 登录 / 注册弹窗 */
    .auth-mask {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.55);
      display: none; /* 默认隐藏 */
      align-items: center;
      justify-content: center;
      z-index: 999;
    }

    .auth-modal {
      background: #151a2c;
      border-radius: 14px;
      width: 320px;
      max-width: 92%;
      padding: 16px 16px 18px;
      border: 1px solid rgba(119, 140, 255, 0.5);
      box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75);
      color: var(--text-main);
    }

    .auth-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }

    .auth-title {
      font-size: 15px;
      font-weight: 600;
    }

    .auth-close {
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-size: 18px;
      cursor: pointer;
      padding: 0;
      line-height: 1;
    }

    .auth-close:hover {
      color: #ffffff;
    }

    .auth-body {
      font-size: 13px;
    }

    .auth-body label {
      display: block;
      font-size: 12px;
      margin-bottom: 4px;
      color: var(--text-muted);
    }

    .auth-body input[type="text"],
    .auth-body input[type="password"] {
      width: 100%;
      padding: 7px 9px;
      border-radius: 8px;
      border: 1px solid rgba(112, 122, 180, 0.9);
      background: rgba(10, 12, 24, 0.98);
      color: var(--text-main);
      font-size: 13px;
      outline: none;
      margin-bottom: 10px;
    }

    .auth-body input[type="text"]:focus,
    .auth-body input[type="password"]:focus {
      border-color: rgba(255, 204, 51, 0.9);
      box-shadow: 0 0 0 1px rgba(255, 204, 51, 0.35);
    }

    .auth-actions {
      margin-top: 4px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .auth-actions button {
      flex: 1;
      justify-content: center;
    }

    .auth-msg {
      margin-top: 6px;
      font-size: 12px;
      min-height: 16px;
      color: var(--text-muted);
    }

    .auth-switch {
      margin-top: 8px;
      font-size: 12px;
      color: var(--text-muted);
      text-align: right;
    }

    .auth-switch a {
      color: var(--accent);
      text-decoration: none;
      margin-left: 4px;
    }

    .auth-switch a:hover {
      text-decoration: underline;
    }

    @media (max-width: 840px) {
      .layout-main {
        grid-template-columns: minmax(0, 1fr);
      }
    }

    @media (max-width: 600px) {
      .header {
        flex-direction: column;
        align-items: flex-start;
      }

      .header-right {
        align-items: flex-start;
      }

      .pill-notice {
        width: 100%;
        justify-content: center;
      }

      .card {
        padding: 14px 12px 12px;
      }
    }
