/* 菜谱网站样式 - 移动优先响应式设计 */
:root {
    --primary: #e85d04;
    --primary-light: #f48c06;
    --bg: #faf7f2;
    --card-bg: #ffffff;
    --text: #2d2d2d;
    --text-light: #666;
    --border: #e8e4de;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    background: var(--primary);
    color: white;
    padding: 2rem 1rem 1.5rem;
    text-align: center;
}
.header h1 { font-size: 1.5rem; font-weight: 600; }
.header-sm { padding: 1.2rem 1rem 1rem; }
.subtitle { opacity: 0.85; font-size: 0.9rem; margin-top: 0.3rem; }
.back-link {
    color: white; text-decoration: none; font-size: 0.9rem;
    display: inline-block; margin-bottom: 0.5rem; opacity: 0.9;
}
.back-link:hover { opacity: 1; }

/* Search */
.search-box {
    display: flex; gap: 0.5rem;
    max-width: 500px; margin: 1rem auto 0;
}
.search-box input {
    flex: 1; padding: 0.6rem 1rem; border: none; border-radius: 8px;
    font-size: 0.95rem; outline: none;
}
.search-box button {
    padding: 0.6rem 1.2rem; border: none; border-radius: 8px;
    background: var(--text); color: white; font-size: 0.95rem;
    cursor: pointer; white-space: nowrap;
}
.search-box button:active { opacity: 0.8; }

/* Container */
.container {
    max-width: 800px; margin: 0 auto; padding: 1rem;
}

/* Section */
.section { margin-bottom: 1.5rem; }
.section h2 {
    font-size: 1.1rem; margin-bottom: 0.8rem; font-weight: 600;
}

/* Category Grid */
.cat-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.6rem;
}
.cat-card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 0.8rem; text-align: center; text-decoration: none;
    color: var(--text); box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 0.2rem;
    transition: transform 0.15s;
}
.cat-card:active { transform: scale(0.97); }
.cat-name { font-size: 0.95rem; font-weight: 500; }
.cat-count { font-size: 0.75rem; color: var(--text-light); }

/* Recipe Grid */
.recipe-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.8rem;
}

/* Recipe Card */
.recipe-card {
    background: var(--card-bg); border-radius: var(--radius);
    overflow: hidden; text-decoration: none; color: var(--text);
    box-shadow: var(--shadow); transition: transform 0.15s;
    display: flex; flex-direction: column;
}
.recipe-card:active { transform: scale(0.98); }
.card-img { width: 100%; aspect-ratio: 16/10; overflow: hidden; background: #f0ebe4; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 0.8rem; }
.card-body h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; }
.card-desc {
    font-size: 0.8rem; color: var(--text-light); margin-top: 0.3rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Tag */
.tag {
    display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.5rem;
    background: #fff3e0; color: var(--primary); border-radius: 20px;
    font-weight: 500;
}

/* Detail Page */
.detail-page .section { margin-bottom: 1.5rem; }
.detail-page h2 {
    font-size: 1.05rem; margin-bottom: 0.8rem;
    padding-bottom: 0.4rem; border-bottom: 2px solid var(--primary);
}

/* Ingredients */
.ingredients-list {
    list-style: none; display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.ingredients-list li {
    padding: 0.4rem 0.6rem; background: #faf7f2; border-radius: 6px;
    font-size: 0.9rem;
}
.amount { color: var(--primary); font-weight: 500; }

/* Steps */
.steps-list { list-style: none; counter-reset: none; }
.steps-list li {
    padding: 0.6rem 0; border-bottom: 1px solid var(--border);
    font-size: 0.95rem; line-height: 1.7;
    display: flex; gap: 0.6rem; align-items: flex-start;
}
.steps-list li:last-child { border-bottom: none; }
.step-num {
    background: var(--primary); color: white;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 600; flex-shrink: 0; margin-top: 2px;
}

/* Tips */
.tips {
    background: #fff8e1; border-radius: var(--radius);
    padding: 1rem; border-left: 4px solid var(--primary-light);
}
.tips h3 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.tips p { font-size: 0.9rem; color: var(--text-light); white-space: pre-line; }

/* Recipe Image */
.recipe-image {
    margin-bottom: 1rem; border-radius: var(--radius); overflow: hidden;
}
.recipe-image img { width: 100%; display: block; }

/* Footer */
.footer {
    text-align: center; padding: 1.5rem; color: var(--text-light);
    font-size: 0.8rem;
}

/* Empty state */
.empty-state {
    text-align: center; padding: 3rem 1rem; color: var(--text-light);
}
.empty-state p { font-size: 1.1rem; }

/* Search highlight */
.search-highlight { background: #fff3cd; padding: 0 2px; border-radius: 2px; }

/* Responsive */
@media (min-width: 600px) {
    .header h1 { font-size: 1.8rem; }
    .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .ingredients-list { grid-template-columns: 1fr 1fr 1fr; }
}
