.restaurant-meta #current-restaurant-name,
.restaurant-meta #current-restaurant-cuisine,
.restaurant-meta #current-restaurant-combined {
    color: #202124;
    font-weight: 700;
    font-size: 1.375rem;
}
/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 输入行（PC端一行显示） */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
    align-items: end;
}

/* 去除输入组在输入行内的额外底部间距，保证与总预算对齐 */
.input-row .input-group { margin-bottom: 0; }

.budget-info {
    background: #f8f9fa;
    padding: 0 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    color: #1a73e8;
    border: 1px solid #e8eaed;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
}

@media (max-width: 767px) {
    .input-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* 头部样式 */
.header {
    text-align: center; /* 默认仍居中，标题行内会单独左对齐 */
    margin-bottom: 16px;
    padding: 20px 16px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8eaed;
}

/* 标题行：标题居中，选择器置于其下方居中（全端一致） */
.title-row {
    display: grid;
    grid-template-columns: 1fr; /* 单列布局 */
    justify-items: center; /* 内容居中 */
    align-items: center;
    row-gap: 6px;
    margin-bottom: 4px;
}
.title-row h1 {
    margin: 0;
    text-align: center;
    justify-self: center; /* 在网格中水平居中 */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    word-break: keep-all;
}
.title-row #restaurant-title {
    color: #0b57d0;
    font-weight: 700;
}
.header-select select {
    min-width: 160px; /* 缩窄下拉框 */
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid #dadce0;
    background: #f8f9fa;
    color: #202124;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) inset;
}
.header-select select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.12);
    background: #ffffff;
}

.header h1 {
    font-size: 2rem;
    color: #1a73e8;
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.95rem;
    color: #5f6368;
    font-weight: 400;
    text-align: center; /* 副标题保持居中 */
    display: block;
    width: 100%;
    margin: 2px 0 4px;
}

/* 标题下方：餐馆名 · 菜系 居中显示 */
.restaurant-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 2px;
    color: #202124;
    font-weight: 700;
    font-size: 1.375rem; /* 保持可读性 */
    line-height: 1.2;
}
.restaurant-meta .dot {
    color: #9aa0a6;
    font-weight: 700;
    margin: 0 8px; /* 与点的左右间距更合理 */
}

/* 自定义餐馆下拉触发器 */
.restaurant-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
    color: #202124; /* 餐馆名与菜系一致用黑色 */
}
.restaurant-picker:hover {
    background: #f3f7ff;
}
.restaurant-picker:focus { outline: none; border-color: #1a73e8; }
.restaurant-picker .caret { font-size: 12px; color: #5f6368; margin-right: 2px; }
.restaurant-picker[aria-expanded="true"] .caret { transform: rotate(180deg); }

/* 自定义餐馆下拉菜单 */
.restaurant-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    min-width: 260px;
    z-index: 100;
    padding: 6px;
}
.restaurant-menu .restaurant-item {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #202124;
}
.restaurant-menu .restaurant-item:hover { background: #f8f9fa; }
.restaurant-menu .restaurant-item.active { background: #e8f0fe; border-color: #d2e3fc; color: #1557b0; }
.restaurant-menu .empty { padding: 8px 10px; color: #5f6368; font-size: 14px; }

/* 让下拉菜单相对 header 区域定位 */
.header { position: relative; }

/* 主要内容区域 */
.main-content {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

/* 用餐信息区域样式 */
.dining-info-section {
    grid-column: 1 / -1;
}

.dining-info-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8eaed;
    margin-bottom: 16px;
}

.basic-info {
    margin-bottom: 24px;
}

.selected-dishes-table {
    margin-bottom: 20px;
}

.selected-dishes-table h3 {
    color: #202124;
    font-size: 1.125rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.table-container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8eaed;
}

#selected-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    table-layout: fixed;
}

#selected-table thead {
    background: #f8f9fa;
}

#selected-table th,
#selected-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e8eaed;
    text-align: left;
    font-size: 0.875rem;
    white-space: normal;           /* 允许换行 */
    word-break: break-all;         /* 汉字也可断行 */
    overflow-wrap: anywhere;       /* 超长连续字符断行 */
}

/* 已选菜品列宽：序号/名称/份数/单价/操作 */
#selected-table th:nth-child(1),
#selected-table td:nth-child(1) { width: 64px; }
#selected-table th:nth-child(2),
#selected-table td:nth-child(2) { width: 40%; }
#selected-table th:nth-child(3),
#selected-table td:nth-child(3) { width: 96px; }
#selected-table th:nth-child(4),
#selected-table td:nth-child(4) { width: 110px; }
#selected-table th:nth-child(5),
#selected-table td:nth-child(5) { width: 120px; text-align: center; white-space: nowrap; }

/* 操作按钮并排显示且不换行到多行（避免过度挤压可适当增宽列宽） */
#selected-table td:nth-child(5) .keep-dish-btn,
#selected-table td:nth-child(5) .remove-dish-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
    width: 32px;              /* 统一尺寸 */
    height: 32px;             /* 统一尺寸 */
    padding: 0;               /* 移除内边距避免看起来偏窄 */
    border-radius: 10px;      /* 统一圆角 */
    font-size: 18px;          /* 图标大小一致 */
    font-weight: 700;
    line-height: 1;           /* 居中对齐 */
    border: 1px solid transparent;
}

#selected-table th {
    color: #5f6368;
    font-weight: 600;
}

#selected-table tbody tr:hover {
    background: #fafafa;
}

.rice-row {
    background: #e8f0fe !important;
}

.rice-row:hover {
    background: #d2e3fc !important;
}

.remove-dish-btn {
    background: #ea4335;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.keep-dish-btn {
    background: #e6f4ea;
    color: #0f9d58; /* 绿色加号 */
    border-color: #ccebd6;
}
.keep-dish-btn:hover { background: #d7f0df; }
.keep-dish-btn:active { transform: translateY(1px); }

.remove-dish-btn {
    background: #fde7e9;
    color: #d93025; /* 红色叉号 */
    border-color: #f3c6c9;
}
.remove-dish-btn:hover { background: #fbd2d5; }
.remove-dish-btn:active { transform: translateY(1px); }

/* 卡片通用样式 */
.input-card,
.selection-card,
.selected-card,
.result-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8eaed;
    margin-bottom: 16px;
}

.input-card h2,
.selection-card h2,
.selected-card h2,
.result-card h2 {
    color: #202124;
    font-size: 1.375rem;
    margin-bottom: 20px;
    font-weight: 500;
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 12px;
}

/* 输入区域样式 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #3c4043;
    font-weight: 500;
    font-size: 0.875rem;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
    height: 44px;
}

.input-group input:focus {
    outline: none;
    border-color: #1a73e8;
    background: white;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}


/* 分类标签样式 */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* 卡片标题工具栏（含按钮） */
.card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 12px;
}

.card-toolbar h2 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.card-toolbar .action-buttons.toolbar {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .card-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .card-toolbar .action-buttons.toolbar {
        justify-content: center;
    }
}

/* 手动选菜头部与搜索 */
.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 12px;
}

.search-box {
    min-width: 240px;
}

/* 餐馆下拉选择 */
.restaurant-box {
    min-width: 200px;
}
.restaurant-box select {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #dadce0;
    border-radius: 24px;
    font-size: 0.875rem;
    background: #f8f9fa;
    color: #202124;
}
.restaurant-box select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
    background: #ffffff;
}

.search-box input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #dadce0;
    border-radius: 24px;
    font-size: 0.875rem;
    background: #f8f9fa;
}

.search-box input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
    background: #ffffff;
}

@media (max-width: 767px) {
    .selection-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .search-box {
        min-width: auto;
    }
    .restaurant-box { min-width: auto; }
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid #dadce0;
    background: white;
    color: #5f6368;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
    font-size: 0.875rem;
}

.tab-btn:hover {
    background: #f8f9fa;
    color: #202124;
    border-color: #1a73e8;
}

.tab-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

/* 菜品网格样式 */
.dishes-grid {
    display: grid;
    /* 中间宽度：自适应尽可能多 */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 8px;
    padding-top: 8px;   /* 避免顶部悬停阴影被裁切 */
    padding-bottom: 8px;/* 避免底部悬停阴影被裁切 */
}

.dish-item {
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* 菜卡角标（随机/已确认） */
.dish-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.12);
    color: #fff;
    z-index: 2;
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: saturate(150%) blur(2px);
}
.badge-random {
    background: linear-gradient(135deg, #ff8f1f 0%, #fbbc04 50%, #ffd54f 100%);
    color: #2b2b2b;
}
.badge-confirm {
    background: linear-gradient(135deg, #0f9d58 0%, #34a853 50%, #7ad67c 100%);
}

/* 菜品缩略图 */
.dish-thumb {
    width: 100%;
    aspect-ratio: 14 / 9;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #e8eaed;
    position: relative; /* 允许占位内部绝对定位 */
}

.dish-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 无图片映射时的占位块样式 */
.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(180deg, #fafbfc 0%, #f1f3f4 100%);
    color: #5f6368;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.thumb-placeholder .ph-emoji { font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.08)); }
.thumb-placeholder .ph-text {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.92);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #e8eaed;
    color: #5f6368;
    white-space: nowrap;
}

/* 选中态下占位对比度（保证在蓝色卡片上仍清晰） */
.dish-item.selected .thumb-placeholder { background: linear-gradient(180deg, #1f7ef5 0%, #1557b0 100%); }
.dish-item.selected .thumb-placeholder .ph-text { background: rgba(255,255,255,0.96); color: #0b4aa6; border-color: rgba(255,255,255,0.7); }
.dish-item.selected .thumb-placeholder .ph-emoji { filter: drop-shadow(0 1px 1px rgba(0,0,0,0.12)); }

/* 自适应尺寸：移动端更紧凑，桌面略大 */
@media (max-width: 767px) {
    .thumb-placeholder .ph-emoji { font-size: 22px; }
    .thumb-placeholder .ph-text { font-size: 11px; padding: 3px 8px; }
}
@media (min-width: 1200px) {
    .thumb-placeholder .ph-emoji { font-size: 28px; }
    .thumb-placeholder .ph-text { font-size: 12px; padding: 4px 12px; }
}

.dish-item:hover {
    background: #f8f9fa;
    border-color: #1a73e8;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
    z-index: 2; /* 确保不被同级卡片遮挡 */
}

.dish-item.selected {
    background: #1a73e8;
    color: white;
    border-color: #1557b0;
}

.dish-name {
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 5px;
}

.dish-category {
    font-size: 0.75rem;
    color: #5f6368;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dish-item.selected .dish-category {
    color: rgba(255, 255, 255, 0.7);
}

.dish-price {
    font-weight: 600;
    font-size: 1.125rem;
    color: #ea4335;
}

.dish-item.selected .dish-price {
    color: #fff3c4;
}

/* 已选菜品样式 */
.selected-list {
    min-height: 100px;
    margin-bottom: 20px;
}

.selected-item,
.rice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #1a73e8;
}

.rice-item {
    border-left-color: #34a853;
    background: #e8f5e8;
}

.dish-name {
    font-weight: 600;
    flex: 1;
}

.dish-quantity {
    color: #5f6368;
    margin: 0 12px;
    font-size: 0.875rem;
}

.dish-price {
    font-weight: 600;
    color: #ea4335;
    font-size: 0.875rem;
}

.remove-btn {
    background: #ea4335;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-left: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #d33b2c;
    transform: scale(1.1);
}

.selected-summary {
    background: #e8f0fe;
    padding: 16px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    border: 1px solid #e8eaed;
}

/* 表格内标签：随机/已确认 */
.tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
}
.tag-random { background: #fff4d6; color: #a06b00; border: 1px solid #fbbc04; }
.tag-confirm { background: #e8f5e9; color: #1b5e20; border: 1px solid #34a853; }

.summary-item {
    text-align: center;
    font-weight: 600;
    color: #1a73e8;
}

/* 按钮样式 */
.action-section {
    text-align: center;
    margin: 32px 0;
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #1a73e8;
    color: white;
    border: 1px solid #1a73e8;
}

.btn-primary:hover {
    background: #1557b0;
    border-color: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.24);
}

.btn-secondary {
    background: #ffffff;
    color: #5f6368;
    border: 1px solid #dadce0;
}

.btn-secondary:hover {
    background: #f8f9fa;
    color: #202124;
    border-color: #1a73e8;
}

/* 结果展示样式 */
.final-menu {
    margin-bottom: 20px;
}

/* 最终菜单表格样式 */
.final-menu table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}
.final-menu th,
.final-menu td {
    white-space: normal;           /* 允许换行 */
    word-break: break-all;         /* 汉字也可断行 */
    overflow-wrap: anywhere;       /* 超长连续字符断行 */
}

.final-menu thead {
    background: #f8f9fa;
}

.final-menu th,
.final-menu td {
    padding: 12px 14px;
    border-bottom: 1px solid #e8eaed;
    text-align: left;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 最终菜单列宽：序号/菜品/份数/单价 */
.final-menu th:nth-child(1),
.final-menu td:nth-child(1) { width: 64px; }
.final-menu th:nth-child(2),
.final-menu td:nth-child(2) { width: 40%; }
.final-menu th:nth-child(3),
.final-menu td:nth-child(3) { width: 96px; }
.final-menu th:nth-child(4),
.final-menu td:nth-child(4) { width: 110px; }

.final-menu th {
    color: #5f6368;
    font-weight: 600;
}

.final-menu tbody tr:hover {
    background: #fafafa;
}

.final-menu tfoot td {
    font-weight: 600;
}

.final-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    border: 1px solid #e8eaed;
}

.summary-row {
    text-align: center;
    font-weight: 600;
    color: #1a73e8;
}

.final-summary .summary-row span { font-weight: 700; }

/* 提示信息样式 */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ea4335;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(234, 67, 53, 0.24);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    font-size: 0.875rem;
}

.alert.success {
    background: #34a853;
}

.alert.warning {
    background: #fbbc04;
    color: #202124;
}

.alert-close {
    color: inherit;
}

.alert-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        padding: 32px;
        max-width: 1400px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .manual-selection,
    .dining-info-section,
    .result-section {
        grid-column: 1 / -1;
    }
    
    .dishes-grid {
        /* 中等屏幕：自适应尽可能多 */
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

/* 大屏（PC）：固定每行 8 个 */
@media (min-width: 1200px) {
    .dishes-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 767px) {
    .container {
        padding: 16px;
    }
    
    .header {
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    .title-row { 
        display: grid;
        grid-template-columns: 1fr; /* 小屏上下排列 */
        gap: 12px;
        width: 100%;
    }
    .title-row h1 { width: 100%; text-align: center; justify-content: center; font-size: 2.25rem; }
    /* 移动端：餐馆·菜系与PC一致居中显示 */
    .restaurant-meta { width: 100%; justify-content: center; text-align: center; font-size: 1.5rem; }
    .header-select select { 
        width: 100%;
        min-width: 0;
        padding: 8px;
        border: 1px solid #dadce0;
        border-radius: 8px;
    }
    
    .header h1 {
        font-size: 1.875rem;
        margin-bottom: 8px;
    }
    
    .input-card,
    .selection-card,
    .selected-card,
    .result-card {
        padding: 20px;
    }
    
    .dishes-grid {
        /* 移动端：每行 2 个 */
        grid-template-columns: repeat(2, 1fr);
        max-height: 300px;
    }
    
    /* 移动端菜品图片优化 */
    .dish-thumb {
        aspect-ratio: 3 / 2;
        max-height: 120px;
    }
    
    .category-tabs {
        gap: 8px;
    }
    
    .tab-btn {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    /* 移动端：已选表格操作列上下排列按钮并允许换行 */
    #selected-table td:nth-child(5) {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        white-space: normal; /* 覆盖桌面端不换行 */
        width: auto; /* 自适应 */
    }
    #selected-table td:nth-child(5) .keep-dish-btn,
    #selected-table td:nth-child(5) .remove-dish-btn {
        margin: 0; /* 垂直堆叠不需要左右间距 */
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        height: 44px;
        border-radius: 999px;
    }
    
    .selected-summary {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .final-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 移动端：用餐信息卡片标题工具栏按钮满宽显示 */
    .card-toolbar .action-buttons.toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .card-toolbar .action-buttons.toolbar .btn {
        max-width: 100%;
        width: 100%;
        height: 44px;
        border-radius: 999px;
    }
    
    /* 移动端：最终菜单复制全部按钮满宽显示 */
    .result-card .action-buttons .btn {
        max-width: 100%;
        width: 100%;
        height: 44px;
        border-radius: 999px;
    }
    .result-card .action-buttons { margin-bottom: 8px; }
}

/* 滚动条样式 */
.dishes-grid::-webkit-scrollbar {
    width: 6px;
}

.dishes-grid::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.dishes-grid::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

.dishes-grid::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

/* 焦点样式优化 */
.btn:focus,
.tab-btn:focus,
.input-group input:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* 加载状态样式 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 过渡动画优化 */
.dish-item,
.selected-item,
.rice-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 卡片阴影层次 */
.input-card:hover,
.selection-card:hover,
.selected-card:hover,
.result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 文本选择样式 */
::selection {
    background: rgba(26, 115, 232, 0.2);
    color: #202124;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.result-section {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dish-item {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.selected-item {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 微交互效果 */
.btn:active {
    transform: translateY(1px);
}

.dish-item:active {
    transform: scale(0.98);
}

.tab-btn:active {
    transform: scale(0.95);
}
