:root {
    --primary-color: #2bb24c;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --border-color: #dee2e6;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

/* タッチデバイス対応 */
button, a, .tag-cloud-item, .tag {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* スムーズスクロール */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark-text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    /* iOS Safari でのバウンス防止 */
    overscroll-behavior-y: none;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #249a3c 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.header-content h1 i {
    color: #ffd700;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 30px;
}

/* 2段組みレイアウト */
.two-column-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    align-items: start;
}

.left-column {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--light-bg);
}

.left-column::-webkit-scrollbar {
    width: 8px;
}

.left-column::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 4px;
}

.left-column::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.right-column {
    min-height: 500px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2 i {
    color: var(--primary-color);
}

/* API Section */
.api-info {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--info-color);
}

.info-text {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-text i {
    color: var(--info-color);
}

.info-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.info-text a:hover {
    text-decoration: underline;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.token-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.token-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: #249a3c;
}

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

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c82333;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Status Messages */
.status-message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
    animation: slideIn 0.3s ease-out;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
    font-size: 0.95rem;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.stat-item {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
    cursor: pointer;
}

.stat-item:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(43, 178, 76, 0.3);
}

.stat-item:active {
    transform: scale(0.98);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 500;
}

/* Tag Cloud Section */
.tags-section {
    margin-bottom: 25px;
}

.tag-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tag-cloud {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 10px;
    min-height: 100px;
}

.empty-state-small {
    width: 100%;
    text-align: center;
    padding: 20px;
    color: var(--secondary-color);
}

.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 2px solid #90caf9;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tag-cloud-item:hover {
    background: linear-gradient(135deg, #bbdefb, #90caf9);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
}

.tag-cloud-item.tag-selected {
    background: linear-gradient(135deg, var(--primary-color), #249a3c);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(43, 178, 76, 0.4);
}

.tag-count {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 500;
}

/* タグサイズ */
.tag-size-1 { font-size: 0.85rem; }
.tag-size-2 { font-size: 0.9rem; }
.tag-size-3 { font-size: 0.95rem; }
.tag-size-4 { font-size: 1rem; }
.tag-size-5 { font-size: 1.05rem; }
.tag-size-6 { font-size: 1.1rem; }
.tag-size-7 { font-size: 1.15rem; }
.tag-size-8 { font-size: 1.2rem; }
.tag-size-9 { font-size: 1.25rem; }
.tag-size-10 { font-size: 1.3rem; font-weight: 700; }

/* Selected Tag Display */
.selected-tag-display {
    margin-top: 15px;
}

.selected-tag-info {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #fff3cd, #ffe69c);
    color: #856404;
    border: 2px solid #ffc107;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.selected-tag-info i {
    color: #ffc107;
}

.selected-tag-name {
    padding: 4px 12px;
    background: white;
    border-radius: 15px;
    color: var(--primary-color);
}

/* Filter Section */
.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.sort-select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* タブセクション */
.tabs-section {
    margin-bottom: 0;
    padding: 0;
}

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 3px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: var(--light-bg);
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    margin-bottom: -3px;
}

.tab-button:hover {
    background: #e9ecef;
    color: var(--dark-text);
}

.tab-button.active {
    background: white;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-button i {
    font-size: 1.1rem;
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--secondary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

.tab-button.active .tab-count {
    background: var(--primary-color);
}

.tab-button:hover .tab-count {
    transform: scale(1.1);
}

/* Favorites List */
.favorites-section {
    margin-bottom: 30px;
}

.favorites-section h2 {
    margin-bottom: 15px;
}

.favorites-list {
    display: grid;
    gap: 30px;
    max-height: 800px;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--light-bg);
}

.favorites-list::-webkit-scrollbar {
    width: 8px;
}

.favorites-list::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 4px;
}

.favorites-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.favorite-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.favorite-item.read {
    opacity: 0.85;
    border-color: #ddd;
}

.favorite-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

/* 大きな画像表示 */
.favorite-image-large {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
}

.favorite-image-large a {
    display: block;
    width: 100%;
    height: 100%;
}

.favorite-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.favorite-item:hover .favorite-image-large img {
    transform: scale(1.05);
}

/* メインコンテンツ */
.favorite-main-content {
    padding: 25px;
}

.favorite-header {
    margin-bottom: 15px;
}

.favorite-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.favorite-title a {
    color: var(--dark-text);
    text-decoration: none;
    transition: color 0.3s;
    flex: 1;
    min-width: 200px;
}

.favorite-title a:hover {
    color: var(--primary-color);
}

/* バッジ */
.read-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.unread-badge i {
    font-size: 0.6rem;
}

/* メタ情報 */
.favorite-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: var(--secondary-color);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.favorite-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.favorite-meta i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* タグ */
.favorite-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid #90caf9;
}

.tag:hover {
    background: linear-gradient(135deg, #bbdefb, #90caf9);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.2);
}

.tag i {
    font-size: 0.75rem;
}

/* プレビュー表示 */
.favorite-preview {
    margin: 20px 0;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.favorite-preview h4 {
    font-size: 1.1rem;
    color: var(--dark-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.favorite-preview h4 i {
    color: var(--primary-color);
}

.favorite-preview p {
    color: #444;
    line-height: 1.8;
    font-size: 0.95rem;
    margin: 0;
}

/* アクション */
.favorite-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.btn-sm {
    padding: 10px 18px;
    font-size: 0.9rem;
}

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

.btn-info:hover {
    background: #138496;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.empty-hint {
    font-size: 0.9rem;
    color: #999;
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.pagination button:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
footer {
    background: var(--light-bg);
    padding: 20px;
    text-align: center;
    color: var(--secondary-color);
    border-top: 1px solid var(--border-color);
}

footer i {
    color: var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .container {
        border-radius: 8px;
    }

    header {
        padding: 25px 20px;
    }

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

    .subtitle {
        font-size: 0.9rem;
    }

    main {
        padding: 15px;
    }
    
    /* 2段組みをシングルカラムに */
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .left-column {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    
    .favorites-list {
        max-height: 600px;
    }

    .card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .card h2 {
        font-size: 1.2rem;
    }

    /* API設定 */
    .input-group,
    .button-group,
    .filter-controls,
    .tag-controls {
        flex-direction: column;
    }

    .token-input,
    .search-input,
    .sort-select,
    .btn,
    #batchSize,
    #statusFilter {
        width: 100%;
    }

    .btn {
        justify-content: center;
    }

    /* 統計情報 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-item {
        padding: 15px 10px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    /* タグクラウド */
    .tag-cloud {
        padding: 15px;
    }

    .tag-cloud-item {
        font-size: 0.85rem !important;
        padding: 6px 12px;
    }

    .tag-count {
        font-size: 0.75rem;
    }

    /* 一覧画面 */
    .favorites-list {
        gap: 15px;
    }

    .favorite-item {
        border-radius: 8px;
    }

    .favorite-image-large {
        height: 180px;
    }
    
    .favorite-main-content {
        padding: 15px;
    }
    
    .favorite-title {
        font-size: 1.1rem;
    }

    .favorite-title a {
        min-width: 150px;
    }

    .read-badge,
    .unread-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .favorite-meta {
        font-size: 0.85rem;
        gap: 10px;
    }

    .favorite-tags {
        gap: 8px;
    }

    .tag {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .favorite-preview {
        padding: 15px;
        margin: 15px 0;
    }

    .favorite-preview h4 {
        font-size: 0.95rem;
    }

    .favorite-preview p {
        font-size: 0.9rem;
    }
    
    .favorite-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .favorite-actions .btn,
    .favorite-actions a {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 0.95rem;
    }

    /* ページネーション */
    .pagination {
        gap: 5px;
        justify-content: center;
    }

    .pagination button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* モーダル */
    .modal-content {
        width: 98%;
        margin: 2% auto;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 20px 15px;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 20px 15px;
    }
    
    .detail-title h3 {
        font-size: 1.3rem;
    }

    .detail-image {
        max-height: 250px;
        margin-bottom: 20px;
    }

    .detail-meta-section h4,
    .detail-tags-section h4,
    .detail-summary-section h4 {
        font-size: 1.05rem;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .meta-label {
        font-size: 0.8rem;
    }

    .meta-value {
        font-size: 0.9rem;
    }

    .detail-tags {
        gap: 8px;
    }

    .tag-large {
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    .detail-summary {
        padding: 15px;
    }

    .detail-summary p {
        font-size: 0.95rem;
    }
    
    .detail-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .detail-actions .btn,
    .detail-actions a {
        width: 100%;
        justify-content: center;
    }

    /* フッター */
    footer {
        padding: 15px;
        font-size: 0.85rem;
    }

    /* 選択タグ表示 */
    .selected-tag-info {
        font-size: 0.85rem;
        padding: 10px 15px;
    }
}

/* さらに小さい画面（スマホ縦持ち） */
@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
    }

    .header-content h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    main {
        padding: 10px;
    }

    .card {
        padding: 12px;
        border-radius: 8px;
    }

    .card h2 {
        font-size: 1.1rem;
    }

    /* 統計情報 */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    /* 画像 */
    .favorite-image-large {
        height: 160px;
    }

    .favorite-main-content {
        padding: 12px;
    }

    .favorite-title {
        font-size: 1rem;
    }

    .favorite-meta {
        font-size: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .favorite-preview {
        padding: 12px;
    }

    .favorite-preview h4 {
        font-size: 0.9rem;
    }

    .favorite-preview p {
        font-size: 0.85rem;
    }

    /* タグクラウド */
    .tag-cloud-item {
        font-size: 0.8rem !important;
        padding: 5px 10px;
    }

    /* ボタン */
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    /* モーダル */
    .modal-content {
        width: 100%;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    .detail-title h3 {
        font-size: 1.1rem;
    }

    .detail-meta-section,
    .detail-tags-section,
    .detail-summary-section {
        margin-bottom: 20px;
    }
}

/* Modal Styles */
.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.75);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #249a3c 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.6rem;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

/* 詳細モーダル専用 */
.detail-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
    flex-wrap: wrap;
}

.detail-title h3 {
    font-size: 1.8rem;
    color: var(--dark-text);
    margin: 0;
    flex: 1;
    min-width: 200px;
}

.detail-image {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 30px;
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* メタ情報セクション */
.detail-meta-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 10px;
}

.detail-meta-section h4 {
    font-size: 1.2rem;
    color: var(--dark-text);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-meta-section h4 i {
    color: var(--primary-color);
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-label i {
    color: var(--primary-color);
}

.meta-value {
    font-size: 0.95rem;
    color: var(--dark-text);
    word-break: break-all;
}

.meta-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.meta-value a:hover {
    text-decoration: underline;
}

/* タグセクション */
.detail-tags-section {
    margin-bottom: 30px;
}

.detail-tags-section h4 {
    font-size: 1.2rem;
    color: var(--dark-text);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-tags-section h4 i {
    color: var(--primary-color);
}

.detail-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tag-large {
    padding: 8px 18px;
    font-size: 0.95rem;
}

/* 要約セクション */
.detail-summary-section {
    margin-bottom: 30px;
}

.detail-summary-section h4 {
    font-size: 1.2rem;
    color: var(--dark-text);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-summary-section h4 i {
    color: var(--primary-color);
}

.detail-summary {
    padding: 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    line-height: 1.8;
}

.detail-summary p {
    margin: 0;
    color: #333;
    font-size: 1rem;
    white-space: pre-wrap;
}

.no-summary {
    color: var(--secondary-color);
    font-style: italic;
}

/* アクション */
.detail-actions {
    display: flex;
    gap: 15px;
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
    flex-wrap: wrap;
}
