/* 全局字体定义 - 阿里巴巴普惠体 */
@font-face {
    font-family: 'AliPuHui';
    src: url('/preorder/fonts/ali.woff2') format('woff2'),
         url('/preorder/fonts/ali.woff') format('woff');
    font-display: swap;
}
/* ============================================
   assets/recipe.css - 菜谱库管理专用样式
   后台管理 + 前台展示 (整合分页、搜索栏等)
   ============================================ */

/* ----- 全局重置与基础样式（供前台及后台共用） ----- */
* {
    -webkit-tap-highlight-color: transparent;
}
a, button, [onclick] {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
a:active, button:active, [onclick]:active {
    outline: none;
}

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

body {
    font-family: "AliPuHui","PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
    min-height: 100vh;
}

/* ============================================
   后台菜谱列表卡片
   ============================================ */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.recipe-card {
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    border: 2px solid #f1e7eb;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(212,78,122,0.1);
    border-color: #fbb1c2;
}

.recipe-card-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #fef0f5, #fff5f0);
    border-bottom: 2px solid #fbb1c2;
}

.recipe-card-cover-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #fef0f5 0%, #fff5f0 50%, #fef0f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #fbb1c2;
    border-bottom: 2px solid #fbb1c2;
}

.recipe-card-body {
    padding: 20px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recipe-card-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #a63c5e;
    margin-bottom: 8px;
    line-height: 1.3;
}

.recipe-card-body .card-desc {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 16px;
}

.recipe-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.recipe-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recipe-card-actions .btn-sm {
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.recipe-card-actions .btn-sm:hover {
    background: #fef0f5;
    border-color: #ffb3c6;
}

.recipe-card-actions .btn-sm.btn-print {
    background: #4f46e5;
    color: #fff;
    border: none;
    box-shadow: 0 3px 0 #3730a3;
}

.recipe-card-actions .btn-sm.btn-print:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #3730a3;
}

.recipe-card-actions .btn-sm.btn-delete {
    color: #b91c1c;
    border-color: #fee2e2;
}

.recipe-card-actions .btn-sm.btn-delete:hover {
    background: #fee2e2;
}

/* ----- 后台菜谱编辑页 ----- */
.recipe-edit-section {
    background: #fafcff;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    border: 2px solid #f1e7eb;
}

.recipe-edit-section h3 {
    color: #a63c5e;
    font-size: 1.2rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ingredient-row,
.step-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    background: #fff;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid #f1e7eb;
}

.ingredient-row .drag-handle,
.step-row .drag-handle {
    cursor: grab;
    color: #cbd5e1;
    font-size: 1.3rem;
    user-select: none;
}

.ingredient-row input,
.step-row input,
.step-row textarea {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border 0.2s, box-shadow 0.2s;
}

.ingredient-row input:focus,
.step-row input:focus,
.step-row textarea:focus {
    border-color: #ff85a2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,138,174,0.1);
}

.ingredient-row .ing-name {
    flex: 2 1 140px;
    min-width: 120px;
}

.ingredient-row .ing-qty {
    flex: 1 1 120px;
    min-width: 100px;
}

.step-row .step-desc {
    flex: 4 1 300px;
    min-width: 200px;
    min-height: 42px;
    resize: vertical;
}

.step-row .step-number-badge {
    background: #ff8aae;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ingredient-row .remove-btn,
.step-row .remove-btn {
    background: #fff1f2;
    border: 1px solid #ffccd0;
    color: #b91c1c;
    padding: 8px 14px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}

.ingredient-row .remove-btn:hover,
.step-row .remove-btn:hover {
    background: #fee2e2;
}

.cover-upload-area {
    border: 3px dashed #fbb1c2;
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    background: #fff9fb;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.cover-upload-area:hover {
    border-color: #ff8aae;
    background: #fff0f5;
}

.cover-upload-area i {
    font-size: 2.5rem;
    color: #ff8aae;
    margin-bottom: 8px;
}

.cover-upload-area p {
    color: #a63c5e;
    font-weight: 500;
}

.cover-preview {
    max-width: 300px;
    max-height: 200px;
    border-radius: 20px;
    margin-top: 12px;
    border: 3px solid #fbb1c2;
    object-fit: cover;
}

/* ----- 菜谱详情页（后台查看 + 前台展示共用） ----- */
.recipe-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.recipe-detail-hero {
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    margin-bottom: 28px;
    border: 3px solid #fbb1c2;
    box-shadow: 0 12px 32px rgba(212,78,122,0.08);
}

.recipe-detail-hero img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.recipe-detail-hero .hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    padding: 40px 28px 24px;
}

.recipe-detail-hero .hero-overlay h1 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin: 0;
}

.recipe-detail-hero .hero-placeholder {
    background: linear-gradient(135deg, #fef0f5, #fff5f0, #fef0f5);
    padding: 60px 28px 40px;
    text-align: center;
}

.recipe-detail-hero .hero-placeholder h1 {
    color: #a63c5e;
    font-size: 2rem;
    font-weight: 700;
}

/* 简介段落 */
.recipe-detail-intro {
    color: #4a2c3a;
    text-align: center;
    margin: 24px 0 28px;
    font-size: 1.05rem;
    line-height: 1.6;
}

.recipe-detail-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    color: #64748b;
    font-size: 0.95rem;
}

.recipe-detail-meta span {
    background: #f8fafc;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid #e9eef2;
}

/* 食材清单 */
.ingredients-section {
    background: #fff9fb;
    border-radius: 28px;
    padding: 28px;
    margin-bottom: 28px;
    border: 2px solid #ffd9e4;
}

.ingredients-section h2 {
    color: #a63c5e;
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.ingredient-tag {
    background: #fff;
    border: 2px solid #ffd0dc;
    border-radius: 20px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.ingredient-tag:hover {
    border-color: #ff8aae;
    box-shadow: 0 4px 12px rgba(212,78,122,0.06);
}

.ingredient-tag .ing-name {
    font-weight: 600;
    color: #4a2c3a;
}

.ingredient-tag .ing-qty {
    color: #a63c5e;
    font-weight: 700;
    background: #fef0f5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* 制作步骤 */
.steps-section {
    margin-bottom: 28px;
}

.steps-section h2 {
    color: #a63c5e;
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-item {
    display: flex;
    gap: 18px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.step-number {
    background: #ff8aae;
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255,138,174,0.3);
}

.step-content {
    flex: 1;
    background: #fff;
    border-radius: 20px;
    padding: 18px 22px;
    border: 2px solid #f1e7eb;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #334155;
}

/* 小贴士 */
.tips-section {
    background: #fff9db;
    border-radius: 24px;
    padding: 24px 28px;
    border: 2px solid #ffd966;
    margin-bottom: 28px;
}

.tips-section h2 {
    color: #a63c5e;
    font-size: 1.2rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-section p {
    color: #4a2c3a;
    font-size: 1rem;
    line-height: 1.7;
}

/* 操作按钮区 */
.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.btn-print-large {
    background: #4f46e5;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 0 #3730a3;
    transition: all 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-print-large:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #3730a3;
}

.btn-print-large:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #3730a3;
}

.btn-back-detail {
    background: #fff;
    padding: 14px 28px;
    border-radius: 50px;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid #e9eef2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-back-detail:hover {
    background: #fef0f5;
    border-color: #ffb3c6;
    text-decoration: none;
    color: #a63c5e;
}

/* ============================================
   后台搜索栏 & 按钮统一样式
   ============================================ */
.recipe-search-bar {
    position: relative;
    margin: 20px 0 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.recipe-search-bar i.fa-search {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #c94f7c;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 1;
}

.recipe-search-bar input {
    flex: 1 1 240px;
    min-width: 180px;
    max-width: 400px;
    height: 48px;
    padding: 0 20px 0 48px;
    border: 2px solid #ffd0dc;
    border-radius: 60px;
    font-size: 1rem;
    background: white;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.recipe-search-bar input:focus {
    border-color: #ff85a2;
    box-shadow: 0 0 0 4px rgba(255, 138, 174, 0.1);
}

.search-btn,
.clear-search-btn {
    height: 48px;
    padding: 0 22px;
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    margin-left: 10px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.search-btn {
    background: #ff8aae;
    color: #fff;
    border: none;
    box-shadow: 0 3px 0 #c1547a;
}

.search-btn:hover {
    background: #ff7a9f;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #c1547a;
}

.search-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #c1547a;
}

.clear-search-btn {
    background: #fee2e2;
    color: #b91c1c;
    border: 2px solid #fecaca;
}

.clear-search-btn:hover {
    background: #fecaca;
}

/* 移动端搜索栏 */
@media (max-width: 600px) {
    .recipe-search-bar input {
        max-width: 100%;
        width: 100%;
        margin-bottom: 10px;
    }
    .search-btn,
    .clear-search-btn {
        margin-left: 0;
        margin-right: 8px;
        margin-bottom: 10px;
    }
}

/* ============================================
   前台菜谱库列表（recipes.php）样式
   ============================================ */
.recipe-front-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px 50px;
}

/* 平板端 */
@media (min-width: 769px) and (max-width: 1024px) {
    .recipe-front-list {
        max-width: 680px;
        padding: 28px 28px 50px;
    }
}

.recipe-front-list .list-header {
    text-align: center;
    padding: 20px 0 12px;
    position: relative;
}

.recipe-front-list .list-header h1 {
    color: #a63c5e;
    font-size: 1.8rem;
    font-weight: 700;
}

.recipe-front-list .list-header p {
    color: #64748b;
    margin-top: 6px;
}

.back-home {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c94f7c;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    background: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s;
    border: 1px solid #f1e7eb;
}

.back-home:hover {
    background: #fef0f5;
    border-color: #ffb3c6;
}

/* ---------- 前台搜索栏（优化版：内嵌图标，消除贴边与溢出） ---------- */
.front-search-bar {
    margin: 0 0 24px;
    display: flex;
    justify-content: center;
}

.search-input-wrap {
    position: relative;
    width: 100%;
    /* 移除固定 max-width，改为继承父级宽度，与卡片对齐 */
}

/* 图标 */
.search-input-wrap .search-icon-tap {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #d95f8c;
    font-size: 1.2rem;
    pointer-events: auto;
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s;
}

.search-input-wrap .search-icon-tap:hover {
    color: #ff7a9f;
}

/* 输入框 */
.search-input-wrap .search-input-with-icons {
    width: 100%;
    height: 50px;
    padding: 0 48px 0 48px; /* 左右留出图标与清除按钮空间 */
    border: 2px solid #ffd0dc;
    border-radius: 50px;
    font-size: 1rem;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border 0.2s, box-shadow 0.2s;
    color: #1e293b;
}

.search-input-wrap .search-input-with-icons:focus {
    border-color: #ff85a2;
    box-shadow: 0 0 0 4px rgba(255, 138, 174, 0.15);
}

/* 清除按钮 */
.search-inline-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff1f2;
    border: 1px solid #ffccd0;
    color: #b91c1c;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    line-height: 1;
}

.search-inline-clear:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
    .search-input-wrap {
        /* 容器撑满宽度，无需额外padding */
    }
    .search-input-wrap .search-icon-tap {
        left: 16px;      /* 留出舒适间距 */
        font-size: 1.1rem;
    }
    .search-input-wrap .search-input-with-icons {
        height: 48px;
        padding: 0 46px 0 46px;  /* 保证左右呼吸空间 */
        font-size: 0.95rem;
    }
    .search-inline-clear {
        right: 12px;     /* 避免贴边 */
        width: 28px;
        height: 28px;
    }
}

/* ---------- 平板端 ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
    /* 前端列表容器内边距已定，搜索栏无需额外 max-width，自动与卡片对齐 */
    .search-input-wrap .search-icon-tap {
        left: 18px;
    }
    .search-input-wrap .search-input-with-icons {
        padding: 0 50px 0 48px;
    }
    .search-inline-clear {
        right: 14px;     /* 确保在输入框内部 */
    }
}

/* 桌面端保持原有舒适比例 */
@media (min-width: 1025px) {
    .search-input-wrap {
        /* 可恢复宽屏最大宽度，留出优雅比例 */
        max-width: 600px;
        margin: 0 auto;
    }
}

/* 前台列表卡片 */
.front-recipe-card-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.front-recipe-card {
    position: relative;
    min-height: 110px;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid #f1e7eb;
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: block;
}

.front-recipe-card:hover {
    border-color: #fbb1c2;
    box-shadow: 0 8px 24px rgba(212,78,122,0.08);
    text-decoration: none;
    color: inherit;
    transform: translateY(-2px);
}

.front-card-img,
.front-card-img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 110px;
    height: 100%;
    object-fit: cover;
    background: #fef0f5;
    border-radius: 18px 0 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #fbb1c2;
}

.front-card-img-placeholder {
    background: linear-gradient(135deg, #fef0f5, #fff5f0);
}

.front-card-body {
    margin-left: 126px;
    padding: 16px 16px 16px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 110px;
    position: relative;
    z-index: 1;
}

.front-card-body h3 {
    color: #a63c5e;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.front-card-body .front-card-desc {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.front-card-body .front-card-meta {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* 加入待烹饪按钮 */
.btn-add-pending {
    position: absolute;
    right: 10px;
    top: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ffb3c6;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    color: #a63c5e;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    z-index: 2;
}

.btn-add-pending:hover {
    background: #fef0f5;
    border-color: #ff8aae;
}

/* 移动端前台调整 */
@media (max-width: 768px) {
    .recipe-front-list {
        padding: 16px 16px 40px;
    }

    .recipe-front-list .list-header h1 {
        font-size: 1.6rem;
    }

    .back-home {
        position: static;
        transform: none;
        margin-bottom: 10px;
        width: fit-content;
        left: auto;
    }

    .list-header {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .front-recipe-card {
        min-height: 90px;
    }

    .front-card-img,
    .front-card-img-placeholder {
        width: 90px;
        border-radius: 14px 0 0 14px;
    }

    .front-card-body {
        margin-left: 106px;
        min-height: 90px;
    }

    .front-card-body h3 {
        font-size: 1rem;
    }

    .btn-add-pending {
        right: 6px;
        top: 6px;
        padding: 2px 8px;
        font-size: 0.7rem;
    }
}

/* 平板端前台微调 */
@media (min-width: 769px) and (max-width: 1024px) {
    .recipe-front-list .list-header h1 {
        font-size: 1.7rem;
    }
    .front-recipe-card {
        min-height: 100px;
    }
    .front-card-img,
    .front-card-img-placeholder {
        width: 100px;
        border-radius: 16px 0 0 16px;
    }
    .front-card-body {
        margin-left: 116px;
        min-height: 100px;
    }
}

/* ----- 前台密码验证页样式 ----- */
.password-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(145deg, #fef0f5 0%, #ffe4ec 100%);
}

.password-gate .gate-box {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 36px 28px;
    border-radius: 40px;
    box-shadow: 0 16px 0 #fbb1c2, 0 24px 40px rgba(212,78,122,0.12);
    width: 100%;
    max-width: 400px;
    border: 3px solid #fff;
    text-align: center;
}

.password-gate .gate-box h2 {
    color: #a63c5e;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.password-gate .gate-box p {
    color: #64748b;
    margin-bottom: 24px;
}

.password-gate .gate-box input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #f9c6d4;
    border-radius: 40px;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 14px;
}

.password-gate .gate-box button {
    background: #ff8aae;
    color: #fff;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 0 #c1547a;
    transition: all 0.1s;
}

.password-gate .gate-box button:hover {
    background: #ff7a9f;
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #c1547a;
}

.password-gate .gate-box .gate-error {
    color: #b91c1c;
    margin-top: 12px;
    font-size: 0.9rem;
}

/* ----- 通用分页样式（后台和前台共用） ----- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    background: white;
    color: #334155;
    white-space: nowrap;
}

.pagination a:hover {
    background: #fef0f5;
    border-color: #ffb3c6;
    color: #a63c5e;
}

.pagination .active {
    background: #ff8aae;
    color: white;
    border-color: #ff8aae;
}

.pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
}

.pagination .ellipsis {
    pointer-events: none;
    border: none;
    background: transparent;
    min-width: auto;
    padding: 0 4px;
}

/* ----- 辅助 ----- */
.no-result-msg {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
}

/* 打印样式 */
@media print {
    body {
        background: #fff !important;
        font-size: 13pt;
        color: #000;
    }
    header, nav, .no-print, .detail-actions, .btn-print-large, .btn-back-detail,
    .copyright, .recipe-card-actions, #toast-container {
        display: none !important;
    }
    .admin-container {
        max-width: 100%;
        margin: 0;
        padding: 10px;
    }
    .content {
        box-shadow: none;
        border: none;
        padding: 0;
        background: #fff;
    }
    .recipe-detail-container {
        max-width: 100%;
    }
    .recipe-detail-hero {
        border: 2px solid #ccc;
        box-shadow: none;
        border-radius: 8px;
    }
    .recipe-detail-hero .hero-overlay h1 {
        color: #000;
        text-shadow: none;
        font-size: 1.6rem;
    }
    .recipe-detail-hero .hero-placeholder h1 {
        font-size: 1.6rem;
    }
    .ingredients-section {
        background: #fff;
        border: 2px solid #ddd;
        border-radius: 8px;
        padding: 16px;
    }
    .ingredient-tag {
        border: 1px solid #ccc;
        border-radius: 8px;
        padding: 8px 12px;
    }
    .steps-section h2, .ingredients-section h2, .tips-section h2 {
        color: #000;
    }
    .step-content {
        border: 1px solid #ddd;
        border-radius: 8px;
    }
    .step-number {
        background: #333;
        box-shadow: none;
    }
    .tips-section {
        background: #fff;
        border: 2px solid #ddd;
        border-radius: 8px;
    }
    .recipe-detail-hero img {
        max-height: 250px;
    }
    @page {
        margin: 1.5cm;
    }
}

/* ========== 待烹饪悬浮按钮及弹窗样式 ========== */
.pending-cook-fab {
    position: fixed;
    right: 20px;
    bottom: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8aae, #ff6a9f);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(255, 138, 174, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pending-cook-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 24px rgba(255, 138, 174, 0.5);
}

.pending-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: #ff4d6d;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #ff8aae;
}

/* 弹窗遮罩 */
.pending-cook-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.pending-cook-overlay.show {
    opacity: 1;
    visibility: visible;
}

.pending-cook-panel {
    background: #fff;
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    border-radius: 28px 28px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.1);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pending-cook-overlay.show .pending-cook-panel {
    transform: translateY(0);
}

.pending-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1e7eb;
}

.pending-panel-header h2 {
    font-size: 1.2rem;
    color: #a63c5e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.pending-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
}

.pending-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}

.pending-empty {
    text-align: center;
    color: #94a3b8;
    padding: 30px 0;
}

.pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f0f2;
}

.pending-item:last-child {
    border-bottom: none;
}

.pending-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    cursor: pointer;
}

.pending-item-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: #fef0f5;
    flex-shrink: 0;
}

.pending-item-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fef0f5, #fff5f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fbb1c2;
    flex-shrink: 0;
}

.pending-item-title {
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

.pending-item-remove {
    background: none;
    border: none;
    color: #b91c1c;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
}

.pending-panel-footer {
    padding: 12px 20px;
    border-top: 1px solid #f1e7eb;
}

.btn-clear-pending {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    transition: all 0.2s;
}

.btn-clear-pending:hover {
    background: #fecaca;
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .pending-cook-fab {
        right: 28px;
        bottom: 40px;
        width: 60px;
        height: 60px;
    }
    .pending-cook-panel {
        max-width: 440px;
    }
}