/* ===========================================
   Paper Summary DB — Plugin Styles
   ★ すべて .psdb- プレフィクス付きなので
     既存テーマのスタイルと衝突しません
   =========================================== */

/* --- コンテナ --- */
.psdb-wrap {
    max-width: 860px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.psdb-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

/* --- 統計バー --- */
.psdb-stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    background: #eff6ff;
    border-radius: 10px;
}

.psdb-stat {
    text-align: center;
}

.psdb-stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #2563eb;
    line-height: 1.2;
}

.psdb-stat-label {
    font-size: 0.75rem;
    color: #64748b;
}

/* --- 検索フォーム --- */
.psdb-search-form {
    max-width: 100%;
    margin: 0 0 1.5rem;
}

.psdb-search-row {
    display: flex;
    gap: 0.5rem;
}

.psdb-search-input {
    flex: 1;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s;
}

.psdb-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.psdb-search-btn {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.psdb-search-btn:hover {
    background: #1d4ed8;
}

/* --- 詳細フィルター --- */
.psdb-advanced-toggle {
    margin-top: 0.6rem;
}

.psdb-advanced-toggle summary {
    cursor: pointer;
    color: #6b7280;
    font-size: 0.88rem;
    user-select: none;
}

.psdb-advanced-toggle summary:hover {
    color: #374151;
}

.psdb-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 0.75rem;
    margin-top: 0.6rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.psdb-filter-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.psdb-filter-group select,
.psdb-filter-group input[type="number"] {
    width: 100%;
    padding: 0.45rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.88rem;
    background: #fff;
}

/* --- キーワードクラウド --- */
.psdb-keyword-cloud {
    margin-bottom: 1.5rem;
}

.psdb-cloud-label {
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.psdb-cloud-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* --- キーワードタグ (共通) --- */
.psdb-keyword-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.78rem;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    line-height: 1.5;
}

.psdb-keyword-tag:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.psdb-keyword-tag sup {
    font-size: 0.65em;
    margin-left: 0.15em;
    opacity: 0.7;
}

/* --- 結果ヘッダー --- */
.psdb-results-header {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.psdb-results-header strong {
    color: #111827;
}

/* --- 論文カード --- */
.psdb-paper-list {
    /* リストコンテナ */
}

.psdb-paper-card {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.psdb-paper-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.psdb-card-title {
    margin: 0 0 0.4rem !important;
    font-size: 1.1rem !important;
    line-height: 1.45;
    font-weight: 600;
}

.psdb-card-title a {
    color: #1e3a5f !important;
    text-decoration: none !important;
}

.psdb-card-title a:hover {
    color: #2563eb !important;
}

.psdb-paper-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    font-size: 0.83rem;
    color: #6b7280;
    margin-bottom: 0.6rem;
}

.psdb-paper-excerpt {
    font-size: 0.92rem;
    color: #374151;
    line-height: 1.7;
    margin-bottom: 0.6rem;
}

.psdb-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.psdb-empty {
    text-align: center;
    color: #9ca3af;
    padding: 3rem 0;
}

/* --- ページネーション --- */
.psdb-pagination {
    text-align: center;
    margin-top: 2rem;
}

.psdb-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.psdb-pagination .page-numbers {
    display: inline-block;
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    background: #f3f4f6;
    font-size: 0.88rem;
}

.psdb-pagination .page-numbers.current {
    background: #2563eb;
    color: #fff;
}

.psdb-pagination .page-numbers:hover:not(.current) {
    background: #e5e7eb;
}

/* --- 個別ページ --- */
.psdb-breadcrumb {
    margin-bottom: 1.25rem;
}

.psdb-breadcrumb a {
    font-size: 0.88rem;
    color: #6b7280;
    text-decoration: none;
}

.psdb-breadcrumb a:hover {
    color: #2563eb;
}

.psdb-single-title {
    font-size: 1.4rem !important;
    line-height: 1.5;
    margin-bottom: 1rem !important;
    font-weight: 700;
    color: #1e293b;
}

.psdb-single-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.psdb-single-meta dt {
    font-weight: 600;
    color: #475569;
}

.psdb-single-meta dd {
    margin: 0;
    color: #1e293b;
}

.psdb-single-meta a {
    color: #2563eb;
}

.psdb-single-content {
    line-height: 1.85;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.psdb-single-notes {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: #fefce8;
    border-left: 4px solid #facc15;
    border-radius: 0 8px 8px 0;
}

.psdb-single-notes h3 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    color: #854d0e;
}

.psdb-single-notes p {
    margin: 0;
    line-height: 1.7;
}

.psdb-post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    font-size: 0.88rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.psdb-post-nav a {
    color: #6b7280;
    text-decoration: none;
}

.psdb-post-nav a:hover {
    color: #2563eb;
}

/* --- レスポンシブ --- */
@media (max-width: 600px) {
    .psdb-search-row {
        flex-direction: column;
    }
    .psdb-filters {
        grid-template-columns: 1fr;
    }
    .psdb-paper-meta {
        flex-direction: column;
        gap: 0.2rem;
    }
    .psdb-single-meta {
        grid-template-columns: 1fr;
    }
    .psdb-stats-bar {
        gap: 1rem;
    }
}
