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

body {
    font-family: 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro', Arial, sans-serif;
    background-color: #fff;
    color: #333;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: Arial, sans-serif;
    font-weight: bold;
}

/* ===== HEADER ===== */
header {
    background-color: #fff;
    color: #000;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    height: 30px;
    width: auto;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: #000;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.7;
}

.hamburger {
    display: none;
}

@media (max-width: 640px) {
    /* ハンバーガー非表示・navを常時表示 */
    .hamburger { display: none; }
    nav {
        display: flex;
        gap: 0;
    }
    nav a {
        font-size: 13px;
    }
}

/* ===== HERO ===== */
.hero {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px 30px;
}

.main-title {
    font-size: 140px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    letter-spacing: 4px;
    margin-bottom: 10px;
    line-height: 1;
}

/* D-E-S-I-G-N T-O-O-L-S 各文字色 */
.main-title .c1  { color: #f94144; }
.main-title .c2  { color: #f3722c; }
.main-title .c3  { color: #f8961e; }
.main-title .c4  { color: #f9844a; }
.main-title .c5  { color: #c8a800; }
.main-title .c6  { color: #6a9e4d; }
.main-title .c7  { color: #43aa8b; }
.main-title .c8  { color: #4d908e; }
.main-title .c9  { color: #577590; }
.main-title .c10 { color: #277da1; }

.subtitle {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    font-family: 'Hiragino Kaku Gothic Pro', Arial, sans-serif;
}

@media (max-width: 768px) {
    .main-title { font-size: 80px; }
    .subtitle { font-size: 14px; }
}
@media (max-width: 480px) {
    .main-title { font-size: 64px; }
}

/* ===== CATEGORY TABS ===== */
.category-tabs {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    background-color: #fff;
}

.category-tab {
    background-color: #666;
    color: #fff;
    padding: 9px 14px;
    cursor: pointer;
    border: none;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.3s;
}

.category-tab:hover { opacity: 0.85; }
.category-tab.active { background-color: #000; }

/* 各カテゴリータブの色（パレット順） */
.category-tab[data-category="color"]     { background-color: #f94144; }
.category-tab[data-category="font"]      { background-color: #f3722c; }
.category-tab[data-category="ai"]        { background-color: #f8961e; }
.category-tab[data-category="app"]       { background-color: #f9844a; }
.category-tab[data-category="material"]  { background-color: #c8a800; }
.category-tab[data-category="prototype"] { background-color: #6a9e4d; }
.category-tab[data-category="image"]     { background-color: #43aa8b; }
.category-tab[data-category="code"]      { background-color: #4d908e; }
.category-tab[data-category="preview"]   { background-color: #577590; }
.category-tab[data-category="mobile"]    { background-color: #277da1; }
.category-tab[data-category="premium"]   { background-color: #f94144; }
.category-tab[data-category="free"]      { background-color: #f3722c; }

/* ===== MAIN CONTENT ===== */
.main-content {
    width: 100%;
    padding: 0;
}

/* ===== CATEGORY SECTION ===== */
.category-section {
    width: 100%;
    padding: 0 0 30px;
    border-top: none;
}

.category-header {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px 10px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: transparent;
    box-sizing: border-box;
}

.category-header .cat-title {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 80px;
    color: rgba(255,255,255,0.38);
    letter-spacing: 4px;
    line-height: 1;
}

.category-header .cat-subtitle {
    font-family: 'Hiragino Kaku Gothic Pro', Arial, sans-serif;
    font-size: 19px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .category-header {
        padding: 16px 16px 10px;
        margin-bottom: 16px;
    }
    .category-header .cat-title { font-size: 52px; }
    .category-header .cat-subtitle { font-size: 12px; }
}

/* ===== TOOLS GRID ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-height: 700px;
    overflow: hidden;
    transition: max-height 0.5s ease;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.tools-grid.expanded {
    max-height: none;
    overflow: visible;
}

@media (max-width: 1200px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .tools-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px)  { .tools-grid { grid-template-columns: 1fr; } }

/* ===== TOOL ITEM ===== */
.tool-item {
    border: 1px solid #ddd;
    padding: 16px;
    background-color: #fff;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 200px;
    overflow: visible;
}

.tool-item:hover {
    border-color: #aaa;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

/* ===== PRICE BADGE（リボン型 ∧ノッチ） ===== */
.tool-price-badge {
    position: absolute;
    top: 0;
    right: 12px;
    padding: 10px 10px 22px;
    font-size: 11px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: #fff;
    text-align: center;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
    min-width: 46px;
    line-height: 1.3;
    z-index: 1;
}

.price-free-badge { background-color: #29acd9; }
.price-paid-badge { background-color: #e8000d; }

/* ===== FAVORITE BUTTON ===== */
.tool-favorite-btn {
    position: absolute;
    top: 46px;
    right: 12px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #ccc;
    transition: all 0.3s;
    line-height: 1;
    z-index: 2;
    width: 46px;
    text-align: center;
}

.tool-favorite-btn:hover { color: #d94f00; transform: scale(1.2); }
.tool-favorite-btn.active { color: #d94f00; }

/* ===== CARD LINK ===== */
a.tool-item {
    text-decoration: none;
    color: inherit;
    display: flex;
}

/* ===== カテゴリーバッジ（PC：左上長方形・常時表示） ===== */
.tool-category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    font-size: 9px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: #fff;
    border-radius: 3px;
    z-index: 2;
    letter-spacing: 0.5px;
    white-space: nowrap;
    pointer-events: none;
    display: inline-block;
}

/* 検索結果グリッド */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1400px;
    margin: 16px auto 0;
    padding: 0 20px;
    box-sizing: border-box;
}

@media (max-width: 1200px) { .search-results-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { 
    .search-results-grid { 
        grid-template-columns: 1fr; 
        gap: 8px;
        padding: 0 10px;
    } 
}

/* ===== 検索中の戻るボタン ===== */
.search-back-btn {
    display: none;
    margin: 24px auto;
    padding: 12px 30px;
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #999;
    font-size: 13px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-weight: bold;
    transition: all 0.3s;
}

.search-back-btn.visible {
    display: block;
}

.search-back-btn:hover { 
    background-color: #000;
    color: #fff;
    border-color: #000;
    transform: scale(1.05); 
}
.badge-color     { background-color: #f94144; }
.badge-font      { background-color: #f3722c; }
.badge-ai        { background-color: #f8961e; }
.badge-app       { background-color: #f9844a; }
.badge-material  { background-color: #c8a800; }
.badge-prototype { background-color: #6a9e4d; }
.badge-image     { background-color: #43aa8b; }
.badge-code      { background-color: #4d908e; }
.badge-preview   { background-color: #577590; }
.badge-mobile    { background-color: #277da1; }
.badge-premium   { background-color: #f94144; }
.badge-free      { background-color: #f3722c; }

@media (max-width: 768px) {
    /* SP：バッジをツール名の上にblock表示 */
    .tool-category-badge {
        position: static;
        clip-path: none;
        display: inline-block;
        padding: 2px 8px;
        font-size: 9px;
        border-radius: 3px;
        margin-bottom: 6px;
        pointer-events: none;
        min-width: auto;
        white-space: nowrap;
    }
    .tool-header .tool-header-content {
        flex: 1;
    }
}

/* ===== TOOL HEADER ===== */
.tool-header {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    padding-right: 30px;
    margin-top: 20px;
}

.tool-logo {
    width: 44px;
    height: 44px;
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.tool-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.tool-header-content {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 17px;
    margin-bottom: 2px;
    color: #111;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-url {
    font-size: 11px;
    color: #bbb;
    font-family: Arial, sans-serif;
}

.tool-tagline {
    font-size: 13px;
    color: #d94f00;
    font-family: 'Hiragino Kaku Gothic Pro', Arial, sans-serif;
    font-weight: bold;
    margin-bottom: 6px;
    line-height: 1.4;
}

.tool-description {
    font-size: 11px;
    color: #999;
    line-height: 1.7;
    flex-grow: 1;
}

/* ===== SP版コンパクトカード ===== */
@media (max-width: 768px) {
    /* ロゴサイズ元indexと同じ */
    .logo img { height: 24px; }

    .tools-grid {
        gap: 8px;
        padding: 0 10px;
        /* SP版カード途中フェードアウト */
        -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
        mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    }

    .tools-grid.expanded {
        -webkit-mask-image: none;
        mask-image: none;
    }

    .tool-item {
        padding: 10px 8px 10px 8px;
        min-height: unset;
    }

    /* SP版バッジ: padding 6px+font 9px*1.3+16px ≒ 28px → ★はtop:29px */
    .tool-price-badge {
        right: 6px;
        padding: 6px 7px 14px;
        min-width: 34px;
        font-size: 9px;
        line-height: 1.3;
    }

    .tool-favorite-btn {
        top: 33px !important;
        bottom: auto !important;
        right: 3px;
        font-size: 18px;
        width: 34px;
        text-align: center;
    }

    .tool-header {
        gap: 6px;
        margin-bottom: 6px;
        margin-top: 4px;
        padding-right: 22px;
    }

    .tool-logo {
        width: 32px;
        height: 32px;
        border-radius: 6px;
    }

    .tool-logo img {
        width: 22px;
        height: 22px;
    }

    .tool-name { font-size: 12px; }
    .tool-url { font-size: 9px; }
    .tool-tagline { font-size: 11px; margin-bottom: 4px; }
    .tool-description { font-size: 10px; line-height: 1.5; }

    /* SP版もっと見るボタン → PC TOPボタンと同じ配色 */
    .more-button {
        background-color: rgba(255,255,255,0.25) !important;
        color: #fff !important;
        border: 1px solid rgba(255,255,255,0.5) !important;
    }

    .more-button:hover {
        background-color: rgba(255,255,255,0.4) !important;
    }
}

/* ===== MORE BUTTON ===== */
.more-button {
    display: block;
    margin: 24px auto;
    padding: 12px 30px;
    background-color: #000;
    color: #fff;
    border: none;
    font-size: 13px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-weight: bold;
    transition: all 0.3s;
}

.more-button:hover { background-color: #333; transform: scale(1.05); }
.more-button.hidden { display: none; }

/* ===== PC版 トップに戻るボタン ===== */
.back-to-top-pc {
    display: block;
    margin: 0 auto 20px;
    padding: 10px 24px;
    background-color: rgba(255,255,255,0.25);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.5);
    font-size: 12px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s;
    max-width: 160px;
    text-align: center;
}

.back-to-top-pc:hover {
    background-color: rgba(255,255,255,0.4);
}

@media (max-width: 768px) {
    .back-to-top-pc { display: none; }
}

/* ===== SP版 フロートボタン ===== */
.back-to-top-float {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 999;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.back-to-top-float.visible {
    display: flex;
}

.back-to-top-float:hover {
    background-color: rgba(0,0,0,0.8);
}

@media (min-width: 769px) {
    .back-to-top-float { display: none !important; }
}

/* ===== 価格注釈 ===== */
.price-note {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-family: 'Hiragino Kaku Gothic Pro', Arial, sans-serif;
    text-align: center;
    padding: 8px 20px;
    max-width: 1400px;
    margin: 0 auto;
    display: block;
}

/* ===== AD SPACE ===== */
.ad-space {
    height: 100px;
    margin: 0 auto;
    max-width: 1400px;
    padding: 0 20px;
}

/* ===== FOOTER ===== */
footer {
    background-color: #fff;
    color: #000;
    padding: 30px 20px;
    border-top: 1px solid #ddd;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a { color: #000; text-decoration: none; transition: opacity 0.3s; }
.footer-links a:hover { opacity: 0.7; }
.footer-copyright { color: #999; }

@media (max-width: 768px) {
    .footer-inner { flex-direction: column; gap: 15px; text-align: center; }
}

/* ===== HIDDEN ===== */
.tool-item.hidden { display: none; }
.category-section.hidden { display: none; }

/* ===== 検索エリア ===== */
#search-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 0;
}

.search-inner {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    font-size: 15px;
    font-family: 'Hiragino Kaku Gothic Pro', Arial, sans-serif;
    border: 2px solid #ddd;
    outline: none;
    background: #fff;
    color: #333;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #f94144;
}

.search-clear-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    font-size: 16px;
    color: #aaa;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.search-clear-btn:hover { color: #333; }

.search-result-count {
    font-size: 12px;
    color: #999;
    font-family: Arial, sans-serif;
    margin-top: 8px;
    min-height: 18px;
}

/* 検索ヒットなしのカテゴリーは非表示 */
.category-section.search-hidden {
    display: none;
}

@media (max-width: 768px) {
    .search-input { font-size: 14px; padding: 12px 44px 12px 16px; }
}

/* ===== お気に入りエリア ===== */
#favorites-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px;
}

.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 16px;
    border-bottom: 2px solid #d94f00;
    margin-bottom: 16px;
}

.favorites-title {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 16px;
    color: #333;
    letter-spacing: 1px;
}

.favorites-title .fav-star {
    color: #d94f00;
}

.favorites-toggle-btn {
    background: none;
    border: 1px solid #d94f00;
    color: #d94f00;
    font-size: 12px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.favorites-toggle-btn:hover {
    background-color: #d94f00;
    color: #fff;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.favorites-empty {
    color: #aaa;
    font-size: 13px;
    padding: 20px 0;
    text-align: center;
    font-family: 'Hiragino Kaku Gothic Pro', Arial, sans-serif;
}

.favorites-section-hidden {
    display: none;
}

@media (max-width: 1200px) { .favorites-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .favorites-grid { grid-template-columns: 1fr; } }

.recommend-badge {
    background-color: #00aaff; /* 画像に基づいた鮮やかな青 */
    color: #ffffff;           /* 白文字 */
    font-size: 0.7rem;        /* 少し小さめに設定 */
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;       /* 角を少し丸く */
    margin-left: 8px;         /* テキストとの間隔 */
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
}

/* 親要素の調整（折り返しを防ぐ場合） */
.tool-tagline-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
