/* ========================================
   地方特色美食 - local_specialty_food.css
   ======================================== */

/* ========== 主容器 ========== */
.lsf-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fdf8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.lsf-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.lsf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 60%, #dc2626 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.35);
    flex-shrink: 0;
}

.lsf-toolbar .toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.lsf-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.lsf-toolbar .toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #c2410c;
    transition: all 0.2s;
    white-space: nowrap;
}

.lsf-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.lsf-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.lsf-toolbar .toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lsf-toolbar .toolbar-btn-primary {
    background: rgba(255, 255, 255, 1);
    color: #ea580c;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.lsf-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: #fff7ed;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* ========== 主内容区（三栏布局）========== */
.lsf-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fdf8f0;
}

/* ========== 左侧历史面板 ========== */
.lsf-history-panel {
    width: 210px;
    background: white;
    border-right: 1px solid #fed7aa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.lsf-history-panel .history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fff7ed 0%, #fed7aa22 100%);
    border-bottom: 1px solid #fed7aa;
    flex-shrink: 0;
}

.lsf-history-panel .history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #9a3412;
}

.history-count {
    font-size: 11px;
    color: #ea580c;
    font-weight: 500;
}

.lsf-history-panel .history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.lsf-history-panel .history-clear-btn:hover {
    background: #fde8e8;
}

.lsf-history-panel .history-search {
    padding: 8px 10px;
    border-bottom: 1px solid #fed7aa55;
    flex-shrink: 0;
}

.lsf-history-panel .history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #fbd0a0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fffbf7;
}

.lsf-history-panel .history-search input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

.lsf-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.lsf-history-list::-webkit-scrollbar {
    width: 4px;
}

.lsf-history-list::-webkit-scrollbar-thumb {
    background: #fbd0a0;
    border-radius: 2px;
}

.lsf-history-list::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

.history-empty {
    text-align: center;
    color: #d1a57a;
    font-size: 12px;
    padding: 30px 10px;
    line-height: 1.6;
}

.lsf-history-item {
    position: relative;
    padding: 10px 12px;
    margin-bottom: 5px;
    background: #fffbf7;
    border: 1px solid #fddcb5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    animation: fadeInItem 0.2s ease;
}

@keyframes fadeInItem {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.lsf-history-item:hover {
    background: #fff7ed;
    border-color: #fdba74;
    transform: translateX(2px);
}

.lsf-history-item.active {
    background: #fff1e6;
    border-color: #f97316;
    box-shadow: 0 1px 4px rgba(249, 115, 22, 0.2);
}

.history-item-city {
    font-size: 13px;
    font-weight: 600;
    color: #c2410c;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
}

.history-item-type {
    font-size: 11px;
    color: #9a3412;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-time {
    font-size: 10px;
    color: #d1a57a;
    margin-top: 4px;
}

.history-item-del {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0;
}

.lsf-history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    background: #fca5a5;
}

/* ========== 中栏输入面板 ========== */
.lsf-input-panel {
    width: 300px;
    min-width: 260px;
    background: #fff;
    border-right: 1px solid #fed7aa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.lsf-input-panel .panel-header {
    padding: 14px 16px 10px;
    background: linear-gradient(to bottom, #fff7ed, #fffbf7);
    border-bottom: 1px solid #fddcb5;
    flex-shrink: 0;
}

.lsf-input-panel .panel-header h3 {
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 600;
    color: #9a3412;
}

.lsf-input-panel .panel-tip {
    font-size: 11px;
    color: #d1a57a;
    line-height: 1.4;
    display: block;
}

.lsf-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.lsf-input-body::-webkit-scrollbar {
    width: 4px;
}

.lsf-input-body::-webkit-scrollbar-thumb {
    background: #fbd0a0;
    border-radius: 2px;
}

.lsf-input-body::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #7c3f1e;
    margin-bottom: 5px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-weight: 400;
    color: #c4a07a;
    font-size: 11px;
}

.lsf-input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #fddcb5;
    border-radius: 6px;
    font-size: 13px;
    color: #4a2c17;
    background: #fffbf7;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.lsf-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background: #fff;
}

.lsf-input.shake {
    animation: shakeInput 0.4s ease;
}

@keyframes shakeInput {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.lsf-select {
    width: 100%;
    padding: 8px 30px 8px 11px;
    border: 1px solid #fddcb5;
    border-radius: 6px;
    font-size: 13px;
    color: #4a2c17;
    background: #fffbf7;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ea580c' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.lsf-select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.lsf-textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #fddcb5;
    border-radius: 6px;
    font-size: 13px;
    color: #4a2c17;
    background: #fffbf7;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
    line-height: 1.5;
}

.lsf-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background: #fff;
}

.lsf-textarea::-webkit-scrollbar {
    width: 4px;
}

.lsf-textarea::-webkit-scrollbar-thumb {
    background: #fbd0a0;
    border-radius: 2px;
}

.lsf-textarea::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.textarea-hint {
    font-size: 11px;
    color: #c4a07a;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-group-half {
    flex: 1;
    min-width: 0;
}

/* ========== 右侧结果面板 ========== */
.lsf-result-panel {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.lsf-result-panel .panel-header {
    padding: 14px 18px 10px;
    background: linear-gradient(to bottom, #fff7ed, #fffbf7);
    border-bottom: 1px solid #fddcb5;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.lsf-result-panel .panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #9a3412;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    transition: opacity 0.3s ease-in-out;
}

.result-meta-city {
    font-size: 12px;
    font-weight: 600;
    color: #f97316;
    background: #fff7ed;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #fed7aa;
}

.result-char-count {
    font-size: 11px;
    color: #d1a57a;
}

.result-char-count.count-normal { color: #64ba78; }
.result-char-count.count-warning { color: #f59e0b; }
.result-char-count.count-danger  { color: #ef4444; }

.result-time {
    font-size: 11px;
    color: #c4a07a;
}

/* 美食数量统计 */
.result-food-count {
    font-size: 11px;
    font-weight: 600;
    color: #ea580c;
    background: #fff7ed;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #fddcb5;
}

.lsf-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.lsf-result-body::-webkit-scrollbar {
    width: 6px;
}

.lsf-result-body::-webkit-scrollbar-thumb {
    background: #fbd0a0;
    border-radius: 3px;
}

.lsf-result-body::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

/* 占位 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 250px;
    text-align: center;
    color: #d1a57a;
}

.placeholder-icon {
    font-size: 52px;
    margin-bottom: 14px;
    opacity: 0.75;
    animation: placeholderFloat 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes placeholderFloat {
    0%, 100% { transform: translateY(0);     }
    50%       { transform: translateY(-10px); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #c4a07a;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 13px;
    color: #d1a57a;
    margin: 0 0 4px 0;
    line-height: 1.5;
}

/* 加载动画 */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 250px;
}

.loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: #f97316;
    border-radius: 50%;
    animation: dotBounce 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: 0s;    }
.loading-dots span:nth-child(2) { animation-delay: 0.2s;  }
.loading-dots span:nth-child(3) { animation-delay: 0.4s;  }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1.1); opacity: 1;   }
}

.loading-text {
    font-size: 13px;
    color: #d1a57a;
    margin: 0;
    min-height: 20px;
    transition: opacity 0.2s;
}

/* 结果内容 - 外层容器 */
.result-content {
    word-break: break-word;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

/* strong 标签深红色加粗规范 */
.result-content strong {
    color: #8B1A1A;
    font-weight: 700;
}

/* ul/ol 列表标记颜色规范 */
.result-content ul li::marker {
    color: #C0392B;
    font-weight: 600;
}
.result-content ol li::marker {
    color: #C0392B;
    font-weight: 600;
}

/* 无结构纯文本回退显示 */
.food-plain {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.85;
    color: #3d1c09;
}

/* 美食卡片条目 */
.food-item {
    background: linear-gradient(135deg, #fffbf7 0%, #fff7ed 100%);
    border: 1px solid #fddcb5;
    border-left: 4px solid #f97316;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    transition: box-shadow 0.2s, transform 0.2s;
    animation: foodItemIn 0.35s ease both;
}

.food-item:last-child {
    margin-bottom: 0;
}

.food-item:hover {
    box-shadow: 0 3px 12px rgba(249, 115, 22, 0.12);
    transform: translateX(2px);
}

@keyframes foodItemIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* 美食名称 */
.food-item-name {
    font-size: 15px;
    font-weight: 700;
    color: #c2410c;
    margin-bottom: 8px;
    line-height: 1.4;
    letter-spacing: 0.3px;
    word-break: break-word;
}

/* 美食详情正文 */
.food-item-body {
    font-size: 13.5px;
    line-height: 1.85;
    color: #5c3517;
    word-break: break-word;
}

/* 标签关键词（口味特点、食材做法等） */
.food-label {
    font-weight: 700;
    color: #ea580c;
}

/* 重试按钮 */
.result-retry-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 18px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.result-retry-btn:hover {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.35);
    transform: translateY(-1px);
}

/* 错误块 */
.result-content--error {
    white-space: normal;
}

.result-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.result-error-icon {
    font-size: 36px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.result-error-title {
    font-size: 14px;
    color: #d97706;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.result-error-hint {
    font-size: 12px;
    color: #c4a07a;
    margin: 0;
}

/* ========== 示例模态框 ========== */
.lsf-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: none;
    animation: overlayFadeIn 0.2s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lsf-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    max-width: 92vw;
    max-height: 82vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    display: none;
    flex-direction: column;
    animation: modalSlideIn 0.25s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translate(-50%, -52%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.lsf-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 82vh;
}

.lsf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #fddcb5;
    background: linear-gradient(135deg, #fff7ed, #fef3e2);
    flex-shrink: 0;
}

.lsf-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #9a3412;
}

.lsf-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #c4a07a;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.lsf-modal-close:hover {
    background: #fde8d0;
    color: #ea580c;
}

.lsf-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-content: start;
}

.lsf-modal-body::-webkit-scrollbar {
    width: 6px;
}

.lsf-modal-body::-webkit-scrollbar-thumb {
    background: #fbd0a0;
    border-radius: 3px;
}

.lsf-modal-body::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

.example-card {
    background: #fffbf7;
    border: 1px solid #fddcb5;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    border-color: #f97316;
    background: #fff7ed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.12);
}

.example-card-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 6px;
}

.example-card-title span:first-child {
    font-size: 13px;
    font-weight: 700;
    color: #9a3412;
    flex: 1;
}

.example-card-badge {
    font-size: 10px;
    font-weight: 600;
    color: #ea580c;
    background: #fff0e6;
    padding: 2px 7px;
    border-radius: 8px;
    border: 1px solid #fdba74;
    white-space: nowrap;
}

.example-card-desc {
    font-size: 11px;
    color: #c4a07a;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.example-card-import {
    display: inline-block;
    padding: 5px 12px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card-import:hover {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.35);
}

/* ========== 响应式适配 ========== */
@media (max-width: 900px) {
    .lsf-history-panel {
        display: none;
    }
    .lsf-input-panel {
        width: 260px;
        min-width: 240px;
    }
}

@media (max-width: 640px) {
    .lsf-main-content {
        flex-direction: column;
    }
    .lsf-input-panel {
        width: 100%;
        min-width: unset;
        max-height: 45%;
        border-right: none;
        border-bottom: 1px solid #fed7aa;
    }
    .lsf-result-panel {
        min-height: 50%;
    }
    .lsf-modal-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ========== 打印样式 ========== */
@media print {
    .lsf-toolbar,
    .lsf-history-panel,
    .lsf-input-panel,
    #resultPlaceholder,
    #resultLoading {
        display: none !important;
    }
    .lsf-container {
        height: auto;
        box-shadow: none;
    }
    .lsf-result-panel {
        width: 100%;
    }
}
