/* Shared public-page navigation and narrow-screen layouts. */
.logo { flex-shrink: 0; }
.register-mobile { display: none; }
.hero-card { border-radius: 8px; }
.right { margin-left: auto; }
.links { min-width: 0; overflow-x: auto; }
.links a { white-space: nowrap; }
.hero-text, .cell, .tool, .price, .split > *, .cm-post > * { min-width: 0; }
.hero-text, .cell, .tool, .price, .cm, .invite-card { overflow-wrap: anywhere; }
.cm-body table { display: block; max-width: 100%; overflow-x: auto; }

/* 导航只有 5 项，840px 以上都跟 BrowserX 放在同一行；窄一点时字号和间距收一收（首页自己 900px 以下会把导航藏掉，这里放出来） */
@media (min-width: 841px) and (max-width: 1200px) {
    header .links { display: flex; }
    header .wrap { gap: 24px; }
    header .links { gap: 20px; }
    header .links a { font-size: 16px; }
}
/* 再窄一点放不下：导航里的「排行榜」不显示（插件市场页面顶部有「排行榜」标签） */
@media (min-width: 841px) and (max-width: 1100px) {
    header .links .nav-rank { display: none; }
}

@media (max-width: 840px) {
    header .wrap { height: auto; min-height: 72px; flex-wrap: wrap; gap: 12px 20px; padding-top: 12px; }
    header .links { display: flex; order: 3; flex: 0 0 100%; min-width: 0; gap: 24px; overflow-x: auto; padding-bottom: 8px; }
    .links a { display: flex; align-items: center; min-height: 44px; font-size: 16px; }
    section { scroll-margin-top: 140px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .wrap { padding-inline: 16px; }
    header { position: relative; }
    header .wrap { gap: 8px; }
    header .right { flex: 0 1 auto; flex-wrap: nowrap; gap: 4px; margin-left: auto; }
    header .right .btn { min-height: 34px; height: 34px; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
    header .right .theme-btn { display: inline-flex; flex: 0 0 30px; width: 30px; min-height: 34px; padding: 0; }
    header .right .login-btn { display: inline-flex; }
    .register-desktop { display: none; }
    .register-mobile { display: inline; }
    header .links { gap: 20px; }
    .btn { min-height: 44px; height: auto; padding-block: 10px; max-width: 100%; white-space: normal; line-height: 1.35; text-align: center; }
    .hero { padding-top: 12px; }
    .hero-card { padding: 28px 20px; gap: 28px; border-radius: 8px; }
    .hero h1 { font-size: clamp(32px, 9vw, 48px); line-height: 1.12; }
    .hero-pill { flex-wrap: wrap; gap: 6px; font-size: 14px; margin-bottom: 20px; border-radius: 16px; }
    .hero p, .lead { font-size: 17px; }
    .hero .cta { gap: 10px; }
    .hero .cta .btn { flex: 1 1 auto; white-space: nowrap; padding-inline: 14px; } /* 两个按钮放得下就并排占满一行（中文），放不下（日文等）就各占一行，按钮里的字不折行 */
    .hero .cta .btn.lg { flex: 1 1 0; min-height: 36px; height: 36px; padding-block: 0; } /* 手机上首屏两个按钮矮一些；flex-basis 0 让并排时两个一样宽、左右对齐 */
    .hero small { font-size: 14px; }
    section { padding-block: 48px; scroll-margin-top: 16px; }
    .h2 { font-size: 30px; }
    .cell, .tool, .price { padding: 22px; }
    .grid, .prices, .cats { margin-top: 24px; }
    .cat { height: auto; min-height: 44px; padding-block: 8px; }
    .invite-card { padding: 24px 20px; }
    .invite-big { font-size: 42px; line-height: 1.2; }
    .cm { padding-top: 12px; padding-bottom: 48px; }
    .cm-row { padding: 14px; }
    .cm-tools > span { display: flex; flex-wrap: wrap; gap: 8px; }
    .cm-cats a { min-height: 44px; }
    .rk-ind { grid-template-columns: minmax(0, 1fr); }
    footer { padding-block: 28px; }
}

/* Native language picker keeps keyboard and mobile selection support. */
.language-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; }
.language-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; pointer-events: none; }
.language-icon .language-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.language-icon:hover { background: var(--hover-bg); border-color: var(--hover-line); }
.language-icon:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 600px) {
    header .language-icon { flex-basis: 34px; width: 34px; height: 34px; }
    header .language-icon svg { width: 18px; height: 18px; }
}
@media (max-width: 360px) {
    header .right .login-btn { display: none; }
}

@media (max-width: 360px) {
    header .logo { font-size: 16px; gap: 6px; }
    header .logo img { width: 28px; height: 28px; }
}
