/* Base Styles & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9fb;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3 {
    color: #111;
    margin-bottom: 15px;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.8rem;
    margin-top: 30px;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
}

h3 {
    font-size: 1.3rem;
    margin-top: 25px;
}

p, ul, ol {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

ul, ol {
    padding-left: 40px;
}

li {
    margin-bottom: 10px;
}

hr {
    border: 0;
    height: 1px;
    background: #eaeaea;
    margin: 40px 0;
}

section[id] {
    scroll-margin-top: 24px;
}

/* Header & Footer */
.language-switcher {
    text-align: right;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #999;
}

.language-switcher a {
    color: #666;
    text-decoration: none;
    padding: 0 5px;
    transition: color 0.2s;
}

.language-switcher a:hover {
    color: #007aff;
}

.language-switcher a.active {
    font-weight: 600;
    color: #007aff;
}

.site-header {
    background-color: #fff;
    padding: 40px 0;
    border-bottom: 1px solid #eaeaea;
    text-align: center;
    margin-bottom: 40px;
}

.site-header p {
    color: #666;
    margin-bottom: 0;
}

.site-footer {
    background-color: #fff;
    padding: 40px 0;
    border-top: 1px solid #eaeaea;
    margin-top: 60px;
    text-align: center;
}

/* Chapter navigation */
.chapter-toc {
    background: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin: 30px 0 10px;
    padding: 18px 20px;
}

.chapter-toc-title {
    color: #111;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.chapter-toc ul {
    display: grid;
    gap: 8px 22px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    list-style: none;
    margin-bottom: 0;
    padding-left: 0;
}

.chapter-toc li {
    font-size: 1rem;
    margin-bottom: 0;
}

.chapter-toc a {
    color: #005bb5;
    text-decoration: none;
}

.chapter-toc a:hover,
.chapter-toc a:focus-visible {
    text-decoration: underline;
}

.back-to-contents {
    font-size: 0.95rem;
    margin: 28px 0 0;
    text-align: right;
}

.back-to-contents a {
    color: #005bb5;
    text-decoration: none;
}

.back-to-contents a::before {
    content: "↑ ";
}

.back-to-contents a:hover,
.back-to-contents a:focus-visible {
    text-decoration: underline;
}

/* Tables */
.feature-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.feature-table th, .feature-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eaeaea;
}

.feature-table th {
    background-color: #f2f2f7;
    font-weight: 600;
}

/* Images & Placeholders */
.responsive-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.manual-portrait-img {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 20px auto;
}

.image-placeholder {
    background-color: #e5e5ea;
    color: #666;
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    border: 2px dashed #c7c7cc;
    margin: 20px 0;
    font-weight: 500;
}

/* Blockquotes / Tips */
.tip {
    background-color: #e0f2fe;
    border-left: 4px solid #007aff;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    color: #0c4a6e;
}

/* Feedback Widget */
.feedback-widget h3 {
    margin-bottom: 15px;
}

.btn-feedback {
    background-color: #f2f2f7;
    border: 1px solid #d1d1d6;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 20px;
    cursor: pointer;
    margin: 0 5px;
    transition: background-color 0.2s;
}

.btn-feedback:hover {
    background-color: #e5e5ea;
}

.footer-note {
    margin-top: 30px;
    font-size: 0.9rem;
    color: #999;
}
