:root {
    --primary-color: #556b2f; /* アースグリーン */
    --primary-light: #7c9354;
    --primary-dark: #3e4f21;
    --accent-color: #d4a373; /* ソフトブラウン/ゴールド */
    --bg-color: #fdfbf7; /* アイボリー系 */
    --card-bg: #ffffff;
    --text-main: #4a4a4a;
    --text-light: #7a7a7a;
    --border-color: #e5e0d8;
    --shadow-sm: 0 2px 8px rgba(85, 107, 47, 0.08);
    --shadow-md: 0 4px 12px rgba(85, 107, 47, 0.12);
    --shadow-hover: 0 8px 24px rgba(85, 107, 47, 0.15);
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 999px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Meiryo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45)), url('背景素材.png');
    background-size: cover;
    background-position: center;
    color: var(--primary-dark);
    padding: 2.5rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-bottom: 2px solid var(--primary-light);
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.app-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: 2px;
    color: var(--primary-dark);
    text-shadow: 2px 2px 0px rgba(255,255,255,0.9), -1px -1px 0px rgba(255,255,255,0.9), 0px 0px 8px rgba(255,255,255,1), 3px 3px 6px rgba(85, 107, 47, 0.3);
}

.app-notice {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.6);
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: var(--radius-full);
}

/* Main */
.app-main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Search Section */
.search-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

#searchInput {
    flex: 1;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-speed);
    font-family: inherit;
}

#searchInput:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(124, 147, 84, 0.1);
}

.search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1.2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.search-btn:hover {
    background-color: var(--primary-dark);
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.filter-group select {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #fafafa;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.filter-group select:focus {
    border-color: var(--primary-light);
}

.reset-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.2rem;
    transition: color 0.2s;
}

.reset-btn:hover {
    color: #b58552;
}

/* Results Section */
.results-count {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

#countNumber {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Card Design */
.ingredient-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
}

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

.card-header {
    background-color: rgba(85, 107, 47, 0.04);
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.category-badge {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background-color: var(--primary-light);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.ingredient-name {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
}

.ingredient-furigana {
    font-size: 0.75rem;
    color: var(--text-light);
}

.card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tag-nature {
    background-color: #f0f4eb;
    color: #4a5c2d;
}
.tag-nature:hover {
    background-color: #e1ebda;
    border-color: #4a5c2d;
}

.tag-flavor {
    background-color: #fbf3ec;
    color: #a87b51;
}
.tag-flavor:hover {
    background-color: #f7e6d7;
    border-color: #a87b51;
}

.tag-meridian {
    background-color: #f4f6f8;
    color: #5c6b7a;
}
.tag-meridian:hover {
    background-color: #e7ecf0;
    border-color: #5c6b7a;
}

.tag-label {
    font-weight: bold;
    margin-right: 0.2rem;
    opacity: 0.8;
}

.efficacy-section h3, .notes-section h3 {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.2rem;
}

.efficacy-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.efficacy-tag {
    font-size: 0.85rem;
    background-color: rgba(212, 163, 115, 0.1);
    color: #9a6b3e;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s;
}

.efficacy-tag:hover {
    background-color: rgba(212, 163, 115, 0.2);
}

.notes-text {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 600px) {
    .filter-section {
        flex-direction: column;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}
