/* リセット・基本スタイル */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colors - 白ベース + 水色アクセント */
    --bg-main: #f8fafb;
    --bg-card: #ffffff;
    --bg-header: #f5f5f5;
    --text-dark: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --price-color: #e53935;
    --star-color: #ffb300;
    --rakuten-color: #bf0000;
    --room-color: #e91e8c;
    --border-color: #e8e8e8;
    --accent-color: #4facfe;

    /* Fonts */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Space Grotesk', 'Noto Sans JP', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;

    /* Shadows */
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    font-weight: 400;
}

/* ヘッダー */
header {
    text-align: center;
    padding: 4rem 1rem 3rem;
    background: var(--bg-header);
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
}

header h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 1rem;
}

.subtitle {
    font-family: var(--font-jp);
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.15em;
}

.sns-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.sns-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.sns-links a:hover {
    background: var(--text-dark);
    color: white;
    border-color: var(--text-dark);
    transform: translateY(-2px);
}

/* メインコンテンツ */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* 商品グリッド */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* 商品カード */
.link-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.link-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.link-card .image-container {
    position: relative;
    width: 100%;
    height: 280px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.link-card img {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.link-card:hover img {
    transform: scale(1.05);
}

.link-card .content {
    padding: 1.25rem;
}

.link-card .name {
    font-family: var(--font-jp);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-dark);
    /* 3行まで表示 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.3em;
    margin-bottom: 0.75rem;
}

.link-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.link-card .price {
    font-family: var(--font-jp);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--price-color);
}

.link-card .review {
    font-family: var(--font-jp);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.link-card .stars {
    color: var(--star-color);
    letter-spacing: -0.05em;
}

.link-card .badge-container {
    margin-top: 0.5rem;
}

.source-badge {
    font-family: var(--font-jp);
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.source-badge.rakuten {
    background: var(--rakuten-color);
    color: white;
}

.source-badge.room {
    background: var(--room-color);
    color: white;
}

/* ローディング */
.loading {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    font-family: var(--font-jp);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* エラー */
.error {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-radius: 12px;
    max-width: 500px;
    margin: 2rem auto;
    border: 1px solid var(--border-color);
}

/* 空状態 */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-family: var(--font-jp);
    font-size: 1rem;
}

/* フッター */
footer {
    text-align: center;
    padding: 3rem 1rem 4rem;
    color: var(--text-muted);
    background: var(--bg-main);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.pr-notice {
    font-family: var(--font-jp);
    font-size: 0.75rem;
    background: #f5f5f5;
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.last-updated {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.copyright {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* レスポンシブ */
@media (max-width: 768px) {
    header {
        padding: 3rem 1rem 2rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    main {
        padding: 1.5rem 1rem;
    }

    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1rem;
    }

    .link-card .image-container {
        height: 240px;
    }

    .link-card .content {
        padding: 1rem;
    }

    .link-card .price {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }

    .link-card .image-container {
        height: 260px;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.link-card {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.link-card:nth-child(1) { animation-delay: 0.05s; }
.link-card:nth-child(2) { animation-delay: 0.1s; }
.link-card:nth-child(3) { animation-delay: 0.15s; }
.link-card:nth-child(4) { animation-delay: 0.2s; }
.link-card:nth-child(5) { animation-delay: 0.25s; }
.link-card:nth-child(6) { animation-delay: 0.3s; }
.link-card:nth-child(7) { animation-delay: 0.35s; }
.link-card:nth-child(8) { animation-delay: 0.4s; }
.link-card:nth-child(9) { animation-delay: 0.45s; }
.link-card:nth-child(10) { animation-delay: 0.5s; }
.link-card:nth-child(n+11) { animation-delay: 0.55s; }
