/* ClipTuck - 世田谷ベース風（手作り工具箱）スタイル */

:root {
    /* 羊皮紙風アンティークカラーパレット */
    --parchment-bg: #F4F1E8; /* メイン羊皮紙色 */
    --aged-paper: #EDE8DD; /* 古い紙 */
    --warm-cream: #F8F3E7; /* 温かいクリーム */
    --antique-brown: #8B6F47; /* アンティークブラウン */
    --dark-sepia: #5D4E37; /* ダークセピア */
    --leather-brown: #964B00; /* レザーブラウン */
    --copper-accent: #B87333; /* 銅アクセント */
    --old-gold: #CFB53B; /* 古い金色 */
    
    /* アンティーク調メインカラー */
    --primary-color: #5D4E37; /* ダークセピア（メイン） */
    --secondary-color: #D2B48C; /* 温かいタン */
    --accent-color: #B87333; /* 銅色（アクセント） */
    --success-color: #8FBC8F; /* 暖かい緑 */
    --danger-color: #CD853F; /* 古いローズ */
    --warning-color: #DDB06B; /* 温かいゴールド */
    --book-spine: #8B6F47; /* 本の背表紙アクセント */
    
    /* 羊皮紙の質感 */
    --workspace-bg: #F4F1E8; /* 羊皮紙ベース */
    --paper-bg: #F8F3E7; /* 明るい羊皮紙 */
    --aged-bg: #EDE8DD; /* 古い紙 */
    --wood-bg: #D2B48C; /* ライトウッド */
    --metal-accent: #8B6F47; /* アンティークメタル */
    
    /* アンティーク調テキストと境界 */
    --text-color: #3E2723; /* 深いセピアブラウン */
    --text-muted: #6D4C41; /* ミディアムブラウン */
    --border-color: #D7CCC8; /* 淡いブラウン */
    --divider-color: #A1887F; /* ソフトブラウン */
    --dark-gray: #5D4037; /* ダークブラウン */
    --medium-gray: #8D6E63; /* ミディアムブラウン */
    --light-gray: #EFEBE9; /* ライトブラウン */

    /* アンティーク調装飾カラー */
    --caramel-050: #F8F3E7; /* クリームハイライト */
    --caramel-100: #EFEBE9; /* クリーム */
    --caramel-300: #D7CCC8; /* ライトベージュ */
    --caramel-500: #A1887F; /* 基調ブラウン */
    --caramel-600: #8D6E63; /* ミディアムブラウン */
    --caramel-700: #6D4C41; /* ダークブラウン */
    --caramel-800: #5D4037; /* ディープブラウン */
    --caramel-900: #3E2723; /* 深いブラウン・文字色 */
    --accent-red: #A0522D; /* アンティーク調の赤茶 */
    --cream: #F8F3E7; /* 内側ハイライト用 */
    
    /* アンティーク調の影とエフェクト */
    --shadow: 0 4px 12px rgba(93, 78, 55, 0.2);
    --text-shadow: 0.5px 0.5px 1px rgba(62, 39, 35, 0.15);
    --parchment-shadow: 0 6px 20px rgba(139, 111, 71, 0.25);
    --book-shadow: 0 8px 24px rgba(93, 78, 55, 0.3);
    
    /* 角の丸み（控えめに） */
    --radius: 6px;
    --bookmark-radius: 0 0 8px 8px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Comic Neue', 'Klee One', 'Noto Sans JP', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--parchment-bg);
    /* 羊皮紙風の自然なテクスチャと色合い */
    background-image: 
        /* 古い紙のシミや変色を表現 */
        radial-gradient(circle at 25% 25%, rgba(139, 111, 71, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(184, 115, 51, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 50% 10%, rgba(210, 180, 140, 0.08) 0%, transparent 30%),
        /* 羊皮紙の基本グラデーション */
        linear-gradient(135deg, var(--aged-paper) 0%, var(--parchment-bg) 50%, var(--warm-cream) 100%),
        /* 紙の繊維質感 */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(139, 111, 71, 0.02) 1px,
            rgba(139, 111, 71, 0.02) 2px
        );
    color: var(--text-color);
    line-height: 1.6;
    text-shadow: 0.5px 0.5px 1px rgba(62, 39, 35, 0.1);
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 25px;
    background: var(--paper-bg);
    /* 古い羊皮紙の自然な境界線 */
    border: 3px solid var(--border-color);
    border-radius: 12px 8px 10px 15px;
    box-shadow: 
        0 8px 32px rgba(93, 78, 55, 0.15),
        inset 0 1px 0 rgba(248, 243, 231, 0.8);
    position: relative;
    min-height: calc(100vh - 60px);
    /* 羊皮紙の自然な質感テクスチャ */
    background-image: 
        /* 古い紙の汚れやシミ */
        radial-gradient(circle at 20% 80%, rgba(139, 111, 71, 0.03) 0%, transparent 25%),
        radial-gradient(circle at 80% 20%, rgba(160, 82, 45, 0.02) 0%, transparent 20%),
        radial-gradient(circle at 60% 60%, rgba(210, 180, 140, 0.04) 0%, transparent 15%),
        /* 羊皮紙の繊維質感 */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(139, 111, 71, 0.015) 1px,
            rgba(139, 111, 71, 0.015) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 1px,
            rgba(139, 111, 71, 0.01) 1px,
            rgba(139, 111, 71, 0.01) 2px
        );
}

/* 古い羊皮紙の装飾的な境界線 */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, 
        var(--antique-brown), 
        var(--copper-accent), 
        var(--old-gold), 
        var(--copper-accent), 
        var(--antique-brown)
    );
    border-radius: 12px 8px 0 0;
    opacity: 0.7;
}

/* ヘッダー */
.header {
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 2px solid var(--divider-color);
    position: relative;
}

/* 3列グリッドレイアウト */
.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.header-left,
.header-center,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: center;
    padding-right: 40px;
}

.header-center {
    justify-content: center;
}

.header-right {
    justify-content: center;
    padding-left: 40px;
}

/* 装飾的な線 */
.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: var(--accent-color);
}



/* 中央のメインタイトル */
.header-center h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 3em;
    font-weight: 400;
    font-family: 'Fredoka One', 'Klee One', cursive;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(93, 78, 55, 0.3);
    transform: rotate(-1deg);
    z-index: 2;
    position: relative;
}

/* 左側のサブタイトル */
.header-left .subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.1em;
    font-style: italic;
    font-weight: 700;
    white-space: nowrap;
}

/* 右側のボタン */
.header-right .handmade-badge {
    margin: 0;
}

/* 手作りバッジ（クリッカブルボタン） */
.handmade-badge {
    display: inline-block;
    background: var(--warning-color);
    color: var(--text-color);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 700;
    margin-bottom: 15px;
    transform: rotate(2deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px dashed var(--accent-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', 'Klee One', 'Noto Sans JP', sans-serif;
}

.handmade-badge:hover {
    background: var(--accent-color);
    color: var(--paper-bg);
    transform: rotate(-1deg) translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    border-color: var(--warning-color);
}

.handmade-badge:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}



/* ブックマークレットセクション - 古い洋書風 */
.bookmarklet-section {
    background: var(--aged-paper);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
    box-shadow: var(--book-shadow);
}

/* ブックマークレットセクションの装飾 */
.bookmarklet-section::before {
    content: '📖';
    position: absolute;
    top: -15px;
    left: 25px;
    background: var(--aged-paper);
    padding: 0 8px;
    font-size: 20px;
}

.bookmarklet-section::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.bookmarklet-section h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.bookmarklet-container {
    background: var(--light-gray);
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* アンティーク調羊皮紙風ブックマークレットボタン */
.bookmarklet-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--copper-accent) 0%, var(--antique-brown) 50%, var(--dark-sepia) 100%);
    color: var(--warm-cream);
    padding: 16px 32px;
    text-decoration: none;
    border: 3px solid var(--leather-brown);
    border-radius: 10px 8px 12px 6px;
    font-weight: 700;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 16px;
    letter-spacing: 0.5px;
    cursor: grab;
    position: relative;
    overflow: hidden;
    text-shadow: 2px 2px 4px rgba(93, 78, 55, 0.7);
    box-shadow:
        0 6px 16px rgba(93, 78, 55, 0.3),
        inset 0 2px 0 rgba(248, 243, 231, 0.2),
        inset 0 -2px 0 rgba(62, 39, 35, 0.3);
    transition: all 0.3s ease;
    transform: perspective(600px) rotateX(3deg);
}

/* 古い本の金箔装飾風のグラデーション */
.bookmarklet-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 140, 0, 0.4) 50%,
        transparent
    );
    transition: left 0.6s ease;
}

/* 装飾的なボーダー効果 */
.bookmarklet-button::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    pointer-events: none;
}

.bookmarklet-button:hover {
    background: linear-gradient(135deg, var(--old-gold) 0%, var(--copper-accent) 50%, var(--leather-brown) 100%);
    border-color: var(--old-gold);
    transform: perspective(600px) rotateX(0deg) translateY(-3px);
    box-shadow:
        0 10px 25px rgba(139, 111, 71, 0.4),
        inset 0 2px 0 rgba(248, 243, 231, 0.3),
        inset 0 -2px 0 rgba(62, 39, 35, 0.2);
    cursor: grab;
}

.bookmarklet-button:hover::before {
    left: 100%;
}

.bookmarklet-button:active {
    transform: perspective(600px) rotateX(5deg) translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(139, 69, 19, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    cursor: grabbing;
}

/* セカンダリボタン（タグ付き保存） - グレースケール×オレンジアクセント */
.bookmarklet-button:not(:first-child) {
    background: linear-gradient(135deg, #808080 0%, #696969 50%, #808080 100%);
    border: 4px solid #FF8C00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    box-shadow:
        0 6px 16px rgba(255, 140, 0, 0.4),
        inset 0 3px 0 rgba(255, 255, 255, 0.4),
        inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.bookmarklet-button:not(:first-child):hover {
    background: linear-gradient(135deg, #A9A9A9 0%, #808080 50%, #A9A9A9 100%);
    border-color: #FF6B35;
    box-shadow:
        0 8px 20px rgba(255, 107, 53, 0.5),
        inset 0 3px 0 rgba(255, 255, 255, 0.5),
        inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

/* 栞風の切り込み効果（クリップタック感を演出） */
.bookmarklet-button:first-child::before {
    border-left-color: #FF8C00;
    border-right-color: #FF8C00;
}

.bookmarklet-button:not(:first-child)::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 140, 0, 0.4) 50%,
        transparent
    );
}



/* ボタンのテキスト調整 */
.bookmarklet-button:first-child,
.bookmarklet-button:not(:first-child) {
    padding-left: 20px;
    text-align: left;
    position: relative;
}

/* 古い洋書の背表紙風の質感追加 */
.bookmarklet-button {
    background-image: 
        linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.05) 2px,
            rgba(0, 0, 0, 0.05) 3px
        );
    background-blend-mode: multiply;
}

/* モバイル対応のためのレスポンシブ調整 */
@media (max-width: 599px) {
    .bookmarklet-button {
        padding: 14px 20px 14px 44px;
        font-size: 15px;
        border-radius: 10px;
        transform: none;
        margin-bottom: 8px;
    }
    
    .bookmarklet-button:hover {
        transform: translateY(-2px);
    }
    
    .bookmarklet-button:active {
        transform: translateY(0);
    }
    
    .bookmarklet-button:first-child::after,
    .bookmarklet-button:not(:first-child)::after {
        left: 10px;
        font-size: 18px;
    }
}

/* レスポンシブ: 大きい画面では横並び */
@media (min-width: 600px) {
    .bookmarklet-container {
        flex-direction: row;
        justify-content: center;
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark-gray);
}

/* コントロールエリア - 古い羊皮紙のメモ帳風 */
.controls {
    background: var(--aged-paper);
    border: 2px solid var(--antique-brown);
    border-radius: 8px 6px 10px 7px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 
        0 6px 12px rgba(93, 78, 55, 0.15),
        inset 0 1px 0 rgba(248, 243, 231, 0.4);
    position: relative;
    transform: rotate(0.1deg);
    /* 古い紙の質感 */
    background-image: 
        radial-gradient(circle at 30% 70%, rgba(184, 115, 51, 0.03) 0%, transparent 30%),
        radial-gradient(circle at 70% 30%, rgba(139, 111, 71, 0.02) 0%, transparent 25%);
}

/* コントロールエリアの装飾 */
.controls::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--divider-color), transparent);
}

/* フォーム */
.add-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.form-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.add-form input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid var(--antique-brown);
    border-radius: 6px 8px 7px 5px;
    font-size: 14px;
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--warm-cream);
    color: var(--text-color);
    box-shadow: inset 0 2px 4px rgba(93, 78, 55, 0.1);
    transition: all 0.3s ease;
}

.add-form input:focus {
    outline: none;
    border-color: var(--copper-accent);
    box-shadow: inset 0 2px 4px rgba(93, 78, 55, 0.15), 0 0 8px rgba(184, 115, 51, 0.3);
    background: var(--paper-bg);
}

/* プライマリボタン（保存ボタン） - アンティーク羊皮紙風 */
.primary-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--copper-accent) 0%, var(--antique-brown) 100%);
    color: var(--warm-cream);
    border: 2px solid var(--dark-sepia);
    border-radius: 8px 6px 10px 7px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    font-size: 14px;
    font-family: 'Georgia', 'Times New Roman', serif;
    text-shadow: 1px 1px 2px rgba(93, 78, 55, 0.6);
    box-shadow:
        0 4px 8px rgba(93, 78, 55, 0.25),
        inset 0 1px 0 rgba(248, 243, 231, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.primary-btn:hover {
    background: linear-gradient(135deg, var(--old-gold) 0%, var(--copper-accent) 100%);
    border-color: var(--leather-brown);
    transform: translateY(-2px);
    box-shadow:
        0 6px 12px rgba(93, 78, 55, 0.3),
        inset 0 1px 0 rgba(248, 243, 231, 0.3);
}

/* .add-form button は .primary-btn に統一済み */

/* フィルター */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filters input, .filters select {
    padding: 10px 15px;
    border: 1px solid var(--antique-brown);
    border-radius: 6px 4px 8px 5px;
    font-size: 13px;
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--warm-cream);
    color: var(--text-color);
    box-shadow: inset 0 1px 3px rgba(93, 78, 55, 0.1);
    transition: all 0.3s ease;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--copper-accent);
    box-shadow: inset 0 1px 3px rgba(93, 78, 55, 0.15), 0 0 6px rgba(184, 115, 51, 0.3);
    background: var(--paper-bg);
}

.filters input {
    flex: 1;
    min-width: 28px;
}

.view-toggle {
    display: flex;
    gap: 10px;
}

.view-toggle label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 14px;
    cursor: pointer;
}

/* データコントロール */
.data-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

/* 選択コントロール（統一サイズ横並び） */
.selection-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.bulk-tags-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 180px;
}

.bulk-tags-wrapper .smart-btn {
    width: 100%;
}

#bulkTagsContainer {
    display: none;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

#bulkTagsContainer input {
    flex: 1 1 220px;
    min-width: 200px;
}

#bulkTagsContainer button {
    flex: 0 0 auto;
}

/* 削除（新しいレイアウトに統合） */

.gallery-selection-controls button {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 3px;
    font-weight: 500;
    transition: all 0.2s;
}

/* IDベースのボタンは .smart-btn クラスで統一済み（下記は後方互換性のための追加スタイル） */

#deleteSelectedBtn {
    /* 既に .smart-btn.danger-btn で定義済み */
    min-width: 120px;
}

.data-controls button:disabled,
.smart-btn:disabled {
    background: linear-gradient(135deg, #A0A0A0 0%, #808080 100%);
    border-color: #808080;
    color: #CCCCCC;
    cursor: not-allowed;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 2px 4px rgba(128, 128, 128, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transform: none;
}

.bookmark-selector {
    display: flex;
    align-items: center;
    padding: 18px 10px 18px 12px;
    flex-shrink: 0;
}

.bookmark-selector input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.bookmark-item.selected {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.bookmark-item.selected:hover {
    background-color: #bbdefb;
}

/* スマートボタンスタイル - アンティーク羊皮紙風 */
.smart-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Georgia', 'Times New Roman', serif;
    border-radius: 6px 8px 7px 5px;
    border: 2px solid var(--antique-brown);
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--antique-brown) 100%);
    color: var(--warm-cream);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(93, 78, 55, 0.6);
    box-shadow: 
        0 3px 6px rgba(93, 78, 55, 0.2), 
        inset 0 1px 0 rgba(248, 243, 231, 0.15);
}

.smart-btn:hover {
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--copper-accent) 100%);
    border-color: var(--dark-sepia);
    color: var(--parchment-bg);
    transform: translateY(-2px);
    box-shadow: 
        0 5px 10px rgba(93, 78, 55, 0.25), 
        inset 0 1px 0 rgba(248, 243, 231, 0.2);
    text-shadow: 1px 1px 2px rgba(93, 78, 55, 0.5);
}

/* ヘルプボタン */
.smart-btn.help-button {
    background: linear-gradient(135deg, #6B9FCC 0%, #5A8AB8 100%);
    color: var(--paper-bg);
    border: 3px solid #3F6B9A;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow:
        0 4px 8px rgba(63, 107, 154, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.smart-btn.help-button:hover {
    background: linear-gradient(135deg, #6B9FCC 0%, #5A8AB8 100%);
    border-color: #5A8AB8;
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(63, 107, 154, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 選択ボタン（青色） */
.smart-btn.select-btn {
    background: linear-gradient(135deg, #6B9FCC 0%, #5A8AB8 100%);
    color: var(--paper-bg);
    border: 3px solid #3F6B9A;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 8px rgba(63, 107, 154, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.smart-btn.select-btn:hover {
    background: linear-gradient(135deg, #6B9FCC 0%, #5A8AB8 100%);
    border-color: #5A8AB8;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 8px rgba(63, 107, 154, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 選択解除ボタン（グレー） */
.smart-btn.deselect-btn {
    background: linear-gradient(135deg, #8E8E8E 0%, #7A7A7A 100%);
    color: var(--paper-bg);
    border: 3px solid #5A5A5A;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 8px rgba(90, 90, 90, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.smart-btn.deselect-btn:hover {
    background: linear-gradient(135deg, #8E8E8E 0%, #7A7A7A 100%);
    border-color: #7A7A7A;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 8px rgba(90, 90, 90, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 削除ボタン */
.smart-btn.danger-btn {
    background: linear-gradient(135deg, #DC6E6E 0%, #C85A5A 100%);
    color: var(--paper-bg);
    border: 3px solid #A84343;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 8px rgba(168, 67, 67, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.smart-btn.danger-btn:hover {
    background: linear-gradient(135deg, #DC6E6E 0%, #C85A5A 100%);
    border-color: #C85A5A;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 8px rgba(168, 67, 67, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 選択・削除ボタンの統一サイズ */
.selection-controls .smart-btn {
    min-width: 80px;
    flex: 0 0 auto;
}

/* ファイルラベルの改善 */
.file-label.smart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6B9FCC 0%, #5A8AB8 100%);
    border: 3px solid #3F6B9A;
}

/* 旧スタイル（後方互換） */
.data-controls button,
.file-label {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    color: var(--paper-bg);
    border: 3px solid var(--accent-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    font-family: 'EB Garamond', 'Old Standard TT', 'Georgia', serif;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 8px rgba(139, 69, 19, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.data-controls button:hover,
.file-label:hover {
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--accent-color) 100%);
    border-color: var(--warning-color);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(139, 69, 19, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

/* ブックマーク一覧 - 古い羊皮紙ボード風 */
.bookmarks-list {
    background: var(--parchment-bg);
    border-radius: 10px 8px 12px 6px;
    box-shadow: var(--parchment-shadow);
    overflow: visible;
    position: relative;
    border: 2px solid var(--antique-brown);
    /* 古い羊皮紙の質感 */
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(139, 111, 71, 0.02) 0%, transparent 30%),
        radial-gradient(circle at 80% 20%, rgba(184, 115, 51, 0.015) 0%, transparent 25%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(139, 111, 71, 0.01) 10px,
            rgba(139, 111, 71, 0.01) 20px
        );
}

/* 古い羊皮紙風のブックマークアイテム */
.bookmark-item {
    display: flex;
    position: relative;
    margin-bottom: 12px;
    background: var(--aged-paper);
    border: 2px solid var(--antique-brown);
    border-radius: 8px 6px 10px 5px;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 8px rgba(93, 78, 55, 0.15),
        inset 0 1px 0 rgba(248, 243, 231, 0.6),
        inset 0 -1px 0 rgba(139, 111, 71, 0.1);
    align-items: center;
    transform: rotate(0deg);
    /* 古い紙の質感 */
    background-image: 
        radial-gradient(circle at 80% 20%, rgba(184, 115, 51, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 20% 80%, rgba(139, 111, 71, 0.02) 0%, transparent 25%);
}

/* 付箋の交互の傾き */
.bookmark-item:nth-child(odd) {
    transform: rotate(0.5deg);
}

.bookmark-item:nth-child(even) {
    transform: rotate(-0.3deg);
}

/* 古い羊皮紙の角の装飾（巻いた紙風） */
.bookmark-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-top: 12px solid var(--copper-accent);
    z-index: 2;
    opacity: 0.7;
}

/* 羊皮紙の左端の装飾線（古い装丁風） */
.bookmark-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--copper-accent), var(--antique-brown));
    border-radius: 4px 0 0 4px;
    opacity: 0.6;
}

.bookmark-item:hover {
    background: var(--warm-cream);
    box-shadow: 
        0 6px 12px rgba(93, 78, 55, 0.2),
        inset 0 1px 0 rgba(248, 243, 231, 0.8),
        inset 0 -1px 0 rgba(139, 111, 71, 0.15);
}

.bookmark-item:nth-child(odd):hover {
    transform: translateY(-3px) rotate(1deg);
}

.bookmark-item:nth-child(even):hover {
    transform: translateY(-3px) rotate(-0.8deg);
}

.bookmark-item:last-child {
    border-bottom: 1px solid var(--border-color);
}

.bookmark-content {
    flex: 1;
    padding: 20px 20px 20px 28px; /* 左側の余白を少し詰める */
    cursor: default;
    position: relative;
    z-index: 1;
}

.bookmark-title {
    margin: 0 0 10px 0;
    font-size: 17px;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Zen Old Mincho', 'Playfair Display', 'Libre Baskerville', 'Times New Roman', 'Georgia', serif;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.1);
    transition: color 0.3s ease;
}

.bookmark-title:hover {
    color: var(--accent-color);
}

.bookmark-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.bookmark-domain {
    font-weight: 500;
    color: var(--accent-color);
    font-style: normal;
}

.bookmark-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* 古い羊皮紙風のタグデザイン */
.tag {
    background: linear-gradient(45deg, var(--warning-color) 0%, var(--secondary-color) 100%);
    color: var(--dark-sepia);
    padding: 3px 10px;
    border: 1px solid var(--antique-brown);
    border-radius: 12px 6px 10px 8px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 
        0 2px 4px rgba(93, 78, 55, 0.15),
        inset 0 1px 0 rgba(248, 243, 231, 0.3);
    font-family: 'Georgia', 'Times New Roman', serif;
    position: relative;
    transition: all 0.2s ease;
    transform: rotate(-1deg);
    display: inline-flex; /* 編集ボタンと横並びにする */
    align-items: center;
    gap: 6px;
    margin: 2px;
    /* 古い紙の質感 */
    background-image: 
        radial-gradient(circle at 70% 30%, rgba(184, 115, 51, 0.1) 0%, transparent 50%);
}

.tag:hover {
    background: linear-gradient(45deg, var(--copper-accent) 0%, var(--old-gold) 100%);
    color: var(--warm-cream);
    transform: translateY(-1px) rotate(0.5deg);
    box-shadow: 
        0 3px 6px rgba(93, 78, 55, 0.2),
        inset 0 1px 0 rgba(248, 243, 231, 0.4);
}

/* 交互のタグの傾き */
.tag:nth-child(even) {
    transform: rotate(1deg);
}

.tag:nth-child(odd) {
    transform: rotate(-1.5deg);
}

/* タグ削除ボタン */
.tag-remove {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: rgba(0,0,0,0.08);
    color: var(--dark-sepia);
    width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.tag-remove:hover {
    background: rgba(0,0,0,0.18);
}
.tag-label { pointer-events: none; }

/* タグ追加ボタン（リスト末尾用） */
.tag-add {
    appearance: none;
    -webkit-appearance: none;
    border: 1px dashed rgba(0,0,0,0.2);
    background: transparent;
    color: var(--accent-color);
    width: 22px;
    height: 22px;
    line-height: 20px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}
.tag-add:hover {
    border-color: var(--accent-color);
    background: rgba(0,0,0,0.03);
}

.bookmark-actions {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 5px;
}

.bookmark-actions button {
    width: 44px;
    height: 44px;
    border: 3px solid var(--accent-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    color: var(--paper-bg);
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 3px 6px rgba(139, 69, 19, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-archive:hover {
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--accent-color) 100%);
    border-color: var(--warning-color);
    transform: translateY(-2px);
    box-shadow: 
        0 5px 10px rgba(218, 165, 32, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #DC6E6E 0%, #C85A5A 100%);
    border-color: #C85A5A;
    transform: translateY(-2px);
    box-shadow: 
        0 5px 10px rgba(168, 67, 67, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* グループ表示 - 古い洋書風 */
.domain-group, .date-group {
    margin-bottom: 30px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.group-header {
    background: var(--secondary-color);
    padding: 18px 25px;
    border-bottom: 2px solid var(--divider-color);
    position: relative;
}

/* グループヘッダーの装飾 */
.group-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25px;
    right: 25px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.group-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--primary-color);
    font-family: 'Georgia', serif;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-content {
    background: white;
}

.date-subgroup {
    border-top: 1px solid var(--medium-gray);
}

.date-subgroup:first-child {
    border-top: none;
}

.subgroup-header {
    background: #f8f9fa;
    padding: 10px 20px;
    border-bottom: 1px solid var(--medium-gray);
}

.subgroup-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

.subgroup-content {
    background: white;
}

/* グルーピングされた状態での境界線調整 */
.group-content .bookmark-item:last-child,
.subgroup-content .bookmark-item:last-child {
    border-bottom: none;
}

/* フィルタレイアウトの改善 */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.filters select,
.filters input[type="text"] {
    flex: 1;
    min-width: 150px;
}

.view-and-group-toggle {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.view-toggle,
.group-toggle {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.view-toggle label,
.group-toggle label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 14px;
    cursor: pointer;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--light-gray);
    border-radius: var(--radius);
    margin-top: 10px;
}

.custom-date-range input[type="date"] {
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
}

/* 空の状態 - 古い洋書風 */
.empty-state {
    text-align: center;
    padding: 80px 25px;
    color: var(--text-muted);
    background: var(--aged-paper);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    margin: 20px 0;
}

.empty-state p {
    font-size: 18px;
    margin: 0;
    font-family: 'Georgia', serif;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

/* ステータス - 古い洋書風 */
.status {
    text-align: center;
    padding: 18px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-muted);
    font-family: 'Georgia', serif;
    font-style: italic;
    box-shadow: var(--shadow);
}

/* フローティングヘルプボタン - アンティーク調 */
.floating-help-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--copper-accent) 0%, var(--old-gold) 100%);
    color: var(--warm-cream);
    border: 3px solid var(--antique-brown);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 
        0 6px 16px rgba(93, 78, 55, 0.3),
        inset 0 2px 0 rgba(248, 243, 231, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    font-family: 'Georgia', 'Times New Roman', serif;
    transform: rotate(-2deg);
    text-shadow: 1px 1px 2px rgba(93, 78, 55, 0.6);
}

.floating-help-btn:hover {
    background: linear-gradient(135deg, var(--old-gold) 0%, var(--leather-brown) 100%);
    transform: rotate(0deg) scale(1.05);
    box-shadow: 
        0 8px 20px rgba(93, 78, 55, 0.4),
        inset 0 2px 0 rgba(248, 243, 231, 0.4);
}

.floating-help-btn:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 110px; /* フローティングボタンとの重複を避ける */
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius);
    color: white;
    font-weight: bold;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow);
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

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

.toast.error {
    background: var(--danger-color);
}

.toast.info {
    background: var(--primary-color);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px 10px;
    }
    
    /* 小さい画面では縦並びに変更 */
    .header-grid {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-left,
    .header-center,
    .header-right {
        justify-content: center;
        padding: 0;
    }
    
    .header-center h1 {
        font-size: 2.2em;
    }
    
    .header-left .subtitle {
        font-size: 1em;
        font-weight: 700;
    }
    
    .header-right .handmade-badge {
        font-size: 0.75em;
        font-weight: 700;
        padding: 4px 10px;
    }
    
    .add-form {
        flex-direction: column;
    }
    
    .add-form input {
        min-width: auto;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters input {
        min-width: auto;
    }
    

    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .form-actions .smart-btn,
    .form-actions .primary-btn {
        width: 100%;
        text-align: center;
    }
    
    .selection-controls {
        justify-content: center;
        gap: 4px;
    }

    .bulk-tags-wrapper {
        min-width: 100%;
        align-items: stretch;
    }

    #bulkTagsContainer {
        flex-direction: column;
        align-items: stretch;
    }

    #bulkTagsContainer input,
    #bulkTagsContainer button {
        width: 100%;
    }
    
    .selection-controls .smart-btn {
        flex: 1;
        min-width: 70px;
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .bookmark-item {
        flex-direction: column;
    }
    
    .bookmark-actions {
        flex-direction: row;
        padding: 15px 20px 20px 20px;
        gap: 10px;
    }
    
    .bookmark-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .toast {
        right: 15px;
        left: 15px;
        max-width: none;
    }
}





/* タブレット・中サイズ画面での調整 */
@media (max-width: 1024px) and (min-width: 769px) {
    .header-center h1 {
        font-size: 2.5em;
    }
    
    .header-left .subtitle {
        font-size: 1.05em;
        font-weight: 700;
    }
    
    .header-right .handmade-badge {
        font-size: 0.8em;
        font-weight: 700;
        padding: 4px 11px;
    }
    
    .header-grid {
        gap: 15px;
    }
}

/* 印刷スタイル */
@media print {
    .controls,
    .bookmark-actions,
    .toast {
        display: none;
    }
    
    .bookmarks-list {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .bookmark-item:hover {
        background-color: transparent;
    }
}

/* Werther's Original キャラメルゴールド・赤縁取りボタン */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'EB Garamond', 'Old Standard TT', 'Georgia', serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 2px solid var(--accent-red);
    border-radius: 12px;
    background: linear-gradient(135deg, var(--caramel-300), var(--caramel-700));
    color: white;
    text-shadow: none;
    box-shadow:
        0 2px 0 rgba(96, 29, 13, 0.25),
        inset 0 1px 0 var(--cream);
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* タグサジェストドロップダウン */
.tag-dropdown {
    position: absolute;
    z-index: 2000;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

.tag-dropdown.above {
    box-shadow: 0 -8px 20px rgba(0,0,0,0.15);
}

.tag-dropdown-header {
    display: flex;
    gap: 4px;
    padding: 6px;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-gray);
}

.tag-dropdown-header .seg {
    flex: 1;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
}

.tag-dropdown-header .seg.active,
.tag-dropdown-header .seg[aria-pressed="true"] {
    background: var(--secondary-color);
    border-color: var(--divider-color);
}

.tag-dropdown-list {
    max-height: 240px;
    overflow: auto;
}

.tag-option {
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tag-option:hover,
.tag-option.active {
    background: #e6f2ff;
}

.tag-option-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag-suggest-delete {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    color: #999;
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.tag-option:hover .tag-suggest-delete,
.tag-option.active .tag-suggest-delete {
    opacity: 1.0;
}
.tag-suggest-delete:hover {
    background: rgba(0,0,0,0.05);
    color: #c00;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--caramel-500), var(--caramel-800));
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(96, 29, 13, 0.3),
        inset 0 1px 0 var(--cream);
}

.btn-primary:active {
    background: linear-gradient(135deg, var(--caramel-600), #8C4A1B);
    transform: translateY(-1px);
    box-shadow:
        0 2px 4px rgba(96, 29, 13, 0.25),
        inset 0 1px 0 var(--cream);
}

.btn-primary:focus {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #E3AB92, #C89B8A);
    border-color: #E3AB92;
    color: #B87A6A;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 0 rgba(96, 29, 13, 0.15);
}

/* セカンダリ（枠線ボタン） */
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'EB Garamond', 'Old Standard TT', 'Georgia', serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 2px solid var(--accent-red);
    border-radius: 12px;
    background: var(--cream);
    color: var(--caramel-800);
    text-shadow: none;
    box-shadow: 0 2px 0 rgba(96, 29, 13, 0.15);
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--caramel-100);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(96, 29, 13, 0.2);
}

.btn-outline:focus {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

/* フォーカススタイル（アクセシビリティ） */
button:focus,
input:focus,
select:focus,
.bookmarklet-button:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* 高コントラストアクセシビリティ */
@media (prefers-contrast: more) {
    :root {
        --text-color: #000000;
        --text-muted: #333333;
        --border-color: #808080;
    }
    
    .tag {
        border: 2px solid #000000;
    }
    
    .bookmark-item {
        border: 2px solid #000000;
    }
}

/* 無効化スタイル */
button:disabled,
input:disabled,
select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 説明欄スタイル - 古い洋書風 */
.add-form textarea,
.edit-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Georgia', serif;
    font-size: 14px;
    line-height: 1.6;
    background: var(--paper-bg);
    color: var(--text-color);
    resize: vertical;
    min-height: 80px;
    box-shadow: inset 0 2px 4px rgba(139, 69, 19, 0.05);
    transition: all 0.3s ease;
}

.add-form textarea:focus,
.edit-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: inset 0 2px 4px rgba(139, 69, 19, 0.1), 0 0 8px rgba(139, 69, 19, 0.2);
}

/* ブックマーク説明欄表示 */
.bookmark-description {
    margin-top: 8px;
    font-size: 14px;
    color: var(--dark-gray);
    line-height: 1.4;
    white-space: pre-wrap;
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--paper-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--book-shadow);
    position: relative;
}

/* モーダルの本風装飾 */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--book-spine), var(--accent-color), var(--book-spine));
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.edit-form label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.edit-form input,
.edit-form textarea {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
}

.edit-form input:focus,
.edit-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-cancel {
    padding: 10px 20px;
    border: 3px solid #7A7A7A;
    background: linear-gradient(135deg, #8E8E8E 0%, #7A7A7A 100%);
    color: var(--paper-bg);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: 'EB Garamond', 'Old Standard TT', 'Georgia', serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 8px rgba(90, 90, 90, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #A2A2A2 0%, #8E8E8E 100%);
    border-color: #8E8E8E;
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(90, 90, 90, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.btn-save {
    padding: 10px 20px;
    border: 3px solid var(--success-color);
    background: linear-gradient(135deg, #83B461 0%, var(--success-color) 100%);
    color: var(--paper-bg);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: 'EB Garamond', 'Old Standard TT', 'Georgia', serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 8px rgba(85, 107, 47, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-save:hover {
    background: linear-gradient(135deg, #97C875 0%, #83B461 100%);
    border-color: #83B461;
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(85, 107, 47, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

/* 編集ボタン */
.btn-edit {
    width: 44px;
    height: 44px;
    border: 3px solid var(--accent-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    color: var(--paper-bg);
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 3px 6px rgba(139, 69, 19, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #5CA4B8 0%, #4A90A4 100%);
    border-color: #4A90A4;
    transform: translateY(-2px);
    box-shadow: 
        0 5px 10px rgba(74, 144, 164, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* ヘルプモーダル専用スタイル */
.help-content {
    line-height: 1.6;
}

.help-content h4 {
    margin: 20px 0 10px 0;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
}

.help-content h4:first-child {
    margin-top: 0;
}

.help-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.help-content li {
    margin: 8px 0;
}

.help-content strong {
    color: var(--text-color);
    font-weight: 600;
}

.help-content kbd {
    background: var(--medium-gray);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 12px;
    font-family: monospace;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.help-content p {
    margin: 10px 0;
}

/* モーダルのレスポンシブ対応 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
    
    .help-content h4 {
        font-size: 15px;
    }
    
    .help-content ul {
        padding-left: 16px;
    }
}
