/* KFC管理系统 - 公共样式 */
/* 基于 kfc-log 前端代码风格文档重构 - 明亮蓝白配色 */

/* ========== CSS 变量定义 ========== */
:root {
    /* 主品牌色 - Ant Design 蓝 */
    --accent: #1677ff;
    --accent-hover: #0958d9;
    --accent-light: #e6f4ff;
    --accent-muted: rgba(22, 119, 255, 0.1);
    
    /* 兼容旧变量名 */
    --kfc-primary: #1677ff;
    --kfc-primary-dark: #0958d9;
    
    /* 背景色 */
    --bg-base: #f0f2f5;
    --bg-elevated: #ffffff;
    --bg-surface: #f7f8fa;
    --bg-hover: #e8f4ff;
    
    /* 文字色 */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    /* 边框色 */
    --border: #d9e0e8;
    --border-light: #e5e9ef;
    
    /* 状态色 */
    --success: #52c41a;
    --success-bg: rgba(82, 196, 26, 0.1);
    --warning: #faad14;
    --warning-bg: rgba(250, 173, 20, 0.1);
    --danger: #ff4d4f;
    --danger-bg: rgba(255, 77, 79, 0.1);
    
    /* 圆角规范 */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    /* 阴影规范 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
    
    /* 字体 */
    --font-sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "Consolas", "Monaco", monospace;
}

/* ========== 基础样式重置 ========== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bfc6d0;
}

/* 编辑SKU对接 - 关联下单方案搜索结果列表滚动条加粗 */
#plan-search-results::-webkit-scrollbar {
    width: 16px;
}

#plan-search-results::-webkit-scrollbar-track {
    background: var(--bg-base);
    border-radius: 8px;
}

#plan-search-results::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 8px;
}

#plan-search-results::-webkit-scrollbar-thumb:hover {
    background: #bfc6d0;
}

/* ========== 侧边栏样式 ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
    padding-top: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-md);
}

/* 侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.05);
}

.sidebar-header h4 {
    color: white;
    margin: 0;
    font-weight: 600;
    font-size: 18px;
}

.sidebar-header small {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.85);
    padding: 12px 20px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: rgba(255,255,255,0.6);
}

.sidebar .nav-link.active {
    background: rgba(255,255,255,0.18);
    color: white;
    border-left-color: white;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 18px;
    font-size: 15px;
}

.nav-section-title {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    padding: 15px 20px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ========== 主内容区样式 ========== */
.main-content {
    margin-left: 250px;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-base);
}

.top-navbar {
    background: var(--bg-elevated);
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

.content-area {
    padding: 24px;
}

/* ========== 卡片样式 ========== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    background: var(--bg-elevated);
}

.card-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-header i {
    color: var(--accent);
    margin-right: 8px;
}

/* 按钮内的图标应继承按钮文字颜色，而非被 .card-header i 覆盖 */
.card-header .btn i,
.card-header .btn .bi {
    color: inherit;
    margin-right: 4px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    padding: 12px 20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ========== 系统开关样式 ========== */
.system-switch-card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.system-switch-header {
    background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
    border-bottom: 1px solid var(--border-light);
}

.system-switch-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
}

.system-switch-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.system-switch-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.system-switch-item {
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    transition: all 0.15s ease;
}

.system-switch-item:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.system-switch-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

.system-switch-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.system-switch-toggle .form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

.system-switch-toggle .form-check-label {
    margin-left: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ========== 统计卡片样式 ========== */
.stats-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.15s ease;
}

.stats-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stats-card .icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 12px;
}

.stats-card .value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1.2;
}

.stats-card .label {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ========== 按钮样式 ========== */
.btn {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-kfc {
    background: var(--accent);
    border: none;
    color: white;
}

.btn-kfc:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-kfc:active {
    transform: translateY(1px);
}

.btn-outline-kfc {
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline-kfc:hover {
    background: var(--accent);
    color: white;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active {
    background: #ff7875;
    border-color: #ff7875;
    color: #fff;
}

.btn-outline-primary {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-outline-secondary {
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline-danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active,
.btn-outline-danger.active {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-outline-info {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active,
.btn-outline-info.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-outline-success {
    border-color: var(--success);
    color: var(--success);
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active,
.btn-outline-success.active {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-outline-warning {
    border-color: var(--warning);
    color: var(--warning);
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active,
.btn-outline-warning.active {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active {
    background: #73d13d;
    border-color: #73d13d;
    color: #fff;
}

.btn-info {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.active {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

/* ========== 可排序表头 ========== */
.table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.table th.sortable:hover {
    color: var(--accent);
}

.table th.sortable.active {
    color: var(--accent);
}

.table th.sortable .sort-icon {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.4;
}

.table th.sortable:hover .sort-icon,
.table th.sortable.active .sort-icon {
    opacity: 1;
}

/* ========== 表格样式 ========== */
.table {
    margin-bottom: 0;
    font-size: 13px;
}

.table th {
    border-top: none;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-surface);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.table th:first-child {
    padding-left: 20px;
}

.table td:first-child {
    padding-left: 20px;
}

.table th:last-child {
    padding-right: 20px;
}

.table td:last-child {
    padding-right: 20px;
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.table-hover tbody tr:hover {
    background: var(--bg-hover);
}

/* 表格不换行样式 */
.table-nowrap th,
.table-nowrap td {
    white-space: nowrap;
}

/* ========== 表单样式 ========== */
.form-control {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    transition: all 0.15s ease;
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.form-control:hover {
    border-color: var(--accent);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    transition: all 0.15s ease;
    background-color: var(--bg-elevated);
}

.form-select:hover {
    border-color: var(--accent);
}

.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

/* ========== 分页样式 ========== */
.pagination {
    margin-bottom: 0;
    gap: 4px;
}

.page-link {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 13px;
    transition: all 0.15s ease;
}

.page-link:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.page-item.disabled .page-link {
    background: var(--bg-surface);
    border-color: var(--border-light);
    color: var(--text-muted);
}

/* ========== 徽章样式 ========== */
.badge {
    font-weight: 500;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.badge.bg-primary,
.badge.bg-info {
    background: var(--accent-muted) !important;
    color: var(--accent);
}

.badge.bg-success {
    background: var(--success-bg) !important;
    color: var(--success);
}

.badge.bg-warning {
    background: var(--warning-bg) !important;
    color: var(--warning);
}

.badge.bg-danger {
    background: var(--danger-bg) !important;
    color: var(--danger);
}

.badge.bg-secondary {
    background: var(--bg-surface) !important;
    color: var(--text-secondary);
}

/* ========== 模态框样式 ========== */
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    background: var(--bg-surface);
}

.modal-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-light);
    padding: 12px 20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 模态框遮罩 */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.45);
}

.modal-backdrop.show {
    opacity: 1;
}

/* ========== 下拉菜单样式 ========== */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 4px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.1s ease;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.dropdown-item i {
    margin-right: 8px;
    width: 16px;
}

.dropdown-divider {
    border-color: var(--border-light);
    margin: 4px 0;
}

/* ========== Alert 样式 ========== */
.alert {
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 13px;
    border: 1px solid;
}

.alert-info {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-hover);
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success);
    color: #389e0d;
}

.alert-warning {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: #d48806;
}

.alert-danger {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: #cf1322;
}

.alert i {
    margin-right: 8px;
}

/* ========== 加载遮罩 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay .spinner-border {
    color: var(--accent) !important;
}

/* ========== 搜索框 ========== */
.search-box {
    max-width: 300px;
}

.search-box .form-control {
    border-right: none;
}

.search-box .form-control:focus {
    border-right: none;
}

.search-box .btn {
    border-left: none;
    border-color: var(--border);
}

.search-box .form-control:focus + .btn {
    border-color: var(--accent);
}

/* ========== 表单样式 ========== */
.collect-form .form-label {
    font-weight: 500;
}

.result-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 15px;
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    color: var(--text-secondary);
}

/* ========== 餐品管理专用样式 ========== */
.badge-menu-type {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 11px;
}

.badge-classic {
    background: var(--accent-muted);
    color: var(--accent);
}

.badge-prime {
    background: var(--warning-bg);
    color: var(--warning);
}

.spec-preview {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    color: var(--text-muted);
}

.price-text {
    font-weight: 600;
    color: var(--danger);
    font-family: var(--font-mono);
}

/* ========== 采集指定餐品规格 - 搜索下拉 ========== */
.spec-search-wrapper {
    position: relative;
}

.spec-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1060;
    display: none;
}

.spec-search-dropdown.show {
    display: block;
}

.spec-search-item {
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.1s ease;
}

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

.spec-search-item:hover {
    background: var(--bg-hover);
}

.spec-search-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* ========== 餐厅代码搜索下拉 ========== */
.store-search-wrapper {
    position: relative;
}

.store-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1060;
    display: none;
}

.store-search-dropdown.show {
    display: block;
}

.store-search-item {
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.1s ease;
}

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

.store-search-item:hover {
    background: var(--bg-hover);
}

.store-search-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* ========== 库存管理专用样式 ========== */
.stock-count {
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
    font-family: var(--font-mono);
}

.expire-soon {
    color: var(--warning);
}

.expire-warning {
    color: var(--danger);
}

.progress-task {
    margin-top: 10px;
}

.progress {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-surface);
}

.progress-bar {
    background: var(--accent);
}

.progress-bar.bg-kfc {
    background: var(--accent) !important;
}

.refresh-status {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-top: 15px;
}

.coupon-name {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== 规格选择器样式 ========== */
.spec-viewer {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 15px;
}

.spec-round {
    margin-bottom: 15px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.spec-round-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.spec-round-title .badge {
    font-size: 10px;
}

.spec-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin: 4px;
    background: var(--accent-light);
    border-radius: 16px;
    font-size: 12px;
    color: var(--accent);
}

.spec-item.condiment {
    background: var(--warning-bg);
    color: var(--warning);
}

.spec-item.group-item {
    background: var(--success-bg);
    color: var(--success);
}

.spec-item-name {
    margin-right: 6px;
}

.spec-item-price {
    color: var(--danger);
    font-weight: 500;
    font-family: var(--font-mono);
}

.spec-item-quantity {
    background: rgba(0,0,0,0.08);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
}

.group-round {
    border-left: 3px solid var(--success);
}

.condiment-round {
    border-left: 3px solid var(--warning);
}

.normal-round {
    border-left: 3px solid var(--accent);
}

.spec-empty {
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* ========== 页面容器（SPA用）========== */
.page-container {
    display: none;
}

.page-container.active {
    display: block;
}

/* ========== 嵌套模态框样式 ========== */
.modal.show ~ .modal .modal-content {
    border: 2px solid var(--accent);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ========== 下单方案规格配置弹窗优化 ========== */
#spec-config-modal .modal-body {
    padding-top: 18px;
    padding-bottom: 18px;
}

#spec-config-modal #spec-config-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 2px;
}

#spec-config-modal #spec-config-container::-webkit-scrollbar {
    width: 16px;
}

#spec-config-modal #spec-config-container::-webkit-scrollbar-track {
    background: var(--bg-base);
    border-radius: 8px;
}

#spec-config-modal #spec-config-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 8px;
}

#spec-config-modal #spec-config-container::-webkit-scrollbar-thumb:hover {
    background: #bfc6d0;
}

#spec-config-modal #spec-config-container > .alert {
    margin-bottom: 12px !important;
    padding: 10px 12px;
}

#spec-config-modal .spec-round {
    margin-bottom: 12px !important;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: visible;
    box-shadow: none;
}

#spec-config-modal .spec-round:last-child {
    margin-bottom: 0 !important;
}

#spec-config-modal .spec-round-header {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.18);
}

#spec-config-modal .spec-config-round-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    line-height: 1.35;
}

#spec-config-modal .spec-round-header .badge.bg-warning {
    background-color: var(--bs-warning) !important;
    color: var(--bs-dark) !important;
}

#spec-config-modal .spec-config-round-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

#spec-config-modal .spec-config-round-actions .btn {
    margin-right: 0 !important;
    padding: 0.2rem 0.5rem;
    line-height: 1.3;
}

#spec-config-modal .spec-round-body {
    padding: 10px 12px 10px 20px;
    background: var(--bg-surface);
    border-top: 0 !important;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

#spec-config-modal .spec-config-option-row {
    margin-bottom: 0;
    padding: 4px 0 4px 1.5em;
    min-height: 28px;
}

#spec-config-modal .spec-config-option-row .form-check-input {
    margin-top: 0.18rem;
    margin-left: -1.5em;
}

#spec-config-modal .spec-config-option-row .form-check-label {
    line-height: 1.35;
    font-size: 13px;
}

#spec-config-modal .spec-config-option-row .badge {
    font-size: 10px;
    padding: 2px 6px;
}

/* 有子规格的餐品行：flex 布局，折叠按钮在左侧 */
#spec-config-modal .spec-config-has-subtree {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 0;
}

#spec-config-modal .spec-config-has-subtree .form-check {
    flex: 1;
    min-width: 0;
    padding-left: 1.5em;
}

#spec-config-modal .spec-config-subtree {
    margin-left: 18px;
    margin-top: 6px;
    padding-left: 12px;
}

#spec-config-modal .spec-config-subtitle {
    margin-bottom: 4px !important;
    line-height: 1.3;
}

#spec-config-modal .spec-config-subround {
    margin-top: 8px;
    padding: 8px 10px;
}

#spec-config-modal .spec-config-subround-title {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.3;
}

#spec-config-modal .spec-config-subround-body,
#spec-config-modal .spec-config-nested-items {
    padding-left: 8px;
}

#spec-config-modal .spec-config-nested-round {
    margin-top: 4px;
}

#spec-config-modal .spec-config-nested-round-label {
    line-height: 1.25;
}

#spec-config-modal .spec-config-nested-round .form-check-inline {
    margin-right: 0.75rem;
    margin-bottom: 0.25rem;
}

#spec-config-modal .spec-config-nested-round .form-check-label {
    font-size: 12px;
    line-height: 1.3;
}

/* ========== 规格折叠功能 ========== */
#spec-config-modal .spec-collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1;
}

#spec-config-modal .spec-collapse-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
}

#spec-config-modal .spec-collapse-toggle .bi {
    transition: transform 0.25s ease;
    display: block;
}

#spec-config-modal .spec-collapse-toggle.collapsed .bi {
    transform: rotate(-90deg);
}

#spec-config-modal .spec-collapsible {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    max-height: 5000px;
    opacity: 1;
}

#spec-config-modal .spec-collapsible.spec-collapsed {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* 子规格折叠按钮（深色背景上） */
#spec-config-modal .spec-sub-collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    padding: 0;
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1;
    margin-right: 6px;
}

#spec-config-modal .spec-sub-collapse-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

#spec-config-modal .spec-sub-collapse-toggle .bi {
    transition: transform 0.25s ease;
    display: block;
}

#spec-config-modal .spec-sub-collapse-toggle.collapsed .bi {
    transform: rotate(-90deg);
}

/* 子规格标题行 flex 布局 */
#spec-config-modal .spec-config-subround-title {
    display: flex;
    align-items: center;
}

.modal.show ~ .modal .modal-dialog {
    z-index: 1060;
}

.modal.show ~ .modal .modal-header {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal.show ~ .modal .modal-header .modal-title {
    color: var(--text-primary);
}

.modal.show ~ .modal .modal-header .btn-close {
    filter: none;
}

/* ========== SKU对接弹窗美化 ========== */
#skuModal .modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

#skuModal .modal-header {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border-top-left-radius: calc(var(--radius-lg) - 1px);
    border-top-right-radius: calc(var(--radius-lg) - 1px);
    padding: 16px 24px;
}

#skuModal .modal-header .modal-title {
    color: white;
}

#skuModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

#skuModal .modal-body {
    padding: 24px 28px;
    background: var(--bg-surface);
}

#skuModal .modal-footer {
    padding: 16px 24px;
    background: var(--bg-elevated);
    border-bottom-left-radius: calc(var(--radius-lg) - 1px);
    border-bottom-right-radius: calc(var(--radius-lg) - 1px);
}

/* 已选方案卡片 */
.selected-plan-tag {
    display: inline-block;
    background: var(--accent-light);
    border: 1px solid rgba(22, 119, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin: 0 8px 8px 0;
    max-width: 300px;
    font-size: 13px;
}

.selected-plan-tag .plan-name {
    font-weight: 600;
    color: var(--accent-hover);
}

.selected-plan-tag .plan-detail {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.selected-plan-tag .plan-remove {
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s;
}

.selected-plan-tag .plan-remove:hover {
    color: var(--danger);
}

/* ========== SKU对接列表样式 ========== */
.sku-plans-cell {
    max-width: 280px;
}

.sku-plan-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    padding: 3px 0;
    border-bottom: 1px dashed var(--border-light);
    white-space: nowrap;
}

.sku-plan-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.sku-plan-item .badge {
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

.sku-plan-detail {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.sku-plan-item[title] {
    cursor: help;
}

.sku-plan-not-found {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 4px 8px !important;
    animation: pulse-warning 2s infinite;
}

.sku-plan-not-found .badge {
    font-size: 12px;
    padding: 4px 8px;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(250, 173, 20, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(250, 173, 20, 0.1);
    }
}

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

.card {
    animation: fadeIn 0.3s ease;
}

.card:nth-child(2) {
    animation-delay: 0.05s;
}

.card:nth-child(3) {
    animation-delay: 0.1s;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ========== 辅助类 ========== */
.bg-kfc {
    background-color: var(--accent) !important;
}

.text-kfc {
    color: var(--accent) !important;
}

.border-kfc {
    border-color: var(--accent) !important;
}

.font-monospace,
code {
    font-family: var(--font-mono);
}

code {
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--accent);
}

/* ========== Toast 提示 ========== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
}

.toast-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    padding: 8px 12px;
}

.toast-body {
    padding: 12px;
    font-size: 13px;
}

/* ========== 输入框组 ========== */
.input-group .form-control:focus {
    z-index: 3;
}

.input-group .btn-outline-secondary {
    border-color: var(--border);
}

.input-group .btn-outline-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--accent);
    color: var(--accent);
}

/* ========== Spinner ========== */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.spinner-border.text-primary {
    color: var(--accent) !important;
}

/* ========== 文本颜色覆盖 ========== */
.text-primary {
    color: var(--accent) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* ========== 边框样式 ========== */
.border {
    border-color: var(--border) !important;
}

.border-bottom {
    border-bottom-color: var(--border-light) !important;
}

.border-danger {
    border-color: var(--danger) !important;
}

.rounded {
    border-radius: var(--radius-md) !important;
}

/* ========== 背景色 ========== */
.bg-light {
    background-color: var(--bg-surface) !important;
}

.bg-white {
    background-color: var(--bg-elevated) !important;
}

.bg-danger {
    background-color: var(--danger) !important;
}

.bg-info {
    background-color: var(--accent) !important;
}

/* ========== Switch 开关优化 ========== */
.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    background-color: var(--border);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.form-switch .form-check-input:checked {
    background-color: var(--accent);
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 2px var(--accent-muted);
}

/* ========== 队列状态统计栏 ========== */
.queue-status-bar {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 12px 8px;
    gap: 0;
    box-shadow: var(--shadow-sm);
}

.queue-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    position: relative;
}

.queue-status-item:hover {
    background: var(--bg-surface);
}

.queue-status-item.active {
    background: var(--bg-surface);
    box-shadow: inset 0 -2px 0 var(--accent);
}

.queue-status-item.active .queue-status-count {
    color: var(--accent);
}

.queue-status-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.queue-status-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.queue-status-count {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.queue-status-count.stat-count-updated {
    animation: statPulse 0.3s ease;
}

.queue-status-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.queue-status-divider {
    width: 1px;
    height: 32px;
    background: var(--border-light);
    flex-shrink: 0;
}

@keyframes statPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); color: var(--accent); }
    100% { transform: scale(1); }
}

/* 响应式：小屏幕下隐藏图标 */
@media (max-width: 992px) {
    .queue-status-icon {
        display: none;
    }
    .queue-status-item {
        padding: 6px 10px;
        justify-content: center;
    }
    .queue-status-info {
        align-items: center;
    }
    .queue-status-count {
        font-size: 16px;
    }
}

/* 下单方案 Tooltip 浮层 */
.plan-tooltip {
    position: absolute;
    z-index: 1070;
    max-width: 420px;
    min-width: 280px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    line-height: 1.6;
}

.plan-tooltip-sku {
    font-weight: 600;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}

.plan-tooltip-sku + .plan-tooltip-sku {
    margin-top: 8px;
}

.plan-tooltip-plan {
    padding: 4px 0 4px 16px;
}

.plan-tooltip-detail {
    padding-left: 32px;
    color: var(--text-secondary);
    font-size: 12px;
}

.plan-tooltip-empty {
    padding-left: 16px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 12px;
}

.plan-tooltip-index {
    color: var(--text-muted);
    font-size: 12px;
}

.plan-tooltip-name {
    color: var(--accent);
    font-weight: 500;
}

.plan-tooltip-badge {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.plan-tooltip-tag {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #e6f4ff;
    color: var(--accent);
}

.plan-cell {
    cursor: default;
}

.plan-tooltip-trigger {
    cursor: help;
    border-bottom: 1px dashed #6c757d;
}

.plan-tooltip-plan-flat {
    padding-left: 0;
}

.plan-tooltip-detail-flat {
    padding-left: 16px;
}

.plan-summary-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 220px;
    min-width: 0;
}

.plan-summary-cell .plan-tooltip-trigger {
    display: block;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.plan-tooltip-title {
    font-weight: 600;
    font-size: 13px;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.plan-tooltip-item {
    padding: 6px 0;
}

.plan-tooltip-item + .plan-tooltip-item {
    border-top: 1px dashed var(--border-light);
}

.plan-tooltip-item-header {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.plan-tooltip-item-name {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 0;
}

.plan-tooltip-item-type {
    font-size: 11px;
    padding: 0 4px;
    border-radius: 2px;
    color: #fff;
    flex-shrink: 0;
}

.plan-tooltip-item-type-s {
    background: var(--accent);
}

.plan-tooltip-item-type-g {
    background: #17a2b8;
}

.plan-tooltip-item-code {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
}

.plan-tooltip-spec {
    padding-left: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.plan-tooltip-spec-empty {
    color: var(--text-muted);
}

.plan-tooltip-spec-round {
    display: flex;
    gap: 4px;
}

.plan-tooltip-spec-round-name {
    color: var(--text-muted);
    flex-shrink: 0;
}

.plan-tooltip-spec-round-items {
    color: var(--text-secondary);
}
