/* 主页面CSS样式 */
/* 所有CSS类名和选择器，都要加文件名前缀 "home_" */

/* 全局样式重置 */
.home_body {
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f5f5; /* 浅灰底色 */
    min-height: 100vh;
    color: #333;
}

/* 主容器样式 */
.home_container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px; /* 减小两侧空间 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 120px; /* 为底部固定的输入栏留出空间 */
}

/* 日期显示样式 */
.home_date-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 8px 15px; /* 减小两侧内边距 */
    margin-bottom: 2px; /* 最小间距 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home_date-display #home_current-date {
    font-size: 20px; /* 字号减小一号 */
    font-weight: bold;
    color: #4a5568;
    text-align: center;
}

/* 母菜单容器样式 */
.home_parent-menu-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px; /* 圆角改小 */
    padding: 5px; /* 边柜间距更细 */
    margin-bottom: 2px; /* 最小间距 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home_parent-menu-arrow {
    background: #28a745; /* 绿色 */
    color: white; /* 白符号 */
    border: none;
    border-radius: 0; /* 移除默认圆角 */
    width: 24px; /* 1.5字宽 */
    height: 36px; /* 上下各减2px，从40px改为36px */
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 左箭头：只有左边有圆角 */
#home_parent-menu-left {
    border-radius: 8px 0 0 8px;
}

/* 右箭头：只有右边有圆角 */
#home_parent-menu-right {
    border-radius: 0 8px 8px 0;
}

.home_parent-menu-arrow:hover {
    background: #218838; /* 深绿色 */
}

.home_parent-menu-scroll-container {
    flex: 1;
    overflow: hidden;
    margin: 0 0; /* 移除左右间距 */
}

.home_parent-menu-scroll {
    display: flex;
    transition: transform 0.3s ease;
}

.home_parent-menu {
    display: flex;
    gap: 10px;
}

.home_parent-menu-item {
    padding: 6px 24px; /* 上下各减2px，从8px改为6px */
    background: #f7fafc;
    border: 1px solid #28a745; /* 边框减到最细 */
    border-radius: 4px; /* 圆角改小 */
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: normal; /* 未选中字体不要加粗 */
    color: #4a5568;
    white-space: nowrap;
}

.home_parent-menu-item:hover {
    background: #edf2f7;
    border-color: #218838; /* 深绿色边框 */
}

.home_parent-menu-item.home_active {
    background: #8dd19d; /* 修改为#8dd19d */
    color: #000000;
    border-color: #8dd19d;
    box-shadow: 0 4px 15px rgba(141, 209, 157, 0.3);
    font-weight: bold; /* 选中时字体加粗 */
}

/* 子菜单容器样式 */
.home_child-menu-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px; /* 圆角改小 */
    padding: 5px; /* 边柜间距更细 */
    margin-bottom: 10px; /* 减小底部间距 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home_child-menu-scroll-container {
    flex: 1;
    overflow: hidden;
    margin: 0 0; /* 移除左右间距 */
}

.home_child-menu-scroll {
    display: flex;
    transition: transform 0.3s ease;
}

.home_child-menu {
    display: flex;
    flex-shrink: 0;
    width: 100%; /* 改为100%宽度 */
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    padding: 1px;
}

.home_child-menu-item {
    flex-shrink: 0;
    padding: 6px 16px; /* 减小上下内边距 */
    background-color: #f0f0f0;
    border: 1px solid #ffd700; /* 浅黄边框 */
    border-radius: 6px; /* 四周小圆角 */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
    min-width: 80px; /* 4个汉字宽度 */
    text-align: center;
    z-index: 10; /* 确保子菜单项在正确层级 */
    position: relative; /* 为z-index生效 */
}

.home_child-menu-item:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.home_child-menu-item.home_active {
    background-color: #abf6bd;
    color: #000000;
    border-color: #84e0b8;
    box-shadow: 0 2px 8px rgba(132, 224, 184, 0.3);
    font-weight: bold;
}

/* 子菜单箭头按钮 */
.home_child-menu-arrow {
    background-color: #28a745; /* 绿色 */
    color: white; /* 白符号 */
    border: 1px solid #218838;
    border-radius: 0; /* 移除默认圆角 */
    width: 24px; /* 1.5字宽 */
    height: 32px; /* 修改高度为32px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 10;
}

/* 子菜单左箭头：只有左边有圆角 */
#home_child-menu-left {
    border-radius: 8px 0 0 8px;
}

/* 子菜单右箭头：只有右边有圆角 */
#home_child-menu-right {
    border-radius: 0 8px 8px 0;
}

.home_child-menu-arrow:hover {
    background-color: #218838; /* 深绿色 */
    border-color: #1e7e34;
}

.home_child-menu-arrow-left {
    margin-right: 0; /* 移除右边距 */
}

.home_child-menu-arrow-right {
    margin-left: 0; /* 移除左边距 */
}



/* 交互区样式 */
.home_result-space {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 8px; /* 减小内边距 */
    margin-bottom: 10px; /* 减小底部间距 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-y: auto;
    min-height: 300px;
}

.home_initial-message {
    text-align: center;
    color: #a0aec0;
    font-size: 18px;
    font-style: italic;
}

.home_result-space h3 {
    color: #4a5568;
    margin-bottom: 15px;
    border-bottom: none;
    padding-bottom: 10px;
}

/* 输入条样式 */
.home_input-bar {
    display: flex;
    justify-content: space-between; /* 输入框在左，按钮在右 */
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 800px;
    z-index: 1000;
}

.home_input-bar #home_command-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    min-width: 0;
}

.home_input-bar #home_command-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.home_input-bar #home_send-button {
    padding: 12px 15px;
    background: #28a745; /* 绿色 */
    color: white; /* 白字 */
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 90px; /* 3个汉字宽 */
    min-width: 90px;
    flex-shrink: 0;
}

.home_input-bar #home_send-button:hover {
    background: #218838; /* 深绿色 */
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* 动画效果 */
@keyframes home_fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.home_result-space > * {
    animation: home_fadeIn 0.5s ease;
}



/* 圆形按钮样式 */
.home_todo-button {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
}

.home_todo-button:hover {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

/* 隐藏类 */
.home_hidden {
    display: none !important;
}



/* 分词结果样式 */
.home_tokenized-result {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.home_tokenized-container {
    margin-top: 10px;
}

.home_meal-type {
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    padding: 8px 12px;
    background-color: #e9ecef;
    border-radius: 4px;
    border-left: 4px solid #28a745;
}

.home_tokenized-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.home_token-tag {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
    min-width: 60px;
    text-align: center;
    display: block !important; /* 确保菜品标签显示 */
}

.home_token-tag-matched {
    background-color: #fff5f5;
    border: 2px solid #dc3545;
    color: #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.home_token-tag-matched:hover {
    background-color: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.home_token-tag-unmatched {
    background-color: #f8f9fa;
    border: 1px solid #dc3545;
    color: #000000;
    display: block !important; /* 确保未匹配菜品标签显示 */
}

.home_token-tag-unmatched:hover {
    background-color: #dc3545;
    color: white;
    transform: translateY(-2px);
}

.home_tag-text {
    display: inline-block;
}

/* 下拉框样式 */
.home_dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    border: 1px solid #dee2e6;
    z-index: 1000;
    margin-top: 5px;
}

.home_dropdown-show {
    display: block;
}

.home_dropdown-item {
    padding: 8px 12px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.home_dropdown-item:hover {
    background-color: #f8f9fa;
}

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