/* ==========================================================================
   ブログ用スタイル
   ========================================================================== */

/* ブログ2カラムレイアウト */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}

.blog-main {
    min-width: 0;
}

/* ========================================================================== */
/* サイドバーウィジェット */
/* ========================================================================== */

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    margin: 0;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
}

.widget-content {
    padding: 12px 16px;
}

.no-items {
    color: var(--text-light);
    font-size: 14px;
    text-align: center;
    margin: 0;
    padding: 8px 0;
}

/* カレンダーウィジェット */
.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.cal-nav a {
    color: var(--primary);
    text-decoration: none;
    padding: 4px 8px;
}

.cal-nav a:hover {
    background: var(--hover-bg);
    border-radius: 4px;
}

.mini-calendar {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: center;
}

.mini-calendar th {
    padding: 4px;
    font-weight: 500;
    color: var(--text-light);
}

.mini-calendar td {
    padding: 4px;
    color: var(--text);
}

.mini-calendar td.has-posts {
    background: var(--primary-light);
    border-radius: 4px;
}

.mini-calendar td.has-posts a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: block;
}

.mini-calendar td.has-posts a:hover {
    text-decoration: underline;
}

/* 最新記事ウィジェット */
.recent-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-posts-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.recent-posts-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-posts-list a {
    display: block;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
}

.recent-posts-list a:hover {
    color: var(--primary);
}

.recent-posts-list .post-date {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.recent-posts-list .draft-label {
    display: inline-block;
    font-size: 12px;
    padding: 1px 6px;
    background: var(--warning-bg);
    color: var(--warning);
    border-radius: 4px;
    margin-left: 4px;
}

/* カテゴリウィジェット */
.categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-list li {
    margin-bottom: 8px;
}

.categories-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 0;
}

.categories-list a:hover {
    color: var(--primary);
}

.categories-list .cat-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.categories-list .cat-count {
    color: var(--text-light);
    font-size: 12px;
    margin-left: auto;
}

/* アーカイブウィジェット */
.archives-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-year {
    margin-bottom: 8px;
}

.archive-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.archive-toggle:hover {
    color: var(--primary);
}

.archive-toggle .count {
    color: var(--text-light);
    font-weight: 400;
    margin-left: 4px;
}

.archive-toggle .toggle-icon {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.archive-year.open .toggle-icon {
    transform: rotate(90deg);
}

.archive-months {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
}

.archive-year.open .archive-months {
    display: block;
}

.archive-months li {
    margin: 4px 0;
}

.archive-months a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}

.archive-months a:hover {
    color: var(--primary);
}

.archive-months .count {
    color: var(--text-light);
    font-size: 12px;
}

/* 管理リンクウィジェット */
.admin-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-links li {
    margin-bottom: 8px;
}

.admin-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}

.admin-links a:hover {
    color: var(--primary);
}

/* ========================================================================== */
/* 記事一覧 */
/* ========================================================================== */

.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.blog-header h2 {
    margin: 0;
}

.btn-new-post {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-new-post:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.category-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-filter a {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.category-filter a:hover {
    background: var(--hover-bg);
}

.category-filter a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    background: var(--section-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 16px 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.post-card.draft {
    border-left: 4px solid var(--warning);
    opacity: 0.85;
}

.post-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1;
}

.post-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.post-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.draft-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: var(--warning-bg);
    color: var(--warning);
}

.post-excerpt {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 16px;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-posts-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

/* ========================================================================== */
/* 記事詳細 */
/* ========================================================================== */

.post-header {
    margin-bottom: 12px;
}

.post-detail-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.post-detail-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--text-light);
    font-size: 14px;
}

.post-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 24px 28px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}

/* ブログ記事内の段落間隔 */
.post-content p {
    margin-bottom: 24px;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* 改行タグの間隔（連続改行時に間隔を確保） */
.post-content br {
    display: block;
    content: "";
    margin-bottom: 10px;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 12px;
    padding-left: 14px;
    border-left: 4px solid var(--primary);
}

.post-content h1 {
    font-size: 26px;
    font-weight: 700;
}

.post-content h2 {
    font-size: 20px;
    font-weight: 600;
    border-left-color: var(--profit);
}

.post-content h3 {
    font-size: 18px;
    font-weight: 600;
    border-left-color: var(--warning);
}

/* タグのバッジスタイル */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.post-tags .tag {
    display: inline-block;
    padding: 4px 14px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-tags .tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* 壊れた画像を非表示 */
.post-content img:not([src]),
.post-content img[src=""],
.post-content img[src="x"] {
    display: none !important;
}

.post-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}


/* 銘柄リンク */
.stock-link {
    color: #3b82f6;
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stock-link:hover {
    color: #2563eb;
}

/* ========================================================================== */
/* 設定・編集ページ */
/* ========================================================================== */

.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.settings-card h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
}

.widget-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--section-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.widget-item.disabled {
    opacity: 0.5;
}

.widget-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.widget-order-buttons {
    display: flex;
    gap: 4px;
}

.order-btn {
    padding: 4px 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.order-btn:hover {
    background: var(--hover-bg);
}

.count-input {
    width: 60px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--section-bg);
    color: var(--text);
}

/* Quillエディタ */
.ql-container {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 16px;
}

.ql-editor {
    min-height: 300px;
}

/* フォームアクションボタン - PC用 */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.form-actions-row-1,
.form-actions-row-2 {
    display: flex;
    gap: 12px;
    justify-content: flex-end; /* PCでは右寄せが一般的だが、中央揃え希望？ひとまず右寄せか全体幅等のデフォルトに合わせる */
}

/* 削除・キャンセル（PCでは上に配置） */
.form-actions-row-2 {
    order: 1; /* PC: 上 */
    justify-content: space-between; /* 削除左、キャンセル右など */
}

.form-actions-row-1 {
    order: 2; /* PC: 下 */
    justify-content: flex-end;
}

/* 削除ボタンがない場合のデザイン調整 */
.form-actions-row-2:not(:has(.btn-danger)) {
    justify-content: flex-end;
}

/* 区切り線 */
.form-divider {
    order: 1; /* 無視される（display: noneなので） */
    display: none;
}

/* PC/モバイル切替表示（PCデフォルト） */
.pc-only {
    display: inline;
}

.mobile-only {
    display: none;
}

/* カレンダー挿入ボタン - PCでは全幅 */
.embed-btn-mobile-half {
    grid-column: span 2;
}

/* プレビュー行 - PCでは横並び */
.embed-btn-preview-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

/* 挿入ツール折りたたみ - PCでは常に表示 */
.embed-btn-accordion {
    margin-bottom: 8px;
}

.embed-btn-accordion-toggle {
    display: none;
}

/* PCでは常にグリッド表示（折りたたみ不要・detailsの状態に関係なく表示） */
.embed-btn-accordion .embed-btn-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
}


/* レスポンシブ */
@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* サイドバーをメインコンテンツの下に配置 */
    .blog-sidebar {
        order: 2;
        margin-top: 8px;
        min-width: 0;
    }

    .blog-main {
        order: 1;
    }

    /* ブログラッパーのパディング調整 */
    .blog-wrapper {
        padding: 16px !important;
    }

    /* ヘッダーの調整 */
    .blog-header {
        margin-bottom: 16px !important;
    }

    .blog-header h2 {
        font-size: 24px !important;
    }

    /* カテゴリフィルターの調整 */
    .category-filter {
        gap: 6px;
        margin-bottom: 16px;
        padding-bottom: 10px;
    }

    .category-filter a {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* 記事カードの調整 */
    .post-card {
        padding: 12px 14px !important;
    }

    .post-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .post-title {
        font-size: 15px !important;
    }

    .post-badges {
        align-self: flex-start;
    }

    .post-excerpt {
        font-size: 12px !important;
        -webkit-line-clamp: 3;
    }

    /* サムネイル付きカードのモバイル対応 */
    .post-card > div[style*="display: flex"][style*="align-items: center"] {
        flex-direction: row !important;
        gap: 12px !important;
    }

    /* サムネイルサイズの調整 */
    .post-thumbnail {
        width: 80px !important;
        height: 80px !important;
        flex-shrink: 0;
    }

    /* メタ情報の調整 */
    .post-meta {
        flex-wrap: wrap;
        gap: 8px !important;
        font-size: 11px !important;
    }

    /* サイドバーウィジェットの調整 */
    .sidebar-widget {
        border-radius: 10px;
    }

    .widget-title {
        font-size: 14px;
        padding: 10px 14px;
    }

    .widget-content {
        padding: 10px 14px;
    }

    /* 新規投稿ボタン - モバイルでは非表示 */
    .widget-new-post {
        display: none !important;
    }

    .btn-new-post {
        padding: 6px 12px !important;
        font-size: 14px !important;
    }

    /* 記事詳細ページ */
    .post-header {
        position: relative !important;
    }

    .post-header > a[href*="edit.php"] {
        position: static !important;
        display: block !important;
        width: fit-content !important;
        margin-bottom: 8px !important;
        margin-left: auto !important;
    }

    .post-detail-title {
        font-size: 22px !important;
        padding-right: 0 !important;
    }

    .post-content {
        padding: 0 !important;
        font-size: 15px !important;
    }

    /* 記事ラッパーのパディング調整 */
    .post-wrapper {
        padding: 16px 15px !important;
    }

    /* 投資損益カード - 縦並び・マージン縮小 */
    .profit-card-grid {
        flex-direction: column !important;
        gap: 6px !important;
    }

    .profit-card-grid-item {
        width: 100% !important;
        padding: 6px !important;
    }

    .profit-card-header {
        margin-bottom: 6px !important;
        padding-bottom: 6px !important;
    }

    .profit-card-type {
        margin-bottom: 0 !important;
    }

    /* 編集ページ - ボタン類の整理 */
    .embed-buttons {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .embed-btn-preview {
        width: 100% !important;
    }

    .embed-btn-preview-row {
        flex-direction: column !important;
    }

    .embed-btn-preview-row .embed-btn {
        width: 100% !important;
    }

    /* 挿入ツール折りたたみ - モバイルで有効 */
    .embed-btn-accordion-toggle {
        display: block !important;
        padding: 10px 16px;
        background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
        border: 1px solid var(--border);
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        color: var(--text);
        cursor: pointer;
        text-align: center;
        list-style: none;
        margin-bottom: 8px;
    }

    .embed-btn-accordion-toggle::-webkit-details-marker {
        display: none;
    }

    .embed-btn-accordion:not([open]) .embed-btn-grid {
        display: none !important;
    }

    .embed-btn-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .embed-btn {
        text-align: center !important;
        padding: 10px 8px !important;
        font-size: 12px !important;
    }
    
    /* PC/モバイル切替表示 */
    .pc-only {
        display: none !important;
    }
    
    .mobile-only {
        display: inline !important;
    }
    
    /* カレンダー挿入ボタンをモバイルでは半幅に */
    .embed-btn-mobile-half {
        grid-column: span 1 !important;
    }

    /* フォームアクションボタン */
    .form-actions {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* 下書きと公開を1列縦並び */
    .form-actions-row-1 {
        order: 0 !important;  /* モバイル時は先に表示 */
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .form-actions-row-1 .btn {
        width: 100% !important;
        text-align: center !important;
    }

    /* 区切り線 */
    .form-divider {
        display: block !important;
        border: none !important;
        border-top: 1px solid var(--border) !important;
        margin: 8px 0 !important;
        width: 100% !important;
    }

    /* 削除とキャンセルを2列横並び */
    .form-actions-row-2 {
        order: 2 !important;  /* モバイル時は後に表示 */
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .form-actions-row-2 .btn {
        flex: 1 !important;
        text-align: center !important;
    }

    /* サムネイル設定 - 縦並び中央揃え */
    .thumbnail-settings {
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
    }

    .thumbnail-buttons {
        align-items: stretch !important;
        width: 100% !important;
    }

    .thumbnail-buttons button {
        justify-content: center !important;
    }

    /* 編集ページヘッダー - 順序リセット */
    .calendar-header-row {
        order: unset !important;
        flex-direction: column !important;
        gap: 12px !important;
        margin-top: 10px !important;
    }

    .calendar-header-row .calendar-nav {
        order: unset !important;
    }

    .calendar-header-row .calendar-nav h2 {
        font-size: 22px !important;
        order: unset !important;
    }

    .calendar-header-row .btn-publish-header {
        width: 100% !important;
        justify-content: center !important;
    }

    /* 検索結果表示 */
    .search-result-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ========================================================================== */
/* SNS埋め込み */
/* ========================================================================== */

/* YouTube埋め込み */
.embed-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9アスペクト比 */
    margin: 20px 0;
    background: #000;
    border-radius: var(--card-radius);
    overflow: hidden;
}

.embed-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Twitter埋め込み */
.embed-twitter {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.embed-twitter .twitter-tweet {
    margin: 0 !important;
}

/* Instagram埋め込み */
.embed-instagram {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.embed-instagram .instagram-media {
    margin: 0 !important;
    max-width: 540px !important;
    min-width: 326px !important;
    width: calc(100% - 2px) !important;
}

/* ==========================================================================
   back-linkスタイル（ブログトップへ戻るリンク）
   ========================================================================== */
.back-link {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   目次（Table of Contents）スタイル
   ========================================================================== */
.toc-container {
    background: #fbfcfe;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 14px 24px;
    margin: 20px 0;
}

body[data-theme="dark"] .toc-container {
    background: #1e293b;
    border-color: #334155;
}

.toc-header {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

body[data-theme="dark"] .toc-header {
    color: #a5b4fc;
}

.toc-nav {
    margin: 0;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc-h1;
}

.toc-list li {
    margin: 0;
    padding: 0;
}

.toc-list li::before {
    display: none;
}

.toc-list a {
    display: block;
    padding: 3px 10px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
}

.toc-list a:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

body[data-theme="dark"] .toc-list a:hover {
    background: rgba(165, 180, 252, 0.15);
    color: #a5b4fc;
}

/* H1: 番号付き太字 */
.toc-list li:not(.toc-indent):not(.toc-indent-2) {
    counter-increment: toc-h1;
}

.toc-list li:not(.toc-indent):not(.toc-indent-2) a::before {
    content: counter(toc-h1) ". ";
    font-weight: 700;
    color: var(--text);
}

.toc-list li:not(.toc-indent):not(.toc-indent-2) a {
    font-weight: 600;
}

/* H2 */
.toc-list li.toc-indent a {
    padding-left: 28px;
    font-size: 13px;
    color: var(--text-light);
}

/* H3 */
.toc-list li.toc-indent-2 a {
    padding-left: 44px;
    font-size: 13px;
    color: var(--text-light);
}

/* ==========================================================================
   楽天商品カード（ショートコード [rakuten:...] 用）
   ========================================================================== */
.rakuten-card {
    margin: 16px 0;
    position: relative;
}

.rakuten-card-pr {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #fecaca;
    letter-spacing: 0.05em;
    z-index: 1;
}

.rakuten-card-link {
    display: flex;
    align-items: stretch;
    border: 1px solid #fecaca;
    border-radius: 12px;
    overflow: hidden;
    background: #fff5f5;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(191, 0, 0, 0.06);
}

.rakuten-card-link,
.rakuten-card-link * {
    text-decoration: none !important;
}

.rakuten-card-link:hover {
    box-shadow: 0 6px 20px rgba(191, 0, 0, 0.15);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text);
    border-color: #bf0000;
}

.rakuten-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    min-height: 140px;
    flex-shrink: 0;
    background: #fff;
    padding: 12px;
}

.rakuten-card-image img {
    max-width: 116px;
    max-height: 116px;
    object-fit: contain;
}

.rakuten-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 18px;
    flex: 1;
    min-width: 0;
    gap: 4px;
}

.rakuten-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.rakuten-card-price {
    font-size: 20px;
    font-weight: 700;
    color: #dc2626;
    letter-spacing: -0.02em;
}

.rakuten-card-shop {
    font-size: 12px;
    color: var(--text-light);
}

.rakuten-card-review {
    font-size: 12px;
    color: #f59e0b;
}

.rakuten-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, #bf0000, #e60012);
    border-radius: 6px;
    padding: 5px 14px;
    margin-top: 4px;
    font-weight: 600;
    width: fit-content;
    transition: background 0.2s ease;
}

.rakuten-card-link:hover .rakuten-card-badge {
    background: linear-gradient(135deg, #d40000, #ff1a2e);
}

.rakuten-badge-icon {
    font-size: 14px;
}

/* ダークテーマ */
body[data-theme="dark"] .rakuten-card-link {
    background: rgba(191, 0, 0, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
}

body[data-theme="dark"] .rakuten-card-pr {
    color: rgba(220, 38, 38, 0.3);
}

body[data-theme="dark"] .rakuten-card-image {
    background: #1e293b;
}

body[data-theme="dark"] .rakuten-card-price {
    color: #f87171;
}

body[data-theme="dark"] .rakuten-card-badge {
    background: linear-gradient(135deg, #991b1b, #dc2626);
}

body[data-theme="dark"] .rakuten-card-link:hover .rakuten-card-badge {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .rakuten-card-image {
        width: 100px;
        min-height: 100px;
        padding: 8px;
    }

    .rakuten-card-image img {
        max-width: 84px;
        max-height: 84px;
    }

    .rakuten-card-info {
        padding: 10px 12px;
    }

    .rakuten-card-title {
        font-size: 13px;
    }

    .rakuten-card-price {
        font-size: 17px;
    }
}

/* ==========================================================================
   OGPリンクカード
   ========================================================================== */

.ogp-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0;
    background: var(--card-bg, #ffffff);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.ogp-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.ogp-card-link {
    display: flex;
    gap: 0;
    text-decoration: none !important;
    color: inherit !important;
}

.ogp-card-image {
    flex-shrink: 0;
    width: 200px;
    min-height: 120px;
    max-height: 160px;
    overflow: hidden;
    background: var(--hover-bg, #f1f5f9);
}

.ogp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ogp-card-body {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ogp-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #1e293b);
    line-height: 1.45;
    margin-bottom: 6px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ogp-card-description {
    font-size: 13px;
    color: var(--text-light, #64748b);
    line-height: 1.5;
    margin-bottom: 8px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ogp-card-site {
    font-size: 12px;
    color: var(--text-light, #94a3b8);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ogp-card-favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* OGPカード - ミニマル版（OGPデータなし時） */
.ogp-card-minimal {
    border-style: dashed;
}

.ogp-card-minimal .ogp-card-body {
    padding: 12px 16px;
}

/* OGPカード - レスポンシブ */
@media (max-width: 768px) {
    .ogp-card-link {
        flex-direction: column;
    }

    .ogp-card-image {
        width: 100%;
        min-height: 0;
        height: 160px;
    }

    .ogp-card-body {
        padding: 12px 14px;
    }

    .ogp-card-title {
        font-size: 14px;
    }

    .ogp-card-description {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
}