
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg:          #232734;
      --bg-deep:     #1c1f29;
      --bg-card:     #2b3043;
      --bg-card-hov: #343a51;
      --bg-tab:      #272c3e;
      --border:      #454c68;
      --border-soft: #363c54;
      --accent:      #b98a2c;
      --accent-glow: #d9ae4a;
      --accent-deep: #6e5424;
      --accent2:     #b8504c;
      --text:        #eceff5;
      --text-sub:    #aab4c5;
      --text-muted:  #7d889c;
      --font-en:     'Rajdhani', sans-serif;
      --font-jp:     'Noto Sans JP', sans-serif;
      --radius:      10px;
      --radius-sm:   5px;
      --radius-lg:   16px;
    }

    html { scroll-behavior: smooth; }
    body {
      background: var(--bg);
      color: var(--text); font-family: var(--font-jp); font-size: 15px; line-height: 1.7; min-height: 100vh;
    }
    a { color: inherit; text-decoration: none; }
    img { display: block; width: 100%; height: auto; object-fit: cover; }
    ul { list-style: none; }
    ::-webkit-scrollbar { width: 11px; }
    ::-webkit-scrollbar-track { background: var(--bg-deep); }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; border: 3px solid var(--bg-deep); }

    /* 読書プログレスバー */
    .progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200; background: linear-gradient(90deg, var(--accent), var(--accent-glow)); transition: width .1s; }

    /* HEADER */
    .site-header { position: sticky; top: 0; z-index: 100; background: rgba(20,22,31,.82); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--border-soft); }
    .header-inner { max-width: 1220px; margin: 0 auto; padding: 0 22px; height: 64px; display: flex; align-items: center; gap: 30px; }
    .site-logo { font-family: var(--font-en); font-size: 23px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; filter: drop-shadow(0 0 12px rgba(217,174,74,.22)); }
    .site-logo .k { color: var(--accent-glow); }
    .site-logo .dot { color: var(--text-muted); }
    .site-logo .net { color: var(--text-sub); font-size: 16px; }
    .header-nav { display: flex; gap: 2px; flex: 1; }
    .header-nav a { position: relative; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; color: var(--text-sub); transition: color .2s; }
    .header-nav a::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--accent-glow); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
    .header-nav a:hover { color: var(--text); }
    .header-nav a:hover::after { transform: scaleX(1); }
    .header-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }
    .badge-18 { background: linear-gradient(135deg, var(--accent2), #8f3b38); color: #fff; font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: var(--radius-sm); letter-spacing: 1px; }
    .menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }

    /* CAT TAG */
    .cat-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .5px; padding: 4px 12px; border-radius: 99px; width: fit-content; background: rgba(28,31,41,.82); color: var(--accent-glow); border: 1px solid rgba(217,174,74,.45); }

    /* LAYOUT */
    .main-layout { max-width: 1220px; margin: 28px auto 64px; padding: 0 22px; display: grid; grid-template-columns: 1fr 300px; gap: 36px; align-items: start; }
    main { min-width: 0; }

    /* パンくず */
    .breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); margin-bottom: 22px; flex-wrap: wrap; }
    .breadcrumb a { transition: color .2s; }
    .breadcrumb a:hover { color: var(--accent-glow); }
    .breadcrumb .sep { color: var(--border); }
    .breadcrumb .current { color: var(--text-sub); }

    /* 記事ヘッダー */
    .article-header { margin-bottom: 24px; }
    .article-header .cat-tag { margin-bottom: 14px; }
    .article-title { font-size: 30px; font-weight: 900; line-height: 1.5; margin-bottom: 10px; letter-spacing: .2px; }
    .article-lead { font-size: 14.5px; color: var(--text-sub); margin-bottom: 16px; }
    .article-meta { display: flex; align-items: center; gap: 10px 14px; font-size: 12.5px; color: var(--text-muted); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); padding: 12px 2px; flex-wrap: wrap; }
    .article-meta .dot { color: var(--border); }
    .ver-chip { font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--text-sub); }
    .ver-chip b { color: var(--accent-glow); font-family: var(--font-en); }
    .ver-chip.todo { border-style: dashed; color: var(--text-muted); }

    /* 目次＋全部開く */
    .toc { background: var(--bg-card); border: 1px solid var(--border-soft); border-left: 3px solid var(--accent-glow); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 32px; }
    .toc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
    .toc-title { font-size: 13px; font-weight: 700; color: var(--accent-glow); letter-spacing: .5px; }
    .toggle-all { background: none; border: 1px solid var(--border); border-radius: 99px; padding: 3px 12px; font-family: var(--font-jp); font-size: 12px; color: var(--text-sub); cursor: pointer; transition: .2s; }
    .toggle-all:hover { border-color: var(--accent); color: var(--accent-glow); }
    .toc ol { list-style: none; counter-reset: toc; }
    .toc li { counter-increment: toc; margin-bottom: 8px; }
    .toc li:last-child { margin-bottom: 0; }
    .toc a { font-size: 14px; color: var(--text-sub); display: flex; align-items: baseline; gap: 10px; transition: color .2s; }
    .toc a::before { content: counter(toc,decimal-leading-zero); font-family: var(--font-en); font-weight: 700; color: var(--accent); font-size: 13px; }
    .toc a:hover { color: var(--accent-glow); }

    /* 本文 */
    .article-body { line-height: 1.95; font-size: 15.5px; }
    .article-body h2 { font-size: 22px; font-weight: 900; padding-left: 16px; margin: 46px 0 18px; position: relative; scroll-margin-top: 80px; }
    .article-body h2::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; background: linear-gradient(var(--accent-glow), var(--accent)); }
    .article-body h3 { font-size: 18px; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); margin: 30px 0 14px; }
    .article-body p { margin-bottom: 18px; color: var(--text); }
    .article-body strong { color: var(--accent-glow); font-weight: 700; }
    .article-body a.inline { color: var(--accent-glow); text-decoration: underline; text-underline-offset: 2px; }
    .article-body ul, .article-body ol { margin: 0 0 18px 4px; padding-left: 22px; }
    .article-body ul { list-style: none; }
    .article-body ul li { position: relative; padding-left: 6px; }
    .article-body ul li::before { content: '▸'; position: absolute; left: -16px; color: var(--accent); }
    .article-body ol { list-style: decimal; }
    .article-body li { margin-bottom: 8px; color: var(--text); }
    .en { font-family: var(--font-en); font-size: .95em; color: var(--text-muted); }

    /* 表 */
    .table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--border-soft); border-radius: var(--radius); }
    .note-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.7; }
    .note-table th, .note-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; }
    .note-table th { background: var(--bg-tab); color: var(--text-sub); font-weight: 700; font-size: 13px; white-space: nowrap; }
    .note-table tr:last-child td { border-bottom: none; }
    .note-table td.ok { color: #8fc79a; font-weight: 700; white-space: nowrap; }
    .note-table td.ng { color: #e3b4b1; font-weight: 700; white-space: nowrap; }
    .note-table td.mid { color: var(--accent-glow); font-weight: 700; white-space: nowrap; }

    /* クリックで開く枠 */
    .fold { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); margin: 0 0 14px; overflow: hidden; }
    .fold > summary {
      list-style: none; cursor: pointer; padding: 13px 18px; font-weight: 700; font-size: 15px;
      display: flex; align-items: center; gap: 10px; transition: background .2s;
    }
    .fold > summary::-webkit-details-marker { display: none; }
    .fold > summary::before { content: '▸'; color: var(--accent); transition: transform .2s; }
    .fold[open] > summary::before { transform: rotate(90deg); }
    .fold > summary:hover { background: var(--bg-card-hov); }
    .fold > summary .sum-note { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-muted); }
    .fold-body { padding: 4px 20px 6px; border-top: 1px solid var(--border-soft); }
    .fold-body > :first-child { margin-top: 14px; }

    /* Nightly（先行版）だけの話。本文より一歩引いた見た目で、最初は閉じておく */
    .nightly-note { margin: 0 0 18px; border: 1px dashed var(--border); border-left: 3px solid var(--text-muted); border-radius: var(--radius-sm); background: rgba(28,31,41,.5); }
    .nightly-note > summary { list-style: none; cursor: pointer; padding: 8px 13px; font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
    .nightly-note > summary::-webkit-details-marker { display: none; }
    .nightly-note > summary::after { content: '開く'; margin-left: auto; font-size: 11px; }
    .nightly-note[open] > summary::after { content: '閉じる'; }
    .nightly-note .nn-body { padding: 0 14px 10px; font-size: 13.5px; color: var(--text-sub); line-height: 1.8; }
    .nn-label { display: inline-block; padding: 0 7px; border-radius: 99px; border: 1px solid var(--border); font-family: var(--font-en); font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text-sub); }

    /* 注意書き */
    .notice-box { display: flex; gap: 13px; align-items: flex-start; padding: 15px 18px; border-radius: var(--radius); margin: 22px 0; font-size: 14px; }
    .notice-box.warning { background: rgba(217,174,74,.08); border: 1px solid rgba(217,174,74,.25); }
    .notice-box.nsfw { background: rgba(184,80,76,.08); border: 1px solid rgba(184,80,76,.25); }
    .notice-box .notice-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
    .notice-box .notice-text { color: var(--text-sub); line-height: 1.75; }
    .notice-box .notice-text strong { color: var(--text); display: block; margin-bottom: 2px; }

    /* 調べ方メモ（出典） */
    .source-note { margin: 34px 0 0; padding: 14px 18px; border-radius: var(--radius); background: var(--bg-deep); border: 1px solid var(--border-soft); font-size: 12.5px; color: var(--text-muted); line-height: 1.8; }
    .source-note b { color: var(--text-sub); }

    /* 前後ナビ */
    .article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
    .article-nav a { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 16px 18px; transition: .25s; display: flex; flex-direction: column; gap: 6px; }
    .article-nav a:hover { background: var(--bg-card-hov); border-color: var(--border); transform: translateY(-2px); }
    .article-nav .nav-label { font-size: 11px; color: var(--text-muted); }
    .article-nav .nav-title { font-size: 14px; font-weight: 700; line-height: 1.45; }
    .article-nav .next { text-align: right; }

    /* SIDEBAR */
    .sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 82px; }
    .sidebar-block { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; }
    .sb-title { background: var(--bg-tab); padding: 13px 17px; font-size: 13px; font-weight: 700; letter-spacing: .5px; color: var(--accent-glow); border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; gap: 9px; }
    .search-wrap { padding: 16px; }
    .search-inner { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-deep); }
    .search-inner input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; padding: 10px 13px; font-size: 13px; color: var(--text); font-family: var(--font-jp); }
    .search-inner input::placeholder { color: var(--text-muted); }
    .search-inner button { background: var(--accent); border: none; padding: 0 15px; cursor: pointer; color: #1a1205; font-size: 15px; }
    .side-list { padding: 6px 0; }
    .side-list a { display: flex; align-items: center; gap: 9px; padding: 9px 17px; font-size: 13.5px; color: var(--text-sub); transition: background .2s, color .2s; }
    .side-list a::before { content: '›'; color: var(--accent); font-weight: 700; }
    .side-list a:hover { background: var(--bg-card-hov); color: var(--text); }
    .side-list a.here { color: var(--accent-glow); font-weight: 700; background: rgba(217,174,74,.06); }

    /* FOOTER */
    .site-footer { border-top: 1px solid var(--border-soft); margin-top: 20px; padding: 40px 22px 32px; background: var(--bg-deep); }
    .footer-inner { max-width: 1220px; margin: 0 auto; text-align: center; }
    .footer-logo { font-family: var(--font-en); font-size: 22px; font-weight: 700; margin-bottom: 14px; }
    .footer-logo .k { color: var(--accent-glow); }
    .footer-links { display: flex; justify-content: center; gap: 22px; margin-bottom: 18px; flex-wrap: wrap; }
    .footer-links a { color: var(--text-muted); font-size: 13px; transition: color .2s; }
    .footer-links a:hover { color: var(--text); }
    .footer-note { font-size: 12px; color: var(--text-sub); line-height: 1.8; margin-bottom: 14px; }
    .footer-warning { background: rgba(184,80,76,.08); border: 1px solid rgba(184,80,76,.22); border-radius: var(--radius); padding: 10px 18px; font-size: 11.5px; color: #e3b4b1; display: inline-block; margin-bottom: 16px; }
    .footer-copy { font-size: 11.5px; color: var(--text-muted); }

    /* RESPONSIVE */
    @media (max-width: 980px) {
      .main-layout { grid-template-columns: 1fr; }
      .sidebar { position: static; }
    }
    @media (max-width: 680px) {
      .header-nav { display: none; }
      .menu-toggle { display: block; }
      .article-title { font-size: 23px; }
      .article-nav { grid-template-columns: 1fr; }
      .fold-body { padding: 4px 14px 6px; }
    }
  
    /* notes 用の追加 */
    .item-icon { width: 28px; height: 28px; vertical-align: middle; margin-right: 8px; image-rendering: pixelated; }
    .note-table td:first-child { white-space: nowrap; }
    .note-table.wide { min-width: 760px; }
    .note-table.mid { min-width: 560px; }
    .note-table td { min-width: 4.5em; }
    .article-body code { font-family: var(--font-en); background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: 4px; padding: 0 5px; font-size: .9em; color: var(--text-sub); }
    .article-body pre.code { background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 12px 16px; overflow-x: auto; font-size: 13px; margin-bottom: 18px; white-space: pre-wrap; }
    .article-body hr.sep { border: none; border-top: 1px solid var(--border-soft); margin: 30px 0; }
    .article-body li > ul, .article-body li > ol { margin-top: 8px; margin-bottom: 0; }
    .article-body .notice-text p { margin-bottom: 6px; }
    .sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0 0 26px; }
    .sub-grid a { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 11px 14px; font-size: 14px; font-weight: 700; transition: .2s; display: flex; gap: 8px; }
    .sub-grid a::before { content: '›'; color: var(--accent); }
    .sub-grid a:hover { background: var(--bg-card-hov); border-color: var(--border); color: var(--accent-glow); }
    .shot-todo { border: 1px dashed var(--border); border-radius: var(--radius); padding: 26px 16px; margin: 0 0 22px; text-align: center; font-size: 13px; color: var(--text-muted); background: var(--bg-deep); }
    .draft-note { border: 1px solid var(--accent); background: rgba(217,174,74,.08); color: var(--text-sub); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 18px; font-size: 13px; }
    .shot { margin: 0 0 22px; }
    .shot img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border-soft); }
    .shot figcaption { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
    .sub-grid a .cnt { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
    .article-body p, .article-body li, .article-lead, .notice-text, .fold > summary { word-break: auto-phrase; text-wrap: pretty; }
    .side-list a.child { padding-left: 32px; font-size: 12.5px; }
