  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 20px 20px 70px;
    min-height: 100vh;
  }
  .container { max-width: 900px; margin: 0 auto; }
  header { text-align: center; margin-bottom: 30px; }
  h1 {
    font-size: 28px;
    color: #DB7E22;
    margin-bottom: 6px;
  }
  .subtitle { color: #888; font-size: 13px; margin-top: 6px; }
  .author {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    letter-spacing: 1px;
    font-style: italic;
  }
  .toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
  }
  .toolbar input {
    flex: 1;
    min-width: 200px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
  }
  /* 复选框不吃上面文本框的拉伸规则(否则勾选框被拉宽 200px, 和文字隔老远) */
  .toolbar input[type="checkbox"] {
    flex: 0 0 auto;
    min-width: 0;
    padding: 0;
  }
  .toolbar button,
  .btn-link {
    background: #DB7E22;
    color: #000;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    text-decoration: none;
    display: inline-block;
    vertical-align: middle;
  }
  .toolbar button:hover,
  .btn-link:hover { background: #f08c2e; }
  .stats {
    background: #2a2a2a;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    color: #888;
    font-size: 13px;
  }
  /* 地区导航：根网址默认国服，国服保留原来的称号和装备展示。 */
  .region-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
  .region-tabs a { display:inline-block; background:#2a2a2a; color:#aaa; border:1px solid #444;
    border-radius:4px; padding:8px 18px; text-decoration:none; font-size:14px; font-weight:bold; }
  .region-tabs a[aria-current="page"] { background:#704d21; border-color:#DB7E22; color:#f5d193; }
  .region-tabs a:hover { border-color:#DB7E22; color:#fff; }
  .region-tabs a:focus-visible { outline:2px solid #f5b86a; outline-offset:2px; }
  /* 归档赛季总结面板 */
  .season-summary {
    background: linear-gradient(135deg, #2a2a2a, #333);
    border-left: 3px solid #DB7E22;
    padding: 14px 18px;
    margin-bottom: 12px;
    border-radius: 4px;
    display: none;
  }
  .season-summary.show { display: block; }
  .season-summary h3 {
    color: #DB7E22;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: normal;
  }
  .season-summary .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
    border-bottom: 1px dashed #333;
  }
  .season-summary .stat-row:last-child { border-bottom: none; }
  .season-summary .label { color: #888; }
  .season-summary .value { color: #e0e0e0; font-weight: bold; }
  table {
    width: 100%;
    background: #2a2a2a;
    border-collapse: collapse;
    border-radius: 4px;
    overflow: hidden;
    table-layout: fixed;  /* 固定列宽,避免昵称列吃掉所有空白 */
  }
  /* 职业列同时容纳头像、名称和装备入口，窄屏使用表格横向滚动。 */
  th:nth-child(1), td:nth-child(1) { width: 155px; }  /* 称号铭牌；更长的文字在牌内滚动 */
  th:nth-child(2), td:nth-child(2) { width: 56px; }   /* 排名 */
  th:nth-child(3), td:nth-child(3) { width: 170px; }  /* 昵称 */
  th:nth-child(4), td:nth-child(4) { width: 84px; }   /* 巅峰 (专家模式下显示专家巅峰) */
  th:nth-child(5), td:nth-child(5) { width: 194px; }  /* 职业及装备入口 */
  th:nth-child(6), td:nth-child(6) { width: 134px; }  /* 近7天经验/小时 */
  th:nth-child(7), td:nth-child(7) { width: auto; }   /* 更新时间 */
  /* 昵称太长时省略号截断,避免撑爆列 */
  td:nth-child(3) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 称号列: 右对齐贴着排名, 只读淡金色 */
  th.title-col { text-align: right; }
  td.title-col { text-align: right; color: #C9A24B; font-size: 13px; font-weight: 700; letter-spacing: .3px; overflow: hidden; white-space: nowrap; -webkit-font-smoothing: antialiased; }
  /* 称号整体: flex 右对齐; 标题放进自己的滚动窗口, "改"独立永远可见 */
  td.title-col .tt-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; overflow: hidden; }
  .tt-view { --tt-ink:#d2c4a5;--tt-hi:#ede3cd;--tt-line:#766951;--tt-wash:#a58b4c17;
    position:relative;display:inline-flex;align-items:center;box-sizing:border-box;max-width:100%;min-width:0;
    padding:4px 7px;border:1px solid var(--tt-line);border-radius:4px;overflow:hidden;isolation:isolate;
    background:linear-gradient(115deg,var(--tt-wash),#191b1dc2);box-shadow:inset 0 1px 0 #ffffff08;
    color:var(--tt-ink);line-height:1.4;vertical-align:middle; }
  td.title-col .tt-view { flex:0 1 auto; }
  .tt-window { display:block;min-width:0;overflow:hidden; }
  .tt-view::before { content:"";position:absolute;left:8px;right:8px;top:0;height:1px;
    background:linear-gradient(90deg,transparent,var(--tt-hi),transparent);opacity:.3;pointer-events:none; }
  td.title-col .tt-run { display: inline-block; white-space: nowrap; }
  td.title-col .tt-txt { display: inline-block; white-space: nowrap; }
  td.title-col .tt-edit { flex: 0 0 auto; }
  /* 超长: 在窗口内自动左右滚动展示全称(不用悬停); --tt-shift/--tt-dur 由 JS 按标题真实超出量算 */
  td.title-col .tt-view.tt-scroll .tt-run { animation: tt-marquee var(--tt-dur, 6s) ease-in-out infinite alternate; }
  @keyframes tt-marquee { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--tt-shift, 0px))); } }
  /* 档次沿用用户原选择。金属字保持清晰，不再让整段文字循环闪暗。 */
  .tt-view.tc-gray{--tt-ink:#b7bdc7;--tt-hi:#e1e5ec;--tt-line:#565c65;--tt-wash:#89919e12;}
  .tt-view.tc-green{--tt-ink:#84d8a0;--tt-hi:#c8f0d6;--tt-line:#42674d;--tt-wash:#54b87b1b;}
  .tt-view.tc-blue{--tt-ink:#8cbbef;--tt-hi:#d5e8ff;--tt-line:#465f7f;--tt-wash:#599beb20;}
  .tt-view.tc-purple{--tt-ink:#c5a0ed;--tt-hi:#eedeff;--tt-line:#6a5086;--tt-wash:#a878e324;}
  .tt-view.tc-orange{--tt-ink:#f2ac65;--tt-hi:#ffe5be;--tt-line:#a36b34;--tt-wash:#ea913526;}
  .tt-view.tc-pink{--tt-ink:#e6a0c1;--tt-hi:#ffe3f0;--tt-line:#9b617c;--tt-wash:#db76a62a;}
  .tt-view.tc-gold{--tt-ink:#ebcb7e;--tt-hi:#fff2c7;--tt-line:#ad8a43;--tt-wash:#dfb14e2b;}
  .tt-view[class*="tc-"] .tt-txt { background:linear-gradient(180deg,var(--tt-hi) 15%,var(--tt-ink) 78%);
    -webkit-background-clip:text;background-clip:text;color:transparent; }
  /* 扫光只在鼠标进入高档铭牌时播放一次，仅移动装饰层，不循环重绘文字。 */
  @media(hover:hover) and (prefers-reduced-motion:no-preference) {
    .tt-view:is(.tc-orange,.tc-pink,.tc-gold):hover::after { content:"";position:absolute;pointer-events:none;
      top:-10%;bottom:-10%;left:25%;width:45%;background:linear-gradient(110deg,transparent,#fff5,transparent);
      transform:translateX(250%);animation:tt-gleam .85s ease-out 1; }
  }
  @keyframes tt-gleam { from{transform:translateX(-220%);}to{transform:translateX(250%);} }
  /* 只运行屏幕内的长称号滚动；后台和装备弹窗背后的榜单暂停。 */
  #tbody .tt-view .tt-run{animation-play-state:paused;}
  #tbody .tt-view.tt-visible .tt-run{animation-play-state:running;}
  body.page-inactive #tbody .tt-view .tt-run,body.page-inactive :is(#tbody,#ed-preview) .tt-view::after,
  body:has(#equipment-dialog[open]) #tbody .tt-run,body:has(#equipment-dialog[open]) #tbody .tt-view::after{animation-play-state:paused;}
  @media(prefers-reduced-motion:reduce){.tt-view .tt-run{animation:none!important;}}
  .tt-edit { cursor: pointer; color: #cfe4ff; font-size: 12px;
             background: #33506e; padding: 1px 7px; border-radius: 4px; }
  .tt-edit:hover { background: #416088; }
  .tt-set  { cursor: pointer; color: #9ecbff; font-size: 13px; font-weight: bold; }
  /* 保留原看榜开关：关闭彩色底框和扫光，回到朴素金字。 */
  body.hide-glows td.title-col .tt-view{background:none;border-color:transparent;box-shadow:none;}
  body.hide-glows td.title-col .tt-view::before,body.hide-glows td.title-col .tt-view::after{display:none;}
  body.hide-glows td.title-col .tt-txt {
    animation: none !important; text-shadow: none !important; -webkit-text-stroke: 0 !important;
    background: none !important; color: #C9A24B !important; -webkit-text-fill-color: #C9A24B !important; filter: none !important;
  }
  /* 称号说明 + 开关条 */
  .title-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
               font-size: 12px; color: #9aa0a6; margin: 0 0 8px; }
  .title-bar .hint { color: #C9A24B; }
  .title-bar label { cursor: pointer; user-select: none; }
  /* 称号编辑器浮层 */
  #称号编辑器 { position: fixed; z-index: 999; left: 20px; top: 80px; width: 300px;
               background: #232428; border: 1px solid #C9A24B; border-radius: 8px;
               padding: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.5); display: none; }
  #称号编辑器 h4 { margin: 0 0 10px; color: #FAD97B; font-size: 14px; }
  #称号编辑器 .row { margin: 8px 0; display: flex; align-items: center; gap: 6px; font-size: 13px; }
  #称号编辑器 select { flex: 1; background: #2b2b2b; border: 1px solid #444; color: #e0e0e0;
                      padding: 5px; border-radius: 4px; font-family: inherit; }
  #称号编辑器 .preview { margin: 10px 0; padding: 8px; text-align: center; background: #1b1c1f;
                        border-radius: 4px; color: #FAD97B; min-height: 20px; }
  #称号编辑器 .btns { display: flex; gap: 8px; margin-top: 10px; }
  #称号编辑器 button { flex: 1; cursor: pointer; padding: 7px; border: none; border-radius: 4px; font-family: inherit; }
  #ed-save { background: #C9A24B; color: #222; }
  #ed-cancel { background: #3a3a3a; color: #ccc; }
  #称号编辑器 .tip { font-size: 11px; color: #888; margin-top: 6px; }
  th {
    background: #333;
    color: #DB7E22;
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    user-select: none;
  }
  th:hover { background: #3a3a3a; }
  th.sortable::after {
    content: ' ⇅';
    color: #555;
    font-size: 11px;
  }
  th.sort-asc::after { content: ' ▲'; color: #DB7E22; }
  th.sort-desc::after { content: ' ▼'; color: #DB7E22; }
  td {
    padding: 10px 12px;
    border-top: 1px solid #1a1a1a;
    font-size: 14px;
  }
  tr:hover td { background: #333; }
  tr.me td { background: #3a2a15; color: #f5b86a; }
  #tbody tr.rank-target td { background: #49351e; box-shadow: inset 0 1px #DB7E22, inset 0 -1px #DB7E22; }
  #tbody tr.rank-target td:first-child { box-shadow: inset 3px 0 #DB7E22, inset 0 1px #DB7E22, inset 0 -1px #DB7E22; }
  .rank {
    width: 50px;
    color: #888;
    font-family: monospace;
  }
  .rank.top1 { color: gold; font-weight: bold; }
  .rank.top2 { color: silver; font-weight: bold; }
  .rank.top3 { color: #cd7f32; font-weight: bold; }
  .nick { color: #6db8ff; }
  .paragon {
    color: #5fcf80;
    font-weight: bold;
    font-family: monospace;
  }
  .eph {
    color: #c2a85f;
    font-family: monospace;
    font-size: 13px;
  }
  .eph.unavail {
    color: #555;
  }
  .class { color: #aaa; font-size: 13px; }
  .class-entry { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
  .class-identity { display: inline-flex; align-items: center; width: calc(32px + 4em); flex: none; white-space: nowrap; }
  .table-wrap { overflow-x: auto; }
  #榜.hide-eph #tbody td:nth-child(6) { display: none; }
  /* 保留所有行供查找、复制和定位；只让浏览器跳过远离屏幕的行内排版。 */
  @supports (content-visibility: auto) {
    #榜, #榜 thead, #tbody { display: block; }
    #榜 tr { display: grid; grid-template-columns: 155px 56px 170px 84px 194px 134px minmax(0, 1fr); }
    #榜.hide-eph tr { grid-template-columns: 155px 56px 170px 84px 194px minmax(0, 1fr); }
    #tbody tr { content-visibility: auto; contain-intrinsic-size: auto 52px; }
    #tbody td { align-content: center; }
    #tbody td[colspan] { grid-column: 1 / -1; width: auto; }
  }
  @media print { #tbody tr { content-visibility: visible; } }
  /* 虚拟窗口使用固定行高及真实高度占位；不隐藏玩家数据，也不改变列布局。 */
  #榜.rank-window { --rank-row-height: 52px; display: block; overflow-anchor: none; }
  #榜.rank-window thead, #榜.rank-window #tbody { display: block; }
  #榜.rank-window tr { display: grid; grid-template-columns:155px 56px 170px 84px 194px 134px minmax(0,1fr); }
  #榜.rank-window.hide-eph tr { grid-template-columns:155px 56px 170px 84px 194px minmax(0,1fr); }
  #榜.rank-window #tbody tr[data-rank] { height:var(--rank-row-height); content-visibility:visible; }
  #榜.rank-window #tbody tr:not([data-rank]) { content-visibility:visible; }
  #榜.rank-window #tbody td[colspan] { grid-column:1 / -1; width:auto; }
  #榜.rank-window #tbody td { min-width:0; align-content:center; white-space:nowrap; }
  #榜.rank-window #tbody tr.rank-spacer { display:block; content-visibility:visible; contain:strict; pointer-events:none; }
  #榜.rank-window #tbody tr.rank-spacer td { display:none; }
  .rank-render-tools { color:#888; font-size:12px; margin:8px 0; }
  .rank-render-tools label { cursor:pointer; }
  @media(max-width:700px) { #榜.rank-window { --rank-row-height:46px; } }
  @media print { .rank-render-tools { display:none; } }
  table { min-width: 900px; }
  .cls-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    text-align: center;
    margin-right: 4px;
    font-size: 16px;
    vertical-align: middle;
    object-fit: contain;
  }
  .nick.anon { color: #777; }
  .time { color: #666; font-size: 12px; }
  .empty {
    text-align: center;
    padding: 40px;
    color: #666;
  }
  .loading {
    text-align: center;
    padding: 40px;
    color: #888;
  }
  footer {
    text-align: center;
    margin-top: 40px;
    color: #555;
    font-size: 12px;
  }
  footer a { color: #DB7E22; text-decoration: none; }
  footer a:hover { text-decoration: underline; }

  /* 名次导航固定在左下角，滚动到榜单深处也能继续跳转。 */
  .rank-jump {
    position: fixed; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20;
    display: flex; align-items: center; gap: 4px;
  }
  .rank-jump input {
    width: 70px; height: 30px; padding: 4px 6px; background: #191919;
    border: 1px solid #777; border-radius: 3px; color: #fff; font: inherit; font-size: 13px;
    appearance: textfield;
  }
  .rank-jump input::-webkit-inner-spin-button, .rank-jump input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  .rank-jump button {
    height: 30px; padding: 0 9px; border: 0; border-radius: 3px; background: #DB7E22;
    color: #15110d; font: inherit; font-size: 13px; font-weight: bold; cursor: pointer;
  }
  .rank-jump button:hover:not(:disabled) { background: #f08c2e; }
  .rank-jump :disabled { opacity: .5; cursor: not-allowed; }
  .rank-jump input:focus-visible, .rank-jump button:focus-visible { outline: 2px solid #f5b86a; outline-offset: 2px; }
  .rank-jump input[aria-invalid="true"] { border-color: #ff998b; }
  /* 状态仅供屏幕阅读器读取，不占用输入框旁的空间。 */
  .rank-jump-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  @media print { .rank-jump { display: none; } }

  /* 手机端优化 */
  @media (max-width: 700px) {
    body { padding: 10px 10px 70px; }
    .rank-jump { left: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
    h1 { font-size: 22px; }
    .toolbar button,
    .btn-link { padding: 6px 14px; font-size: 13px; }
    .stats { font-size: 11px; padding: 8px 10px; }
    /* 表格容器横向滚动 */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 900px; }  /* 保留装备入口及更新时间，窄屏横向滚动 */
    th, td { padding: 8px 8px; font-size: 12px; white-space: nowrap; }
    .rank { width: 36px; }
    .class { font-size: 11px; }
    .time { font-size: 10px; }
    .eph { font-size: 11px; }
  }

  /* 默认主城轮换卡片 */
  .spawn-card {
    background: linear-gradient(135deg, #2a2a2a, #333);
    border-left: 3px solid #DB7E22;
    padding: 16px 18px;
    border-radius: 4px;
    text-align: center;
    /* 宽屏: 固定浮在榜单右侧留白区, 不占榜单空间, 滚动时常驻可见 */
    position: fixed;
    top: 185px;  /* 初始估值; JS 会精确对齐到左侧统计栏 */
    left: calc(50% + 460px);
    width: 280px;
    z-index: 10;
  }
  .spawn-card .sc-label { color: #bbb; font-size: 12px; margin-bottom: 2px; }
  .spawn-card .sc-act { font-size: 24px; font-weight: bold; line-height: 1.2; }
  .spawn-card .sc-divider { border-top: 1px solid #3a3a3a; margin: 12px 0; }
  .spawn-card .sc-countdown {
    font-size: 24px; font-weight: bold; color: #6db8ff;
    font-family: monospace; line-height: 1.2;
  }
  .spawn-card .sc-list { margin-top: 6px; }
  .spawn-card .sc-row {
    display: flex; justify-content: center; gap: 14px;
    padding: 8px 0; font-size: 13px; border-bottom: 1px dashed #333;
  }
  .spawn-card .sc-row:last-child { border-bottom: none; }
  .spawn-card .sc-time { color: #e0e0e0; }
  .spawn-card .sc-rel { color: #bbb; }
  /* 留白不够宽 (窄屏 / 手机): 取消浮动, 回到正常文档流显示在顶部 */
  @media (max-width: 1520px) {
    .spawn-card {
      position: static;
      left: auto; top: auto; width: auto;
      margin-bottom: 12px;
    }
  }
