/* =========================================
   01. 全局基础样式
   ========================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: #f3eee6;
    color: #2d241f;
    font-family: Arial, "Microsoft YaHei", sans-serif;
}

h1 {
    margin: 0;
    font-size: 34px;
}

.section-text {
    margin-top: 0;
    color: #746861;
    line-height: 1.5;
}


/* =========================================
   02. 顾客端：页面主体与餐厅标题
   ========================================= */

.menu-page {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 32px 24px 120px;
    background-color: #ffffff;
}

.restaurant-header {
    padding: 28px 22px;
    border-radius: 20px;
    background-color: #8b1e1e;
    color: #ffffff;
}

.menu-page .restaurant-header {
    position: relative;
    padding: 82px 22px 28px;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 14px;
    opacity: 0.8;
}

.chinese-name {
    margin: 8px 0 20px;
    font-size: 18px;
}

.table-badge {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background-color: #f5d58b;
    color: #472f12;
    font-weight: 700;
}


/* =========================================
   03. 顾客端：菜单标题与分类按钮
   ========================================= */

.menu-section {
    padding-top: 30px;
}

.menu-section h2 {
    margin-bottom: 8px;
    font-size: 26px;
}

.category-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 22px 0;
    overflow-x: auto;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex-shrink: 0;
    padding: 9px 16px;
    border: none;
    border-radius: 999px;
    background-color: #eee9e4;
    color: #544942;
    font-size: 14px;
    cursor: pointer;
}

.category-tab.active {
    background-color: #8b1e1e;
    color: #ffffff;
}


/* =========================================
   04. 顾客端：菜品卡片
   ========================================= */

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.menu-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid #eee6df;
    border-radius: 18px;
    background-color: #ffffff;
    box-shadow: 0 5px 18px rgba(70, 45, 30, 0.07);
}

.menu-item[hidden] {
    display: none;
}

.food-icon {
    display: flex;
    width: 82px;
    min-width: 82px;
    height: 82px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background-color: #f7eee5;
    font-size: 40px;
}

.food-icon.has-image {
    overflow: hidden;
    padding: 0;
}

.food-icon.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-item-info {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.menu-item-info h3 {
    margin: 2px 0 7px;
    font-size: 18px;
}

.menu-item-info p {
    margin: 0;
    color: #7b6e66;
    font-size: 13px;
    line-height: 1.4;
}

.menu-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.price {
    color: #8b1e1e;
    font-size: 17px;
    font-weight: 700;
}


/* =========================================
   05. 顾客端：菜品数量按钮
   ========================================= */

.menu-quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-quantity {
    min-width: 22px;
    color: #241b18;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
}

.menu-quantity-controls .add-button,
.menu-quantity-controls .decrease-button {
    display: flex;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background-color: #9b1c1f;
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

.menu-quantity-controls .decrease-button:disabled,
.menu-page .add-button:disabled {
    background-color: #d8d1cc;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.8;
}

.add-button:hover {
    background-color: #671414;
}


/* =========================================
   06. 顾客端：售罄状态
   ========================================= */

.menu-item.is-sold-out {
    background-color: #f4f1ee;
    opacity: 0.58;
}

.menu-item.is-sold-out .add-button {
    background-color: #c9c1bb;
    cursor: not-allowed;
}

.sold-out-label {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background-color: #f2d9d7;
    color: #8e2a27;
    font-size: 13px;
    font-weight: 700;
}

.menu-notice {
    color: #8b1e1e;
    line-height: 1.6;
}

.menu-page [hidden] {
    display: none !important;
}


/* =========================================
   07. 顾客端：购物车栏
   ========================================= */

.cart-bar > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-page .cart-bar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    z-index: 15;
    display: none;
    width: calc(100% - 32px);
    max-width: 432px;
    padding: 14px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transform: translateX(-50%);
    border: 1px solid #eadbd4;
    border-radius: 18px;
    background: #fffaf5;
    box-shadow: 0 6px 28px rgba(57, 18, 18, 0.13);
}

.menu-page .cart-bar.visible {
    display: flex;
}

#openCartButton {
    padding: 11px 16px;
    border: none;
    border-radius: 12px;
    background-color: #f5d58b;
    color: #38250f;
    font-weight: 700;
    cursor: pointer;
}


/* =========================================
   08. 顾客端：购物车弹窗
   ========================================= */

.cart-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    padding: 18px;
    align-items: flex-end;
    justify-content: center;
    background-color: rgba(25, 18, 15, 0.55);
}

.cart-modal.visible {
    display: flex;
}

.cart-panel {
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    padding: 24px;
    overflow-y: auto;
    border-radius: 24px 24px 16px 16px;
    background-color: #ffffff;
}

.cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-panel-header h2 {
    margin: 0;
}

#closeCartButton {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background-color: #eee9e4;
    font-size: 25px;
    cursor: pointer;
}

.cart-item-row {
    display: flex;
    padding: 14px 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #eee5de;
}

.cart-item-details {
    display: grid;
    min-width: 0;
    gap: 6px;
    overflow-wrap: anywhere;
}

.quantity-controls {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 10px;
}

.quantity-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3e9e1;
    color: #8b1e1e;
    font-size: 22px;
    cursor: pointer;
}

.cart-summary {
    display: flex;
    margin: 24px 0;
    padding: 16px;
    justify-content: space-between;
    border-radius: 14px;
    background-color: #f7f2ed;
}

.cart-panel label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

#orderNote {
    width: 100%;
    padding: 13px;
    border: 1px solid #d9cec7;
    border-radius: 12px;
    font: inherit;
    resize: vertical;
}

#sendOrderButton {
    width: 100%;
    margin-top: 18px;
    padding: 15px;
    border: none;
    border-radius: 14px;
    background-color: #8b1e1e;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}


/* =========================================
   09. 顾客端：成功弹窗
   ========================================= */

.order-success-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    padding: 24px;
    align-items: center;
    justify-content: center;
    background-color: rgba(42, 27, 22, 0.55);
}

.order-success-modal.visible {
    display: flex;
}

.order-success-panel {
    width: min(100%, 440px);
    padding: 34px 28px 28px;
    border-radius: 24px;
    background-color: #ffffff;
    text-align: center;
    box-shadow: 0 18px 50px rgba(38, 23, 18, 0.28);
}

.success-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 50%;
    background-color: #e3f3e2;
    color: #2f7436;
    font-size: 32px;
    font-weight: 700;
}

.success-eyebrow {
    margin: 0;
    color: #991e20;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.order-success-panel h2 {
    margin: 8px 0;
    font-size: 31px;
}

.success-text {
    margin: 0;
    color: #6f625c;
    line-height: 1.5;
}

.success-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 24px 0 15px;
}

.success-summary div {
    padding: 14px 10px;
    border-radius: 14px;
    background-color: #f6f1eb;
}

.success-summary span {
    display: block;
    margin-bottom: 5px;
    color: #786a63;
    font-size: 13px;
}

.success-summary strong {
    color: #991e20;
    font-size: 17px;
}

.success-order-id {
    margin: 0 0 22px;
    color: #6f625c;
    font-size: 14px;
}

#closeSuccessButton {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 13px;
    background-color: #991e20;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}


/* =========================================
   10. 顾客端：语言切换按钮
   ========================================= */

.language-selector {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 20;
}

.language-toggle {
    display: flex;
    min-height: 42px;
    padding: 9px 13px;
    align-items: center;
    gap: 9px;
    border: 1px solid #eadbd4;
    border-radius: 14px;
    background: #fffaf5;
    color: #6f1c20;
    font: 700 14px Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(58, 8, 8, 0.13);
    cursor: pointer;
}

.language-toggle:hover {
    background: #ffffff;
}

.language-globe {
    display: none;
}

.language-arrow {
    color: #8b1e1e;
    font-size: 16px;
}

.language-menu {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    width: 174px;
    padding: 6px;
    border: 1px solid #eadfd8;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(57, 18, 18, 0.16);
}

.language-option {
    display: flex;
    width: 100%;
    min-height: 44px;
    padding: 10px 11px;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #2d241f;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.language-option:hover,
.language-option.is-active {
    background: #f7ece7;
    color: #9d1d20;
}

.language-option.is-active::after {
    margin-left: auto;
    content: "✓";
    font-weight: 900;
}

.menu-page button:focus-visible {
    outline: 3px solid #dfa933;
    outline-offset: 3px;
}


/* =========================================
   11. 员工端：通用页面样式
   ========================================= */

.staff-page {
    min-height: 100vh;
    background-color: #f2eee8;
    color: #261d19;
}


/* =========================================
   12. 后厨端：顶部区域
   ========================================= */

.kitchen-page {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 32px 24px 60px;
}

.kitchen-header {
    display: flex;
    padding: 30px 34px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    border-radius: 24px;
    background-color: #991e20;
    color: #ffffff;
}

.kitchen-eyebrow {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    opacity: 0.85;
}

.kitchen-header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 44px);
}

.kitchen-subtitle {
    margin: 8px 0 0;
    font-size: 18px;
    opacity: 0.9;
}

.kitchen-header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 14px;
}

.kitchen-live-status {
    display: flex;
    padding: 11px 15px;
    align-items: center;
    gap: 9px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.16);
    font-weight: 700;
    white-space: nowrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #91e48c;
    box-shadow: 0 0 0 4px rgba(145, 228, 140, 0.16);
}


/* =========================================
   13. 后厨端：订单看板
   ========================================= */

.kitchen-board {
    margin-top: 30px;
}

.kitchen-board-heading {
    display: flex;
    margin-bottom: 18px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.kitchen-board-heading h2 {
    margin: 0;
    font-size: 28px;
}

.kitchen-board-heading p {
    margin: 7px 0 0;
    color: #6f655f;
}

.order-counter {
    padding: 9px 13px;
    border-radius: 999px;
    background-color: #fae09a;
    color: #5c3f08;
    font-weight: 700;
    white-space: nowrap;
}

.staff-view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 20px;
}

.staff-view-tab {
    padding: 11px 15px;
    border: none;
    border-radius: 999px;
    background-color: #e9e4df;
    color: #3e302a;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.staff-view-tab.active {
    background-color: #991e20;
    color: #ffffff;
}


/* =========================================
   14. 后厨端：订单卡片
   ========================================= */

.kitchen-order-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 18px;
}

.kitchen-order-card {
    padding: 23px;
    border: 1px solid #eadfd7;
    border-radius: 20px;
    background-color: #ffffff;
    box-shadow: 0 10px 26px rgba(74, 45, 32, 0.08);
}

.kitchen-order-card.is-new {
    border-top: 7px solid #e06a38;
}

.kitchen-order-card.is-preparing {
    border-top-color: #f3c766;
}

.kitchen-order-card.is-finished {
    border-top-color: #75a66e;
    opacity: 0.82;
}

.kitchen-order-card.is-cancelled {
    border-top-color: #8e2a27;
    opacity: 0.76;
}

.kitchen-order-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.new-order-label {
    display: inline-block;
    margin-bottom: 8px;
    padding: 6px 9px;
    border-radius: 999px;
    background-color: #fff0e8;
    color: #ab3d17;
    font-size: 13px;
    font-weight: 700;
}

.kitchen-order-card.is-preparing .new-order-label {
    background-color: #fff8df;
    color: #896000;
}

.kitchen-order-card.is-finished .new-order-label {
    background-color: #edf7eb;
    color: #367136;
}

.kitchen-order-card.is-cancelled .new-order-label {
    background-color: #f4dfdd;
    color: #8e2a27;
}

.kitchen-order-top h3 {
    margin: 0;
    font-size: 27px;
}

.kitchen-order-top p {
    margin: 6px 0 0;
    color: #756a63;
}

.kitchen-total {
    color: #991e20;
    font-size: 21px;
    white-space: nowrap;
}

.kitchen-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 23px 0;
    padding: 0;
    list-style: none;
}

.kitchen-items li {
    padding: 11px 13px;
    border-radius: 10px;
    background-color: #f7f2ed;
    font-size: 17px;
    font-weight: 700;
}

.kitchen-note {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 13px;
    border-left: 4px solid #f3c766;
    border-radius: 8px;
    background-color: #fff9e9;
    color: #5e4d2e;
}


/* =========================================
   15. 后厨端：订单操作按钮
   ========================================= */

.kitchen-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.kitchen-action-button {
    flex: 1;
    min-height: 46px;
    border: none;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.kitchen-action-button:hover {
    filter: brightness(0.96);
}

.kitchen-action-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.start-button {
    background-color: #991e20;
    color: #ffffff;
}

.finish-button {
    background-color: #e9e4df;
    color: #3e302a;
}

.cancel-button {
    background-color: #f4dfdd;
    color: #8e2a27;
}


/* =========================================
   16. 后厨端：菜品供应管理
   ========================================= */

.kitchen-inventory {
    margin-top: 34px;
}

.inventory-list {
    display: grid;
    gap: 12px;
}

.inventory-item {
    display: flex;
    padding: 16px 18px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #eadfd7;
    border-radius: 15px;
    background-color: #ffffff;
}

.inventory-item > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inventory-available,
.inventory-sold-out {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.inventory-sold-out {
    background-color: #f2d9d7;
    color: #8e2a27;
}

.inventory-available {
    background-color: #e6f3e4;
    color: #397436;
}

.inventory-toggle-button {
    min-height: 39px;
    padding: 8px 12px;
    border: none;
    border-radius: 9px;
    background-color: #991e20;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}


/* =========================================
   17. 后厨端：语言切换按钮
   与顾客端保持统一
   ========================================= */

.staff-language-switcher {
    position: relative;
    z-index: 100;
}

.staff-language-button {
    display: flex;
    min-width: 0;
    min-height: 42px;
    padding: 9px 13px;
    align-items: center;
    gap: 9px;
    border: 1px solid #eadbd4;
    border-radius: 14px;
    background-color: #fffaf5;
    color: #6f1c20;
    font: 700 14px Arial, "Microsoft YaHei", sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(58, 8, 8, 0.13);
}

.staff-language-button:hover {
    background-color: #ffffff;
}

.staff-language-button:focus-visible {
    outline: 3px solid rgba(247, 202, 103, 0.55);
    outline-offset: 3px;
}

/* 直接显示 HTML 和 JS 中的 Emoji 国旗 */

.staff-language-flag {
    display: inline-block !important;
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    font-size: 22px !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.staff-language-arrow {
    margin-left: auto;
    color: #a91e24;
    font-size: 13px;
    transition: transform 0.2s ease;
}

.staff-language-button[aria-expanded="true"]
.staff-language-arrow {
    transform: rotate(180deg);
}

.staff-language-menu {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    width: 174px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid #eadfd8;
    border-radius: 16px;
    background-color: #ffffff;
    box-shadow: 0 12px 30px rgba(57, 18, 18, 0.16);
}

.staff-language-menu[hidden] {
    display: none !important;
}

.staff-language-option {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 44px;
    padding: 10px 36px 10px 11px;
    align-items: center;
    gap: 12px;
    border: none;
    border-radius: 11px;
    background-color: transparent;
    color: #2d241f;
    font: 700 14px Arial, "Microsoft YaHei", sans-serif;
    text-align: left;
    cursor: pointer;
}

.staff-language-option:hover {
    background-color: #f7ece7;
    color: #9d1d20;
}

.staff-language-option.active {
    background-color: #f7ece7;
    color: #9d1d20;
}

.staff-language-option.active::after {
    position: absolute;
    top: 50%;
    right: 14px;
    content: "✓";
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 900;
}


/* =========================================
   18. 管理端：页面与顶部标题
   ========================================= */

.admin-page {
    width: min(100% - 32px, 1120px);
    margin: 0 auto;
    padding: 34px 0 60px;
}

.admin-header {
    display: flex;
    padding: 34px 42px;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border-radius: 26px;
    background-color: #991e20;
    color: #ffffff;
}

.admin-header h1 {
    margin: 6px 0;
    font-size: clamp(34px, 6vw, 54px);
}

.admin-header .kitchen-subtitle {
    margin: 0;
}

.admin-badge {
    padding: 11px 15px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.18);
    font-weight: 700;
}


/* =========================================
   19. 管理端：菜品编辑表单
   ========================================= */

.admin-editor,
.admin-menu-section {
    margin-top: 30px;
    padding: 28px;
    border-radius: 22px;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(54, 32, 24, 0.08);
}

.admin-section-heading h2 {
    margin: 0 0 6px;
}

.admin-section-heading p {
    margin: 0;
    color: #74665e;
}

.menu-form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.menu-form label {
    display: grid;
    gap: 8px;
    color: #3e302a;
    font-weight: 700;
}

.menu-form input,
.menu-form select,
.menu-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ded3ca;
    border-radius: 11px;
    background-color: #ffffff;
    color: #2c221d;
    font: inherit;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.image-preview-box {
    display: grid;
    width: 130px;
    height: 130px;
    place-items: center;
    overflow: hidden;
    border-radius: 16px;
    background-color: #f5eee7;
    font-size: 54px;
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.admin-action-button,
.primary-form-button,
.secondary-form-button {
    padding: 11px 14px;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.primary-form-button {
    background-color: #991e20;
    color: #ffffff;
}

.secondary-form-button {
    background-color: #eee8e3;
    color: #493730;
}

.secondary-form-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}


/* =========================================
   20. 管理端：现有菜品列表
   ========================================= */

.admin-menu-list {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.admin-menu-card {
    display: flex;
    gap: 18px;
    padding: 18px;
    border: 1px solid #eadfd7;
    border-radius: 17px;
}

.admin-dish-picture {
    display: grid;
    flex-shrink: 0;
    width: 105px;
    min-width: 105px;
    height: 105px;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background-color: #f5eee7;
    font-size: 44px;
}

.admin-dish-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-dish-info {
    flex: 1;
}

.admin-dish-title-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.admin-dish-title-row h3 {
    margin: 5px 0;
    font-size: 20px;
}

.admin-dish-title-row > strong {
    color: #991e20;
    white-space: nowrap;
}

.admin-dish-info p {
    margin: 7px 0 10px;
    color: #74665e;
}

.admin-availability,
.admin-category-label {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.admin-category-label {
    background-color: #f2e8df;
    color: #6a5146;
}

.admin-availability.is-available {
    background-color: #e2f1e3;
    color: #2f7436;
}

.admin-availability.is-sold-out {
    background-color: #f3dfdc;
    color: #8e2a27;
}

.admin-dish-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
}

.admin-action-button {
    background-color: #eee8e3;
    color: #493730;
}

.admin-action-button.edit-action {
    background-color: #f5d77f;
}

.admin-action-button.delete-action {
    background-color: #f3dfdc;
    color: #8e2a27;
}


/* =========================================
   21. 平板与手机适配
   ========================================= */

@media (max-width: 700px) {
    .kitchen-header {
        flex-direction: column;
    }

    .kitchen-header-tools {
        width: 100%;
        justify-content: space-between;
    }

    .staff-language-button {
        min-width: 0;
    }

    .staff-language-menu {
        right: auto;
        left: 0;
    }
}

@media (max-width: 650px) {
    .admin-dish-title-row,
    .admin-header,
    .admin-menu-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-form-actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .admin-form-actions button {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .kitchen-page {
        padding: 16px 14px 40px;
    }

    .kitchen-header {
        align-items: flex-start;
        padding: 24px;
    }

    .kitchen-board-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-item {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 380px) {
    .menu-page {
        padding-right: 16px;
        padding-left: 16px;
    }

    .food-icon {
        width: 64px;
        min-width: 64px;
        height: 64px;
    }
}

/* =========================================
   收银端：复用顾客端语言选择器
   ========================================= */

.cashier-header {
    position: relative;
}

.cashier-header .language-selector {
    position: relative;
    top: auto;
    right: auto;
    z-index: 100;
}

.cashier-header .language-menu {
    z-index: 101;
}

/* ========================================
   管理端 — 餐厅功能设置白色卡片
   ======================================== */

.admin-page > .admin-settings-section {
    width: 100%;
    margin: 32px 0 42px;
    padding: 38px 42px;

    background: #ffffff;
    border: 1px solid rgba(142, 91, 63, 0.08);
    border-radius: 30px;

    box-shadow:
        0 18px 45px rgba(75, 47, 31, 0.09);
}


/* 设置区域顶部小标题 */

.admin-settings-eyebrow {
    margin: 0 0 8px;

    color: #a71f23;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
}


/* 设置区域标题 */

.admin-settings-section .admin-section-heading h2 {
    margin: 0 0 8px;

    color: #241b17;
    font-size: 30px;
    line-height: 1.2;
}


/* 设置区域说明 */

.admin-settings-section .admin-section-heading p:not(
    .admin-settings-eyebrow
) {
    margin: 0;

    color: #80685c;
    font-size: 16px;
    line-height: 1.6;
}


/* ========================================
   呼叫服务员功能卡片
   ======================================== */

.admin-setting-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;

    margin-top: 28px;
    padding: 24px 26px;

    background: #fbf7f4;
    border: 1px solid #eaded7;
    border-radius: 20px;
}


/* 铃铛图标 */

.admin-setting-icon {
    display: grid;
    place-items: center;

    width: 58px;
    height: 58px;

    background: #f7d785;
    border-radius: 17px;

    font-size: 26px;
}


/* 功能名称 */

.admin-setting-information h3 {
    margin: 0 0 7px;

    color: #2b211c;
    font-size: 20px;
    line-height: 1.3;
}


/* 功能说明 */

.admin-setting-information p {
    max-width: 700px;
    margin: 0;

    color: #80685c;
    font-size: 15px;
    line-height: 1.55;
}


/* ========================================
   呼叫服务员开关
   ======================================== */

.admin-setting-control {
    display: flex;
    align-items: center;
    gap: 12px;

    cursor: pointer;
    user-select: none;
}


/* 隐藏原生复选框 */

.admin-setting-control input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}


/* 开关背景 */

.admin-setting-switch {
    position: relative;
    display: block;
    flex-shrink: 0;

    width: 54px;
    height: 31px;

    background: #d7cec9;
    border-radius: 999px;

    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}


/* 开关圆点 */

.admin-setting-switch-handle {
    position: absolute;
    top: 4px;
    left: 4px;

    width: 23px;
    height: 23px;

    background: #ffffff;
    border-radius: 50%;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.22);

    transition: transform 0.2s ease;
}


/* 开启时的背景 */

.admin-setting-control input:checked
    + .admin-setting-switch {
    background: #a91e23;
}


/* 开启时圆点移动 */

.admin-setting-control input:checked
    + .admin-setting-switch
    .admin-setting-switch-handle {
    transform: translateX(23px);
}


/* 键盘选中效果 */

.admin-setting-control input:focus-visible
    + .admin-setting-switch {
    outline: 3px solid rgba(169, 30, 35, 0.22);
    outline-offset: 3px;
}


/* Activé 状态文字 */

#serviceCallStatusText {
    min-width: 68px;

    color: #a91e23;
    font-size: 15px;
    font-weight: 800;
}


/* 保存成功提示 */

.admin-setting-save-message {
    min-height: 20px;
    margin: 13px 0 0;

    color: #237a3a;
    font-size: 14px;
    font-weight: 700;
}


/* ========================================
   餐厅设置区域 — 手机适配
   ======================================== */

@media (max-width: 700px) {
    .admin-page > .admin-settings-section {
        margin: 22px 0 30px;
        padding: 25px 21px;

        border-radius: 22px;
    }

    .admin-settings-section
    .admin-section-heading h2 {
        font-size: 24px;
    }

    .admin-setting-card {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 15px;

        padding: 19px;
        border-radius: 17px;
    }

    .admin-setting-icon {
        width: 50px;
        height: 50px;

        border-radius: 14px;
        font-size: 23px;
    }

    .admin-setting-control {
        grid-column: 1 / -1;
        justify-content: flex-end;

        margin-top: 4px;
        padding-top: 16px;

        border-top: 1px solid #e7dcd5;
    }
}

/* 呼叫服务员功能关闭状态 */

#restaurantSettingsSection.is-disabled
#serviceCallStatusText {
    color: #8d817b;
}

#restaurantSettingsSection.is-disabled
.admin-setting-icon {
    background: #e5dfdb;
    filter: grayscale(1);
}

/* ==================================================
   顾客端：呼叫服务员卡片
   ================================================== */

.service-call-panel {
    width: 100%;
    margin: 22px 0 110px;
    padding: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 18px;
    background:
        linear-gradient(
            135deg,
            #fffdfb 0%,
            #fff7f3 100%
        );
    border: 1px solid #efdcd4;
    border-radius: 22px;
    box-shadow:
        0 12px 30px
        rgba(70, 31, 20, 0.08);
}

.service-call-panel[hidden] {
    display: none !important;
}

.service-call-information {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.service-call-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8ded7;
    border-radius: 50%;
    font-size: 22px;
}

.service-call-information h2 {
    margin: 0 0 5px;
    color: #2d241f;
    font-size: 19px;
    line-height: 1.25;
}

.service-call-information p {
    margin: 0;
    color: #78675f;
    font-size: 14px;
    line-height: 1.5;
}

.service-call-button {
    min-width: 155px;
    min-height: 46px;
    padding: 11px 18px;
    border: 0;
    border-radius: 14px;
    background: #a7191f;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        0 7px 16px
        rgba(167, 25, 31, 0.2);
    transition:
        transform 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.service-call-button:hover:not(:disabled) {
    background: #8e1419;
    transform: translateY(-1px);
    box-shadow:
        0 9px 20px
        rgba(167, 25, 31, 0.25);
}

.service-call-button:active:not(:disabled) {
    transform: translateY(0);
}

.service-call-button:focus-visible {
    outline: 3px solid
        rgba(167, 25, 31, 0.22);
    outline-offset: 3px;
}

.service-call-button:disabled {
    background: #dfbbb5;
    color: #ffffff;
    cursor: default;
    box-shadow: none;
}

.service-call-message {
    min-height: 18px;
    margin: 0;
    grid-column: 1 / -1;
    color: #347346;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}


/* ==================================================
   收银端：顾客呼叫区域
   ================================================== */

.cashier-service-call-board {
    margin-bottom: 24px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #eadfd9;
    border-radius: 24px;
    box-shadow:
        0 14px 34px
        rgba(53, 35, 28, 0.08);
}

.cashier-service-call-board.has-pending-calls {
    border-color: #e5aaa6;
    box-shadow:
        0 14px 34px
        rgba(167, 25, 31, 0.1);
}

.cashier-service-call-heading {
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.cashier-service-call-heading h2 {
    margin: 0 0 6px;
    color: #2d241f;
    font-size: 23px;
    line-height: 1.2;
}

.cashier-service-call-heading p {
    margin: 0;
    color: #796960;
    font-size: 14px;
    line-height: 1.5;
}

.cashier-service-call-counter {
    flex-shrink: 0;
    padding: 8px 13px;
    background: #f5ebe7;
    color: #8f322d;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.has-pending-calls
.cashier-service-call-counter {
    background: #a7191f;
    color: #ffffff;
}

.cashier-service-call-list {
    display: grid;
    gap: 12px;
}

.cashier-service-call-card {
    padding: 16px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    background:
        linear-gradient(
            135deg,
            #fff9f7 0%,
            #fff2ef 100%
        );
    border: 1px solid #ecc6c0;
    border-left: 5px solid #a7191f;
    border-radius: 17px;
}

.cashier-service-call-alert-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f6d9d4;
    border-radius: 50%;
    font-size: 21px;
}

.cashier-service-call-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cashier-service-call-details strong {
    color: #2d241f;
    font-size: 18px;
    line-height: 1.25;
}

.cashier-service-call-details span {
    color: #806d64;
    font-size: 13px;
}

.cashier-service-call-handle {
    min-height: 43px;
    padding: 10px 16px;
    border: 0;
    border-radius: 13px;
    background: #a7191f;
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        background-color 0.18s ease;
}

.cashier-service-call-handle:hover {
    background: #8e1419;
    transform: translateY(-1px);
}

.cashier-service-call-handle:active {
    transform: translateY(0);
}

.cashier-service-call-handle:focus-visible {
    outline: 3px solid
        rgba(167, 25, 31, 0.2);
    outline-offset: 3px;
}

.cashier-service-call-empty {
    min-height: 90px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f8f6f4;
    border: 1px dashed #d9cec8;
    border-radius: 16px;
    color: #776a63;
}

.cashier-service-call-empty span {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dff0e2;
    color: #347346;
    border-radius: 50%;
    font-weight: 900;
}

.cashier-service-call-empty p {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}


/* ==================================================
   呼叫卡片：手机适配
   ================================================== */

@media (max-width: 680px) {
    .service-call-panel {
        margin: 18px 0 105px;
        padding: 17px;
        grid-template-columns: 1fr;
        border-radius: 19px;
    }

    .service-call-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        font-size: 20px;
    }

    .service-call-information h2 {
        font-size: 17px;
    }

    .service-call-information p {
        font-size: 13px;
    }

    .service-call-button {
        width: 100%;
        min-width: 0;
    }

    .service-call-message {
        text-align: center;
    }

    .cashier-service-call-board {
        padding: 18px;
        border-radius: 20px;
    }

    .cashier-service-call-heading {
        flex-direction: column;
        gap: 10px;
    }

    .cashier-service-call-heading h2 {
        font-size: 20px;
    }

    .cashier-service-call-card {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 14px;
    }

    .cashier-service-call-handle {
        width: 100%;
        grid-column: 1 / -1;
    }
}


/* ==================================================
   减少动画设置
   ================================================== */

@media (prefers-reduced-motion: reduce) {
    .service-call-button,
    .cashier-service-call-handle {
        transition: none;
    }
}

/* ==================================================
   顾客端：纯文字语言选择器（唯一最终版本）
   ================================================== */

.menu-page .restaurant-header {
    position: relative;
}


/* 整个语言组件 */

.menu-page .language-selector {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1000;

    width: 150px;
}


/* 顶部语言按钮 */

.menu-page .language-toggle {
    width: 150px;
    min-width: 150px;
    max-width: 150px;

    height: 46px;
    min-height: 46px;
    max-height: 46px;

    padding: 0 15px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border: 1px solid #ead7cf;
    border-radius: 15px;

    background: #fffaf7;
    color: #72161a;

    font-family:
        Arial,
        "Microsoft YaHei",
        sans-serif;

    font-size: 14px;
    font-weight: 800;
    line-height: 1;

    box-shadow:
        0 7px 18px
        rgba(44, 20, 15, 0.13);

    cursor: pointer;
}


/* language.js 会生成 SVG 国旗；显式限制尺寸，避免使用 SVG 默认的 300×150px。 */

.menu-page .language-flag {
    display: block;
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    height: 16px;
    min-height: 16px;
    max-height: 16px;
    flex: 0 0 24px;
}

.menu-page .language-option .language-flag {
    margin-right: 10px;
}


/* 隐藏顾客端地球和国旗 */

.menu-page .language-globe,
.menu-page #selectedLanguageFlag,
.menu-page .language-option > span:first-child {
    display: none !important;
}


/* 顶部当前语言文字 */

.menu-page #selectedLanguageShort {
    display: block;

    width: auto;
    min-width: 0;
    height: auto;

    flex: 0 1 auto;

    color: inherit;

    font-size: 14px;
    font-weight: 800;
    line-height: 1;

    text-align: center;
    white-space: nowrap;
}


/* 顶部小箭头 */

.menu-page .language-arrow {
    display: block;

    width: auto;
    height: auto;

    flex: 0 0 auto;

    margin: 0;

    color: #a7191f;

    font-size: 12px;
    line-height: 1;
}


/* 下拉菜单 */

.menu-page .language-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;

    z-index: 1001;

    width: 168px;
    min-width: 168px;
    max-width: 168px;

    padding: 7px;

    display: grid;
    gap: 3px;

    border: 1px solid #eadbd5;
    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        0 14px 32px
        rgba(44, 20, 15, 0.16);

    overflow: hidden;
}


/* 关闭状态 */

.menu-page .language-menu[hidden] {
    display: none !important;
}


/* 每一个语言选项 */

.menu-page .language-option {
    width: 100%;
    min-width: 0;
    max-width: 100%;

    height: 44px;
    min-height: 44px;
    max-height: 44px;

    padding: 0 13px;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;

    border: 0;
    border-radius: 11px;

    background: transparent;
    color: #352721;

    font-family:
        Arial,
        "Microsoft YaHei",
        sans-serif;

    font-size: 14px;
    font-weight: 700;
    line-height: 1;

    text-align: left;

    cursor: pointer;
    overflow: hidden;
}


/* 下拉菜单中的语言文字 */

.menu-page
.language-option
> span:last-child {
    display: block;

    width: auto;
    min-width: 0;
    height: auto;

    color: inherit;

    font-size: 14px;
    font-weight: 700;
    line-height: 1;

    white-space: nowrap;
}


/* 鼠标经过和当前选中状态 */

.menu-page .language-option:hover,
.menu-page .language-option.active,
.menu-page .language-option.is-active {
    background: #f6e7e2;
    color: #97191e;
}


/* 当前语言右边的对勾 */

.menu-page .language-option.active::after,
.menu-page .language-option.is-active::after {
    margin-left: auto;

    content: "✓";

    font-weight: 900;
}


/* 手机尺寸 */

@media (max-width: 680px) {
    .menu-page .language-selector,
    .menu-page .language-toggle {
        width: 138px;
    }

    .menu-page .language-toggle {
        min-width: 138px;
        max-width: 138px;

        height: 44px;
        min-height: 44px;
        max-height: 44px;
    }

    .menu-page .language-menu {
        width: 156px;
        min-width: 156px;
        max-width: 156px;
    }
}
/* ==================================================
   管理端：Supabase 安全登录与云端状态
   ================================================== */

.admin-auth-page {
    display: grid;
    min-height: 100vh;
    padding: 28px 18px;
    place-items: center;
    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(247, 215, 133, 0.28),
            transparent 38%
        ),
        #f2eee8;
}

.admin-auth-page[hidden],
.admin-page[hidden] {
    display: none !important;
}

.admin-auth-card {
    width: min(100%, 460px);
    padding: 42px;
    border: 1px solid #eadfd7;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(54, 32, 24, 0.13);
}

.admin-auth-eyebrow {
    margin: 0 0 12px;
    color: #991e20;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.admin-auth-card h1 {
    margin: 0;
    color: #261d19;
    font-size: clamp(34px, 8vw, 48px);
}

.admin-auth-description {
    margin: 12px 0 28px;
    color: #74665e;
    line-height: 1.6;
}

.admin-auth-form {
    display: grid;
    gap: 18px;
}

.admin-auth-form label {
    display: grid;
    gap: 8px;
    color: #3e302a;
    font-weight: 700;
}

.admin-auth-form input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #ded3ca;
    border-radius: 12px;
    background: #fffdfb;
    color: #2c221d;
    font: inherit;
}

.admin-auth-form input:focus {
    border-color: #a91e23;
    outline: 3px solid rgba(169, 30, 35, 0.12);
}

.admin-login-button,
.admin-logout-button {
    border: 0;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.admin-login-button {
    min-height: 50px;
    border-radius: 13px;
    background: #991e20;
    color: #ffffff;
}

.admin-login-button:disabled,
.admin-logout-button:disabled,
.admin-action-button:disabled,
.primary-form-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.admin-auth-message {
    min-height: 20px;
    margin: 0;
    color: #237a3a;
    font-size: 14px;
    font-weight: 700;
}

.admin-auth-message.is-error,
.admin-cloud-status.is-error {
    color: #a91e23;
}

.admin-auth-security {
    margin: 22px 0 0;
    color: #8d817b;
    font-size: 13px;
    text-align: center;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-logout-button {
    padding: 11px 15px;
    border-radius: 999px;
    background: #ffffff;
    color: #8f1d20;
}

.admin-cloud-status {
    min-height: 20px;
    margin-top: 10px !important;
    color: #237a3a !important;
    font-size: 14px;
    font-weight: 700;
}

.admin-empty-state {
    display: grid;
    gap: 7px;
    padding: 30px;
    border: 1px dashed #d9c9bf;
    border-radius: 16px;
    background: #fbf7f4;
    color: #74665e;
    text-align: center;
}

.admin-empty-state strong {
    color: #3e302a;
    font-size: 18px;
}

@media (max-width: 650px) {
    .admin-auth-card {
        padding: 30px 22px;
        border-radius: 22px;
    }

    .admin-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* =========================================
   管理端：餐厅公开资料卡片
   ========================================= */

.admin-profile-section {
    width: 100%;
    margin-top: 30px;
    padding: 38px 42px;
    border: 1px solid rgba(142, 91, 63, 0.08);
    border-radius: 30px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(75, 47, 31, 0.09);
}

.restaurant-profile-form {
    display: grid;
    gap: 20px;
    margin-top: 28px;
}

.restaurant-profile-block {
    display: grid;
    gap: 17px;
    padding: 24px 26px;
    border: 1px solid #eaded7;
    border-radius: 20px;
    background: #fbf7f4;
}

.restaurant-profile-block-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.restaurant-profile-block-heading > span {
    display: grid;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    background: #f7d785;
    font-size: 22px;
}

.restaurant-profile-block-heading h3 {
    margin: 0 0 4px;
    color: #2b211c;
    font-size: 20px;
}

.restaurant-profile-block-heading p {
    margin: 0;
    color: #80685c;
    font-size: 14px;
    line-height: 1.5;
}

.restaurant-profile-form label,
.restaurant-asset-card label {
    display: grid;
    gap: 8px;
    color: #3e302a;
    font-weight: 700;
}

.restaurant-profile-form input,
.restaurant-profile-form textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #ded3ca;
    border-radius: 11px;
    background: #ffffff;
    color: #2c221d;
    font: inherit;
}

.restaurant-profile-form textarea {
    min-height: 96px;
    resize: vertical;
}

.restaurant-profile-form input:focus,
.restaurant-profile-form textarea:focus {
    border-color: #a91e23;
    outline: 3px solid rgba(169, 30, 35, 0.12);
}

.restaurant-profile-form input[readonly] {
    background: #eee8e3;
    color: #756861;
    cursor: not-allowed;
}

.restaurant-assets-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.72fr)
        minmax(0, 1.28fr);
    gap: 20px;
}

.restaurant-asset-card {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e8dbd3;
    border-radius: 17px;
    background: #ffffff;
}

.restaurant-asset-preview {
    display: grid;
    width: 100%;
    place-items: center;
    overflow: hidden;
    border: 1px dashed #d8c6bb;
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            #f5eee7 0%,
            #fffaf7 100%
        );
    color: #9a8174;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-align: center;
}

.restaurant-asset-preview.is-logo {
    aspect-ratio: 1 / 1;
    max-height: 260px;
}

.restaurant-asset-preview.is-cover {
    aspect-ratio: 16 / 9;
}

.restaurant-asset-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.restaurant-asset-preview.is-logo img {
    object-fit: contain;
}

.restaurant-profile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 4px;
}

.restaurant-profile-status {
    min-height: 20px;
    margin: 0;
    color: #237a3a;
    font-size: 14px;
    font-weight: 700;
}

.restaurant-profile-status.is-error {
    color: #a91e23;
}

@media (max-width: 760px) {
    .admin-profile-section {
        padding: 25px 21px;
        border-radius: 22px;
    }

    .restaurant-assets-grid {
        grid-template-columns: 1fr;
    }

    .restaurant-asset-preview.is-logo {
        max-width: 260px;
    }
}

@media (max-width: 650px) {
    .restaurant-profile-block {
        padding: 19px;
        border-radius: 17px;
    }

    .restaurant-profile-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .restaurant-profile-actions
    .primary-form-button {
        width: 100%;
    }
}


/* =========================================
   顾客端：后台餐厅资料显示
   追加到 style.css 文件末尾
   ========================================= */

.menu-page .restaurant-header {
    overflow-wrap: anywhere;
}

/* 餐厅名称 */

.menu-page .restaurant-header #restaurantName {
    margin: 0;
    font-size: clamp(26px, 7vw, 34px);
    line-height: 1.2;
}

/* 三语副标题 */

.menu-page .restaurant-header #restaurantSubtitle {
    margin: 0 0 10px;
    line-height: 1.5;
}

/* 未加载云端资料时保留的中文名称 */

.menu-page .restaurant-header #restaurantChineseName {
    margin: 8px 0 0;
}

/* 餐厅封面 */

.menu-page .restaurant-header .restaurant-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.menu-page .restaurant-header .restaurant-cover-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 餐厅 Logo */

.menu-page .restaurant-header .restaurant-logo {
    display: grid;
    width: 84px;
    height: 84px;
    margin: 0 0 16px;
    padding: 8px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.menu-page .restaurant-header .restaurant-logo-image {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
}

/* 餐厅简介：保留后台填写的换行 */

.menu-page .restaurant-header .restaurant-description {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-line;
}

/* 联系方式 */

.menu-page .restaurant-header .restaurant-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, 0.92);
}

.menu-page .restaurant-header .restaurant-address,
.menu-page .restaurant-header .restaurant-phone {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.menu-page .restaurant-header .restaurant-address > [aria-hidden],
.menu-page .restaurant-header .restaurant-phone > [aria-hidden] {
    flex: 0 0 auto;
}

.menu-page .restaurant-header #restaurantAddress,
.menu-page .restaurant-header #restaurantPhone {
    min-width: 0;
}

.menu-page .restaurant-header #restaurantPhone {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.menu-page .restaurant-header #restaurantPhone[href]:focus-visible {
    border-radius: 3px;
    outline: 2px solid #f5d58b;
    outline-offset: 4px;
}

/* 桌号与资料之间的间距 */

.menu-page .restaurant-header .table-badge {
    margin-top: 20px;
}

/* 空资料或图片加载失败时，不占用显示空间 */

.menu-page .restaurant-header [hidden] {
    display: none !important;
}

/* 资料长文本允许换行，语言按钮始终保持一行。 */
.menu-page .restaurant-header .language-toggle {
    gap: 8px;
    padding-right: 12px;
    padding-left: 12px;
    white-space: nowrap;
    overflow-wrap: normal;
}

.menu-page .restaurant-header .language-toggle > span {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Logo 左上、语言切换右上；封面保留原有宽度和比例。 */
.menu-page .restaurant-header {
    padding-top: 18px;
}

.menu-page .restaurant-header .restaurant-header-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 18px;
    min-width: 0;
}

.menu-page .restaurant-header .restaurant-header-top .restaurant-logo {
    flex: 0 0 auto;
    margin: 0 auto 0 0;
}

.menu-page .restaurant-header .restaurant-header-top .language-selector {
    position: relative;
    top: auto;
    right: auto;
    flex: 0 0 auto;
}

/* 管理端：三语菜单分类 */
.admin-category-section {
    margin-top: 30px;
    padding: 30px;
    border: 1px solid #eaded7;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(75, 47, 31, 0.06);
}

.admin-category-section .admin-section-heading {
    flex-wrap: wrap;
    gap: 16px;
}

.admin-category-form {
    margin-top: 20px;
    padding: 22px;
    border-radius: 16px;
    background: #fbf7f4;
}

.admin-category-form h3 { margin: 0 0 18px; }
.admin-category-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.admin-category-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-category-inputs label { display: grid; min-width: 0; gap: 8px; color: #3e302a; font-weight: 700; }
.admin-category-inputs input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #ded3ca;
    border-radius: 10px;
    background: #fff;
    color: #2c221d;
    font: inherit;
}
.admin-category-inputs input:focus { border-color: #a91e23; outline: 3px solid rgba(169, 30, 35, 0.12); }
.admin-category-form-actions, .admin-category-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-category-form-actions { justify-content: flex-end; margin-top: 16px; }
.admin-category-hint { margin: 12px 0; color: #80685c; font-size: 14px; line-height: 1.5; }
.admin-category-status { min-height: 22px; margin: 16px 0; color: #237a3a; line-height: 1.5; }
.admin-category-status.is-error { color: #a91e23; }
.admin-category-list { display: grid; gap: 12px; }
.admin-category-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid #eaded7;
    border-radius: 14px;
}
.admin-category-details { min-width: 0; overflow-wrap: anywhere; }
.admin-category-details h3 { margin: 0 0 6px; font-size: 18px; }
.admin-category-details p { margin: 0 0 6px; color: #746861; line-height: 1.5; }
.admin-category-meta { color: #80685c; font-size: 13px; }
.admin-category-actions { flex-shrink: 0; }
.admin-category-section button:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-category-section .category-delete-button { color: #a91e23; }
.admin-category-section [hidden] { display: none !important; }
.admin-editor #menuCategory { min-width: 0; max-width: 100%; }

.admin-table-section { margin-top: 30px; padding: 30px; border: 1px solid #eaded7; border-radius: 24px; background: #fff; box-shadow: 0 10px 28px rgba(75,47,31,.06); }
.admin-table-section .admin-section-heading { flex-wrap: wrap; gap: 16px; }
.admin-table-toolbar, .admin-table-form-actions, .admin-table-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-table-toolbar select { min-width: 0; padding: 10px 12px; border: 1px solid #ded3ca; border-radius: 10px; font: inherit; background: #fff; color: #3e302a; }
.admin-table-form { margin-top: 20px; padding: 22px; background: #fbf7f4; border-radius: 16px; }
.admin-table-form h3 { margin: 0 0 18px; }
.admin-table-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.admin-table-inputs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.admin-table-inputs label { display: grid; min-width: 0; gap: 8px; color: #3e302a; font-weight: 700; }
.admin-table-inputs input { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid #ded3ca; border-radius: 10px; font: inherit; color: #2c221d; background: #fff; }
.admin-table-inputs input:focus { border-color: #a91e23; outline: 3px solid rgba(169,30,35,.12); }
.admin-table-inputs input:read-only { background: #f0ece8; color: #746861; }
.admin-table-form-actions { justify-content: flex-end; margin-top: 16px; }
.admin-table-hint, .admin-table-restaurant { margin: 12px 0; color: #80685c; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.admin-table-status { min-height: 22px; margin: 16px 0; color: #237a3a; line-height: 1.5; overflow-wrap: anywhere; }
.admin-table-status.is-error { color: #a91e23; }
.admin-table-list { display: grid; gap: 12px; }
.admin-table-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid #eaded7; border-radius: 14px; }
.admin-table-details { min-width: 0; overflow-wrap: anywhere; }
.admin-table-details h3 { margin: 0 0 6px; font-size: 18px; }
.admin-table-details p { margin: 0 0 8px; color: #746861; line-height: 1.5; }
.admin-table-badge { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.admin-table-badge.is-active { color: #286e35; background: #e7f4e6; }
.admin-table-badge.is-inactive { color: #8b3b31; background: #f6e5e1; }
.admin-table-section button:disabled { opacity: .5; cursor: not-allowed; }
.admin-table-section [hidden] { display: none !important; }
@media (max-width:650px) {
    .admin-table-section { padding: 20px 16px; }
    .admin-table-form { padding: 16px; }
    .admin-table-inputs { grid-template-columns: minmax(0,1fr); }
    .admin-table-card { align-items: stretch; flex-direction: column; }
}

.table-qr-dialog {
    width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
    box-sizing: border-box; overflow: auto; padding: 24px; border: 1px solid #eaded7;
    border-radius: 20px; background: #fff; color: #3e302a; text-align: center;
    box-shadow: 0 20px 64px rgba(45, 20, 10, .2);
}
.table-qr-dialog::backdrop { background: rgba(30, 20, 15, .45); }
.table-qr-dialog h2 { margin: 0 0 12px; font-size: 24px; }
.table-qr-test { display: inline-block; padding: 5px 10px; margin: 0; background: #fff0d3; color: #74440b; border-radius: 8px; font-size: 13px; font-weight: 700; }
.table-qr-restaurant { margin: 16px 0 4px; overflow-wrap: anywhere; font-weight: 700; }
.table-qr-table { margin: 0 0 8px; font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.table-qr-dialog canvas { display: block; width: min(100%, 320px); height: auto; margin: 0 auto; background: #fff; }
.table-qr-hint { margin: 12px 0; font-size: 14px; color: #746861; line-height: 1.5; text-align: left; }
.table-qr-link-label { display: grid; gap: 8px; text-align: left; font-size: 14px; }
.table-qr-link-label input { width: 100%; min-width: 0; box-sizing: border-box; padding: 10px; border: 1px solid #ded3ca; border-radius: 8px; font: inherit; background: #fbf7f4; color: #3e302a; }
.table-qr-dialog [role="status"] { color: #a91e23; font-size: 14px; }
.table-qr-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.table-qr-actions a { text-decoration: none; }
.table-qr-actions form { margin: 0; }
.table-qr-actions button, .table-qr-actions a { margin: 0; width: auto; }
.table-qr-actions button:disabled { opacity: .5; cursor: wait; }

.category-delete-dialog {
    width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
    box-sizing: border-box; overflow: auto; padding: 28px; border: 1px solid #eaded7;
    border-radius: 20px; background: #fff; color: #3e302a;
    box-shadow: 0 20px 64px rgba(45, 20, 10, .2);
}
.category-delete-dialog::backdrop { background: rgba(30, 20, 15, .45); }
.category-delete-dialog h2 { margin: 0 0 16px; font-size: 24px; }
.category-delete-dialog p { margin: 0 0 24px; line-height: 1.6; overflow-wrap: anywhere; }
.category-delete-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.category-delete-dialog-actions button { margin: 0; width: auto; }

/* Staff pages share the restaurant account; customer and admin layouts are unaffected. */
[data-staff-page] [hidden] { display: none !important; }
[data-staff-page] .staff-auth {
    width: min(460px, calc(100% - 32px)); margin: 48px auto; padding: 28px;
    border: 1px solid #eaded7; border-radius: 20px; background: #fff;
    box-shadow: 0 10px 28px rgba(75,47,31,.06); color: #3e302a;
}
[data-staff-page] .staff-auth h1 { margin: 22px 0 12px; font-size: 26px; }
[data-staff-page] .staff-auth p { line-height: 1.6; overflow-wrap: anywhere; }
[data-staff-page] .staff-auth form, [data-staff-page] .staff-auth label { display: grid; gap: 10px; }
[data-staff-page] .staff-auth form { gap: 18px; margin: 22px 0 14px; }
[data-staff-page] .staff-auth input, [data-staff-page] .staff-auth select {
    width: 100%; min-width: 0; padding: 12px; border: 1px solid #ded3ca;
    border-radius: 10px; font: inherit; background: white; color: #3e302a;
}
[data-staff-page] .staff-auth-language { display: flex; justify-content: flex-end; }
[data-staff-page] .staff-auth-language select { width: auto; }
[data-staff-page] .staff-auth button, [data-staff-page] .staff-cloud-toolbar button {
    border: 1px solid #ded3ca; border-radius: 10px; padding: 11px 16px;
    background: #fff; color: #721c1c; font: inherit; cursor: pointer;
}
[data-staff-page] .staff-auth #staffSignIn { background: #8b1e1e; color: #fff; border-color: #8b1e1e; }
[data-staff-page] .staff-auth button:disabled, [data-staff-page] .staff-cloud-toolbar button:disabled { opacity: .55; cursor: wait; }
[data-staff-page] .staff-cloud-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
[data-staff-page] .staff-cloud-toolbar p { flex: 1 1 230px; margin: 0; line-height: 1.5; color: #6e584b; overflow-wrap: anywhere; }
[data-staff-page] .staff-cloud-toolbar > div { display: flex; gap: 8px; flex-wrap: wrap; }
[data-staff-page] #staffLoginMessage { color: #9c2424; }
[data-staff-page] .staff-cloud-offline .status-dot { background: #b8b1aa; box-shadow: none; }

@media (max-width: 650px) {
    .admin-category-section { padding: 20px 16px; }
    .admin-category-form { padding: 16px; }
    .admin-category-inputs { grid-template-columns: minmax(0, 1fr); }
    .admin-category-card { align-items: stretch; flex-direction: column; }
}
