/* style.css */

/* --- Custom Properties (Theme Variables) --- */
:root {
    /* 目に優しく温かみのあるカラーパレット */
    --color-primary: #e67e22;       /* 暖かみのあるオレンジ */
    --color-primary-dark: #d35400;  /* オレンジの濃い色 */
    --color-secondary: #27ae60;     /* 自然を感じるグリーン */
    --color-background: #fdfbf7;    /* アイボリー系・用紙のような背景色 */
    --color-surface: #ffffff;
    --color-text-main: #4a4036;     /* 真っ黒ではなく、柔らかいブラウンがかったダークグレー */
    --color-text-light: #7f7366;
    --color-border: #e8e1d5;
    
    /* フォント設定 (Kiwi Maruで見出しを柔らかく、本文はNoto) */
    --font-heading: 'Kiwi Maru', serif;
    --font-body: 'Noto Sans JP', sans-serif;
    
    /* その他 */
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(74, 64, 54, 0.05);
    --shadow-md: 0 4px 16px rgba(74, 64, 54, 0.1);
    
    --ad-bg: #f0f0f0;               /* 広告枠が目立ちすぎない薄いグレー */
}

/* --- Base --- */
body {
    background-color: var(--color-background);
    color: var(--color-text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text-main);
    margin-top: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Ads Placeholders --- */
.ad-placeholder {
    display: none;
}

.header-ad {
    max-width: 728px;
    height: 90px;
}

.content-ad, .infeed-ad {
    width: 100%;
    min-height: 120px;
}

.sidebar-ad {
    width: 100%;
    min-height: 250px;
}

.sidebar-ad.sticky {
    position: sticky;
    top: 20px;
    min-height: 600px;
}

/* --- Header --- */
.site-header {
    background-color: var(--color-surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.4rem;
    margin: 0;
    color: var(--color-primary);
    font-family: var(--font-heading);
}

.global-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.global-nav a {
    color: var(--color-text-main);
    font-weight: 500;
}

.global-nav a:hover {
    color: var(--color-primary);
}

/* --- Hero --- */
.hero {
    background-color: #faf5eb;
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.hero h2 {
    font-size: 2.2rem;
    line-height: 1.4;
    margin-bottom: 20px;
    color: var(--color-primary-dark);
}

.hero p {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(230, 126, 34, 0.3);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(230, 126, 34, 0.4);
}

/* --- Main Layout --- */
.main-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 15px 20px 40px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* --- Sections --- */
.section-title {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
    margin-bottom: 25px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 20%;
    height: 2px;
    background-color: var(--color-primary-dark);
}

/* --- Category Grid --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    color: inherit;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    color: inherit;
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.category-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: var(--color-text-main);
}

.category-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin: 0;
}

/* --- Recent Updates --- */
.update-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.update-list li {
    border-bottom: 1px solid var(--color-border);
    padding: 15px 0;
}

.update-list li a {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--color-text-main);
}

.update-list li a:hover {
    background-color: rgba(230, 126, 34, 0.03);
    color: var(--color-primary);
}

.date {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    white-space: nowrap;
}

.tag-building { background-color: #e67e22; }
.tag-electrical { background-color: #f1c40f; color: #333; }
.tag-sanitation { background-color: #3498db; }
.tag-hvac { background-color: #2ecc71; }

/* --- Search Forms --- */
.hero-search {
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-radius: 30px;
    background: #fff;
}

.hero-search-input {
    flex: 1;
    border: 1px solid var(--color-border);
    padding: 14px 20px;
    border-radius: 30px 0 0 30px;
    outline: none;
    font-size: 1rem;
    color: var(--color-text-main);
    transition: border-color 0.2s;
}

.hero-search-input:focus {
    border-color: var(--color-primary);
}

.hero-search-btn {
    border: none;
    border-radius: 0 30px 30px 0;
    padding: 0 30px;
    font-size: 1.05rem;
    cursor: pointer;
}

.sidebar-search {
    display: flex;
}

.sidebar-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px 0 0 4px;
    outline: none;
}

.sidebar-search-input:focus {
    border-color: var(--color-primary);
}

.sidebar-search-btn {
    background-color: var(--color-text-light);
    color: #fff;
    border: none;
    padding: 0 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    min-width: 60px;
}

.sidebar-search-btn:hover {
    background-color: var(--color-primary);
}

/* --- Sidebar Widget --- */
.sidebar-widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    border-left: 4px solid var(--color-primary);
    padding-left: 10px;
}

.keyword-tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tags li a {
    display: block;
    padding: 5px 12px;
    background-color: #f5eedf;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--color-text-main);
}

.keyword-tags li a:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* --- Footer --- */
.site-footer {
    background-color: #3e362e;
    color: #dfd8cf;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 30px;
}

.footer-info h2 {
    color: #fff;
    margin-bottom: 15px;
    font-family: var(--font-heading);
}

.footer-info p {
    font-size: 0.9rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #dfd8cf;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--color-primary);
}

.copyright {
    text-align: center;
    font-size: 0.85rem;
}

/* --- Article Styles --- */
.article-content {
    background: var(--color-surface);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

.article-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 20px;
}

/* --- Table of Contents (TOC) --- */
#toc-container {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: 4px;
    padding: 25px 35px;
    margin: 40px 0;
    box-shadow: none;
}

.toc-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-main);
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dotted #ccc;
    letter-spacing: 0.2em;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.toc-list li.toc-h2 {
    font-weight: 700;
    margin-top: 15px;
    font-size: 1rem;
}

.toc-list li.toc-h3 {
    padding-left: 1.5em;
    font-size: 0.9rem;
    color: var(--color-text-light);
    position: relative;
}

.toc-list li.toc-h3::before {
    content: "・";
    position: absolute;
    left: 0.2em;
    color: #bbb;
}

.toc-list a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.toc-list a:hover {
    color: var(--color-primary-dark);
    border-bottom: 1px dashed var(--color-primary-dark);
}

.article-title {
    font-size: 2rem;
    color: var(--color-primary-dark);
    margin-bottom: 15px;
    line-height: 1.3;
}

.title-catchphrase {
    display: block;
    font-size: 0.55em;
    color: var(--color-text-main);
    margin-top: 5px;
}

.article-meta {
    display: flex;
    gap: 15px;
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.article-section {
    margin-bottom: 40px;
}

.article-content h2 {
    font-size: 1.5rem;
    color: var(--color-text-main);
    border-left: 5px solid var(--color-primary);
    padding-left: 15px;
    margin-top: 30px;
    margin-bottom: 20px;
    line-height: 1.4;
    scroll-margin-top: 90px;
}

.article-content h3 {
    font-size: 1.25rem;
    color: var(--color-secondary);
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 8px;
    scroll-margin-top: 90px;
}

.article-content p {
    margin-bottom: 15px;
}

.article-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.article-content li {
    margin-bottom: 8px;
}

.price-box {
    background: #fdf8f4;
    border: 1px solid #f3dac6;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
}

.price-box h4 {
    margin-top: 0;
    color: var(--color-primary-dark);
}

.alert-box {
    background: #fff5f5;
    border-left: 4px solid #e74c3c;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* --- FAQ Styles --- */
.faq-category {
    margin-bottom: 30px;
}

.article-content .faq-category-title {
    font-family: 'Noto Sans JP', sans-serif !important;
    font-weight: 500 !important;
    font-size: 1.05rem !important;
    background: var(--color-text-main);
    color: #fff !important;
    padding: 6px 15px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    border-bottom: none !important;
    line-height: 1.5 !important;
}

.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    padding: 20px;
    background: #fff;
}

.faq-q {
    font-weight: bold;
    color: var(--color-primary-dark);
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    font-size: 1.05rem;
}

.faq-q::before {
    content: "Q.";
    color: var(--color-primary);
    font-size: 1.2em;
    line-height: 1;
}

.faq-a {
    margin-bottom: 0;
    padding-left: 28px;
    position: relative;
}

.faq-a::before {
    content: "A.";
    color: var(--color-text-light);
    font-weight: bold;
    font-size: 1.1em;
    position: absolute;
    left: 0;
    top: 0;
    line-height: 1.5;
}

/* --- Glossary Term Link --- */
.term-link {
    color: var(--color-primary-dark);
    text-decoration: none;
    border-bottom: 1px dashed var(--color-primary);
    padding-bottom: 1px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: help;
}

.term-link:hover {
    color: var(--color-primary);
    background-color: rgba(230, 126, 34, 0.1);
    border-bottom-style: solid;
}

/* --- Glossary Page Styles --- */
.glossary-index {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    background: #fdf8f4;
    padding: 20px;
    border-radius: var(--border-radius);
}

.glossary-index a {
    display: inline-block;
    padding: 5px 15px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--color-text-main);
}

.glossary-index a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.glossary-section {
    margin-top: 40px;
}

.glossary-section h3 {
    font-size: 1.4rem;
    color: #fff;
    background: #7f7366;
    padding: 8px 15px;
    border-radius: 4px;
    margin-bottom: 25px;
}

.term-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--color-border);
    scroll-margin-top: 90px; /* アンカージャンプでヘッダーに隠れないように */
}

.term-item:last-child {
    border-bottom: none;
}

.term-item h4 {
    font-size: 1.25rem;
    color: var(--color-primary-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.term-reading {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: normal;
    background: #f5eedf;
    padding: 2px 10px;
    border-radius: 12px;
}

.term-desc {
    margin-bottom: 0;
    line-height: 1.7;
}

/* --- Contact Form Styles --- */
.contact-form-container {
    background: #fdf8f4;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text-main);
}

.form-group label .required {
    font-size: 0.75rem;
    color: #fff;
    background-color: #e74c3c;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text-main);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
    outline: none;
}

.form-group textarea {
    resize: vertical;
}

.form-submit {
    text-align: center;
    margin-top: 30px;
}

.form-submit button {
    font-size: 1.1rem;
    padding: 15px 40px;
    cursor: pointer;
    border: none;
}

/* --- Subcategory Accordion Styles --- */
.subcategory-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.subcategory-details {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.subcategory-details summary {
    padding: 15px 20px;
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--color-primary-dark);
    background-color: #fdf8f4;
    cursor: pointer;
    list-style: none; /* デフォルトの三角を消す */
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.subcategory-details summary::-webkit-details-marker {
    display: none; /* Safari用 */
}

/* カスタムの開閉アイコン */
.subcategory-details summary::after {
    content: "▼";
    font-size: 0.9rem;
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

.subcategory-details[open] summary::after {
    transform: rotate(180deg);
}

.subcategory-details summary:hover {
    background-color: #fcebd9;
}

/* 展開されるコンテンツ部分 */
.subcategory-content {
    padding: 15px 20px;
    border-top: 1px solid var(--color-border);
    animation: fadeInDown 0.3s ease forwards;
}

/* 開いたときのアニメーション用 */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* update-listを枠内でキレイに見せるための調整 */
.subcategory-content .update-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* --- Image Placeholders (将来の画像挿入用・現在は非表示) --- */
.image-placeholder {
    display: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .header-ad {
        /* スマホ向けにヘッダーバナーを非表示、もしくはサイズリサイズなどを検討 */
        display: none; 
    }
}


/* --- Recent Updates (index.html) --- */
.recent-updates {
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
}
.update-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px 10px;
    border-bottom: 1px dashed var(--color-border);
    color: var(--color-text-main);
    text-decoration: none;
    transition: background-color 0.2s ease, padding-left 0.2s ease;
}
.update-item:hover {
    background-color: rgba(230, 126, 34, 0.05);
    padding-left: 15px;
    color: var(--color-primary);
}
.update-item:last-child {
    border-bottom: none;
}
.update-date {
    font-size: 0.85em;
    color: var(--color-text-light);
    white-space: nowrap;
}
.update-category {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}
.update-title {
    flex: 1;
    font-size: 0.95em;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .update-title {
        flex-basis: 100%;
        margin-top: 5px;
    }
}




/* --- Hero Image Updates (index.html) --- */
.hero-inner-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
.hero-text-vertical {
    text-align: center;
}
.hero-image-vertical {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 800px;
}
.hero-image-vertical img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.hero-actions-vertical {
    width: 100%;
    margin-top: 10px;
}

/* Maintain original hero center alignment */
.hero h2 {
    margin-bottom: 20px;
    color: var(--color-primary-dark);
}
.hero-search {
    margin: 0 auto;
}

@media (max-width: 900px) {
    .hero-inner-vertical {
        gap: 20px;
    }
}


/* --- Hero Background Layout (index.html) --- */
.hero-with-bg {
    background-image: url('../img/hero-image.png');
    background-color: var(--color-bg); /* #faf5eb */
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    z-index: 1;
    padding: 80px 0; /* Add more padding so background is visible */
    border-bottom: none;
}
.hero-with-bg::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Soft white/ivory overlay */
    background: rgba(250, 245, 235, 0.85);
    z-index: -1;
}

.hero-inner-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
.hero-text-vertical {
    text-align: center;
}
/* Ensure text has good contrast */
.hero-with-bg h2 {
    color: var(--color-primary-dark);
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}
.hero-with-bg p {
    color: var(--color-text-main);
    font-weight: 500;
}
.hero-actions-vertical {
    width: 100%;
    margin-top: 10px;
}

/* Article Hero Image */
.article-image {
    width: 100%;
    margin: 1.5rem 0 2.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.article-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 3;
    object-fit: cover;
    object-position: center;
    display: block;
}

.tag-exterior { background-color: #8b4513; }
.tag-law { background-color: #e74c3c; }
.tag-chemical { background-color: #9b59b6; }
.tag-qualification { background-color: #1abc9c; }
.tag-tools { background-color: #34495e; }
.tag-equipment { background-color: #7f8c8d; }
.tag-other { background-color: #95a5a6; }
.tag-others { background-color: #95a5a6; }

/* 記事内のテーブルスタイル */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.article-content th,
.article-content td {
    border: 1px solid #cbd5e1;
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
}
.article-content th {
    background-color: #f1f5f9;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}
.article-content tr:nth-child(even) {
    background-color: #f8fafc;
}
.article-content tr:hover {
    background-color: #f1f5f9;
}

/* --- Breadcrumb --- */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

nav.breadcrumb ol {
    list-style: none;
    list-style-type: none;
    padding: 0;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: ">";
    margin: 0 8px;
    color: #ccc;
    font-size: 0.8em;
}

.breadcrumb a {
    color: var(--color-text-light);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb li:last-child {
    color: var(--color-text-main);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

/* --- Related Articles --- */
.related-articles {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--color-border);
}

.related-articles h2 {
    font-size: 1.3rem;
    color: var(--color-text-main);
    margin-bottom: 20px;
    border-left: 5px solid var(--color-primary);
    padding-left: 15px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.related-card {
    display: block;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 15px;
    color: var(--color-text-main);
    transition: all 0.2s ease;
    text-decoration: none;
}

.related-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
    color: var(--color-text-main);
}

.related-card .related-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    color: #fff;
    display: inline-block;
    margin-bottom: 6px;
}

.related-card .related-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
    .breadcrumb li:last-child {
        max-width: 200px;
    }
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(230, 126, 34, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.45);
}

/* --- Hamburger Menu --- */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 110;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text-main);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .global-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--color-surface);
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        transition: right 0.3s ease;
        z-index: 105;
        padding-top: 80px;
    }

    .global-nav.open {
        right: 0;
    }

    .global-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0 20px;
    }

    .global-nav li {
        border-bottom: 1px solid var(--color-border);
    }

    .global-nav a {
        display: block;
        padding: 15px 0;
        font-size: 1rem;
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 100;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-overlay.visible {
        opacity: 1;
        visibility: visible;
    }
}

/* --- SNS Share Buttons --- */
.share-buttons {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.share-buttons p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 10px;
}

.share-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.share-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.share-list a:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    color: #fff;
}

.share-x { background: #000; }
.share-facebook { background: #1877F2; }
.share-line { background: #06C755; }
.share-copy { background: var(--color-text-light); cursor: pointer; }
.share-copy.copied { background: var(--color-secondary); }

/* --- Print Styles --- */
@media print {
    .site-header,
    .hamburger,
    .nav-overlay,
    .ad-placeholder,
    .sidebar,
    .back-to-top,
    .share-buttons,
    .related-articles,
    .breadcrumb,
    .site-footer,
    #toc-container {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
        line-height: 1.6;
    }

    .main-wrapper {
        display: block;
        padding: 0;
    }

    .article-content {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        max-width: 100%;
    }

    .article-title {
        font-size: 1.5rem;
        color: #000;
    }

    .article-content h2 {
        border-left: 3px solid #333;
        color: #000;
        page-break-after: avoid;
    }

    .article-content h3 {
        color: #333;
        page-break-after: avoid;
    }

    .faq-item {
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .tag {
        border: 1px solid #333;
        color: #333 !important;
        background: none !important;
    }
}

/* --- Dark Mode --- */
[data-theme="dark"] {
    --color-primary: #f0923a;
    --color-primary-dark: #e67e22;
    --color-secondary: #2ecc71;
    --color-background: #1a1a2e;
    --color-surface: #222240;
    --color-text-main: #e0ddd5;
    --color-text-light: #a09a8f;
    --color-border: #3a3a52;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --ad-bg: #2a2a42;
}

[data-theme="dark"] .site-header {
    background-color: #1e1e36;
}

[data-theme="dark"] .hero,
[data-theme="dark"] .hero-with-bg {
    background-color: #1e1e36;
}

[data-theme="dark"] .faq-item {
    background: #2a2a42;
}

[data-theme="dark"] .glossary-index {
    background: #2a2a42;
}

[data-theme="dark"] .glossary-section h3 {
    background: #3a3a52;
}

[data-theme="dark"] .contact-form-container {
    background: #2a2a42;
}

[data-theme="dark"] .price-box {
    background: #2a2a42;
    border-color: var(--color-border);
}

[data-theme="dark"] .keyword-tags li a {
    background-color: #3a3a52;
    color: var(--color-text-main);
}

[data-theme="dark"] .related-card {
    background: #2a2a42;
}

[data-theme="dark"] .site-footer {
    background-color: #12121e;
}

[data-theme="dark"] .article-content table {
    background-color: #2a2a42;
}

[data-theme="dark"] .article-content th {
    background-color: #3a3a52;
    color: var(--color-text-main);
}

[data-theme="dark"] .article-content tr:nth-child(even) {
    background-color: #2e2e48;
}

[data-theme="dark"] .article-content tr:hover {
    background-color: #3a3a52;
}

[data-theme="dark"] .article-content th,
[data-theme="dark"] .article-content td {
    border-color: #3a3a52;
}

[data-theme="dark"] .hero-search-input {
    background: #2a2a42;
    color: var(--color-text-main);
    border-color: var(--color-border);
}

.theme-toggle {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
    z-index: 89;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.theme-toggle:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* --- Reading Progress Bar --- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    z-index: 200;
    transition: width 0.1s linear;
}

/* --- Popular Articles Section --- */
.popular-articles {
    margin-top: 20px;
}

.popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: popular;
}

.popular-list li {
    counter-increment: popular;
    border-bottom: 1px solid var(--color-border);
}

.popular-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: var(--color-text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.popular-list li a:hover {
    color: var(--color-primary);
}

.popular-list li a::before {
    content: counter(popular);
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-light);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popular-list li:nth-child(1) a::before {
    background: #e67e22;
    color: #fff;
}

.popular-list li:nth-child(2) a::before {
    background: #95a5a6;
    color: #fff;
}

.popular-list li:nth-child(3) a::before {
    background: #cd7f32;
    color: #fff;
}

.popular-title {
    font-size: 0.9rem;
    line-height: 1.4;
}

.popular-cat {
    font-size: 0.7rem;
    color: var(--color-text-light);
    display: block;
    margin-top: 2px;
}


/* === References Section === */
.references-section {
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 0 8px 8px 0;
}

.references-section h2 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.references-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.references-list li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: #555;
    border-bottom: 1px dashed #e0e0e0;
    line-height: 1.6;
}

.references-list li:last-child {
    border-bottom: none;
}

.references-list li::before {
    content: "\1F4D6  ";
}
