/* ============================================================
   dining.css - 工作餐订餐系统公共样式（完整版）
   包含所有界面样式和产品导航样式
   ============================================================ */

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 全局工具样式 ---------- */
.breadcrumb {
    padding: 16px 0 8px;
    font-size: 14px;
    color: #94a3b8;
}
.breadcrumb a { color: #2563eb; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 8px; }

.tool-header {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 32px 28px;
    margin: 12px 0 28px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}
.tool-header h1 { font-size: 28px; font-weight: 700; color: #0f172a; }
.tool-header h1 .icon { margin-right: 10px; }
.tool-header .desc { font-size: 16px; color: #475569; margin-top: 8px; max-width: 700px; line-height: 1.7; }
.tool-header .stats {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    color: #2563eb;
    background: #dbeafe;
    padding: 4px 16px;
    border-radius: 20px;
}

/* ---------- 登录后完全隐藏工具头部 ---------- */
.logged-in .tool-header {
    display: none;
    margin: 0;
    padding: 0;
}

.tool-main {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    border: 1px solid #eef2f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 40px;
    min-height: 400px;
}

/* ---------- 未登录欢迎视图 ---------- */
.guest-view {
    text-align: center;
    padding: 40px 20px;
}
.guest-view .icon-big {
    font-size: 72px;
    display: block;
    margin-bottom: 20px;
}
.guest-view h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}
.guest-view .sub {
    font-size: 17px;
    color: #475569;
    max-width: 600px;
    margin: 0 auto 24px;
    line-height: 1.7;
}
.guest-view .features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto 32px;
    text-align: left;
}
.guest-view .features .item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid #eef2f6;
}
.guest-view .features .item .icon { font-size: 28px; display: block; margin-bottom: 6px; }
.guest-view .features .item h4 { font-size: 16px; font-weight: 600; color: #0f172a; margin-bottom: 4px; }
.guest-view .features .item p { font-size: 14px; color: #64748b; margin: 0; }
.guest-view .actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.guest-view .actions .btn {
    padding: 12px 32px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}
.guest-view .actions .btn-primary {
    background: #2563eb;
    color: #fff;
}
.guest-view .actions .btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.25);
}
.guest-view .actions .btn-outline {
    background: transparent;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.guest-view .actions .btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* ---------- 房间详情 ---------- */
.room-detail {
    display: none;
}
.room-detail.active {
    display: block;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.room-header .title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}
.room-header .room-id {
    font-size: 14px;
    color: #94a3b8;
    margin-left: 10px;
    font-weight: 400;
}
.room-header .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: #e2e8f0;
    color: #475569;
    white-space: nowrap;
}
.btn-primary {
    background: #2563eb;
    color: #fff;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-success {
    background: #16a34a;
    color: #fff;
}
.btn-success:hover { background: #15803d; }
.btn-danger {
    background: #fef2f2;
    color: #b91c1c;
}
.btn-danger:hover { background: #fecaca; }
.btn-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
}
.btn-outline:hover { background: #f1f5f9; }
.btn-warning {
    background: #fef3c7;
    color: #d97706;
}
.btn-warning:hover { background: #fde68a; }
.btn-sm {
    padding: 3px 10px;
    font-size: 12px;
}
.btn-xs {
    padding: 1px 8px;
    font-size: 11px;
}

.room-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}
@media (max-width: 992px) {
    .room-layout { grid-template-columns: 1fr; }
}

.panel {
    background: #fafbfc;
    border-radius: 14px;
    border: 1px solid #eef2f6;
    padding: 16px;
}
.panel .panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.panel .panel-title .badge {
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0 10px;
    border-radius: 10px;
}

.member-list, .dish-list {
    max-height: 260px;
    overflow-y: auto;
}
.member-item, .dish-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #eef2f6;
    font-size: 13px;
}
.member-item .role {
    font-size: 12px;
    color: #2563eb;
    font-weight: 500;
}
.member-item .status {
    font-size: 12px;
    padding: 1px 10px;
    border-radius: 12px;
    margin-left: 4px;
}
.member-item .department {
    font-size: 12px;
    color: #64748b;
    margin-left: 6px;
}
.member-item .balance {
    font-size: 13px;
    font-weight: 600;
    color: #16a34a;
    margin-left: 8px;
}
.status.pending { background: #fef3c7; color: #d97706; }
.status.approved { background: #dcfce7; color: #16a34a; }
.status.rejected { background: #fee2e2; color: #b91c1c; }

.search-input {
    width: 100%;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    margin-bottom: 6px;
    outline: none;
}
.search-input:focus {
    border-color: #2563eb;
}

.add-dish-form {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.add-dish-form input, .add-dish-form select {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    flex: 1 1 auto;
    min-width: 60px;
}
.add-dish-form button {
    padding: 4px 14px;
}

/* ---------- 批次选择 ---------- */
.session-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 10px;
}
.session-bar select {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    background: #fff;
}
.session-bar .locked-badge {
    color: #b91c1c;
    font-weight: 600;
    font-size: 13px;
}

/* ---------- 点餐区 ---------- */
.order-area {
    margin-top: 6px;
}
.order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #eef2f6;
}
.order-item .name { flex: 1; font-weight: 500; font-size: 14px; }
.order-item .price { color: #64748b; width: 80px; font-size: 13px; }
.order-item input[type="number"] {
    width: 60px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    text-align: center;
    font-size: 14px;
}
.order-item input[type="number"]:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}
.submit-order {
    margin-top: 14px;
    text-align: right;
}

/* ---------- 统计表格 ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}
.stat-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid #eef2f6;
}
.stat-card .label { font-size: 12px; color: #94a3b8; }
.stat-card .value { font-size: 18px; font-weight: 700; color: #0f172a; }

.summary-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
    margin-top: 6px;
}
.summary-table th {
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: #475569;
}
.summary-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #f1f5f9;
}
.summary-table .total-row td {
    font-weight: 600;
    border-top: 2px solid #cbd5e1;
}

/* ---------- 模态框 ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    padding: 24px 28px;
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal h2 { margin-bottom: 14px; color: #0f172a; font-size: 20px; }
.modal .form-group { margin-bottom: 12px; }
.modal .form-group label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 14px; }
.modal .form-group input, .modal .form-group select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}
.modal .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}
.modal .form-actions .btn-cancel { background: #e2e8f0; color: #475569; }
.modal .form-actions .btn-cancel:hover { background: #cbd5e1; }
.modal .form-actions .btn-confirm { background: #2563eb; color: #fff; }
.modal .form-actions .btn-confirm:hover { background: #1d4ed8; }

.loading { text-align: center; padding: 40px; color: #94a3b8; }

/* ---------- 房间切换条 ---------- */
.room-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 12px;
}
.room-switcher .label {
    font-weight: 500;
    font-size: 14px;
    color: #475569;
}
.room-switcher .room-tag {
    padding: 2px 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.room-switcher .room-tag:hover {
    border-color: #2563eb;
    background: #eff6ff;
}
.room-switcher .room-tag.active {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

/* ---------- 空状态 ---------- */
.empty-room-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.empty-room-state .icon {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
}
.empty-room-state h2 {
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 8px;
}
.empty-room-state p {
    font-size: 15px;
    margin-bottom: 20px;
}
.empty-room-state .actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- 管理员操作区 ---------- */
.admin-actions {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}
.admin-actions .btn {
    margin-right: 6px;
}

/* ---------- 底部 ---------- */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 40px 0 24px;
    margin-top: 16px;
}
.footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px;
}
.footer .brand {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}
.footer .brand span {
    color: #60a5fa;
}
.footer .links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.footer .links a {
    color: #94a3b8;
    font-size: 14px;
}
.footer .links a:hover {
    color: #fff;
}
.footer .copyright {
    width: 100%;
    text-align: center;
    font-size: 13px;
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    margin-top: 12px;
}
.footer .icp {
    width: 100%;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
}
.footer .icp a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.footer .icp a:hover {
    color: #fff;
}
.footer .icp .separator {
    color: #475569;
    user-select: none;
}
.footer .icp .police-icon {
    height: 18px;
    width: auto;
    vertical-align: middle;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .tool-header { padding: 20px 16px; }
    .tool-header h1 { font-size: 22px; }
    .tool-main { padding: 20px 16px; }
    .room-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .room-header { flex-direction: column; align-items: stretch; }
    .session-bar { flex-wrap: wrap; }
    .room-switcher { justify-content: center; }
    .guest-view .features { grid-template-columns: 1fr; }
    .guest-view h2 { font-size: 24px; }
    .footer .container { flex-direction: column; align-items: center; text-align: center; }
    .footer .icp { gap: 4px 10px; font-size: 12px; }
    .footer .icp .police-icon { height: 15px; }
}
@media (max-width: 480px) {
    .tool-header h1 { font-size: 19px; }
    .room-card { padding: 12px; }
    .order-item { flex-wrap: wrap; }
    .order-item input[type="number"] { width: 50px; }
    .add-dish-form input, .add-dish-form select { min-width: 50px; }
    .guest-view .icon-big { font-size: 52px; }
    .footer .icp { font-size: 11px; gap: 4px 6px; }
    .footer .icp .police-icon { height: 13px; }
}

/* ================================================================
   产品专属导航样式（新增，用于覆盖公共导航）
   ================================================================ */
.product-nav {
    background: #ffffff;
    border-bottom: 1px solid #eef2f6;
    padding: 0 0;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.product-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.product-nav .product-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: #0f172a;
    padding: 10px 0;
}
.product-nav .product-brand .icon { font-size: 24px; }
.product-nav .product-brand .badge {
    font-size: 11px;
    background: #dbeafe;
    color: #2563eb;
    padding: 1px 12px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.product-nav .nav-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    padding: 4px 0;
}
.product-nav .nav-tabs .tab-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}
.product-nav .nav-tabs .tab-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.product-nav .nav-tabs .tab-btn.active {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.product-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.product-nav .nav-actions .btn-sm {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.product-nav .nav-actions .btn-sm:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.product-nav .nav-actions .btn-sm.primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.product-nav .nav-actions .btn-sm.primary:hover {
    background: #1d4ed8;
}
@media (max-width: 768px) {
    .product-nav .container {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .product-nav .product-brand {
        justify-content: center;
        padding: 6px 0;
        font-size: 16px;
    }
    .product-nav .nav-tabs {
        justify-content: center;
        gap: 2px;
    }
    .product-nav .nav-tabs .tab-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    .product-nav .nav-actions {
        justify-content: center;
        padding-bottom: 6px;
    }
}