/* =========================================================================
   voxsheet docs — LINE Messaging API reference 風のシンプルな3カラム構成
   （左ナビ / 中央コンテンツ / 右TOC）。素の HTML/CSS/JS のみ。
   ========================================================================= */

:root {
    --accent: #06c755; /* LINE green 系のアクセント */
    --accent-dark: #05a648;
    --accent-soft: #e8f8ef;

    --text: #1f2d3d;
    --text-muted: #6b7785;
    --text-faint: #9aa5b1;

    --bg: #ffffff;
    --bg-soft: #fafbfc;
    --bg-sidebar: #fbfcfd;
    --border: #e6e9ed;
    --border-strong: #d3d9df;

    --code-bg: #f5f7f9;
    --code-block-bg: #1b2733;
    --code-block-text: #e7edf3;
    --code-token-key: #7ee0a6;
    --code-block-border: #0f1923;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

    --header-h: 56px;
    --sidebar-w: 290px;
    --toc-w: 230px;
    --content-max: 860px;

    --radius: 6px;
    --shadow-sm: 0 1px 2px rgba(15, 25, 35, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

/* ---------- ヘッダー ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    z-index: 40;
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.site-header .brand .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.site-header .brand .ver {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-dark);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 2px 8px;
    margin-left: 2px;
}

.site-header .spacer {
    flex: 1;
}

.site-header .header-links {
    display: flex;
    gap: 18px;
    font-size: 14px;
}

.site-header .header-links a {
    color: var(--text-muted);
    font-weight: 600;
}

.site-header .header-links a:hover {
    color: var(--text);
    text-decoration: none;
}

.lang-switch {
    display: inline-flex;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    overflow: hidden;
}

.lang-switch a {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg);
}

.lang-switch a:hover {
    color: var(--text);
    text-decoration: none;
    background: var(--bg-soft);
}

.lang-switch a.active {
    background: var(--accent);
    color: #fff;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    border-radius: var(--radius);
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: var(--text);
}

/* ---------- レイアウト ---------- */
.layout {
    display: flex;
    align-items: flex-start;
    max-width: 1440px;
    margin: 0 auto;
    padding-top: var(--header-h);
}

/* 左サイドバー */
.sidebar {
    position: sticky;
    top: var(--header-h);
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--bg-sidebar);
    padding: 22px 0 60px;
}

.sidebar .nav-group {
    margin-bottom: 4px;
}

.sidebar .nav-group > .group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 8px 22px;
    text-align: left;
}

.sidebar .nav-group > .group-title .chevron {
    transition: transform 0.15s ease;
    font-size: 10px;
    color: var(--text-faint);
}

.sidebar .nav-group.collapsed > .group-title .chevron {
    transform: rotate(-90deg);
}

.sidebar .nav-group.collapsed > ul {
    display: none;
}

.sidebar ul {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}

.sidebar li a {
    display: block;
    padding: 5px 22px 5px 26px;
    font-size: 13.5px;
    color: var(--text-muted);
    border-left: 2px solid transparent;
    line-height: 1.5;
}

.sidebar li a:hover {
    color: var(--text);
    background: var(--bg-soft);
    text-decoration: none;
}

.sidebar li a.active {
    color: var(--accent-dark);
    border-left-color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}

/* 中央コンテンツ */
.content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 30px 48px 120px;
}

.content-inner {
    max-width: var(--content-max);
    margin: 0 auto;
}

/* 右TOC */
.toc {
    position: sticky;
    top: var(--header-h);
    width: var(--toc-w);
    flex: 0 0 var(--toc-w);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 30px 20px 60px;
    font-size: 13px;
}

.toc .toc-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 10px;
}

.toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--border);
}

.toc li a {
    display: block;
    padding: 3px 0 3px 14px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--text-muted);
    line-height: 1.45;
}

.toc li.lvl-3 a {
    padding-left: 26px;
    font-size: 12.5px;
    color: var(--text-faint);
}

.toc li a:hover {
    color: var(--text);
    text-decoration: none;
}

.toc li a.active {
    color: var(--accent-dark);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* ---------- コンテンツ要素 ---------- */
.content h1 {
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.content .lead {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0 0 28px;
}

.content section {
    scroll-margin-top: calc(var(--header-h) + 16px);
    padding-top: 18px;
    margin-bottom: 12px;
}

.content h2 {
    font-size: 23px;
    font-weight: 700;
    margin: 30px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.01em;
}

.content h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 30px 0 10px;
    scroll-margin-top: calc(var(--header-h) + 16px);
}

.content h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 22px 0 8px;
    color: var(--text);
}

.content p {
    margin: 12px 0;
}

.content ul.bullets,
.content ol {
    margin: 12px 0;
    padding-left: 22px;
}

.content ul.bullets li,
.content ol li {
    margin: 5px 0;
}

.anchor-h {
    color: var(--text-faint);
    font-weight: 400;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.1s;
    font-size: 0.8em;
}

h2:hover .anchor-h,
h3:hover .anchor-h {
    opacity: 1;
}

/* インラインコード */
code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    color: #c7254e;
    white-space: nowrap;
}

/* コードブロック */
pre {
    position: relative;
    background: var(--code-block-bg);
    color: var(--code-block-text);
    border: 1px solid var(--code-block-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.65;
}

pre code {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    white-space: pre;
    font-size: 13px;
}

pre .lang-tag {
    position: absolute;
    top: 0;
    right: 52px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7e8c99;
    padding: 4px 8px;
}

.copy-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #c4cfda;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    font-size: 11px;
    font-family: var(--font-sans);
    padding: 3px 9px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.copy-btn.copied {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* パラメータテーブル（Property / Type / Description） */
.param-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.param-table th {
    text-align: left;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.param-table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    vertical-align: top;
}

.param-table td:first-child {
    white-space: nowrap;
}

.param-table .pname {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
}

.param-table .ptype {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--accent-dark);
    white-space: normal;
}

.req {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #c0392b;
    background: #fdecea;
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
}

.opt {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-faint);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
}

/* 補足ボックス */
.note {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 14px;
}

.note.warn {
    border-left-color: #e8a33d;
    background: #fdf6ec;
}

.note .note-title {
    font-weight: 700;
    margin-bottom: 2px;
}

/* キーボードキー */
kbd {
    font-family: var(--font-mono);
    font-size: 11.5px;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--text);
    white-space: nowrap;
}

/* テーブルのスクロール包み */
.table-wrap {
    overflow-x: auto;
}

/* ---------- レスポンシブ ---------- */
.backdrop {
    display: none;
}

@media (max-width: 1100px) {
    .toc {
        display: none;
    }
}

@media (max-width: 820px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        z-index: 35;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow-sm);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .backdrop.show {
        display: block;
        position: fixed;
        inset: var(--header-h) 0 0;
        background: rgba(15, 25, 35, 0.35);
        z-index: 34;
    }

    .content {
        padding: 24px 20px 100px;
    }

    .site-header .header-links {
        display: none;
    }
}
