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

/* XREA等の強制挿入広告・余白の完全消去 */
#vdbanner,
div#vdbanner,
body > div#vdbanner,
div[id="vdbanner"] {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
}

:root {
    --bg-dark: #12131a;
    --card-bg: #1e202d;
    --primary: #ff2a74;
    --primary-hover: #ff4785;
    --accent: #9d4edd;
    --text-main: #f0f2f5;
    --text-muted: #9aa0a6;
    --border-color: #2b2e3f;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
}

/* ヘッダー */
header {
    background: #1b1c27;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 12px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* サイトタイトルの改行禁止 */
.site-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
    white-space: nowrap;
    display: inline-block;
}

.site-title span {
    color: var(--primary);
}

/* ナビゲーションメニュー */
nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
}

nav::-webkit-scrollbar {
    display: none;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.84rem;
    padding: 0.35rem 0.55rem;
    border-radius: 4px;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

nav a:hover,
nav a.active {
    color: var(--primary) !important;
    background-color: rgba(255, 42, 116, 0.12);
}

@media (min-width: 768px) {
    header {
        padding: 1rem 0;
    }
    .container {
        padding: 0 20px;
    }
    .site-title {
        font-size: 1.6rem;
    }
    nav {
        gap: 1.2rem;
        overflow-x: visible;
    }
    nav a {
        font-size: 0.95rem;
        padding: 0.35rem 0.65rem;
    }
}

/* メインコンテンツ配置 */
.layout-wrapper {
    width: 100%;
    flex: 1;
}

main.container {
    padding-top: 1.2rem;
    padding-bottom: 3rem;
}

/* 左右フロート縦長広告（PC専用） */
.side-ad {
    display: none;
}

@media (min-width: 1420px) {
    main.container {
        padding-top: 1.6rem;
        padding-bottom: 3.5rem;
    }
    .side-ad {
        display: block !important;
        position: fixed !important;
        top: 100px !important;
        width: 160px !important;
        height: 600px !important;
        background: #181924;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
        text-align: center;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        z-index: 90 !important;
    }

    .side-ad-left {
        left: calc(50% - 700px) !important;
        right: auto !important;
    }

    .side-ad-right {
        right: calc(50% - 700px) !important;
        left: auto !important;
    }

    .side-ad-label {
        display: none !important;
    }

    .side-ad-content {
        width: 160px;
        height: 600px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

/* 記事カードグリッド（モバイル1列・タブレット2列・PC3列） */
.article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
    width: 100%;
}

@media (min-width: 600px) {
    .article-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 900px) {
    .article-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.4rem;
    }
}

.article-card {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(255, 42, 116, 0.2);
}

/* アイキャッチ画像ラッパー（モバイル・PC共通で比率固定＆はみ出し完全防止） */
.card-thumb-wrapper {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 0;
    padding-top: 56.25%; /* 16:9 固定 */
    background-color: #0f1016;
    overflow: hidden;
}

.card-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.article-card:hover .card-thumb-wrapper img {
    transform: scale(1.04);
}

.card-body {
    padding: 0.95rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.badge {
    display: inline-block;
    align-self: flex-start;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 0.8rem;
    overflow-wrap: break-word;
    word-break: break-word;
    line-break: strict;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--primary);
}

.card-meta {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
}

/* 記事詳細スタイル */
.article-detail-box {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (min-width: 768px) {
    .article-detail-box {
        padding: 2.2rem;
    }
}

.detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
}

.detail-title {
    font-size: 1.2rem;
    line-height: 1.4;
    margin: 0.5rem 0;
    overflow-wrap: break-word;
    word-break: break-word;
    line-break: strict;
}

@media (min-width: 768px) {
    .detail-title {
        font-size: 1.65rem;
    }
}

.hero-thumb {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 440px;
    object-fit: contain;
    background: #000;
    border-radius: 6px;
    margin: 0 auto 1.4rem;
}

/* 記事本文の文字組み・折り返し */
.content {
    font-size: 0.96rem;
    line-height: 1.75;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    line-break: strict;
    max-width: 100%;
}

.content p {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    line-break: strict;
    margin-bottom: 1.05rem;
}

.content hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 1.4rem 0;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
}

/* アフィリエイトCTAボタン */
.dmm-affiliate-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    margin: 1.8rem auto;
    padding: 0.9rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, #ff2a74 0%, #e0004d 100%);
    color: #fff !important;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 42, 116, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (min-width: 768px) {
    .dmm-affiliate-cta {
        padding: 1rem 1.5rem;
        font-size: 1.15rem;
    }
}

.dmm-affiliate-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 42, 116, 0.6);
}

/* ボタン & フォーム */
.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    text-align: center;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #373b52;
}

.btn-secondary:hover {
    background: #464b69;
}

.btn-danger {
    background: #e0245e;
}

.btn-danger:hover {
    background: #c51f52;
}

/* 管理画面・お問い合わせ */
.admin-box, .contact-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.1rem;
    border-radius: 10px;
}

@media (min-width: 768px) {
    .admin-box, .contact-box {
        padding: 2rem;
    }
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 0.7rem;
    background: #141620;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 180px;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.2rem;
    font-size: 0.85rem;
}

table.admin-table th, table.admin-table td {
    border: 1px solid var(--border-color);
    padding: 0.6rem;
    text-align: left;
}

table.admin-table th {
    background-color: #171822;
}

footer {
    background-color: #0d0e14;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}