/* =========================================
   Color Palette - @tic.ppp inspired
   ========================================= */
:root {
    /* メインカラー */
    --color-main: #F5F5F0;
    --color-bg: #FAFAFA;
    --color-white: #FFFFFF;

    /* テキストカラー */
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --color-text-tertiary: #999999;

    /* アクセントカラー */
    --color-accent-blue: #A8B5C7;
    --color-accent-green: #B8C5B0;
    --color-border: #E8E8E8;
    --color-border-light: #F0F0F0;

    /* シャドウ */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

    /* スペーシング */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* ボーダーラディウス */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* トランジション */
    --transition-fast: 0.15s ease-out;
    --transition-base: 0.25s ease-out;
    --transition-slow: 0.35s ease-out;
}

/* =========================================
   Utility Classes
   ========================================= */
.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

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

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-bottom: var(--spacing-xl);
}

/* =========================================
   Container
   ========================================= */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
}

/* =========================================
   Header
   ========================================= */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
}

.header-title {
    font-size: 28px;
    font-weight: 400;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.5px;
}

.header-subtitle {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
}

/* =========================================
   Section Title
   ========================================= */
.section-title {
    font-size: 16px;
    font-weight: 400;
    color: var(--color-text-primary);
    letter-spacing: 0.3px;
    margin-bottom: var(--spacing-md);
}

/* =========================================
   Edit Section
   ========================================= */
.edit-section {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group:last-of-type {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.3px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: var(--color-text-primary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent-blue);
    background: var(--color-white);
    box-shadow: 0 0 0 3px rgba(168, 181, 199, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-tertiary);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* =========================================
   Chips Preview (Badge Style)
   ========================================= */
.chips-preview {
    margin-top: var(--spacing-sm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    min-height: 32px;
}

.chip-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--color-main);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-secondary);
    letter-spacing: 0.2px;
    line-height: 1.4;
    animation: fadeIn var(--transition-fast);
}

.chip-clickable {
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.chip-clickable:active {
    transform: scale(0.95);
    background: var(--color-accent-blue);
    border-color: var(--color-accent-blue);
    color: var(--color-white);
}

@media (min-width: 641px) {
    .chip-clickable:hover {
        background: var(--color-accent-blue);
        border-color: var(--color-accent-blue);
        color: var(--color-white);
    }
}

/* =========================================
   Suggested Tags Container
   ========================================= */
.suggested-tags-container {
    margin-top: var(--spacing-xs);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    min-height: 0;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--color-bg);
    border: 1px dashed var(--color-accent-blue);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 300;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.suggestion-chip:active {
    transform: scale(0.95);
    background: var(--color-accent-blue);
    color: var(--color-white);
    border-style: solid;
}

@media (min-width: 641px) {
    .suggestion-chip:hover {
        background: var(--color-white);
        border-color: var(--color-text-primary);
        color: var(--color-text-primary);
    }
}

.tags-preview {
    margin-top: var(--spacing-sm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    min-height: 24px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--color-accent-blue);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 400;
    color: var(--color-white);
    letter-spacing: 0.2px;
    animation: fadeIn var(--transition-fast);
}

.tag-badge-clickable {
    cursor: pointer;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.tag-badge-clickable:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.tag-badge-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.tag-badge-remove:active {
    background: rgba(255, 255, 255, 0.5);
}

.tag-badge-remove::before {
    content: '×';
    font-size: 12px;
    line-height: 1;
    color: var(--color-white);
}

/* =========================================
   Buttons
   ========================================= */
.button-group {
    display: flex;
    gap: var(--spacing-sm);
}

.btn {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 400;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform var(--transition-base), background var(--transition-base);
    letter-spacing: 0.3px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--color-text-primary);
    color: var(--color-white);
}

.btn-primary:active {
    transform: scale(0.98);
    background: #222222;
}

.btn-secondary {
    background: var(--color-main);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-secondary:active {
    transform: scale(0.98);
    background: #ECECEA;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-main);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.btn-icon:active {
    transform: scale(0.9);
    background: #ECECEA;
}

@media (min-width: 641px) {
    .btn-icon:hover {
        background: var(--color-border);
        box-shadow: var(--shadow-sm);
    }
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-secondary);
}

/* =========================================
   Filter Section
   ========================================= */
.filter-section {
    margin-bottom: var(--spacing-md);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.search-input {
    width: 120px;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    font-weight: 300;
    color: var(--color-text-primary);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 0 3px rgba(168, 181, 199, 0.1);
}

.tag-filter-container {
    display: flex;
    flex-wrap: nowrap;
    /* 横並びに固定 */
    overflow-x: auto;
    /* 横スクロールを許可 */
    padding: 2px 0 var(--spacing-sm) 0;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    -webkit-overflow-scrolling: touch;
    /* スクロールバー非表示 (Chrome/Safari) */
    scrollbar-width: none;
    /* Firefox */
}

.tag-filter-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.filter-tag {
    flex: 0 0 auto;
    /* 幅を縮めない */
    padding: 6px 14px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.filter-tag.active {
    background: var(--color-accent-blue);
    border-color: var(--color-accent-blue);
    color: var(--color-white);
    box-shadow: 0 2px 6px rgba(168, 181, 199, 0.4);
}

/* =========================================
   Prompts Section
   ========================================= */
.prompts-section {
    margin-bottom: var(--spacing-xl);
}

.prompts-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* =========================================
   Prompt Card
   ========================================= */
.prompt-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    animation: fadeIn var(--transition-base);
    position: relative;
    overflow: hidden;
}

.prompt-card-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4), transparent);
    color: var(--color-white);
}

.prompt-card-title-overlay h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}


.prompt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.prompt-card-name {
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text-primary);
    letter-spacing: 0.3px;
    flex: 1;
    word-break: break-word;
}

.prompt-card-actions {
    display: flex;
    gap: var(--spacing-xs);
}


.prompt-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.prompt-card-tags {

    /* Loading State */
    .loading-state {
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-xxl) 0;
        color: var(--color-text-secondary);
    }

    .spinner {
        width: 40px;
        height: 40px;
        border: 3px solid rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        border-top-color: var(--color-primary);
        animation: spin 1s ease-in-out infinite;
        margin-bottom: var(--spacing-md);
    }

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

    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

/* =========================================
   Empty State
   ========================================= */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
}

.prompts-container:not(:has(.prompt-card)) .empty-state {
    display: flex;
}

.prompts-container:has(.prompt-card) .empty-state {
    display: none;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--color-border);
    margin-bottom: var(--spacing-md);
}

.empty-text {
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.empty-hint {
    font-size: 12px;
    color: var(--color-text-tertiary);
    font-weight: 300;
}

/* =========================================
   Toast Notification
   ========================================= */
.toast {
    position: fixed;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text-primary);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
    z-index: 2000;
    font-size: 14px;
    font-weight: 400;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast-icon {
    width: 18px;
    height: 18px;
    color: var(--color-white);
}

/* =========================================
   Animations
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Staggered animation for cards */
.prompt-card {
    animation: fadeInScale 0.4s ease-out backwards;
}

.prompt-card:nth-child(1) {
    animation-delay: 0.05s;
}

.prompt-card:nth-child(2) {
    animation-delay: 0.1s;
}

.prompt-card:nth-child(3) {
    animation-delay: 0.15s;
}

.prompt-card:nth-child(4) {
    animation-delay: 0.2s;
}

.prompt-card:nth-child(5) {
    animation-delay: 0.25s;
}

.prompt-card:nth-child(6) {
    animation-delay: 0.3s;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .prompt-card {
        animation: none;
    }
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .header-title {
        font-size: 24px;
    }

    .edit-section {
        padding: var(--spacing-md);
    }

    .filter-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }
}

@media (min-width: 641px) {
    .prompt-card:hover {
        border-color: var(--color-accent-blue);
        box-shadow: var(--shadow-md);
    }

    .btn:hover {
        transform: translateY(-1px);
    }

    .filter-tag:hover {
        border-color: var(--color-accent-blue);
        color: var(--color-accent-blue);
    }
}

/* =========================================
   Image Upload & Preview
   ========================================= */
.form-input-file {
    width: 100%;
    padding: var(--spacing-sm);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 300;
    color: var(--color-text-primary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition-base), background var(--transition-base);
}

.form-input-file:focus {
    outline: none;
    border-color: var(--color-accent-blue);
    background: var(--color-white);
}

.image-preview {
    margin-top: var(--spacing-sm);
    position: relative;
}

.image-preview-container {
    position: relative;
    display: inline-block;
}

.image-preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--spacing-sm);
    border: 1px solid var(--color-border);
}

.image-preview-remove {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.image-preview-remove:active {
    transform: scale(0.9);
    background: rgba(0, 0, 0, 0.8);
}

.prompt-card-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
}

/* Favorite Filter Styles */
.filter-fav {
    border-color: #e0e0e0;
    color: #f59f00;
}

.filter-fav:hover {
    border-color: #f59f00;
    color: #f59f00;
}

.filter-fav.active {
    background: #f59f00;
    border-color: #f59f00;
    color: #fff;
}

/* Favorite Button Styles in Card */
.fav-btn.active {
    background-color: #fff9db;
}

.fav-btn.active svg {
    color: #f59f00;
    fill: #f59f00;
}

/* =========================================
   Bottom Navigation & Tabs
   ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--color-white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    width: 50%;
    cursor: pointer;
    color: var(--color-text-tertiary);
    transition: all var(--transition-fast);
}

.nav-item.active {
    color: var(--color-text-primary);
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

.tab-content {
    display: none;
    animation: fadeIn var(--transition-base);
}

.tab-content.active {
    display: block;
}

.pb-nav {
    padding-bottom: 80px;
    /* Space for bottom nav */
}

/* =========================================
   Grid Layout & Simple Cards
   ========================================= */
.prompts-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.prompt-card {
    /* Override previous styles for grid items */
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    position: relative;
    aspect-ratio: 1 / 1;
    /* Square aspect ratio especially for images */
    display: flex;
    flex-direction: column;
}

.prompt-card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prompt-card-simple-content {
    padding: var(--spacing-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--color-bg);
}

.prompt-card-simple-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* =========================================
   Modal
   ========================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent backdrop */
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal.show {
    display: flex;
    /* or block depending on layout */
    opacity: 1;
}

.modal-content {
    background: var(--color-white);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform var(--transition-base);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    color: var(--color-text-primary);
}

.modal-close-btn svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Modal Internal Layout */
.detail-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    background: #000;
}

.detail-content {
    padding: var(--spacing-lg);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    padding-right: 44px;
    /* 閉じるボタン（32px + 12px）との重なりを完全に回避 */
}

.detail-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--color-text-primary);
    flex: 1;
    margin-right: var(--spacing-md);
}

.detail-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-shrink: 0;
    /* タイトルに押されないように */
}

/* Responsive Adjustments for PC */
@media screen and (min-width: 768px) {
    .container {
        max-width: 1200px;
        /* 全体の器を広げる */
    }

    /* プロンプト保存（入力）画面は広がりすぎないように制限 */
    .edit-section {
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
        padding: var(--spacing-xl);
    }

    .prompts-container {
        /* カードが入る分だけ自動調整 */
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: var(--spacing-lg);
    }

    .prompt-card {
        aspect-ratio: auto;
        /* 正方形固定を解除 */
        height: auto;
    }

    .prompt-card-thumbnail {
        height: auto;
        max-height: 400px;
        display: block;
    }

    .prompt-card-simple-title {
        font-size: 16px;
    }
}

/* Info Button */
.info-btn {
    display: inline-flex;
    margin-top: 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color var(--transition-base), border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.info-btn span {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.info-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.info-btn svg {
    width: 20px;
    height: 20px;
}

/* Help Content */
.help-body {
    padding: var(--spacing-xl);
}

.help-body h2 {
    font-size: 20px;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.help-section {
    margin-bottom: var(--spacing-xl);
}

.help-section h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--color-primary);
}

.help-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.help-section ul {
    margin-top: var(--spacing-xs);
    padding-left: 20px;
}

.help-section li {
    font-size: 13px;
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

/* Version Tag */
.app-version {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    background: var(--color-border-light);
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0;
}


/* =========================================
   Changelog Section
   ========================================= */
.changelog-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.changelog-item {
    margin-bottom: var(--spacing-md);
}

.changelog-item:last-child {
    margin-bottom: 0;
}

.changelog-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.changelog-date {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.changelog-item ul {
    margin: 0;
    padding-left: 20px;
}

.changelog-item li {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    line-height: 1.5;
}

.changelog-item li:last-child {
    margin-bottom: 0;
}

/* =========================================
   Author Section
   ========================================= */
.author-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.author-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-border);
    margin-bottom: var(--spacing-sm);
}

.author-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.author-description {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
}

.author-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.author-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 400;
    transition: transform var(--transition-base), background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    -webkit-tap-highlight-color: transparent;
}

.author-link:active {
    transform: scale(0.98);
    background: var(--color-white);
    border-color: var(--color-accent-blue);
}

@media (min-width: 641px) {
    .author-link:hover {
        background: var(--color-white);
        border-color: var(--color-accent-blue);
        box-shadow: var(--shadow-sm);
    }
}

.author-link svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.author-link:active svg {
    color: var(--color-accent-blue);
}

@media (min-width: 641px) {
    .author-link:hover svg {
        color: var(--color-accent-blue);
    }
}

/* Primary Author Link (Newsletter) */
.author-link-primary {
    background: linear-gradient(135deg, #A8B5C7 0%, #B8C5B0 100%);
    border-color: var(--color-accent-blue);
    color: var(--color-white);
    font-weight: 500;
}

.author-link-primary svg {
    color: var(--color-white);
}

.author-link-primary:active {
    background: linear-gradient(135deg, #96a3b5 0%, #a6b39e 100%);
    transform: scale(0.98);
}

@media (min-width: 641px) {
    .author-link-primary:hover {
        background: linear-gradient(135deg, #96a3b5 0%, #a6b39e 100%);
        box-shadow: var(--shadow-md);
    }

    .author-link-primary:hover svg {
        color: var(--color-white);
    }
}

/* LP Styles */
.lp-container {
    padding: 0 0 40px;
    background-color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.lp-header {
    background: linear-gradient(135deg, #1A1A1A 0%, #2D3748 100%);
    color: white;
    padding: 60px 24px;
    width: 100%;
    margin-bottom: 32px;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
}

.lp-logo {
    font-size: 48px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lp-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.lp-subtitle {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
}

.lp-features {
    padding: 0 24px;
    width: 100%;
    box-sizing: border-box;
}

.lp-feature-item {
    background: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
}

.lp-icon-bg {
    width: 48px;
    height: 48px;
    background: #f0f4f8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.lp-feature-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #2d3748;
}

.lp-feature-text p {
    font-size: 14px;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

.lp-actions {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, #f8fafc 80%, rgba(248, 250, 252, 0));
}

.btn-lg {
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(66, 153, 225, 0.3);
}

.lp-actions-desktop-header {
    display: none;
}

.lp-spacer-mobile {
    display: block;
}

/* LP Footer Styles */
.lp-footer {
    padding: 32px 24px;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.lp-footer-text {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #718096;
}

.lp-footer-text a {
    color: #4299e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.lp-footer-text a:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

.lp-footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.lp-footer-links a {
    font-size: 0.85rem;
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.lp-footer-links a:hover {
    color: #718096;
}

@media (min-width: 768px) {
    .lp-container {
        padding: 0 0 60px 0;
        justify-content: flex-start;
        max-width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 60px;
    }

    .lp-spacer-mobile {
        display: none;
    }

    .lp-header {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
        flex-shrink: 0;
        padding: 60px 24px 100px 24px;
        height: auto;
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-bottom: 40px;
    }

    .lp-features {
        width: 100%;
        max-width: 800px;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .lp-feature-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        height: 100%;
        margin-bottom: 0;
    }

    /* Force new sections to wrap and center */
    .lp-section {
        width: 100%;
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
    }

    .lp-actions {
        display: block;
        position: static;
        width: 100%;
        max-width: 600px;
        margin-top: 40px;
        background: transparent;
        padding: 0;
    }

    /* Desktop specific login button for LP right column if needed */
    .lp-features .lp-actions-desktop {
        display: none;
        /* Hide inside features grid */
    }

    /* Show a main CTA button in the header for desktop instead */
    .lp-header .lp-actions-desktop-header {
        display: block;
        margin-top: 32px;
        width: 100%;
        max-width: 300px;
    }
}

/* LP Showcase Styles */
.lp-section {
    padding: 0 24px;
    width: 100%;
    box-sizing: border-box;
}

.lp-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.4;
}

.lp-showcase-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
    margin-bottom: 32px;
}

.lp-showcase-img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid #edf2f7;
}

.lp-showcase-text {
    padding: 24px;
}

.lp-showcase-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #2d3748;
}

.lp-showcase-text p {
    font-size: 14px;
    color: #718096;
    line-height: 1.6;
    margin: 0;
}

/* Desktop adjustments for showcase */
@media (min-width: 768px) {
    .lp-section {
        max-width: 800px;
    }

    .lp-showcase-card {
        display: flex;
        align-items: center;
        text-align: left;
    }

    .lp-showcase-img {
        width: 50%;
        border-bottom: none;
        border-right: 1px solid #edf2f7;
    }

    .lp-showcase-text {
        width: 50%;
        padding: 32px;
    }

    /* Alternate order for variety (using specific classes for safety or simple nth-child if structure permits) */
    /* Since sections are separate siblings, this works if wrapped or direct */
}