/* ===================
   Base & Reset
   =================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    color: #333;
    background: #fafafa;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================
   Header
   =================== */
.site-header {
    background: #1a237e;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.site-logo {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #fff;
}

.logo-main {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.logo-sub {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.8;
}

/* ===================
   Hero (Top)
   =================== */
.hero {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #303f9f 100%);
    color: #fff;
    padding: 80px 0 60px;
    text-align: center;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.85;
    margin-bottom: 32px;
    letter-spacing: 0.15em;
}

.hero-lead {
    font-size: 0.95rem;
    line-height: 2;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* ===================
   Filter Bar
   =================== */
.apps-section {
    padding: 48px 0 80px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid #ccc;
    border-radius: 24px;
    background: #fff;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #1a237e;
    color: #1a237e;
}

.filter-btn.active {
    background: #1a237e;
    color: #fff;
    border-color: #1a237e;
}

.pdf-download-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: #c62828;
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
    margin-left: auto;
}

.pdf-download-btn:hover {
    background: #b71c1c;
}

/* ===================
   App Cards Grid
   =================== */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.app-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.card-accent {
    height: 6px;
    background: var(--app-color);
}

.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-header-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.card-icon-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    background: var(--app-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.card-header-row .card-category {
    margin-bottom: 4px;
}

.card-header-row .card-title {
    margin-bottom: 0;
}

.card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--app-color);
    background: var(--app-light);
    padding: 3px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    align-self: flex-start;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #222;
}

.card-name-en {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 12px;
}

.card-tagline {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.7;
}

.card-target {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 16px;
    flex: 1;
}

.card-target .label {
    font-weight: 500;
    color: #555;
}

.card-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--app-color);
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
    transition: opacity 0.2s;
}

.card-link:hover {
    opacity: 0.7;
}

/* ===================
   App Detail - Hero
   =================== */
.app-hero {
    background: linear-gradient(135deg, var(--app-color) 0%, var(--app-color) 100%);
    color: #fff;
    padding: 48px 0 40px;
}

.back-link {
    display: inline-block;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #fff;
}

.app-category-badge {
    display: inline-block;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.2);
    padding: 4px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.app-hero-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 4px;
}

.app-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.app-hero-icon-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--app-color);
    background: rgba(255,255,255,0.9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.app-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.app-name-en {
    font-size: 1rem;
    opacity: 0.7;
    margin-bottom: 16px;
}

.app-tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
}

/* ===================
   App Detail - Content
   =================== */
.app-detail {
    padding: 48px 0 80px;
}

/* 概要 + 生成画像 横並び */
.overview-with-image {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

.overview-text p {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.9;
}

.overview-visual {
    position: sticky;
    top: 80px;
}

.generated-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.generated-image img {
    width: 100%;
    display: block;
}

.generated-image figcaption {
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #666;
    background: #fafafa;
    text-align: center;
}

/* 背景・目的 + 追加の生成画像 */
.purpose-with-image p {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.9;
    margin-bottom: 24px;
}

.purpose-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

@media (max-width: 768px) {
    .overview-with-image {
        grid-template-columns: 1fr;
    }

    .overview-visual {
        position: static;
    }
}

.detail-section {
    margin-bottom: 40px;
}

.detail-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.detail-section p {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.9;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 12px 0 12px 28px;
    position: relative;
    font-size: 0.95rem;
    color: #444;
    border-bottom: 1px solid #f5f5f5;
}

.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--app-color, #1a237e);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    display: inline-block;
    padding: 6px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #555;
}

.screenshot-gallery {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.screenshot-item {
    flex: 0 0 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.screenshot-item img {
    width: 100%;
    display: block;
}

.screenshot-item figcaption {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #666;
    background: #fafafa;
}

/* ===================
   CTA Button
   =================== */
.cta-area {
    text-align: center;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e0e0e0;
}

.cta-button {
    display: inline-block;
    padding: 16px 48px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cta-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ===================
   Footer
   =================== */
.site-footer {
    background: #263238;
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 24px 0;
    font-size: 0.8rem;
}

/* ===================
   Responsive
   =================== */
@media (max-width: 900px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 2rem;
    }

    .app-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 600px) {
    .apps-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 48px 0 40px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-lead {
        font-size: 0.85rem;
    }

    .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .filter-btn {
        flex-shrink: 0;
    }

    .app-title {
        font-size: 1.5rem;
    }
}

/* ===================
   Admin Styles
   =================== */
.admin-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.admin-header h1 {
    font-size: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.admin-table th {
    background: #f5f5f5;
    font-weight: 500;
}

.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover { opacity: 0.8; }

.btn-primary {
    background: #1a237e;
    color: #fff;
}

.btn-danger {
    background: #c62828;
    color: #fff;
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.9rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.login-box {
    max-width: 400px;
    margin: 80px auto;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.3rem;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}
