/* 中国立直麻将天梯榜 - 移动端优先 */
:root{
    --bg: #ffffff;
    --panel: #ffffff;
    --panel-2: #f7f7f7;
    --border: rgba(0,0,0,0.06);
    --text: #222222;
    --muted: rgba(0,0,0,0.55);
    --accent: #fa9715;
    --danger: #ff4d4f;
    --shadow: 0 10px 26px rgba(0,0,0,0.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
    margin:0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background: #ffffff;
    color: var(--text);
}

.rank-app{
    min-height:100%;
    display:flex;
    flex-direction:column;
}

.rank-header{
    position: sticky;
    top: 0;
    z-index: 20;
    background: #ffffff;
    backdrop-filter: none;
    border-bottom: 1px solid var(--border);
}

.rank-header__filters{
    padding: 8px 14px 14px;
}

.rank-nav{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:16px;
    margin-bottom: 10px;
}
.rank-nav__tabs{
    display:flex;
    gap:20px;
}
.rank-nav__tab{
    position:relative;
    border:0;
    background: none;
    padding: 6px 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--muted);
    cursor:pointer;
}
.rank-nav__tab.segmented__item--active{
    color:#000;
}
.rank-nav__tab.segmented__item--active::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:-4px;
    height:3px;
    border-radius:999px;
    background:#000;
}
.rank-nav__controls{
    display:flex;
    align-items:center;
    gap:12px;
}
.rank-nav__control{
    display:flex;
    align-items:center;
    gap:6px;
}
.rank-nav__label{
    font-size: 13px;
    color: var(--muted);
}
.rank-nav__select{
    min-width: 120px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background:#ffffff;
    font-size: 13px;
    outline:none;
}
.rank-nav__control--region[aria-hidden="true"]{
    display:none;
}

.filter-row{
    margin-top: 12px;
    display:grid;
    grid-template-columns: 1fr 86px;
    gap: 10px;
}

.field--search{
    grid-column: 1 / 2;
}

.btn{ grid-column: 2 / 3; }

.rank-app.is-national .field--search{ grid-column: 1 / 2; }
.rank-app.is-national #searchBtn{ grid-column: 2 / 3; }

.rank-app.is-regional .field--search{ grid-column: 1 / 2; }
.rank-app.is-regional #searchBtn{ grid-column: 2 / 3; }

.btn--ghost{
    border-color: rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
    color: var(--text);
}
.btn--ghost:hover{
    border-color: rgba(250,151,21,0.40);
    background: rgba(255,255,255,0.06);
}

.field{
    display:flex;
    align-items:center;
    gap:10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
}
.field__label{
    font-size: 12px;
    color: var(--muted);
    font-weight: 800;
    flex: 0 0 auto;
}
.field__control{
    flex:1;
    background: transparent;
    border:0;
    outline:none;
    color: var(--text);
    font-size: 14px;
    min-width: 0;
}
.field__control::placeholder{ color: rgba(0,0,0,0.35); }
select.field__control{
    cursor:pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 28px;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.78) 50%),
        linear-gradient(135deg, rgba(255,255,255,0.78) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 52%,
        calc(100% - 12px) 52%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}
select.field__control option{
    background: #ffffff;
    color: #222;
}

.btn{
    appearance:none;
    border: 1px solid rgba(250,151,21,0.9);
    background: rgba(250,151,21,0.12);
    color:#222;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 900;
    cursor:pointer;
}
.btn:hover{ background: rgba(250,151,21,0.18); }

.hint{
    margin-top: 10px;
    display:flex;
    align-items:center;
    gap:10px;
    color: var(--muted);
    font-size: 12px;
}
.hint__dot{
    width:6px; height:6px;
    border-radius:999px;
    background: rgba(250,151,21,0.85);
}

.rank-main{
    flex:1;
    padding: 12px 14px 18px;
}

.board{
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow:hidden;
}
.board__head{
    padding: 14px;
    border-bottom: 1px solid var(--border);
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap: 10px;
}
.board__title{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:0;
}
#boardTitle{
    font-weight: 900;
    font-size: 16px;
    white-space: nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.board__sub{
    color: var(--muted);
    font-size: 12px;
}
.board__meta{
    color: var(--muted);
    font-size: 12px;
    text-align:right;
    white-space: nowrap;
}

.board__list{ padding: 6px 0; }

/* 顶部大图与 TOP3 */
.rank-banner{
    width:100%;
}
.rank-banner__img{
    width:100%;
    max-width:100%;
    display:block;
    height:auto;
}

.top3{
    display:grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
    padding: 12px 14px 14px;
}
.top3__item{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
}
.top3__item--1{
    position: relative;
    width: 100%;
    padding-top: 4px;
    overflow: hidden;
    margin-top: -10px;
}
.top3__item--2{
    position: relative;
    width: 100%;
    padding-top: 4px;
    overflow: hidden;
}
.top3__item--3{
    position: relative;
    width: 100%;
    padding-top: 4px;
    overflow: hidden;
}
.top3__item--1::before{
    content:"";
    position:absolute;
    left:0;
    right:0;
    top:48px; /* 从六边形框中心位置开始 */
    bottom:0;
    background: linear-gradient(to bottom, #FEDDAA 0%, #FFFFFF 100%);
    border-top-left-radius: 10%;
    border-top-right-radius: 10%;
    z-index:-1;
}
.top3__item--2::before{
    content:"";
    position:absolute;
    left:0;
    right:0;
    top:48px; /* 从六边形框中心位置开始 */
    bottom:0;
    background: linear-gradient(to bottom, #B0C4E7 0%, #FFFFFF 100%);
    border-top-left-radius: 20%;
    z-index:-1;
}
.top3__item--3::before{
    content:"";
    position:absolute;
    left:0;
    right:0;
    top:48px; /* 从六边形框中心位置开始 */
    bottom:0;
    background: linear-gradient(to bottom, #FFBBAA 0%, #FFFFFF 100%);
    border-top-right-radius: 20%;
    z-index:-1;
}
.top3__frame-wrap{
    position:relative;
    width: 96px;
    height: 96px;
}
.top3__frame{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}
.top3__avatar{
    position:absolute;
    top:50%;
    left:50%;
    width:70px;
    height:70px;
    transform:translate(-50%,-52%);
    object-fit:cover;
    clip-path: polygon(
        50% 0%,
        93% 25%,
        93% 75%,
        50% 100%,
        7% 75%,
        7% 25%
    );
}
.top3__name{
    margin-top:6px;
    font-size:14px;
    font-weight:800;
    max-width:120px;
    text-align:center;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.top3__tag{
    margin-top:2px;
    font-size:12px;
    color:var(--muted);
}

@font-face{
    font-family: 'AgdasimaBold';
    src: url('/static/fonts/agdasima-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

.top3__tag,
.row--season .row__score{
    font-family: 'AgdasimaBold', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    letter-spacing: 0.08em;
}

/* TOP1 / TOP2 / TOP3 渐变文字样式 */
.top3__item--1 .top3__tag,
.top3__item--2 .top3__tag,
.top3__item--3 .top3__tag{
    font-weight: 400;
}
.top3__item--1 .top3__tag{
    font-size: 32px;
    background: linear-gradient(to bottom, #FFB037, #FFFFFF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.top3__item--2 .top3__tag{
    font-size: 24px;
    background: linear-gradient(to bottom, #356ECF, #FFFFFF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.top3__item--3 .top3__tag{
    font-size: 24px;
    background: linear-gradient(to bottom, #E06A43, #FFFFFF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
@supports (not (background-clip: text)) {
    .top3__item--1 .top3__tag{ color:#FFB037; }
    .top3__item--2 .top3__tag{ color:#356ECF; }
    .top3__item--3 .top3__tag{ color:#E06A43; }
}

.row{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 14px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.row:last-child{ border-bottom:0; }

/* 赛季榜单：四列布局 */
.row--season{
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
}
.row--season .row__col-avatar{
    flex-shrink: 0;
}
.row--season .row__avatar-wrap{
    width: 48px;
    height: 48px;
    padding: 2px;
    border-radius: 50%;
    border: 2px solid #d4a84b;
    box-shadow: 0 0 0 1px rgba(212, 168, 75, 0.35);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.row--season .row__avatar{
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.row--season .row__col-info{
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.row--season .row__nickname{
    font-weight: 700;
    font-size: 15px;
    color: #000;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.row--season .row__meta{
    font-size: 12px;
    color: #999;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.row--season .row__col-score{
    display: flex;
    flex-direction: column;;
    align-items: center;
    justify-content: center;
    gap: 4px;
    align-self: stretch;
}
.row--season .row__score{
    font-size: 15px;
    font-weight: 800;
    color: #000;
}
.row--season .row__bonus{
    font-size: 12px;
    color: #999;
}
.row--season .row__col-rank{
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
}

.row-rank{
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
}

.rank-badge{
    width:52px;
    display:flex;
    align-items:center;
    justify-content:center;
}
.rank-badge__inner{
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight: 1000;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
}
.rank-badge__inner--top{
    border-color: rgba(250,151,21,0.55);
    background: rgba(250,151,21,0.14);
    color: #fff;
}

.row-main{
    display:flex;
    align-items:center;
    gap: 12px;
    min-width:0;
}
.row-main__honor{
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
    margin-left: auto;
}
.user__head{
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}
.user__head .user__name{
    margin: 0;
}
.tag--dan{
    flex-shrink: 0;
}
.avatar{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(250,151,21,0.38);
    background: rgba(255,255,255,0.08);
}
/* 生涯列表：段位图片与行高同高(占位+懒加载) + 头像(占位+懒加载) */
.row__career-level-placeholder,
.row__avatar-placeholder{
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.row--career .row__career-level-placeholder{
    align-self: stretch;
    width: 72px;
    min-height: 64px;
}
.row__career-level-placeholder .row__career-level-img,
.row--career .row__career-level-img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.row__avatar-placeholder{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(250,151,21,0.38);
}
.row__avatar-placeholder .avatar{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    display: block;
}
.row--career .row-main{
    gap: 10px;
}
.row--career .user__name{
    font-size: 15px;
}
.user{
    min-width:0;
    flex:1;
}
.user__name{
    font-weight: 900;
    font-size: 18px;
    line-height: 1.2;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user__meta{
    margin-top: 8px;
    display:flex;
    flex-wrap:wrap;
    gap: 8px 10px;
    color: var(--muted);
    font-size: 12px;
}
.tag{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.03);
}
.tag--accent{
    border-color: rgba(250,151,21,0.45);
    background: rgba(250,151,21,0.12);
    color: #fff;
}

.board__footer{
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
}
.pager{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 10px;
}
.pager__btn{
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 12px;
    cursor:pointer;
    font-weight: 900;
    min-width: 92px;
}
.pager__btn:hover{ border-color: rgba(250,151,21,0.45); }
.pager__btn:disabled{
    opacity: 0.5;
    cursor:not-allowed;
}
.pager__info{
    color: var(--muted);
    font-size: 12px;
    text-align:center;
    flex:1;
}

.rank-footer{
    padding: 14px;
    color: rgba(255,255,255,0.55);
    font-size: 12px;
}
.rank-footer__inner{
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    padding: 12px 14px;
}

.row--clickable{
    cursor: pointer;
}
.row--clickable:hover{
    background: rgba(255,255,255,0.03);
}

/* 自定义错误/提示弹窗 */
.rank-toast{
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.rank-toast--hidden{
    display: none;
}
.rank-toast__backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}
.rank-toast__box{
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 20px;
    background: #12121a;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.rank-toast__msg{
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}
.rank-toast__btn{
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(250, 151, 21, 0.5);
    background: rgba(250, 151, 21, 0.15);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.rank-toast__btn:hover{
    background: rgba(250, 151, 21, 0.25);
}

/* 最佳连段弹窗 - 纯白背景，上中下三部分 */
.reason-modal{
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.reason-modal--open{
    display: flex;
}
.reason-modal__backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}
.reason-modal__box{
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 2%;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
/* 关闭按钮固定在弹窗右上角 */
.reason-modal__close{
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    appearance: none;
    border: 0;
    background: transparent;
    color: #666;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 12px 14px;
    flex-shrink: 0;
}
.reason-modal__close:hover{
    color: #000;
}
/* 上方：左头像、中昵称+地区雀庄 */
.reason-modal__top{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 40px 14px 16px;
    flex-shrink: 0;
}
.reason-modal__top-left{
    flex-shrink: 0;
    padding: 3px;
    border-radius: 50%;
    border: 2px solid #d4a84b;
    box-shadow: 0 0 0 1px rgba(212, 168, 75, 0.3);
}
.reason-modal__avatar{
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.reason-modal__top-center{
    flex: 1;
    min-width: 0;
}
.reason-modal__username{
    font-weight: 900;
    color: #000;
    font-size: 16px;
    line-height: 1.3;
}
.reason-modal__meta-line{
    margin-top: 4px;
    font-size: 13px;
}
.reason-modal__region-tag{
    color: #0d47a1;
    background: #e3f2fd;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
}
.reason-modal__store-name{
    color: #999;
}
/* 中间：level_background 背景，两行排名与段位信息 */
.reason-modal__middle{
    margin: 10px 10px 0;
    background: url(/static/images/rate/level_background.png) center/cover no-repeat;
    padding: 16px 14px;
    flex-shrink: 0;
    border-radius: 8px;
}
.reason-modal__middle-inner{
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.reason-modal__rank-row{
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.reason-modal__stat{
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.reason-modal__stat-value{
    font-size: 15px;
    font-weight: 800;
    font-family: 'AgdasimaBold', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.reason-modal__stat-value--gold{
    color: #d4a84b;
}
.reason-modal__stat-value--white{
    color: #fff;
}
.reason-modal__stat-label{
    font-size: 11px;
    color: rgba(255,255,255,0.65);
}
/* 下方：record_background 背景，标题 + 8 个格子，宽度限定，cells 不超出 */
.reason-modal__bottom{
    margin: 10px 10px 14px;
    background: url(/static/images/rate/record_background.png) center/cover no-repeat;
    padding: 14px 16px 18px;
    flex-shrink: 0;
    border-radius: 8px;
    box-sizing: border-box;
}
.reason-modal__bottom-inner{
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
    overflow: hidden;
}
.reason-modal__record-title{
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-align: left;
}
.reason-modal__cells{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 88px));
    grid-template-rows: repeat(2, 100px);
    gap: 10px;
    justify-content: center;
    margin: 0 auto;
    max-width: 100%;
    box-sizing: border-box;
}
.reason-modal__cell{
    width: 100%;
    max-width: 88px;
    height: 100px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: stretch;
    padding: 6px 4px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}
.reason-modal__cell-level{
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
}
.reason-modal__cell-level img{
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
    padding-top: 10px;
}
.reason-modal__cell-score{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    margin: 4px 0;
    padding-top: 10px;
}
.reason-modal__star{
    width: 14px;
    height: 14px;
    object-fit: contain;
}
.reason-modal__cell-score span{
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    font-family: 'AgdasimaBold', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}
.reason-modal__cell-bonus{
    width: calc(100% + 8px);
    margin: auto -4px -6px -4px;
    min-height: 24px;
    border-radius: 0;
    background: url(/static/images/rate/win_background.png) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    box-sizing: border-box;
}
.reason-modal__cell-bonus span{
    font-size: 11px;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}
.reason-modal__cell--clickable{
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.reason-modal__cell--clickable:hover{
    border-color: rgba(250, 151, 21, 0.55);
    box-shadow: 0 0 0 1px rgba(250, 151, 21, 0.25);
}

/* 单局对局详情弹窗 */
.record-detail-modal{
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.record-detail-modal--open{
    display: flex;
}
.record-detail-modal__backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}
.record-detail-modal__box{
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 16px 16px 18px;
    box-sizing: border-box;
}
.record-detail-modal__close{
    position: absolute;
    top: 0;
    right: 0;
    appearance: none;
    border: 0;
    background: transparent;
    color: #666;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 12px 14px;
}
.record-detail-modal__close:hover{
    color: #000;
}
.record-detail-modal__title{
    margin: 0 36px 12px 0;
    font-size: 17px;
    font-weight: 900;
    color: #111;
}
.record-detail-modal__body{
    font-size: 14px;
    color: #333;
    line-height: 1.55;
}
.record-detail-modal__row{
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.record-detail-modal__row:last-child{
    border-bottom: 0;
}
.record-detail-modal__label{
    color: #666;
    flex-shrink: 0;
}
.record-detail-modal__value{
    text-align: right;
    word-break: break-all;
}
.record-detail-modal__player{
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.record-detail-modal__player-pos{
    font-weight: 800;
    color: var(--accent);
}

@media (min-width: 720px){
    .rank-banner{
        margin-top: 6px;
    }
    .rank-banner__img{
        max-height: 320px;
        object-fit: cover;
        border-radius: 16px;
    }
    .rank-header{
        position: static; /* 桌面端不固定头部，避免 banner 占满视口 */
    }
    .rank-header__top{ padding: 16px 20px 12px; }
    .rank-header__filters{ padding: 0 20px 16px; }
    .rank-main{ padding: 20px; }
    .filter-row{ align-items:stretch; }
    .rank-app.is-regional .filter-row{ grid-template-columns: 220px 1fr 92px; }
    .rank-app.is-national .filter-row{ grid-template-columns: 1fr 92px; }

    .rank-app.is-national .field--city{ display:none; }
    .rank-app.is-national .field--search{ grid-column: 1 / 2; }
    .rank-app.is-national #searchBtn{ grid-column: 2 / 3; }

    .rank-app.is-regional .field--city{ grid-column: 1 / 2; }
    .rank-app.is-regional .field--search{ grid-column: 2 / 3; }
    .rank-app.is-regional #searchBtn{ grid-column: 3 / 4; }
    .field{ height: 44px; }
    .btn{ height: 44px; }
    #boardTitle{ font-size: 18px; }
    .row{ grid-template-columns: 1fr auto; padding: 12px 18px; }
    .row--season{ grid-template-columns: auto minmax(0, 1fr) auto auto; }
}

@media (max-width: 719px){
    /* 移动端按钮不要过大 */
    .btn{
        padding: 10px 10px;
        font-size: 13px;
    }
}

/* 超小屏字体自适应（避免文字挤压/换行导致布局错位） */
@media (max-width: 390px){
    .rank-nav__tabs{ gap: 14px; }
    .rank-nav__tab{ font-size: 14px; }
    .rank-nav__select{ min-width: 108px; font-size: 12px; }

    #boardTitle{ font-size: 15px; }

    .top3__name{ font-size: 13px; max-width: 104px; }
    .top3__item--1 .top3__tag{ font-size: 28px; }
    .top3__item--2 .top3__tag,
    .top3__item--3 .top3__tag{ font-size: 22px; }

    .row--season .row__nickname{ font-size: 14px; }
    .row--season .row__score{ font-size: 14px; }
    .row--season .row__meta,
    .row--season .row__bonus{ font-size: 11px; }
    .row--season .row__col-rank{ font-size: 12px; }

    .self-info-mask__name{ font-size: 12px; }
    .self-info-mask__sub{ font-size: 10px; }
    .self-info-mask__value{ font-size: 12px; }
}

@media (max-width: 360px){
    .rank-nav__tab{ font-size: 13px; }
    .rank-nav__select{ min-width: 98px; }

    .filter-row{ grid-template-columns: 1fr 78px; }
    .btn{ font-size: 12px; padding: 9px 10px; }

    .top3__name{ font-size: 12px; max-width: 96px; }
    .top3__item--1 .top3__tag{ font-size: 26px; }
    .top3__item--2 .top3__tag,
    .top3__item--3 .top3__tag{ font-size: 20px; }

    .row--season{ gap: 10px; }
    .row--season .row__nickname{ font-size: 13px; }
    .row--season .row__score{ font-size: 13px; }
}

@media (max-width: 320px){
    .rank-nav__tabs{ gap: 12px; }
    .rank-nav__tab{ font-size: 12px; }
    .rank-nav__select{ min-width: 92px; padding: 6px 8px; font-size: 12px; }

    .top3__item--1 .top3__tag{ font-size: 24px; }
    .top3__item--2 .top3__tag,
    .top3__item--3 .top3__tag{ font-size: 18px; }
}

/* 天梯段位继承选择弹窗 */
.inheritance-modal{
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.inheritance-modal.inheritance-modal--hidden{
    display: none;
}
.inheritance-modal:not(.inheritance-modal--hidden){
    pointer-events: auto;
}
.inheritance-modal__backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.72);
}
.inheritance-modal__box{
    position: relative;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow: auto;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 18px 16px 20px;
}
.inheritance-modal__head{
    margin-bottom: 12px;
}
.inheritance-modal__title{
    font-size: 17px;
    font-weight: 800;
    color: var(--accent);
    margin: 0;
    text-align: center;
}
.inheritance-modal__msg{
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    margin: 0 0 16px;
}
.inheritance-modal__options{
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.inheritance-modal__opt{
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.inheritance-modal__opt:hover,
.inheritance-modal__opt:active{
    background: rgba(255,255,255,0.12);
    border-color: var(--accent);
}

/* 我的信息蒙版：底部省略显示 头像/昵称/段位/分数/全国排名/省内排名 */
.self-info-mask{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}
.self-info-mask.self-info-mask--hidden{
    display: none;
}
.self-info-mask:not(.self-info-mask--hidden){
    pointer-events: auto;
}
.self-info-mask__backdrop{
    display: none;
}
.self-info-mask__box{
    position: relative;
    width: 100%;
    max-width: none;
    max-height: 30vh;
    overflow: hidden;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 6px 12px 10px;
}
.self-info-mask__body{
    display: grid;
    grid-template-columns: auto 1.5fr 1fr 1fr;
    grid-template-rows: repeat(2, auto);
    align-items: center;
    gap: 4px 12px;
    background: rgba(255,255,255,0.96);
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 8px 10px;
}
.self-info-mask__avatar{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.self-info-mask__col{
    min-width: 0;
}
.self-info-mask__col--avatar{
    grid-row: 1 / 3;
    display:flex;
    align-items:center;
    justify-content:center;
}
.self-info-mask__col--info{
    grid-column: 2;
    grid-row: 1 / 3;
}
.self-info-mask__col--score{
    grid-column: 3;
    grid-row: 1 / 3;
}
.self-info-mask__col--rank{
    grid-column: 4;
    grid-row: 1 / 3;
}
.self-info-mask__col--score,
.self-info-mask__col--rank{
    display:flex;
    flex-direction:column;
    justify-content:center;
}
.self-info-mask__name{
    font-weight: 700;
    font-size: 13px;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.self-info-mask__sub{
    margin-top: 2px;
    font-size: 11px;
    color: rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.self-info-mask__value{
    font-weight: 700;
    font-size: 13px;
    color: #000;
    text-align: center;
}

#selfInfoScore{
    font-family: 'AgdasimaBold', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

.self-info-mask__col--rank{
    grid-column: 4;
    grid-row: 1 / 3;
    padding-right: 10px;
}

#selfInfoRank,
#selfInfoProvinceRank{
    white-space: nowrap;
}
