@charset "utf-8";

/* ==========================================================================
   HHKB Professional シリーズ 共通マニュアル
   「キーボード設定の初期化およびペアリング情報の削除方法」（jp / en / cn 共通）
   --------------------------------------------------------------------------
   - 命名規則   : BEM（block__element--modifier）
   - 設計       : モバイルファースト（min-width）
   - ブレイクポイント : 560px / 768px / 1024px / 1280px のみ使用
   - カラー/フォント  : HHKBブランドガイドライン Ver.1.9.1 準拠
                       背景=白、文字=ブラック（90%）、強調色 Red は見出しの罫線（h2 下線・h3 左線）のみ
                       グラデーション・シャドウは使用しない
   - 共通パーツ（.header / .footer）のクラスにはスタイルを当てない
   ========================================================================== */


/* ==========================================================================
   Font
   游ゴシック：Windows では Regular が細くかすれて見えるため、
   Medium を通常ウェイト（400）として扱うエイリアスを定義する。
   ========================================================================== */
@font-face {
  font-family: "HHKB Yu Gothic";
  font-style: normal;
  font-weight: 400;
  src: local("Yu Gothic Medium"), local("YuGothic-Medium"), local("YuGothic Medium"), local("YuGo-Medium");
}

@font-face {
  font-family: "HHKB Yu Gothic";
  font-style: normal;
  font-weight: 700;
  src: local("Yu Gothic Bold"), local("YuGothic-Bold"), local("YuGothic Bold"), local("YuGo-Bold");
}


/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  /* Color（ブランドガイドライン「基本カラー：HHKB」） */
  --manual-color-white: #ffffff;   /* 背景色 */
  --manual-color-text: #1a1a1a;    /* Black C 90% */
  --manual-color-gray: #b1b1b1;    /* Cool Gray 5C */
  --manual-color-gray-60: #cfcfcf; /* Cool Gray 5C 60% */
  --manual-color-gray-5: #fafafa;  /* Cool Gray 5C 5% */
  --manual-color-red: #c11920;     /* 強調色（7620C） */

  /* Font（ブランドガイドライン「指定フォント」） */
  --manual-font-ja: "Open Sans", "HHKB Yu Gothic", YuGothic, "Yu Gothic", sans-serif;
  --manual-font-en: "Open Sans", sans-serif;
  --manual-font-zh: "Open Sans", "Noto Sans SC", sans-serif;
}


/* ==========================================================================
   Base
   ========================================================================== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* 行送りは共通フッターへの影響を避けるため /download/ と同じ 1.5 とし、本文は .manual で指定する */
body {
  margin: 0;
  background-color: var(--manual-color-white);
  color: var(--manual-color-text);
  font-family: var(--manual-font-en);
  font-size: 16px;
  line-height: 1.5;
}

body:lang(ja) {
  font-family: var(--manual-font-ja);
}

body:lang(zh) {
  font-family: var(--manual-font-zh);
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

.manual,
.manual *,
.manual *::before,
.manual *::after,
.manual-skip {
  box-sizing: border-box;
}


/* ==========================================================================
   Block: manual-skip（本文へスキップ）
   ========================================================================== */
.manual-skip {
  position: absolute;
  top: 0;
  left: 24px;
  z-index: 100;
  padding: 8px 16px;
  border: 2px solid var(--manual-color-text);
  background-color: var(--manual-color-white);
  color: var(--manual-color-text);
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-150%);
}

.manual-skip:focus {
  transform: translateY(16px);
}


/* ==========================================================================
   Block: manual（ページ本体）
   ========================================================================== */
.manual {
  --manual-line-height: 1.8;
  display: block;
  padding-bottom: 64px;
  line-height: var(--manual-line-height);
  letter-spacing: 0.04em;
  overflow-wrap: break-word;
}

.manual--en {
  --manual-line-height: 1.7;
  letter-spacing: 0;
}

.manual__inner {
  max-width: 1344px;
  margin: 0 auto;
  padding: 0 24px;
}

@media screen and (min-width: 768px) {
  .manual {
    padding-bottom: 96px;
  }
}


/* ==========================================================================
   Block: manual-article（記事）
   ========================================================================== */
.manual-article__header {
  padding-top: 32px;
}

.manual-article__title {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.5;
}

.manual--ja .manual-article__title {
  word-break: auto-phrase;
}

.manual-article__lead {
  margin-top: 16px;
}

@media screen and (min-width: 768px) {
  .manual-article__header {
    padding-top: 48px;
  }

  .manual-article__title {
    font-size: 30px;
  }

  .manual-article__lead {
    margin-top: 24px;
  }
}

@media screen and (min-width: 1280px) {
  .manual-article__title {
    font-size: 36px;
  }
}


/* ==========================================================================
   Block: manual-toc（目次）
   ========================================================================== */
.manual-toc {
  margin-top: 32px;
}

.manual-toc__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 0;
  list-style: none;
}

.manual-toc__item {
  display: flex;
}

.manual-toc__link {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.4em;
  min-height: 56px;
  padding: 12px 52px 12px 24px;
  border: 2px solid var(--manual-color-text);
  border-radius: 28px;
  background-color: var(--manual-color-white);
  color: var(--manual-color-text);
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

/* 下向きの矢印 */
.manual-toc__link::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 24px;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(135deg);
}

.manual-toc__link:hover {
  background-color: var(--manual-color-text);
  color: var(--manual-color-white);
}

.manual-toc__num {
  flex: none;
}

.manual-toc__text {
  flex: 1 1 auto;
  min-width: 0;
}

.manual--ja .manual-toc__text {
  word-break: auto-phrase;
}

@media screen and (min-width: 768px) {
  .manual-toc {
    margin-top: 48px;
  }

  .manual-toc__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
  }

  .manual-toc__link {
    font-size: 16px;
  }
}


/* ==========================================================================
   Block: manual-section（大見出し単位のセクション）
   ========================================================================== */
.manual-section {
  margin-top: 56px;
  scroll-margin-top: 16px;
}

.manual-section__title {
  padding: 0 0 12px 4px;
  border-bottom: 3px solid var(--manual-color-red);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
}

.manual--ja .manual-section__title {
  word-break: auto-phrase;
}

.manual-section__body {
  max-width: 1000px;
  margin-top: 24px;
}

.manual-section__text + .manual-section__text {
  margin-top: 8px;
}

@media screen and (min-width: 768px) {
  .manual-section {
    margin-top: 80px;
  }

  .manual-section__title {
    padding: 0 0 16px 8px;
    font-size: 24px;
  }

  .manual-section__body {
    margin-top: 32px;
    padding-left: 24px;
  }
}

@media screen and (min-width: 1280px) {
  .manual-section__title {
    font-size: 28px;
  }
}


/* ==========================================================================
   Block: manual-subsection（小見出し単位のセクション）
   ========================================================================== */
.manual-subsection {
  margin-top: 32px;
  scroll-margin-top: 16px;
}

.manual-subsection + .manual-subsection {
  margin-top: 48px;
}

.manual-subsection__title {
  padding-left: 12px;
  border-left: 4px solid var(--manual-color-red);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

@media screen and (min-width: 768px) {
  .manual-subsection__title {
    font-size: 20px;
  }
}


/* ==========================================================================
   Block: manual-steps（手順リスト）
   ========================================================================== */
.manual-steps {
  margin-top: 24px;
  padding: 0;
  list-style: none;
  counter-reset: manual-step;
}

.manual-steps__item {
  position: relative;
  padding-left: 44px;
  counter-increment: manual-step;
}

.manual-steps__item + .manual-steps__item {
  margin-top: 24px;
}

/* 手順番号 */
.manual-steps__item::before {
  content: counter(manual-step);
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--manual-color-text);
  color: var(--manual-color-white);
  font-family: "Open Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.manual-steps__text + .manual-steps__text,
.manual-steps__text + .manual-steps__result {
  margin-top: 4px;
}

.manual-steps__item > .manual-models,
.manual-steps__item > .manual-figure {
  margin-top: 12px;
}

@media screen and (min-width: 560px) {
  .manual-steps__item {
    padding-left: 48px;
  }

  .manual-steps__item::before {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

@media screen and (min-width: 768px) {
  .manual-steps {
    margin-top: 32px;
  }

  .manual-steps__item + .manual-steps__item {
    margin-top: 32px;
  }
}


/* ==========================================================================
   Block: manual-models（機種別の操作）
   ========================================================================== */
.manual-models {
  display: grid;
  gap: 12px;
}

.manual-models__item {
  padding: 16px;
  border: 1px solid var(--manual-color-gray-60);
  border-radius: 4px;
}

.manual-models__name {
  font-weight: 700;
}

.manual-models__desc {
  margin-top: 4px;
}

@media screen and (min-width: 560px) {
  .manual-models__item {
    padding: 20px 24px;
  }
}


/* ==========================================================================
   Block: manual-figure（図版）
   ========================================================================== */
.manual-figure {
  margin-top: 12px;
}

.manual-figure__img {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
}


/* ==========================================================================
   Block: manual-icon（本文中のツール画面アイコン）
   ========================================================================== */
.manual-icon {
  display: inline-block;
  width: auto;
  height: 40px;
  margin: 0 0.25em;
  vertical-align: middle;
}

.manual-icon--menu {
  height: 25px;
}


/* ==========================================================================
   Block: manual-key（キーボードのキー表記）
   ========================================================================== */
.manual-key {
  display: inline-block;
  min-width: 2em;
  margin: 0 0.2em;
  padding: 0 0.5em;
  border: 1px solid var(--manual-color-gray);
  border-bottom-width: 3px;
  border-radius: 4px;
  background-color: var(--manual-color-gray-5);
  color: var(--manual-color-text);
  font-family: "Open Sans", sans-serif;
  font-size: 0.875em;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}


/* ==========================================================================
   Block: manual-next（次に行う手順の案内）
   ========================================================================== */
.manual-next {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--manual-color-gray-60);
  border-left: 4px solid var(--manual-color-text);
  background-color: var(--manual-color-gray-5);
}

.manual-next__text {
  position: relative;
  padding-left: 20px;
}

/* 右向きの矢印（1行目の中央に揃える） */
.manual-next__text::before {
  content: "";
  position: absolute;
  top: calc(var(--manual-line-height) * 0.5em - 4px);
  left: 0;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.manual-next__text + .manual-next__text {
  margin-top: 8px;
}

.manual-next__link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.manual-next__link:hover {
  text-decoration: none;
}

@media screen and (min-width: 768px) {
  .manual-next {
    margin-top: 32px;
    padding: 20px 24px;
  }
}


/* ==========================================================================
   Block: manual-pagetop（ページ先頭へ戻る）
   - position: sticky でメイン領域の末尾に追従させ、フッターに重ならない
   - 表示の切り替えは manual.js が --visible を付与して行う
   ========================================================================== */
.manual-pagetop {
  position: sticky;
  bottom: 16px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  margin-top: 48px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.manual-pagetop--visible {
  opacity: 1;
  visibility: visible;
}

/* JavaScript 無効環境では常に表示 */
@media (scripting: none) {
  .manual-pagetop {
    opacity: 1;
    visibility: visible;
  }
}

.manual-pagetop__link {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  border: 2px solid var(--manual-color-text);
  border-radius: 50%;
  background-color: var(--manual-color-white);
  color: var(--manual-color-text);
  pointer-events: auto;
  transition: background-color 0.2s, color 0.2s;
}

/* 上向きの矢印 */
.manual-pagetop__link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -3px 0 0 -6px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.manual-pagetop__link:hover {
  background-color: var(--manual-color-text);
  color: var(--manual-color-white);
}

.manual-pagetop__label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

@media screen and (min-width: 1024px) {
  .manual-pagetop {
    bottom: 32px;
  }
}


/* ==========================================================================
   Focus
   ========================================================================== */
.manual-skip:focus-visible,
.manual-toc__link:focus-visible,
.manual-next__link:focus-visible,
.manual-pagetop__link:focus-visible {
  outline: 2px solid var(--manual-color-text);
  outline-offset: 3px;
}


/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .manual-toc__link,
  .manual-pagetop,
  .manual-pagetop__link {
    transition: none;
  }
}


/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .manual-skip,
  .manual-pagetop {
    display: none;
  }
}
