@charset "utf-8";
/* 局域网文件传输 */
:root {
    --lan-bg: #F6F9FA;
    --lan-surface: #FFFFFF;
    --lan-ink: #18181B;
    --lan-muted: #5A5F66;
    --lan-line: #E6ECEF;
    --lan-line-2: #D7DEE1;
    --lan-accent: #0E7490;
    --lan-accent-dark: #164E63;
    --lan-soft: #ECFEFF;
    --lan-soft-line: #C7EDF3;
    --lan-soft-ink: #3F6670;
    --lan-ok: #059669;
    /* 安全说明用绿色系（对齐参考站 emerald 盾形图标），文字取 emerald-700 保证对比度 */
    --lan-ok-ico: #059669;
    --lan-ok-soft: #ECFDF5;
    --lan-ok-line: #A7F3D0;
    --lan-ok-ink: #047857;
    --lan-warn: #B45309;
    --lan-err: #B91C1C;
    --lan-ring-1: #CDEEF4;
    --lan-ring-2: #D8F1F6;
    --lan-ring-3: #E2F5F8;
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--lan-bg);
}

body {
    min-height: 100vh;
    color: var(--lan-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--lan-accent); text-decoration: none; }
a:hover { color: var(--lan-accent-dark); }

button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.lan-wrap {
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* ---------- 头部 ---------- */
/* 不换行：换行后语言按钮会掉到标题下方，与副标题挤在一起 */
.lan-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 22px 28px 10px;
}

.lan-brand {
    display: flex;
    align-items: flex-start;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 510px;
}

.lan-mark {
    width: 34px;
    height: 34px;
    flex: none;
    margin-top: 2px;
    border-radius: 11px;
    background: var(--lan-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lan-brand-txt { display: flex; flex-direction: column; min-width: 0; }

.lan-brand-txt h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.015em;
}

/* 标题即回首页的入口，但要长得还像标题：继承字色，悬停才提示可点 */
.lan-brand-txt h1 a { color: inherit; text-decoration: none; }
.lan-brand-txt h1 a:hover { color: var(--lan-accent); }

.lan-brand-txt p {
    margin: 0;
    max-width: 470px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--lan-muted);
}

/* ---------- 语言切换 ---------- */
/* 胶囊的高度随视口线性收缩：720px 及以上保持 44px，360px 及以下收到 36px。
   原先写死 44px，窄屏时标题被挤成好几行、胶囊却纹丝不动，比 h1 还抢眼。
   高度放在 .lan-lang 上而不是按钮上，是因为下面的菜单要按同一个值定位，
   自定义属性只向下继承、不跨兄弟，挂在父元素上两边才都读得到。 */
.lan-lang {
    position: relative;
    flex: none;
    --lan-lang-h: clamp(26px, 2.22vw + 18px, 34px);
}

.lan-lang-btn {
    display: inline-flex;
    align-items: center;
    height: var(--lan-lang-h);
    padding: 0 clamp(4px, .83vw, 6px);
    border: 1px solid var(--lan-line-2);
    border-radius: 999px;
    background: var(--lan-surface);
    color: #2B3135;
    font-size: clamp(12px, .28vw + 11px, 13px);
    font-weight: 600;
}

/* 图标按盒子居中，文字却是按行盒居中：13px 文字的字形中心比行盒中心低约 1px，
   两者并排时图标会显得往上浮。这里把文字整体上提，让字形与图标在同一条水平中线上 */
.lan-lang-btn svg { flex: none; display: block; }
.lan-lang-btn > span { line-height: 1; margin-bottom: 1px; }

.lan-lang-btn[aria-expanded="true"] {
    border-color: var(--lan-accent);
    color: var(--lan-accent);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, .12);
}

.lan-lang-menu {
    position: absolute;
    /* 跟着按钮高度走，始终留 10px 间隙；按钮 44px 时算出来就是原来的 54px */
    top: calc(var(--lan-lang-h) + 10px);
    right: 0;
    width: 208px;
    max-width: calc(100vw - 36px);
    padding: 6px;
    background: var(--lan-surface);
    border: 1px solid #E3E9EB;
    border-radius: 18px;
    box-shadow: 0 20px 44px rgba(12, 42, 50, .18);
    display: none;
    flex-direction: column;
    /* 七种语言在小屏上会顶出可视区，限高后在菜单内滚动 */
    max-height: calc(100vh - 86px);
    overflow-y: auto;
    z-index: 30;
}

.lan-lang-menu.is-open { display: flex; }

.lan-lang-menu button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 12px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--lan-ink);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.lan-lang-menu button:hover { background: #F4F8F9; }
.lan-lang-menu button[aria-checked="true"] { background: #F1F8F9; font-weight: 600; }
.lan-lang-menu button svg { display: none; }
.lan-lang-menu button[aria-checked="true"] svg { display: block; }

/* ---------- 主区 ---------- */
.lan-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 4px 24px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lan-main.is-idle { }

/* ---------- 雷达 ---------- */
.lan-radar {
    position: relative;
    width: 380px;
    height: 380px;
    flex: none;
    transition: width .25s ease, height .25s ease;
}

.lan-radar.is-small { width: 350px; height: 350px; }
.lan-radar svg { display: block; width: 100%; height: 100%; }

.lan-sweep { transform-origin: 50% 50%; animation: lan-spin 3.6s linear infinite; }

@keyframes lan-spin { to { transform: rotate(360deg); } }

/* 节奏：一圈水波荡 3.6s，散尽后整个雷达静止 2s，再来一次。
   做法是把周期拉到 5.6s，动作压在前 64.29%（3.6/5.6），剩下的 35.71% 就是那 2 秒。
   水波只留一圈：多一圈就得错拍，而错拍一旦落进停顿里，看上去又成了不停在动。
   停顿靠拉长周期而不是 JS 定时器：一个属性就说清了节奏，也不必管标签页休眠后的补偿 */

/* 三道刻度圈轻轻呼吸，错开起拍，看着像水面一圈圈荡开。
   缩放幅度压到 1.2%：再大就不像「水波」，像整个雷达在抖
   用 transform 而不是动画 r：前者只合成不重排，也不必担心旧内核对几何属性做动画的支持 */
.lan-ring { transform-origin: 50% 50%; animation: lan-ripple 5.6s ease-in-out infinite; }
.lan-ring-b { animation-delay: .3s; }
.lan-ring-c { animation-delay: .6s; }

@keyframes lan-ripple {
    0% { transform: scale(1); opacity: 1; }
    26.79% { transform: scale(1.012); opacity: .62; }
    /* 呼吸压在 3s 内完成，错拍最晚的那道圈也在 3.6s 收住，跟水波一起静下来 */
    53.57%, 100% { transform: scale(1); opacity: 1; }
}

/* 从本机卡片底下荡开的那一圈：起始半径刚好被卡片盖住，所以像是从中心涌出来的 */
.lan-ping {
    transform-origin: 50% 50%;
    /* 动画接管前先藏着，免得首帧闪一个满圆；reduce 模式下也靠它保持隐形 */
    opacity: 0;
    animation: lan-ping 5.6s cubic-bezier(.22, .61, .36, 1) infinite;
}

@keyframes lan-ping {
    0% { transform: scale(.44); opacity: 0; }
    9% { opacity: .42; }
    /* 荡到边缘即淡尽，停在这个状态等下一轮 */
    64.29%, 100% { transform: scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lan-sweep, .lan-ring, .lan-ping { animation: none; }
}

.lan-self {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lan-self-card {
    width: 164px;
    height: 164px;
    box-sizing: border-box;
    padding: 0 14px;
    border-radius: 50%;
    background: var(--lan-surface);
    border: 1px solid #E6EBED;
    box-shadow: 0 14px 34px rgba(14, 116, 144, .13);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.lan-radar.is-small .lan-self-card { width: 150px; height: 150px; }
/* 图标与“本机”之间留一点，其余几行贴紧，免得圆卡里被空隙撑散 */
.lan-self-ico { display: flex; align-items: center; justify-content: center; margin-bottom: 3px; }
.lan-self-label { font-size: 12px; line-height: 1.25; font-weight: 600; letter-spacing: .01em; }

/* short_name 可能很长（如 Windows10/11_Chrome浏览器），允许折行并限制在卡片内 */
.lan-self-dev {
    max-width: 100%;
    font-size: 10.5px;
    line-height: 1.3;
    color: var(--lan-muted);
    word-break: break-all;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* 本机打开页面的时间，设备重名时靠它分辨 */
.lan-self-time {
    font-size: 10.5px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    color: var(--lan-accent);
}

/* 本机 IP：平时藏着，指到卡片上才顶替时间那一行，
   换位显示而不是另起一行，圆卡的高度才不会跳 */
.lan-self-ip {
    display: none;
    max-width: 100%;
    font-size: 10.5px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    word-break: break-all;
    color: var(--lan-accent);
}

.lan-self-card.has-ip:hover .lan-self-time { display: none; }
.lan-self-card.has-ip:hover .lan-self-ip { display: block; }

/* 雷达上的设备点：小飞碟，弹出后持续悬浮
   高度留出机身下方的尾焰，碟身中心正好落在 margin-top 指定的坐标上 */
.lan-blip {
    position: absolute;
    width: 30px;
    height: 19px;
    margin: -9.5px 0 0 -15px;
    animation: lan-pop .3s ease both, lan-float 2.8s ease-in-out .3s infinite;
}

.lan-blip svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 3px 5px rgba(14, 116, 144, .18));
}

/* 尾焰从碟底往下喷，缩放原点固定在机身底部；两层频率不同，火苗才不呆板 */
.lan-jet {
    transform-box: fill-box;
    transform-origin: center top;
    animation: lan-jet .62s ease-in-out infinite alternate;
}

.lan-jet-out { animation-duration: .9s; }

.lan-led { animation: lan-led 1.35s linear infinite; }
.lan-led-2 { animation-delay: .45s; }
.lan-led-3 { animation-delay: .9s; }

@keyframes lan-float {
    50% { transform: translateY(-3px); }
}

@keyframes lan-jet {
    from { transform: scaleY(.55); }
    to { transform: scaleY(1); }
}

@keyframes lan-led {
    0%, 100% { opacity: .3; }
    25% { opacity: 1; }
}

/* 放在上面的规则之后才能覆盖它们的 animation */
@media (prefers-reduced-motion: reduce) {
    .lan-blip { animation: lan-pop .3s ease both; }
    .lan-jet, .lan-led { animation: none; }
}

/* 入场动画只动 transform，不动 opacity。
   后台标签页、被节流或 reduce-motion 的环境里动画可能不推进，
   一旦用 opacity 做入场，弹层会卡在半透明甚至完全不可见 */
@keyframes lan-pop {
    from { transform: scale(.2); }
    to { transform: scale(1); }
}

/* ---------- 安全说明 ---------- */
.lan-shield {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-top: -12px;
    padding: 8px 15px;
    font-size: 12.5px;
    line-height: 1.45;
    font-weight: 500;
    color: var(--lan-ok-ink);
    background: var(--lan-ok-soft);
    border: 1px solid var(--lan-ok-line);
    border-radius: 999px;
    text-align: left;
}

/* 图标比文字再亮一档，和参考站的 emerald 盾一致。
   尺寸用 em 跟随字号：中文字形比同字号拉丁字母更满，固定 14px 的盾放在中文旁会显小 */
.lan-shield-ico {
    flex: none;
    width: 1.35em;
    height: 1.35em;
    color: var(--lan-ok-ico);
}

/* P2P 不是常识，问号点开一段说明，解释为什么直连就等于隐私 */
.lan-shield-q {
    flex: none;
    box-sizing: border-box;
    width: 1.55em;
    height: 1.55em;
    margin: 0 -5px 0 -6px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--lan-ok-ico);
    opacity: .7;
    transition: opacity .15s ease, background-color .15s ease;
}

.lan-shield-q svg { width: 1.15em; height: 1.15em; }
.lan-shield-q:hover { opacity: 1; background: rgba(5, 150, 105, .12); }
.lan-shield-q[aria-expanded="true"] { opacity: 1; background: rgba(5, 150, 105, .15); }

.lan-shield-pop {
    display: none;
    position: absolute;
    bottom: calc(100% + 11px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    box-sizing: border-box;
    width: 330px;
    max-width: calc(100vw - 32px);
    padding: 14px 16px 15px;
    border-radius: 14px;
    background: var(--lan-surface);
    border: 1px solid var(--lan-ok-line);
    box-shadow: 0 -10px 34px rgba(6, 95, 70, .15), 0 2px 8px rgba(6, 95, 70, .05);
    color: var(--lan-ink);
    font-weight: 400;
    text-align: left;
    cursor: default;
}

.lan-shield-pop.is-open { display: block; }

/* 小三角指回问号所在的那颗胶囊，免得气泡看着像凭空出现 */
.lan-shield-pop::before {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    background: var(--lan-surface);
    border-right: 1px solid var(--lan-ok-line);
    border-bottom: 1px solid var(--lan-ok-line);
    border-radius: 0 0 2px 0;
    transform: rotate(45deg);
}

/* 气泡与胶囊之间那 11px 空隙上搭一座透明的桥：
   指针从问号移进气泡时不会先掠过空白，hover 就不会被打断 */
.lan-shield-pop::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 13px;
}

.lan-shield-pop b { display: block; font-size: 13.5px; font-weight: 600; color: var(--lan-ok-ink); }
.lan-shield-pop i { display: block; margin-top: 5px; font-style: normal; font-size: 12.5px; line-height: 1.55; color: var(--lan-muted); }
.lan-shield-pop ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
.lan-shield-pop li { position: relative; padding-left: 14px; font-size: 12.5px; line-height: 1.55; color: var(--lan-muted); }

.lan-shield-pop li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .64em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--lan-ok-ico);
    opacity: .55;
}

/* ---------- 状态 ---------- */
.lan-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 420px;
}

.lan-status-row { display: flex; align-items: center; }

.lan-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #06B6D4;
    animation: lan-pulse 1.4s ease-in-out infinite;
}

.lan-dot.is-off { background: #9AA3A8; animation: none; }
.lan-dot.is-err { background: var(--lan-err); animation: none; }

@keyframes lan-pulse { 50% { opacity: .25; } }

.lan-status-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.lan-status-tip { margin: 0; font-size: 14px; line-height: 1.5; color: var(--lan-muted); }

/* ---------- 按钮 ---------- */
.lan-acts { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }

/* 手机互传 / 复制链接是次级操作，比主操作小一档，避免抢主操作的视觉重量 */
.lan-acts .lan-btn {
    height: clamp(34px, 1.4vw + 28px, 38px);
    padding: 0 clamp(11px, 3vw, 16px);
    font-size: clamp(12px, .7vw + 9.3px, 13px);
}

.lan-acts .lan-btn svg { width: clamp(13px, 3.2vw, 15px); height: clamp(13px, 3.2vw, 15px); }

/* 按钮随视口连续缩放，不在断点处突变。
   高度下限保持 44px：再小就低于可点击区域的最小尺寸，手机上反而更难按 */
.lan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: clamp(44px, 2.7vw + 34px, 46px);
    padding: 0 clamp(14px, 4vw, 22px);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: clamp(13px, 1vw + 9.25px, 14px);
    font-weight: 600;
}

.lan-btn svg { width: clamp(15px, 3.8vw, 17px); height: clamp(15px, 3.8vw, 17px); flex: none; }
/* 按钮文字一律不换行：标签断行后按钮会被撑成两行，既难看也难按 */
.lan-btn { white-space: nowrap; }

.lan-btn-main { background: var(--lan-accent); color: #FFF; }
.lan-btn-main:hover:not(:disabled) { background: var(--lan-accent-dark); }
.lan-btn-ghost { background: var(--lan-surface); border-color: var(--lan-line-2); color: var(--lan-ink); }
.lan-btn-ghost:hover:not(:disabled) { border-color: #B9C4C9; }
.lan-btn-dark { background: var(--lan-ink); color: #FFF; }
.lan-btn-sm {
    height: clamp(36px, 1.6vw + 30px, 40px);
    padding: 0 clamp(12px, 3.2vw, 20px);
    font-size: clamp(12px, .8vw + 9px, 13px);
}

/* ---------- 设备列表 ---------- */
.lan-list-box { width: 100%; display: flex; flex-direction: column; }

.lan-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 4px;
}

.lan-list-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.lan-list-head span { font-size: 12px; color: var(--lan-muted); }

/* 列表头的 IP 睁眼/闭眼开关：睁眼显示设备 IP，闭眼只留分隔符打码 */
.lan-ip-eye {
    flex: none;
    box-sizing: border-box;
    align-self: center;
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--lan-accent);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.lan-ip-eye svg { width: 16px; height: 16px; display: block; }
.lan-ip-eye:hover { color: var(--lan-accent-dark); background: var(--lan-soft); }
.lan-ip-eye:focus-visible { outline: 2px solid var(--lan-accent); outline-offset: 1px; }
.lan-ip-eye .lan-eye-off { display: none; }
.lan-ip-eye:not(.is-open) .lan-eye-on { display: none; }
.lan-ip-eye:not(.is-open) .lan-eye-off { display: block; }

.lan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.lan-row {
    display: flex;
    align-items: center;
    padding: clamp(10px, 2.4vw, 13px) clamp(10px, 2.6vw, 14px);
    background: var(--lan-surface);
    border: 1px solid var(--lan-line);
    border-radius: 18px;
    animation: lan-rise .25s ease both;
}

@keyframes lan-rise {
    from { transform: translateY(6px); }
    to { transform: none; }
}

.lan-row-ico {
    width: clamp(38px, 9vw, 46px);
    height: clamp(38px, 9vw, 46px);
    flex: none;
    border-radius: clamp(11px, 2.6vw, 14px);
    background: var(--lan-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lan-row-ico svg { width: clamp(19px, 4.4vw, 22px); height: clamp(19px, 4.4vw, 22px); }

.lan-row-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lan-row-name { font-size: clamp(13px, .8vw + 10px, 14px); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lan-row-sub { display: inline-flex; align-items: center; font-size: clamp(11px, .5vw + 9.1px, 12px); color: var(--lan-muted); }
.lan-row-sub i { width: 7px; height: 7px; border-radius: 50%; background: var(--lan-ok); display: inline-block; }
.lan-row-sub.is-room i { background: var(--lan-accent); }

/* 已被占用的设备：按钮降级为次要样式，但仍可点击，由服务端判定能否接管 */
.lan-row .is-linked { color: var(--lan-muted); }

/* ---------- 弹层 ---------- */
.lan-mask {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 42, 50, .42);
    overflow-y: auto;
}

.lan-mask.is-open { display: flex; }

/* 粘贴确认是在传输面板之上弹出来的，层级必须压过面板（面板 50、提示条 70） */
.lan-mask.lan-mask-top { z-index: 60; }

.lan-modal {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 408px;
    box-sizing: border-box;
    margin: auto;
    padding: 30px 30px 26px;
    background: var(--lan-surface);
    border-radius: 26px;
    box-shadow: 0 30px 70px rgba(8, 36, 44, .3);
    display: flex;
    flex-direction: column;
    animation: lan-rise .2s ease both;
}

.lan-modal-x {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #F2F5F6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lan-modal h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.lan-modal p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--lan-muted); }
.lan-modal-head { display: flex; flex-direction: column; padding-right: 38px; min-width: 0; }
.lan-modal-foot { margin: 0; font-size: 12px; color: #6A7075; text-align: center; }
.lan-modal-center .lan-modal-head { padding-right: 0; align-items: center; text-align: center; }

/* 二维码 */
.lan-qr-box {
    align-self: center;
    /* 二维码是点开后才去取的，先把位置留出来，图片到位时弹层不会跳一下。
       这个值对应 Lan::qrAction 里的 size(180)，改那边记得同步 */
    min-width: 180px;
    min-height: 180px;
    padding: 16px;
    border: 1px solid #E3E9EB;
    border-radius: 20px;
    background: #FFF;
}

/* 按图片自身的像素原样画：缩放会让码点糊掉，影响识别率。
   尺寸由服务端决定，这里不写死宽高，也不让任何 max-width 把它压小 */
.lan-qr-box img { display: block; width: auto; height: auto; max-width: none; }

.lan-url {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    background: #F5F8F9;
    border: 1px solid #E6ECEE;
    border-radius: 14px;
}

.lan-url span {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #2B3135;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 房间码 */
.lan-room-create {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #F3F9FA;
    border: 1px solid #DCEDF1;
    border-radius: 18px;
}

/* 只命中文字块：早先用 `.lan-room-create div` 会把图标块也一起命中，
   图标被 flex:1 1 auto 拉伸、方向变成 column，整行排版就散了 */
.lan-rc-ico {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 13px;
    background: #FFF;
    border: 1px solid #DCEDF1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lan-rc-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lan-room-create b { font-size: 14px; font-weight: 600; }
.lan-room-create em { font-style: normal; font-size: 12.5px; line-height: 1.4; color: var(--lan-muted); }
.lan-room-create .lan-btn { flex: none; white-space: nowrap; }

.lan-code-out {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lan-code-out b {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: .22em;
    color: var(--lan-accent);
    /* 字间距会在最后一位右边多留一格，缩进同样的量才真的居中 */
    text-indent: .22em;
}

/* 剩余有效时间：房间码只活 10 分钟，过期了得让人看得出来 */
.lan-code-out i {
    font-style: normal;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--lan-muted);
}

.lan-or { display: flex; align-items: center; }
.lan-or i { flex: 1 1 auto; height: 1px; background: var(--lan-line); }
.lan-or span { font-size: 12px; font-weight: 500; color: #7A8085; }

/* fieldset 的 min-inline-size 默认是 min-content，6 个输入框的固有宽度会把它撑到
   远超弹层宽度，必须显式归零，输入框也要 width:0 才会等分而不是按固有宽度排布 */
.lan-field {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.lan-field legend { padding: 0; font-size: 14px; font-weight: 600; }
.lan-code-in { display: flex; min-width: 0; }

.lan-code-in input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: 56px;
    box-sizing: border-box;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 22px;
    font-weight: 600;
    color: var(--lan-ink);
    background: #FFF;
    border: 1.5px solid #CBD5D8;
    border-radius: 14px;
}

.lan-code-in input:focus {
    outline: 0;
    border-color: var(--lan-accent);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, .14);
}

/* ---------- 粘贴确认 ---------- */
/* 列出这次要发的东西，条数多了在框内滚动，不要把弹层撑长 */
.lan-paste-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 168px;
    overflow-y: auto;
    text-align: left;
}

.lan-paste-list li { display: flex; align-items: baseline; min-width: 0; font-size: 12.5px; color: var(--lan-muted); }
.lan-paste-list b { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--lan-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lan-paste-list i { flex: none; font-style: normal; font-variant-numeric: tabular-nums; }
.lan-paste-acts { display: flex; justify-content: center; }

/* ---------- 传输面板 ---------- */
.lan-sheet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: none;
    background: rgba(12, 42, 50, .42);
}

.lan-sheet.is-open { display: block; }

.lan-sheet-inner {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 88vh;
    box-sizing: border-box;
    padding: 20px 22px 24px;
    background: var(--lan-surface);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -16px 50px rgba(8, 36, 44, .22);
    display: flex;
    flex-direction: column;
    animation: lan-up .22s ease both;
}

@keyframes lan-up {
    from { transform: translateY(24px); }
    to { transform: none; }
}

@media (min-width: 720px) {
    .lan-sheet { display: none; align-items: center; justify-content: center; padding: 24px; }
    .lan-sheet.is-open { display: flex; }
    .lan-sheet-inner {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        max-width: 520px;
        border-radius: 24px;
        box-shadow: 0 30px 70px rgba(8, 36, 44, .3);
    }
}

.lan-sheet-head { display: flex; align-items: center; }

.lan-sh-ico {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 13px;
    background: var(--lan-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lan-sh-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lan-sh-x { position: static; flex: none; }
.lan-sheet-head b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lan-peer-state { display: inline-flex; align-items: center; font-size: 12px; color: var(--lan-muted); }
.lan-peer-state em { font-style: normal; }
.lan-peer-state i { width: 7px; height: 7px; border-radius: 50%; background: #D1A33A; display: inline-block; }
.lan-peer-state.is-on i { background: var(--lan-ok); }
.lan-peer-state.is-err i { background: var(--lan-err); }

.lan-drop {
    padding: 22px 16px;
    border: 1.5px dashed #BFD4DA;
    border-radius: 18px;
    background: #F8FBFC;
    text-align: center;
    color: var(--lan-muted);
    font-size: 13px;
}

.lan-drop.is-over { border-color: var(--lan-accent); background: var(--lan-soft); color: var(--lan-accent); }
.lan-drop b { display: block; margin-bottom: 4px; font-size: 14px; color: var(--lan-ink); }

.lan-send-text { display: flex; align-items: flex-end; }

.lan-send-text textarea {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    max-height: 120px;
    box-sizing: border-box;
    padding: 12px 14px;
    resize: vertical;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--lan-ink);
    background: #FFF;
    border: 1px solid var(--lan-line-2);
    border-radius: 14px;
}

.lan-send-text textarea:focus { outline: 0; border-color: var(--lan-accent); box-shadow: 0 0 0 3px rgba(14, 116, 144, .12); }

.lan-log { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; }

.lan-log-item {
    display: flex;
    align-items: center;
    padding: 11px 13px;
    border: 1px solid var(--lan-line);
    border-radius: 14px;
    background: #FCFDFD;
}

.lan-log-item div { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lan-log-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lan-log-sub { font-size: 12px; color: var(--lan-muted); }
/* 超过 1000 字的文本会改走 .txt 文件通道，这里再兜一层：
   旧版本客户端发来的长文只在条目内滚动，不把整个传输面板撑开 */
.lan-log-text { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; max-height: 8.4em; overflow-y: auto; }

.lan-bar { height: 5px; border-radius: 3px; background: #E8EEF0; overflow: hidden; }
.lan-bar i { display: block; height: 100%; width: 0; background: var(--lan-accent); transition: width .15s linear; }
/* 收发方向用颜色分开：发出去的走主色，收进来的走绿色。
   左侧色条用 inset 阴影而不是 border，免得多出 3px 把内容顶偏 */
.lan-log-item.is-out { box-shadow: inset 3px 0 0 var(--lan-accent); }
.lan-log-item.is-in { box-shadow: inset 3px 0 0 var(--lan-ok); }
.lan-log-item.is-out .lan-log-name { color: var(--lan-accent); }
.lan-log-item.is-in .lan-log-name { color: var(--lan-ok); }
.lan-log-item.is-out .lan-log-sub { color: var(--lan-accent); }
.lan-log-item.is-in .lan-log-sub { color: var(--lan-ok); }
.lan-log-item.is-in .lan-bar i { background: var(--lan-ok); }

/* 失败压过方向色：这条更要紧。
   标题回到普通字色——文件名本身没出错，红色留给状态那行就够了 */
.lan-log-item.is-err { box-shadow: inset 3px 0 0 var(--lan-err); }
.lan-log-item.is-err .lan-log-name { color: var(--lan-ink); }
.lan-log-item.is-err .lan-log-sub { color: var(--lan-err); }

/* 记录条里的「复制 / 保存」不参与挤压：正文一长，弹性收缩会把它压到放不下一个词的宽度。
   面板本来就窄，这里也比通用小按钮再收一点内边距 */
.lan-log-item > .lan-btn { flex: none; padding: 0 14px; }

/* ---------- 图片缩略图 ---------- */
/* 用 button 而不是 div 包图：一来点开大图本就是个按钮，键盘能聚焦、读屏能念出来；
   二来上面的 .lan-log-item div 会把任何 div 子元素变成弹性列，div 在这儿会被那条规则带跑 */
.lan-log-thumb {
    flex: none;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--lan-line);
    border-radius: 10px;
    background: #F1F5F6;
    overflow: hidden;
    display: block;
}

/* cover 裁切而不是 contain 留白：缩略图只用来认图，长图窄图都先填满这个方块 */
.lan-log-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lan-log-thumb:hover { border-color: var(--lan-accent); }
.lan-log-thumb:focus-visible { outline: 2px solid var(--lan-accent); outline-offset: 2px; }

/* ---------- 图片大图 ---------- */
/* 比普通弹层更暗：这里要看的是图，背景越安静越好 */
.lan-img-mask { background: rgba(8, 24, 29, .82); flex-direction: column; padding: 16px; }

.lan-img-mask img {
    max-width: 100%;
    /* 给底下那行文件名和「保存」留出位置，图再高也不会把它顶出屏幕 */
    max-height: calc(100vh - 118px);
    object-fit: contain;
    border-radius: 12px;
    background: var(--lan-surface);
}

.lan-img-x {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--lan-surface);
}

.lan-img-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin-top: 14px;
}

.lan-img-cap {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #E8F1F3;
    font-size: 13px;
}

.lan-img-bar .lan-btn { flex: none; }

/* ---------- 底部 ---------- */
.lan-foot { display: flex; justify-content: center; padding: 10px 24px 34px; }
.lan-foot a { font-size: 13px; font-weight: 500; }

/* ---------- 提示条 ---------- */
.lan-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 70;
    transform: translate(-50%, 16px);
    max-width: 90vw;
    padding: 11px 18px;
    border-radius: 999px;
    background: rgba(24, 24, 27, .92);
    color: #FFF;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.lan-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.lan-hide { display: none !important; }

@media (max-width: 480px) {
    .lan-head { padding: 18px 16px 12px; }
    .lan-brand { }
    .lan-brand-txt { }
    .lan-brand-txt p { font-size: 12px; }
    /* 内距和字号已由 .lan-lang-btn 的 clamp 连续处理，这里不再写死 */
    .lan-main { padding: 4px 18px 44px; }
    /* 面板变窄，缩略图跟着收一档，给文件名留出省略号之外的地方 */
    .lan-log-thumb { width: 40px; height: 40px; }
    /* 关闭按钮和图之间别贴太近 */
    .lan-img-mask { padding: 12px; }
    .lan-img-mask img { max-height: calc(100vh - 108px); }
    .lan-main.is-idle { }
    .lan-radar { width: 252px; height: 252px; }
    .lan-radar.is-small { width: 210px; height: 210px; }
    .lan-radar .lan-self-card, .lan-radar.is-small .lan-self-card { width: 112px; height: 112px; }
    /* 雷达变小，飞碟同比缩一档，免得挤出圆环 */
    .lan-blip { width: 25px; height: 16px; margin: -8px 0 0 -12.5px; }
    .lan-shield { margin-top: -8px; font-size: 12px; padding: 8px 13px; }
    .lan-shield-pop { width: calc(100vw - 36px); padding: 13px 14px 14px; }
    .lan-modal { padding: 26px 20px 22px; border-radius: 22px; }
    .lan-code-in { }
    .lan-code-in input { height: 50px; font-size: 19px; border-radius: 12px; }
    /* 次级操作不拉满宽度，撑满会重新变成主操作的观感 */
    .lan-acts .lan-btn { flex: 0 0 auto; }
}

/* ========== 窄屏下的语言胶囊：收成纯图标圆钮 ==========
   语言名长短差一倍（「中文」对「繁體中文」「Русский」），420px 以下光这枚胶囊
   就要吃掉三分之一屏宽，标题和描述被挤得只剩一条窄缝。这里把文字和箭头收起来，
   只留地球图标，宽度等于高度，正好是个圆。
   当前语言不会因此丢失：i18n.js 会把 langBtn 写进 aria-label（「当前语言：简体
   中文，点击切换语言」），读屏照常播报，菜单里也仍有勾选态。
   箭头用 :last-child 命中——按钮里依次是地球 svg、文字 span、箭头 svg。 */
@media (max-width: 420px) {
    .lan-lang-btn {
        width: var(--lan-lang-h);
        padding: 0;
        justify-content: center;
    }
    .lan-lang-btn > span,
    .lan-lang-btn > svg:last-child { display: none; }
}

/* ========== 元素间距 ==========
   统一用相邻兄弟的 margin，而不是 flex 的 gap：gap 要 Chrome 84 才支持，
   Chrome 79 一类的旧内核会整段忽略它，所有间距塌成 0，页面看着像没排版。
   margin 哪个浏览器都认，也就不必在页面上做特性检测、更不会有两套表现。
   下面按容器分组，值与原先的 gap 一一对应；行方向用 margin-left，列方向用 margin-top。
   选择器前统一加 :root，只为抬一级权重：没有它，像 .lan-brand-txt p { margin: 0 }
   这类「类 + 标签」的规则会压过这里的 .lan-brand-txt > * + *，间距又会掉回 0。 */
:root .lan-head > * + * { margin-left: 14px; }
:root .lan-brand > * + * { margin-left: 12px; }
:root .lan-brand-txt > * + * { margin-top: 7px; }
:root .lan-lang-btn > * + * { margin-left: 6px; }
:root .lan-lang-menu > * + * { margin-top: 2px; }
:root .lan-lang-menu button > * + * { margin-left: 10px; }
:root .lan-main > * + * { margin-top: 26px; }
:root .lan-main.is-idle > * + * { margin-top: 30px; }
:root .lan-self-card > * + * { margin-top: 2px; }
:root .lan-shield > * + *:not(.lan-shield-pop) { margin-left: 8px; }
:root .lan-shield-pop ul > * + * { margin-top: 7px; }
:root .lan-status > * + * { margin-top: 8px; }
:root .lan-status-row > * + * { margin-left: 9px; }
:root .lan-acts .lan-btn > * + * { margin-left: clamp(5px, 1.2vw, 7px); }
:root .lan-btn > * + * { margin-left: clamp(6px, 1.6vw, 9px); }
:root .lan-list-box > * + * { margin-top: 12px; }
:root .lan-list-head > * + * { margin-left: 12px; }
/* 眼睛贴着设备数，"仍在扫描"推到行尾 */
:root .lan-list-head > .lan-ip-eye { margin-left: 4px; }
:root .lan-list-head > span { margin-left: auto; }
:root .lan-list > * + * { margin-top: 10px; }
:root .lan-row > * + * { margin-left: clamp(10px, 2.6vw, 14px); }
:root .lan-row-txt > * + * { margin-top: clamp(2px, .6vw, 3px); }
:root .lan-row-sub > * + * { margin-left: 6px; }
:root .lan-modal > * + *:not(.lan-modal-x) { margin-top: 18px; }
:root .lan-modal-head > * + * { margin-top: 6px; }
:root .lan-url > * + * { margin-left: 10px; }
:root .lan-room-create > * + * { margin-left: 14px; }
:root .lan-rc-txt > * + * { margin-top: 2px; }
:root .lan-code-out > * + * { margin-top: 6px; }
:root .lan-or > * + * { margin-left: 12px; }
:root .lan-field > * + * { margin-top: 12px; }
:root .lan-code-in > * + * { margin-left: 8px; }
:root .lan-paste-list > * + * { margin-top: 7px; }
:root .lan-paste-list li > * + * { margin-left: 10px; }
:root .lan-paste-acts > * + * { margin-left: 10px; }
:root .lan-sheet-inner > * + * { margin-top: 16px; }
:root .lan-sheet-head > * + * { margin-left: 12px; }
:root .lan-sh-txt > * + * { margin-top: 2px; }
:root .lan-peer-state > * + * { margin-left: 6px; }
:root .lan-send-text > * + * { margin-left: 10px; }
:root .lan-log > * + * { margin-top: 8px; }
:root .lan-log-item > * + * { margin-left: 12px; }
:root .lan-log-item div > * + * { margin-top: 4px; }
:root .lan-img-bar > * + * { margin-left: 12px; }

@media (max-width: 480px) {
    :root .lan-head > * + * { margin-left: 10px; }
    :root .lan-brand > * + * { margin-left: 10px; }
    :root .lan-brand-txt > * + * { margin-top: 5px; }
    :root .lan-lang-btn > * + * { margin-left: 5px; }
    :root .lan-main > * + * { margin-top: 20px; }
    :root .lan-main.is-idle > * + * { margin-top: 24px; }
    :root .lan-code-in > * + * { margin-left: 6px; }
}

/* 换行的操作区用负 margin，这样换到第二行时上下也有间距 */
:root .lan-acts { margin: calc(-1 * clamp(8px, 2.4vw, 12px) / 2); }
:root .lan-acts > * { margin: calc(clamp(8px, 2.4vw, 12px) / 2); }

/* 上面那条负 margin 会把操作区与上一块的间距一并顶掉，这里按「原间距 - 负值」补回来。
   有设备时 .lan-main 没有 is-idle，两种状态的间距不同，各写一条 */
:root .lan-main > .lan-acts { margin-top: calc(26px - clamp(8px, 2.4vw, 12px) / 2); }
:root .lan-main.is-idle > .lan-acts { margin-top: calc(30px - clamp(8px, 2.4vw, 12px) / 2);}

/* 这两个元素本来就带负 margin（盾形胶囊往上贴、问号往左收），
   上面按容器写的那条会把各自的负值顶掉，这里把「间距 + 自身负值」的结果一次写死。
   绝对定位的子元素（气泡、模态框的关闭按钮）已在各自容器的规则里用 :not() 排除 */
:root .lan-main > .lan-shield { margin-top: 14px; }
:root .lan-main.is-idle > .lan-shield { margin-top: 18px; }
:root .lan-shield > .lan-shield-q { margin-left: 2px; }

/* fieldset 的 legend 不参与 flex 排列，它后面那个元素也就不该补间距 */
:root .lan-field > legend + * { margin-top: 0; }

/* 关闭按钮绝对定位，不算 flex 项：gap 时代它前后不产生间距，
   但它在 DOM 里排在最前面，* + * 会把紧随其后的那块当成第二项多给一份 */
:root .lan-modal > .lan-modal-x + * { margin-top: 0; }

@media (max-width: 480px) {
    :root .lan-main > .lan-shield { margin-top: 12px; }
    :root .lan-main.is-idle > .lan-shield { margin-top: 16px; }
    :root .lan-main > .lan-acts { margin-top: calc(20px - clamp(8px, 2.4vw, 12px) / 2); }
    :root .lan-main.is-idle > .lan-acts { margin-top: calc(24px - clamp(8px, 2.4vw, 12px) / 2); }
}

/* ========== 阿拉伯语（从右向左） ==========
   flex 的行方向由 dir 自动翻转，这里只处理那些写死了左右的地方：
   间距用的是 margin-left，必须改成 margin-right；绝对定位、内边距和文字对齐同理。
   不用 margin-inline-start 这类逻辑属性，是因为它们要 Chrome 87 起才支持。 */
[dir="rtl"] .lan-head > * + * { margin-right: 14px; margin-left: 0; }
[dir="rtl"] .lan-brand > * + * { margin-right: 12px; margin-left: 0; }
[dir="rtl"] .lan-lang-btn > * + * { margin-right: 6px; margin-left: 0; }
[dir="rtl"] .lan-lang-menu button > * + * { margin-right: 10px; margin-left: 0; }
[dir="rtl"] .lan-shield > * + *:not(.lan-shield-pop) { margin-right: 8px; margin-left: 0; }
[dir="rtl"] .lan-status-row > * + * { margin-right: 9px; margin-left: 0; }
[dir="rtl"] .lan-acts .lan-btn > * + * { margin-right: clamp(5px, 1.2vw, 7px); margin-left: 0; }
[dir="rtl"] .lan-btn > * + * { margin-right: clamp(6px, 1.6vw, 9px); margin-left: 0; }
[dir="rtl"] .lan-list-head > * + * { margin-right: 12px; margin-left: 0; }
[dir="rtl"] .lan-list-head > .lan-ip-eye { margin-right: 4px; margin-left: 0; }
[dir="rtl"] .lan-list-head > span { margin-right: auto; margin-left: 0; }
[dir="rtl"] .lan-row > * + * { margin-right: clamp(10px, 2.6vw, 14px); margin-left: 0; }
[dir="rtl"] .lan-row-sub > * + * { margin-right: 6px; margin-left: 0; }
[dir="rtl"] .lan-url > * + * { margin-right: 10px; margin-left: 0; }
[dir="rtl"] .lan-room-create > * + * { margin-right: 14px; margin-left: 0; }
[dir="rtl"] .lan-or > * + * { margin-right: 12px; margin-left: 0; }
[dir="rtl"] .lan-code-in > * + * { margin-right: 8px; margin-left: 0; }
[dir="rtl"] .lan-sheet-head > * + * { margin-right: 12px; margin-left: 0; }
[dir="rtl"] .lan-peer-state > * + * { margin-right: 6px; margin-left: 0; }
[dir="rtl"] .lan-send-text > * + * { margin-right: 10px; margin-left: 0; }
[dir="rtl"] .lan-log-item > * + * { margin-right: 12px; margin-left: 0; }
[dir="rtl"] .lan-img-bar > * + * { margin-right: 12px; margin-left: 0; }
[dir="rtl"] .lan-head > * + * { margin-right: 10px; margin-left: 0; }
[dir="rtl"] .lan-brand > * + * { margin-right: 10px; margin-left: 0; }
[dir="rtl"] .lan-lang-btn > * + * { margin-right: 5px; margin-left: 0; }
[dir="rtl"] .lan-code-in > * + * { margin-right: 6px; margin-left: 0; }

/* 问号按钮在 RTL 下落在胶囊左端：往外收的那一侧跟着换边 */
[dir="rtl"] .lan-shield > .lan-shield-q { margin-right: 2px; margin-left: -5px; }

[dir="rtl"] .lan-lang-menu { right: auto; left: 0; }
[dir="rtl"] .lan-modal-x { right: auto; left: 16px; }
[dir="rtl"] .lan-modal-head { padding-right: 0; padding-left: 38px; }
[dir="rtl"] .lan-shield, [dir="rtl"] .lan-shield-pop { text-align: right; }
[dir="rtl"] .lan-shield-pop li { padding-left: 0; padding-right: 14px; }
[dir="rtl"] .lan-shield-pop li::before { left: auto; right: 2px; }

/* 房间码和链接始终从左到右：六个数字框镜像后顺序会反，网址同理 */
/* 色条跟着书写方向换到右边 */
[dir="rtl"] .lan-log-item.is-out { box-shadow: inset -3px 0 0 var(--lan-accent); }
[dir="rtl"] .lan-log-item.is-in { box-shadow: inset -3px 0 0 var(--lan-ok); }
[dir="rtl"] .lan-log-item.is-err { box-shadow: inset -3px 0 0 var(--lan-err); }

[dir="rtl"] .lan-paste-list { text-align: right; }
[dir="rtl"] .lan-paste-list li > * + * { margin-right: 10px; margin-left: 0; }
[dir="rtl"] .lan-paste-acts > * + * { margin-right: 10px; margin-left: 0; }

[dir="rtl"] .lan-code-in, [dir="rtl"] .lan-code-out { direction: ltr; }
[dir="rtl"] .lan-url span { direction: ltr; unicode-bidi: embed; }
