/* Java Design Patterns - ダークテーマ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.8;
    color: #e0e0e0;
    background: #0a0a0f;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* SVG背景 */
.bg-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* パンくずリスト */
.breadcrumb {
    list-style: none;
    display: flex;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 30px;
    color: #888;
}

.breadcrumb li {
    display: inline;
}

.breadcrumb li:not(:last-child)::after {
    content: " >";
    margin-left: 8px;
    color: #555;
}

.breadcrumb a {
    color: #f89820;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 戻るリンク */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #5dade2;
    text-decoration: none;
}

.back-link:hover {
    color: #f89820;
}

/* 見出し */
h1 {
    font-size: 28px;
    color: #f89820;
    border-bottom: 2px solid #f89820;
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(248, 152, 32, 0.3);
}

h2 {
    font-size: 20px;
    color: #f89820;
    margin: 40px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

h3 {
    font-size: 16px;
    color: #5dade2;
    margin: 25px 0 10px;
}

h4 {
    font-size: 15px;
    color: #ccc;
    margin: 20px 0 10px;
}

/* 本文 */
p {
    font-size: 15px;
    color: #ccc;
    margin-bottom: 15px;
}

ul, ol {
    padding-left: 25px;
    margin: 10px 0;
    color: #ccc;
}

li {
    margin-bottom: 8px;
}

/* リンク */
a {
    color: #5dade2;
    text-decoration: none;
}

a:hover {
    color: #f89820;
    text-decoration: underline;
}

/* カテゴリラベル */
.category {
    display: inline-block;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 3px;
    margin-bottom: 15px;
    font-weight: bold;
}

.category-creational {
    background: rgba(248, 152, 32, 0.2);
    color: #f89820;
    border: 1px solid #f89820;
}

.category-structural {
    background: rgba(83, 130, 161, 0.2);
    color: #5dade2;
    border: 1px solid #5382a1;
}

.category-behavioral {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

/* 目次 */
.toc {
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid #333;
    padding: 20px 25px;
    margin-bottom: 30px;
}

.toc strong {
    color: #f89820;
    font-size: 14px;
}

.toc ol {
    margin: 15px 0 0;
    color: #ccc;
}

.toc a {
    color: #ccc;
}

.toc a:hover {
    color: #f89820;
}

/* コードブロック */
pre {
    background: #1a1a25;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
    margin: 15px 0;
}

code {
    font-family: 'Consolas', 'Monaco', monospace;
    background: rgba(248, 152, 32, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
    color: #f89820;
}

pre code {
    background: none;
    padding: 0;
    color: #e0e0e0;
}

/* 補足ボックス */
.note {
    background: rgba(83, 130, 161, 0.1);
    border-left: 3px solid #5382a1;
    padding: 15px;
    margin: 15px 0;
    font-size: 14px;
    color: #ccc;
}

/* プロンプトボックス */
.prompt-box {
    background: rgba(248, 152, 32, 0.08);
    border: 1px solid rgba(248, 152, 32, 0.3);
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.prompt-box h4 {
    margin: 0 0 15px;
    font-size: 14px;
    color: #f89820;
}

.prompt-box pre {
    background: #0a0a0f;
    margin: 10px 0 0;
}

/* 関連パターン */
.related {
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid #333;
    padding: 20px;
    margin: 30px 0;
}

.related h3 {
    margin: 0 0 15px;
    font-size: 14px;
    color: #f89820;
}

.related ul {
    margin: 0;
    padding-left: 20px;
}

/* フッター */
footer {
    margin-top: 50px;
    padding: 30px 20px;
    border-top: 1px solid #222;
    text-align: center;
    font-size: 13px;
    color: #666;
}

footer a {
    color: #888;
    margin: 0 10px;
}

footer a:hover {
    color: #f89820;
}

/* 広告コンテナ */
.ad-container {
    text-align: center;
    margin: 30px 0;
}

/* UML図 */
.uml-diagram {
    background: rgba(20, 20, 30, 0.6);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    min-height: 200px;
}

.uml-diagram img {
    max-width: 100%;
    height: auto;
}

/* 上に戻るボタン */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #f89820;
    color: #0a0a0f;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 50px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background 0.2s ease;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(248, 152, 32, 0.4);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #5382a1;
    color: #fff;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    pre {
        font-size: 12px;
        padding: 12px;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 12px;
    }
    
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 18px;
        line-height: 44px;
    }
}
