/* === Reset & Base (Mobile First: 375px) === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', YuGothic, Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f4f5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px;
}

/* === Header === */
header {
    background-color: #fff;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

h1 {
    color: #42b8c3;
    font-size: 20px;
    margin-bottom: 12px;
}

/* === Language Nav (details/summary) === */
.lang-nav {
    position: relative;
    display: inline-block;
}

.lang-nav summary {
    padding: 6px 14px;
    background-color: #42b8c3;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.lang-nav summary::-webkit-details-marker {
    display: none;
}

.lang-nav summary::after {
    content: ' ▼';
    font-size: 10px;
}

.lang-nav[open] summary::after {
    content: ' ▲';
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e0e6e8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 100;
    min-width: 140px;
    padding: 4px 0;
}

.lang-dropdown a {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
}

.lang-dropdown a:hover {
    background-color: #e8f4f5;
}

/* === Tabs === */
.tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    background-color: #fff;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-btn {
    padding: 10px 16px;
    background-color: #f0f4f5;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
}

.tab-btn:hover {
    background-color: #d1ecee;
    border-color: #42b8c3;
}

.tab-btn.active {
    background-color: #42b8c3;
    color: white;
    border-color: #42b8c3;
}

/* === Content === */
.content {
    background-color: #fff;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

h2 {
    color: #42b8c3;
    margin-bottom: 16px;
    font-size: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0f5f6;
}

/* === Accordion (using details/summary) === */
.accordion-item {
    border: 1px solid #e0e6e8;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-header {
    background-color: #f8fafa;
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.5;
    transition: background-color 0.3s;
    gap: 10px;
    list-style: none;
}

.accordion-header::-webkit-details-marker {
    display: none;
}

.accordion-header:hover {
    background-color: #e8f4f5;
}

.accordion-icon {
    transition: transform 0.3s;
    font-size: 10px;
    flex-shrink: 0;
    color: #42b8c3;
}

.accordion-item[open] .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    padding: 14px 16px;
    font-size: 14px;
    border-top: 1px solid #e0f5f6;
}

.accordion-body p {
    margin-bottom: 10px;
}

.accordion-body ol, .accordion-body ul,
.page-content ol, .page-content ul {
    margin: 10px 0 10px 20px;
    padding-left: 0;
}

.accordion-body li,
.page-content li {
    margin-bottom: 5px;
}

.accordion-body strong,
.page-content strong {
    color: #2c3e50;
}

.accordion-body img,
.page-content > img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* === Table === */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    overflow-x: auto;
    display: block;
    font-size: 13px;
}

table thead {
    background-color: #e0f5f6;
}

table th, table td {
    border: 1px solid #d0e0e2;
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
}

table th {
    font-weight: 600;
    color: #2c3e50;
}

/* === Code === */
pre {
    background-color: #f5f8f9;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0;
    border-left: 4px solid #42b8c3;
    font-size: 12px;
}

code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

/* === Tablet: 768px === */
@media (min-width: 768px) {
    .container {
        padding: 20px;
    }

    header {
        padding: 24px;
        border-radius: 12px;
        margin-bottom: 16px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .lang-nav summary {
        padding: 8px 16px;
        font-size: 14px;
    }

    .tabs {
        flex-direction: row;
        gap: 10px;
        padding: 14px;
        margin-bottom: 16px;
    }

    .tab-btn {
        flex: 1;
        padding: 12px 20px;
        font-size: 15px;
    }

    .content {
        padding: 24px;
        border-radius: 12px;
    }

    h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .accordion-header {
        padding: 16px 20px;
        font-size: 15px;
    }

    .accordion-body {
        font-size: 15px;
    }

    .accordion-body img {
        max-width: 80%;
    }

    table {
        font-size: 14px;
    }

    table th, table td {
        padding: 10px 14px;
    }

    pre {
        padding: 16px;
        font-size: 13px;
    }

    code {
        font-size: 13px;
    }
}

/* === PC: 1024px === */
@media (min-width: 1024px) {
    .container {
        padding: 30px;
    }

    header {
        padding: 28px 32px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 26px;
    }

    .lang-nav summary {
        padding: 8px 20px;
        font-size: 14px;
    }

    .tabs {
        padding: 16px;
        gap: 12px;
        margin-bottom: 20px;
    }

    .tab-btn {
        padding: 14px 24px;
        font-size: 16px;
        border-radius: 10px;
    }

    .content {
        padding: 32px;
    }

    h2 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .accordion-item {
        margin-bottom: 10px;
    }

    .accordion-header {
        padding: 18px 24px;
        font-size: 16px;
    }

    .accordion-body {
        font-size: 15px;
    }

    .accordion-body img {
        max-width: 60%;
    }

    table {
        font-size: 15px;
    }

    table th, table td {
        padding: 12px 16px;
    }

    pre {
        padding: 18px;
        font-size: 14px;
    }

    code {
        font-size: 14px;
    }
}
