/* =============================================
   菜谱查询 - recipe_query.css
   三栏布局：历史记录 | 查询设置 | 菜谱详情
   食物主题：暖橙色调
   暗黑模式：body.dark 前缀
   ============================================= */

/* ========== 占位图标浮动动画 ========== */
@keyframes pePlaceholderFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* ========== 加载文本呼吸动画 ========== */
@keyframes recipeBreathText {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ========== 按钮加载流光动画 ========== */
@keyframes recipeBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== 历史条目入场动画 ========== */
@keyframes rqFadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== 输入框摇晃动画 ========== */
@keyframes recipeShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}

/* ========== 加载圆点弹跳动画 ========== */
@keyframes rqDotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1);   opacity: 1; }
}

/* ========== 模态框弹性入场动画 ========== */
@keyframes recipeModalEnter {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.88); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ========== 结果内容入场动画 ========== */
@keyframes rqResultEnter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   主容器
   ============================================= */
.recipe-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #faf8f3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.recipe-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* =============================================
   顶部工具栏
   ============================================= */
.recipe-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    min-height: 38px;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.35);
    flex-shrink: 0;
}

.recipe-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.recipe-toolbar .toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.90);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #d35400;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.5;
}

.recipe-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.recipe-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.recipe-toolbar .toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 主操作按钮（查询菜谱） */
.recipe-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.4);
}

.recipe-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.5);
}

/* 主按钒 disabled 态降级样式（亮色模式） */
.recipe-toolbar .toolbar-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.recipe-toolbar .toolbar-btn-primary.recipe-btn-loading {
    background: linear-gradient(90deg, #27ae60 0%, #58d68d 35%, #27ae60 65%, #1e8449 100%);
    background-size: 200% 100%;
    animation: recipeBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
}

.recipe-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

/* =============================================
   三栏主内容
   ============================================= */
.recipe-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #faf8f3;
}

/* =============================================
   左栏：历史记录
   ============================================= */
.recipe-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #ecdbc8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #fefaf5 0%, #f8f0e3 100%);
    border-bottom: 1px solid #ecdbc8;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7b4a1e;
}

.history-count {
    font-size: 11px;
    color: #b07540;
    font-weight: 400;
}

.history-clear-btn {
    background: #fff5ee;
    border: none;
    color: #d35400;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover { background: #fde8d8; }

.history-search {
    padding: 7px;
    border-bottom: 1px solid #ecdbc8;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #e0c8a8;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #4a2c10;
    background: #fefaf5;
}

.history-search input:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.12);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
}

.history-empty {
    text-align: center;
    padding: 24px 12px;
    color: #b07540;
    font-size: 12px;
    line-height: 1.8;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: #fefaf5;
    border: 1px solid #ecdbc8;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: rqFadeIn 0.2s ease;
}

.history-item:hover {
    background: #fdf3e3;
    border-color: #d4a86a;
    transform: translateX(2px);
}

.history-item.active {
    background: #fde8c8;
    border-color: #e67e22;
    box-shadow: 0 1px 4px rgba(230, 126, 34, 0.22), inset 3px 0 0 #e67e22;
}

.history-item-main { flex: 1; min-width: 0; }

.history-item-dish {
    font-size: 13px;
    font-weight: 600;
    color: #4a2c10;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-top: 3px;
}

.history-item-tag {
    font-size: 10px;
    color: #b07540;
    background: #f8ecd8;
    padding: 1px 4px;
    border-radius: 2px;
}

.history-item-time {
    font-size: 10px;
    color: #c49a6c;
    margin-top: 2px;
}

.history-item.active .history-item-dish { color: #d35400; }

.history-item-del {
    background: none;
    border: none;
    color: #ccb59a;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-left: 4px;
}

.history-item-del:hover {
    background: #fee0cc;
    color: #d35400;
}

/* =============================================
   中栏：查询设置面板
   ============================================= */
.recipe-input-panel {
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #ecdbc8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 10px 14px;
    background: linear-gradient(to bottom, #fefaf5 0%, #f8f0e3 100%);
    border-bottom: 1px solid #ecdbc8;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600;
    color: #7b4a1e;
}

.panel-tip {
    font-size: 11px;
    color: #b07540;
}

.recipe-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

.input-group { margin-bottom: 14px; }

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #7b4a1e;
    margin-bottom: 6px;
}

.input-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

/* 菜品名称搜索框 */
.recipe-search-box {
    display: flex;
    gap: 6px;
    align-items: center;
}

.recipe-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #e0c8a8;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    color: #3d2b1f;
    background: #fefaf5;
    min-width: 0;
}

.recipe-search-input:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.12);
    background: #fff;
}

.recipe-search-input.shake {
    animation: recipeShake 0.4s ease;
    border-color: #e74c3c;
}

.recipe-search-btn {
    padding: 8px 12px;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.recipe-search-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(230, 126, 34, 0.3);
}

.recipe-search-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.recipe-char-counter {
    text-align: right;
    font-size: 11px;
    color: #c49a6c;
    margin-top: 3px;
}

/* 菜系选项 */
.cuisine-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cuisine-option {
    padding: 4px 10px;
    border: 1.5px solid #e0c8a8;
    border-radius: 20px;
    font-size: 12px;
    color: #7b4a1e;
    background: #fefaf5;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    user-select: none;
}

.cuisine-option:hover { border-color: #e67e22; background: #fdf3e3; }

.cuisine-option.selected {
    border-color: #e67e22;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(230, 126, 34, 0.3);
}

/* 用餐人数 */
.servings-options {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.servings-option {
    width: 40px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e0c8a8;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #7b4a1e;
    background: #fefaf5;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.servings-option:hover { border-color: #e67e22; background: #fdf3e3; }

.servings-option.selected {
    border-color: #e67e22;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
    box-shadow: 0 2px 5px rgba(230, 126, 34, 0.3);
}

/* 饮食偏好 */
.recipe-select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid #e0c8a8;
    border-radius: 6px;
    font-size: 12px;
    color: #3d2b1f;
    background: #fefaf5;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.recipe-select:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.1);
}

/* 详细程度 */
.detail-options {
    display: flex;
    gap: 6px;
}

.detail-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    border: 1.5px solid #e0c8a8;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fefaf5;
    text-align: center;
    user-select: none;
}

.detail-option:hover {
    border-color: #e67e22;
    background: #fdf3e3;
    transform: translateY(-1px);
}

.detail-option.selected {
    border-color: #e67e22;
    background: linear-gradient(to bottom, #fff8f0 0%, #fde8c8 100%);
    box-shadow: 0 2px 6px rgba(230, 126, 34, 0.2);
}

.detail-icon { font-size: 18px; line-height: 1; margin-bottom: 4px; }

.detail-name {
    font-size: 12px;
    font-weight: 600;
    color: #7b4a1e;
}

.detail-option.selected .detail-name { color: #d35400; }

.detail-desc {
    font-size: 10px;
    color: #b07540;
    margin-top: 2px;
}

/* 快捷标签 */
.quick-label {
    font-size: 12px;
    font-weight: 600;
    color: #7b4a1e;
    display: block;
    margin-bottom: 6px;
}

.recipe-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.recipe-quick-tag {
    padding: 3px 10px;
    background: #fdf3e3;
    border: 1px solid #e0c8a8;
    border-radius: 12px;
    font-size: 12px;
    color: #7b4a1e;
    cursor: pointer;
    transition: all 0.2s;
}

.recipe-quick-tag:hover {
    background: #e67e22;
    border-color: #e67e22;
    color: #fff;
    transform: translateY(-1px);
}

/* 使用说明 */
.recipe-tips-box {
    background: #fff8f0;
    border: 1px solid #fde8c8;
    border-left: 3px solid #e67e22;
    border-radius: 7px;
    padding: 10px 12px;
    margin-top: 4px;
}

.recipe-tips-box p {
    font-size: 12px;
    font-weight: 600;
    color: #d35400;
    margin: 0 0 6px 0;
}

.recipe-tips-box ul {
    margin: 0;
    padding-left: 16px;
}

.recipe-tips-box li {
    font-size: 11px;
    color: #8a5a30;
    line-height: 1.7;
}

/* =============================================
   右栏：菜谱详情面板
   ============================================= */
.recipe-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #faf8f3;
}

.recipe-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(to bottom, #fefaf5 0%, #f8f0e3 100%);
    border-bottom: 1px solid #ecdbc8;
    flex-shrink: 0;
}

.recipe-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7b4a1e;
}

.result-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-dish-label {
    font-size: 13px;
    font-weight: 700;
    color: #d35400;
    padding: 2px 10px;
    background: #fde8c8;
    border-radius: 12px;
    border: 1px solid #e8c49a;
}

.result-detail-badge {
    font-size: 11px;
    color: #fff;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    padding: 2px 8px;
    border-radius: 10px;
}

.recipe-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

/* ========== 自定义滚动条 ========== */
.history-list::-webkit-scrollbar,
.recipe-input-body::-webkit-scrollbar,
.recipe-result-body::-webkit-scrollbar { width: 5px; }

.history-list::-webkit-scrollbar-track,
.recipe-input-body::-webkit-scrollbar-track,
.recipe-result-body::-webkit-scrollbar-track { background: transparent; }

.history-list::-webkit-scrollbar-thumb,
.recipe-input-body::-webkit-scrollbar-thumb,
.recipe-result-body::-webkit-scrollbar-thumb {
    background: rgba(230, 126, 34, 0.28);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover,
.recipe-input-body::-webkit-scrollbar-thumb:hover,
.recipe-result-body::-webkit-scrollbar-thumb:hover {
    background: rgba(230, 126, 34, 0.55);
}

/* =============================================
   占位符
   ============================================= */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    text-align: center;
}

.pe-placeholder-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 16px;
    animation: pePlaceholderFloat 3s ease-in-out infinite;
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #7b4a1e;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 13px;
    color: #b07540;
    margin: 4px 0;
}

/* =============================================
   加载状态
   ============================================= */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
}

.loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e67e22;
    animation: rqDotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

.loading-text {
    font-size: 14px;
    color: #b07540;
    margin: 0;
}

.recipeBreathText {
    animation: recipeBreathText 1.8s ease-in-out infinite;
}

/* 结果内容入场动效 */
.result-content.result-enter-anim {
    animation: rqResultEnter 0.35s ease both;
}

/* =============================================
   AI 生成的菜谱结果内容
   ============================================= */
.result-content {
    line-height: 1.7;
    color: #3d2b1f;
}

.result-content .recipe-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #ecdbc8;
    border-top: 3px solid #e67e22;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(230, 126, 34, 0.08);
}

.result-content .recipe-header {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
    padding: 16px 20px;
}

.result-content .recipe-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.result-content .recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.result-content .recipe-tag {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.result-content .recipe-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
    margin: 0;
    line-height: 1.6;
}

.result-content .recipe-section {
    padding: 14px 20px;
    border-bottom: 1px solid #f0e4d2;
}

.result-content .recipe-section:last-child { border-bottom: none; }

.result-content .recipe-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #d35400;
    margin: 0 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #fde8c8;
}

.result-content .recipe-ingredients {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.result-content .recipe-ingredients > div > strong {
    display: block;
    font-size: 12px;
    color: #e67e22;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px dotted #fde8c8;
}

.result-content .recipe-ingredients ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-content .recipe-ingredients li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px dashed #f5ece0;
    color: #4a2c10;
}

.result-content .recipe-steps {
    padding-left: 22px;
    margin: 0;
}

.result-content .recipe-steps li {
    padding: 7px 0;
    font-size: 13px;
    color: #3d2b1f;
    line-height: 1.75;
    border-bottom: 1px solid #f8f0e3;
}

.result-content .recipe-steps li:last-child { border-bottom: none; }

.result-content .recipe-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-content .recipe-tips li {
    padding: 5px 0 5px 24px;
    position: relative;
    font-size: 13px;
    color: #5c3b1e;
    line-height: 1.65;
}

.result-content .recipe-tips li::before {
    content: '💡';
    position: absolute;
    left: 0;
    top: 5px;
    font-size: 12px;
}

/* 错误提示 */
.result-error {
    text-align: center;
    padding: 40px 20px;
}

.error-icon { font-size: 38px; margin-bottom: 12px; }

.error-msg {
    font-size: 14px;
    color: #c0392b;
    font-weight: 500;
}

.error-tip {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 6px;
}

/* 错误重试按钒 */
.result-error-retry {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 22px;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
}

.result-error-retry:hover {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

.result-error-retry:active {
    transform: translateY(0);
}

/* =============================================
   示例导入模态框
   ============================================= */
.recipe-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
}

.recipe-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    width: 580px;
    max-width: 94vw;
    max-height: 82vh;
    flex-direction: column;
    overflow: hidden;
}

/* 弹性缓动入场动效（遵循示例导入模态框动效规范） */
.recipe-modal.modal-enter {
    animation: recipeModalEnter 0.35s cubic-bezier(.34,1.4,.64,1) both;
}

.recipe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    flex-shrink: 0;
}

.recipe-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.recipe-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.recipe-modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.recipe-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

.recipe-modal-body::-webkit-scrollbar { width: 5px; }
.recipe-modal-body::-webkit-scrollbar-track { background: transparent; }
.recipe-modal-body::-webkit-scrollbar-thumb { background: rgba(230, 126, 34, 0.28); border-radius: 4px; }
.recipe-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(230, 126, 34, 0.55); }

.example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.example-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1.5px solid #ecdbc8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fefaf5;
}

.example-card:hover {
    border-color: #e67e22;
    background: #fdf3e3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.15);
}

.example-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }

.example-info { flex: 1; min-width: 0; }

.example-dish {
    font-size: 14px;
    font-weight: 700;
    color: #4a2c10;
    margin-bottom: 4px;
}

.example-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 4px;
}

.example-tag-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    background: #fde8c8;
    color: #d35400;
    border: 1px solid #e8c49a;
}

.example-desc {
    font-size: 11px;
    color: #b07540;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =============================================
   Toast 提示
   ============================================= */
.recipe-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(44, 28, 14, 0.88);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.recipe-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =============================================
   响应式布局
   ============================================= */
@media (max-width: 900px) {
    .recipe-history-panel { width: 170px; }
    .recipe-input-panel   { width: 250px; }
}

/* 移动端：历史删除按钒强制可见，不依赖 hover */
@media (max-width: 768px) {
    .history-item-del {
        opacity: 1 !important;
    }
}

@media (max-width: 680px) {
    .recipe-main-content    { flex-direction: column; overflow-y: auto; }
    .recipe-history-panel   { width: 100%; height: 140px; border-right: none; border-bottom: 1px solid #ecdbc8; }
    .recipe-input-panel     { width: 100%; border-right: none; border-bottom: 1px solid #ecdbc8; max-height: 340px; }
    .recipe-result-panel    { min-height: 300px; }
    .example-grid           { grid-template-columns: 1fr; }
}

/* =============================================
   暗黑模式（以 body.dark 作为父级选择器前缀）
   ============================================= */
body.dark .recipe-container      { background: #1e1a16; }
body.dark .recipe-main-content   { background: #1e1a16; }

body.dark .recipe-toolbar {
    background: linear-gradient(135deg, #b85c10 0%, #8a3c00 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
body.dark .recipe-toolbar .toolbar-btn            { background: rgba(255, 255, 255, 0.1);  color: #ffb870; }
body.dark .recipe-toolbar .toolbar-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.18); }
body.dark .recipe-toolbar .toolbar-btn-primary    { background: linear-gradient(135deg, #1e8449 0%, #145a32 100%); color: #fff; }
body.dark .recipe-toolbar .toolbar-btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%); }
body.dark .recipe-toolbar .toolbar-btn-primary:disabled { opacity: 0.32; cursor: not-allowed; }
body.dark .recipe-toolbar .toolbar-title          { color: rgba(255, 255, 255, 0.9); }

body.dark .recipe-history-panel  { background: #252018; border-right-color: #3d3020; }
body.dark .history-panel-header  { background: linear-gradient(to bottom, #2a2218 0%, #241c12 100%); border-bottom-color: #3d3020; }
body.dark .history-panel-header h3 { color: #d4a86a; }
body.dark .history-count         { color: #8a6540; }
body.dark .history-clear-btn     { background: #2d1a0e; color: #e67e22; }
body.dark .history-clear-btn:hover { background: #3d2410; }
body.dark .history-search        { border-bottom-color: #3d3020; }
body.dark .history-search input  { background: #2a2218; border-color: #3d3020; color: #d4a86a; }
body.dark .history-search input:focus { border-color: #e67e22; }
body.dark .history-empty         { color: #6a4a28; }
body.dark .history-item          { background: #2a2218; border-color: #3d3020; }
body.dark .history-item:hover    { background: #342a1c; border-color: #6a4a28; }
body.dark .history-item.active   { background: #3d2a10; border-color: #e67e22; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 3px 0 0 #e67e22; }
body.dark .history-item-dish     { color: #d4a86a; }
body.dark .history-item.active .history-item-dish { color: #f39c12; }
body.dark .history-item-tag      { background: #3d2a10; color: #b07540; }
body.dark .history-item-time     { color: #8a6540; }
body.dark .history-item-del      { color: #6a4a28; }
body.dark .history-item-del:hover { background: #4d2c10; color: #e67e22; }

body.dark .recipe-input-panel    { background: #252018; border-right-color: #3d3020; }
body.dark .panel-header          { background: linear-gradient(to bottom, #2a2218 0%, #241c12 100%); border-bottom-color: #3d3020; }
body.dark .panel-header h3       { color: #d4a86a; }
body.dark .panel-tip             { color: #8a6540; }
body.dark .input-group label     { color: #d4a86a; }
body.dark .recipe-search-input   { background: #2a2218; border-color: #3d3020; color: #d4c8b0; }
body.dark .recipe-search-input:focus { border-color: #e67e22; background: #2e2618; }
body.dark .recipe-char-counter   { color: #8a6540; }
body.dark .cuisine-option        { background: #2a2218; border-color: #3d3020; color: #d4a86a; }
body.dark .cuisine-option:hover  { background: #342a1c; border-color: #e67e22; }
body.dark .cuisine-option.selected { background: linear-gradient(135deg, #b85c10 0%, #8a3c00 100%); color: #fff; border-color: #b85c10; }
body.dark .servings-option       { background: #2a2218; border-color: #3d3020; color: #d4a86a; }
body.dark .servings-option:hover { background: #342a1c; border-color: #e67e22; }
body.dark .servings-option.selected { background: linear-gradient(135deg, #b85c10 0%, #8a3c00 100%); color: #fff; }
body.dark .recipe-select         { background: #2a2218; border-color: #3d3020; color: #d4c8b0; color-scheme: dark; }
body.dark .recipe-select:focus   { border-color: #e67e22; }
body.dark .detail-option         { background: #2a2218; border-color: #3d3020; }
body.dark .detail-option:hover   { background: #342a1c; border-color: #e67e22; }
body.dark .detail-option.selected { background: linear-gradient(to bottom, #342010 0%, #2a1808 100%); border-color: #e67e22; }
body.dark .detail-name           { color: #d4a86a; }
body.dark .detail-option.selected .detail-name { color: #f39c12; }
body.dark .detail-desc           { color: #6a4a28; }
body.dark .recipe-quick-tag      { background: #2a2218; border-color: #3d3020; color: #d4a86a; }
body.dark .recipe-quick-tag:hover { background: #e67e22; border-color: #e67e22; color: #fff; }
body.dark .recipe-tips-box       { background: #2a1808; border-color: #3d2a10; border-left-color: #b85c10; }
body.dark .recipe-tips-box p     { color: #f39c12; }
body.dark .recipe-tips-box li    { color: #b07540; }

body.dark .recipe-result-panel   { background: #1e1a16; }
body.dark .recipe-result-header  { background: linear-gradient(to bottom, #2a2218 0%, #241c12 100%); border-bottom-color: #3d3020; }
body.dark .recipe-result-header h3 { color: #d4a86a; }
body.dark .result-dish-label     { color: #f39c12; background: #3d2a10; border-color: #5a3a18; }
body.dark .result-detail-badge   { background: linear-gradient(135deg, #b85c10 0%, #8a3c00 100%); }
body.dark .placeholder-title     { color: #d4a86a; }
body.dark .placeholder-desc      { color: #6a4a28; }
body.dark .loading-dots span     { background: #e67e22; }
body.dark .loading-text          { color: #8a6540; }

body.dark .result-content        { color: #d4c8b0; }
body.dark .result-content .recipe-card    { background: #252018; border-color: #3d3020; border-top-color: #b85c10; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
body.dark .result-content .recipe-header  { background: linear-gradient(135deg, #b85c10 0%, #8a3c00 100%); }
body.dark .result-content .recipe-section { border-bottom-color: #3d3020; }
body.dark .result-content .recipe-section h4 { color: #f39c12; border-bottom-color: #3d2a10; }
body.dark .result-content .recipe-ingredients > div > strong { color: #f39c12; border-bottom-color: #3d2a10; }
body.dark .result-content .recipe-ingredients li { color: #d4c8b0; border-bottom-color: #3d3020; }
body.dark .result-content .recipe-steps li { color: #d4c8b0; border-bottom-color: #2a2218; }
body.dark .result-content .recipe-tips li { color: #c4a880; }
body.dark .result-content .recipe-tag { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.2); }

body.dark .recipe-modal-overlay  { background: rgba(0, 0, 0, 0.65); }
body.dark .recipe-modal          { background: #252018; }
body.dark .recipe-modal-header   { background: linear-gradient(135deg, #b85c10 0%, #8a3c00 100%); }
body.dark .example-card          { background: #2a2218; border-color: #3d3020; }
body.dark .example-card:hover    { background: #342a1c; border-color: #e67e22; }
body.dark .example-dish          { color: #d4a86a; }
body.dark .example-tag-badge     { background: #3d2a10; color: #e67e22; border-color: #5a3a18; }
body.dark .example-desc          { color: #8a6540; }

body.dark .recipe-toast          { background: rgba(20, 14, 8, 0.92); }

/* 暗黑模式：重试按鈕（遵守 result-error-retry 暗黑模式规范） */
body.dark .result-error-retry {
    background: linear-gradient(135deg, #7a3b0a 0%, #5a2800 100%);
    color: #ffb870;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
body.dark .result-error-retry:hover {
    background: linear-gradient(135deg, #9a4f10 0%, #7a3b0a 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* 暗黑模式：错误提示区域 */
body.dark .error-msg  { color: #e87474; }
body.dark .error-tip  { color: #8a8a9a; }

/* 暗黑模式：示例模态框内容区 */
body.dark .recipe-modal-body { background: #252018; }
body.dark .recipe-modal-body::-webkit-scrollbar-thumb { background: rgba(230, 126, 34, 0.2); }
body.dark .recipe-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(230, 126, 34, 0.45); }

/* 暗黑模式：自定义滚动条 */
body.dark .history-list::-webkit-scrollbar-thumb,
body.dark .recipe-input-body::-webkit-scrollbar-thumb,
body.dark .recipe-result-body::-webkit-scrollbar-thumb { background: rgba(230, 126, 34, 0.2); }

body.dark .history-list::-webkit-scrollbar-thumb:hover,
body.dark .recipe-input-body::-webkit-scrollbar-thumb:hover,
body.dark .recipe-result-body::-webkit-scrollbar-thumb:hover { background: rgba(230, 126, 34, 0.45); }
