/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "Yu Gothic", sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #fff;
}

/* ===== Print / PDF styles ===== */
@media print {
    body { margin: 0; padding: 0; font-size: 10pt; }
    .cover-page { page-break-after: always; }
    .toc { page-break-after: always; }
    .section { page-break-inside: avoid; }
    .no-print { display: none !important; }
}

/* ===== Cover Page ===== */
.cover-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
    text-align: center;
    padding: 60px 40px;
}

.cover-page .logo-placeholder {
    width: 120px;
    height: 120px;
    margin-bottom: 40px;
}

.cover-page h1 {
    font-size: 2.4em;
    color: #485373;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.cover-page .subtitle {
    font-size: 1.3em;
    color: #555;
}

.cover-page .meta {
    font-size: 0.95em;
    color: #888;
    line-height: 2;
}

/* ===== Table of Contents ===== */
.toc {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px;
}

.toc h2 {
    font-size: 1.6em;
    color: #485373;
    border-bottom: 3px solid #485373;
    padding-bottom: 8px;
    margin-bottom: 24px;
}

.toc ol {
    list-style: none;
    padding: 0;
    counter-reset: toc-counter;
}

.toc > ol > li {
    counter-increment: toc-counter;
    margin-bottom: 6px;
}

.toc > ol > li > a {
    display: flex;
    align-items: baseline;
    text-decoration: none;
    color: #333;
    font-size: 1.05em;
    padding: 6px 0;
    border-bottom: 1px dotted #ddd;
}

.toc > ol > li > a::before {
    content: counter(toc-counter) ".";
    font-weight: bold;
    color: #485373;
    margin-right: 8px;
    min-width: 24px;
}

.toc > ol > li > a:hover {
    color: #485373;
}

.toc ol ol {
    padding-left: 32px;
    counter-reset: toc-sub-counter;
}

.toc ol ol li {
    counter-increment: toc-sub-counter;
    margin-bottom: 2px;
}

.toc ol ol li a {
    display: block;
    text-decoration: none;
    color: #555;
    font-size: 0.95em;
    padding: 3px 0;
}

.toc ol ol li a::before {
    content: counter(toc-counter) "." counter(toc-sub-counter) " ";
    color: #999;
    margin-right: 4px;
}

.toc ol ol li a:hover {
    color: #485373;
}

/* ===== Content Container ===== */
.content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* ===== Section ===== */
.section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 1.5em;
    color: #485373;
    border-bottom: 3px solid #485373;
    padding-bottom: 8px;
    margin-bottom: 20px;
    margin-top: 48px;
}

.subsection-title {
    font-size: 1.2em;
    color: #5a6485;
    border-left: 4px solid #5a6485;
    padding-left: 12px;
    margin-top: 32px;
    margin-bottom: 16px;
}

/* ===== Screenshot placeholder ===== */
.screenshot {
    display: block;
    width: 100%;
    max-width: 600px;
    min-height: 300px;
    margin: 20px auto;
    border: 2px solid #ccc;
    border-radius: 8px;
    background-color: #fafafa;
    position: relative;
}

.screenshot img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
}

.screenshot.small {
    max-width: 400px;
    min-height: 200px;
}

.screenshot.small::after {
    padding: 70px 20px;
}

.screenshot-caption {
    text-align: center;
    font-size: 0.85em;
    color: #888;
    margin-top: -12px;
    margin-bottom: 20px;
}

/* ===== Steps ===== */
.steps {
    counter-reset: step-counter;
    padding: 0;
    list-style: none;
}

.steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 40px;
    margin-bottom: 16px;
    min-height: 28px;
}

.steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 28px;
    height: 28px;
    background-color: #485373;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-size: 0.85em;
    font-weight: bold;
}

/* ===== Note / Tip / Warning ===== */
.note, .tip, .warning {
    padding: 14px 18px;
    margin: 16px 0;
    border-radius: 6px;
    font-size: 0.95em;
}

.note {
    background-color: #e3f2fd;
    border-left: 4px solid #1976d2;
}

.note::before {
    content: "ℹ ";
    font-weight: bold;
    color: #1976d2;
}

.tip {
    background-color: #e8f5e9;
    border-left: 4px solid #388e3c;
}

.tip::before {
    content: "✔ ";
    font-weight: bold;
    color: #388e3c;
}

.warning {
    background-color: #fff3e0;
    border-left: 4px solid #f57c00;
}

.warning::before {
    content: "⚠ ";
    font-weight: bold;
    color: #f57c00;
}

/* ===== Example box ===== */
.example {
    background-color: #f5f5f5;
    border-left: 4px solid #9e9e9e;
    padding: 12px 16px;
    margin: 12px 0;
    font-style: italic;
    color: #555;
}

.example::before {
    content: "例）";
    font-style: normal;
    font-weight: bold;
    color: #777;
}

/* ===== Table ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.95em;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px 14px;
    text-align: left;
}

th {
    background-color: #e8eaef;
    color: #485373;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #fafafa;
}

/* ===== Inline UI label ===== */
.ui-label {
    display: inline-block;
    background-color: #e8eaef;
    color: #485373;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    white-space: nowrap;
}

.btn-label {
    display: inline-block;
    background-color: #485373;
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    white-space: nowrap;
}

.btn-label.green {
    background-color: #388e3c;
}

.btn-label.red {
    background-color: #c62828;
}

/* ===== Kbd (keyboard) ===== */
kbd {
    display: inline-block;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 1px 6px;
    font-family: monospace;
    font-size: 0.9em;
}

/* ===== Separator ===== */
hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 40px 0;
}

/* ===== Back to TOC ===== */
.back-to-toc {
    display: block;
    text-align: right;
    margin-top: 24px;
    font-size: 0.9em;
}

.back-to-toc a {
    display: inline-block;
    color: #485373;
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: background-color 0.2s, border-color 0.2s;
}

.back-to-toc a:hover {
    background-color: #e8eaef;
    border-color: #485373;
}

@media print {
    .back-to-toc { display: none !important; }
}

/* ===== Links ===== */
a {
    color: #485373;
}

a:hover {
    color: #3d4460;
}