* {
    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;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

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

.container {
    width: 94%;
    max-width: 1040px;
    margin: 0 auto;
}

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

.site-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}

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

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 600;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--primary);
}

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

main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    min-width: 0;
}

/* 左右フロート縦長広告（ビューポート画面基準で完全に両脇の余白へ配置） */
.side-ad {
    display: none;
}

@media (min-width: 1420px) {
    .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;
    }

    /* 画面中央(50%) - コンテンツ半幅(520px) - 広告幅(160px) - 余白(20px) = 700px */
    .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;
    }
}

/* 記事カード一覧（グリッド表示） */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

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

.article-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(255, 42, 116, 0.25);
}

.card-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%;
    background-color: #0f1016;
    overflow: hidden;
}

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

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

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

.badge {
    align-self: flex-start;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.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.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* 記事詳細スタイル */
.article-detail-box {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
}

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

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

.detail-title {
    font-size: 1.8rem;
    line-height: 1.35;
    margin: 0.8rem 0;
    overflow-wrap: anywhere;
    word-break: break-all;
}

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

.hero-thumb {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.content {
    font-size: 1.05rem;
    line-height: 1.8;
    overflow-wrap: anywhere !important;
    word-break: break-all !important;
    max-width: 100%;
}

.content p {
    overflow-wrap: anywhere !important;
    word-break: break-all !important;
    margin-bottom: 1.2rem;
}

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

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

/* アフィリエイトCTAボタンスタイル */
.dmm-affiliate-cta {
    display: block;
    width: 100%;
    max-width: 450px;
    margin: 2rem auto;
    padding: 1rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #ff2a74 0%, #e0004d 100%);
    color: #fff !important;
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(255, 42, 116, 0.4);
    transition: all 0.25s ease;
    overflow-wrap: anywhere;
    word-break: break-all;
}

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

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

.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: 2rem;
    border-radius: 12px;
}

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

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

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: #141620;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    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.5rem;
}

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

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

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