/* Base styles */
/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Noto+Sans+JP:wght@100..900&display=swap');

:root {
    --color-canvas-default: #ffffff;
    --color-canvas-subtle: #f6f8fa;
    --color-border-default: #d0d7de;
    --color-border-muted: hsla(210,18%,87%,1);
    --color-accent-fg: #0969da;
    --color-fg-default: #1F2328;
    --color-fg-muted: #656d76;
    --color-header-bg: #f6f8fa;
    --base-font: Barlow,"Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --mono-font: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Base layout */
body {
    font-family: var(--base-font);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-fg-default);
    background-color: var(--color-canvas-default);
    min-width: 320px;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
}

/* Container and row setup */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
}

/* Main content wrapper */
.main-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Main container for horizontal layout */
.main-container {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

/* Header styling */
#title-block-header {
    margin: 0 0 2rem 0;
    padding: 0;
}

/* TOC sidebar styles */
.toc-sidebar {
    width: 250px;
    min-width: 250px;
    position: sticky;
    top: 1rem;
    background: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-muted);
    border-radius: 6px;
    padding: 1rem;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.toc-sidebar .toc-title {
    margin: 0 0 1rem 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-fg-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toc-toggle {
    background: none;
    border: none;
    color: var(--color-fg-muted);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 3px;
    font-size: 16px;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.toc-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--color-fg-default);
}

.toc-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.toc-content.collapsed {
    max-height: 0;
    margin: 0;
    padding: 0;
}

/* Content area */
.content {
    flex: 1;
    min-width: 0;
    max-width: 800px;
}

/* TOC content */
nav#TOC {
}

/* TOC content with tighter spacing */
nav#TOC ul {
    padding: 0;
    margin: 0;
    line-height: 1.3;
    list-style-type: none;
}

nav#TOC li {
    margin: 0.2em 0;
}

nav#TOC ul ul {
    padding-left: 1.2em;
    margin: 0;
}

nav#TOC a {
    padding: 0.1em 0.3em;
    margin: 0;
    color: var(--color-fg-default);
    text-decoration: none;
    display: block;
    border-radius: 3px;
    transition: background-color 0.1s ease-out;
}

nav#TOC a:hover {
    background-color: rgba(0,0,0,0.05);
    text-decoration: none;
}

/* Grid system */
.span3 {
    width: 260px;
    padding: 0 1rem;
    box-sizing: border-box;
}

.span9 {
    width: calc(100% - 260px);
    max-width: 800px;
    padding: 1.5rem 1rem 0;
    box-sizing: border-box;
}

.span12 {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem 0;
    box-sizing: border-box;
}

/* Navbar styling */
.navbar {
    background-color: var(--color-canvas-subtle);
    border-bottom: 1px solid var(--color-border-default);
    margin-bottom: 1rem;
}

.navbar-inner {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doc-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-fg-default);
}

.nav.pull-right {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-text {
    margin: 0;
    color: var(--color-fg-muted);
}

/* Removed old TOC styles - using nav#TOC styles instead */

/* Removed TOC scroll bar styling - not needed for normal scroll */

/* Responsive layout */
@media (max-width: 768px) {
    body {
        max-width: 100%;
        padding: 0.5rem;
    }
    nav#TOC {
        margin: 0 0 1.5rem 0;
        padding: 1rem;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 32px;
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.25;
}

h1 {
    font-size: 2em;
    padding-bottom: .3em;
    border-bottom: 1px solid var(--color-border-muted);
}

h2 {
    font-size: 1.5em;
    margin-top: 64px;
    padding-bottom: .3em;
    border-bottom: 1px solid var(--color-border-muted);
}

h3 { font-size: 1.25em; margin-top: 48px; }
h4 { font-size: 1em; }
h5 { font-size: 0.875em; }
h6 { font-size: 0.85em; color: var(--color-fg-muted); }

/* Links */
a {
    color: var(--color-accent-fg);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Paragraphs and lists */
p {
    margin-top: 0;
    margin-bottom: 16px;
}

ul, ol {
    margin-top: 0;
    margin-bottom: 16px;
    padding-left: 2em;
}

li + li {
    margin-top: 0.25em;
}

/* Code blocks */
pre {
    padding: 16px;
    overflow: auto;
    font-family: var(--mono-font);
    font-size: 85%;
    line-height: 1.45;
    background-color: var(--color-canvas-subtle);
    border-radius: 6px;
    margin-bottom: 16px;
}

code {
    font-family: var(--mono-font);
    font-size: 85%;
    padding: 0.2em 0.4em;
    margin: 0;
    background-color: var(--color-canvas-subtle);
    border-radius: 6px;
}

pre code {
    padding: 0;
    margin: 0;
    background-color: transparent;
    border: 0;
}

/* Tables */
table {
    display: block;
    width: 100%;
    width: max-content;
    max-width: 100%;
    overflow: auto;
    margin-top: 0;
    margin-bottom: 16px;
    border-spacing: 0;
    border-collapse: collapse;
}

/* Override col width specifications to allow natural table sizing */
table col {
    width: auto !important;
}

table th {
    font-weight: 600;
}

table th, table td {
    padding: 6px 13px;
    border: 1px solid var(--color-border-default);
}

table tr {
    background-color: var(--color-canvas-default);
    border-top: 1px solid var(--color-border-muted);
}

table tr:nth-child(2n) {
    background-color: var(--color-canvas-subtle);
}

/* Blockquotes */
blockquote {
    padding: 0 1em;
    color: var(--color-fg-muted);
    border-left: 0.25em solid var(--color-border-default);
    margin: 0 0 16px 0;
}

blockquote > :first-child {
    margin-top: 0;
}

blockquote > :last-child {
    margin-bottom: 0;
}

/* Horizontal rule */
hr {
    height: .25em;
    padding: 0;
    margin: 24px 0;
    background-color: var(--color-border-default);
    border: 0;
}

/* Images */
img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Alert containers */
.tip, .note, .warning, .important, .caution {
    margin: 1.5em 0;
    padding: 1em;
    border-radius: 6px;
    border-left: 4px solid;
    background-color: var(--color-canvas-subtle);
}

/* Title styling for all alerts */
.tip .title, .note .title, .warning .title, 
.important .title, .caution .title {
    font-weight: 600;
    margin-bottom: 0.5em;
    text-transform: uppercase;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

/* Specific styles for each alert type */
.tip {
    border-left-color: #238636;
    background-color: #dafbe1;
}

.tip .title p::before {
    content: "💡";
    margin-right: 0.5em;
}

.tip .title p {
    color: #238636;
    margin: 0;
}

.note {
    border-left-color: #2f81f7;
    background-color: #f6f8fa;
}

.note .title p::before {
    content: "📝";
    margin-right: 0.5em;
}

.note .title p {
    color: #2f81f7;
    margin: 0;
}

.warning {
    border-left-color: #d29922;
    background-color: #fff8c5;
}

.warning .title p::before {
    content: "⚠️";
    margin-right: 0.5em;
}

.warning .title p {
    color: #d29922;
    margin: 0;
}

.important {
    border-left-color: #cf222e;
    background-color: #ffebe9;
}

.important .title p::before {
    content: "❗";
    margin-right: 0.5em;
}

.important .title p {
    color: #cf222e;
    margin: 0;
}

.caution {
    border-left-color: #bf8700;
    background-color: #fff8c5;
}

.caution .title p::before {
    content: "🔥";
    margin-right: 0.5em;
}

.caution .title p {
    color: #bf8700;
    margin: 0;
}

/* Alert content styling */
.tip p, .note p, .warning p, 
.important p, .caution p {
    margin: 0;
    line-height: 1.6;
}

.tip p:last-child, .note p:last-child, 
.warning p:last-child, .important p:last-child, 
.caution p:last-child {
    margin-bottom: 0;
}/* ...既存のコード... */

/* Removed duplicate nav#TOC styles - unified above */

/* Removed nav#TOC scrollbar styling - not needed for normal scroll */

/* Removed redundant responsive code */

/* Keyboard shortcuts */
kbd {
    display: inline-block;
    padding: 3px 5px;
    font: 11px var(--mono-font);
    line-height: 10px;
    color: var(--color-fg-default);
    vertical-align: middle;
    background-color: var(--color-canvas-subtle);
    border: solid 1px var(--color-border-muted);
    border-bottom-color: var(--color-border-default);
    border-radius: 6px;
    box-shadow: inset 0 -1px 0 var(--color-border-default);
}

/* Details & Summary */
details {
    margin: 0 0 16px 0;
}

summary {
    cursor: pointer;
}

/* Responsive design for small screens */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .main-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .toc-sidebar {
        width: 100%;
        min-width: auto;
        position: static;
        order: -1;
        margin: 0;
        box-sizing: border-box;
    }
    
    .content {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .toc-content {
        max-height: 0;
        margin: 0;
        padding: 0;
    }
    
    .toc-content:not(.collapsed) {
        max-height: 1000px;
        margin-top: 1rem;
        padding: 0;
    }
    
    .toc-toggle {
        display: block;
    }
}

/* Print styles */
@media print {
    body {
        background-color: var(--color-canvas-default);
        color: var(--color-fg-default);
    }
    
    a {
        color: var(--color-accent-fg);
        text-decoration: underline;
    }
    
    .toc-sidebar {
        display: none;
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .content {
        max-width: 100%;
    }
}

/* Footer styles */
.footer {
    margin-top: 4rem;
    padding: 2rem 0 1rem;
    border-top: 1px solid var(--color-border-muted);
    background-color: var(--color-canvas-subtle);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--color-fg-muted);
}

.footer-copyright p {
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.footer-links a {
    color: var(--color-fg-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--color-fg-default);
}

.footer-links svg {
    transition: transform 0.2s ease;
}

.footer-links a:hover svg {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}