/* 基础样式 */
body {
    margin: 0;
    padding: 20px;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    background: #f5f5f5;
}

/* 布局 */
.split-container {
    display: flex;
    gap: 20px;
    max-width: 100%;
    margin: 0 auto;
}

.left-panel {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 50%;
}

.right-panel {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 50%;
}

/* 标签栏 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.tab.active {
    background: #0066cc;
    color: white;
}

/* 表格样式 */
.menu-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.menu-table th,
.menu-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.menu-table th {
    background: #f8f9fa;
    font-weight: bold;
    white-space: nowrap;
}

.menu-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.menu-table tbody tr:hover {
    background-color: #f0f0f0;
}

.menu-table tr.category-row {
    background-color: #eee !important;
}

/* 按钮样式 */
.ingredients-btn {
    padding: 4px 8px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* iframe样式 */
#right-content {
    width: 100%;
    height: calc(100vh - 40px);
    border: none;
    border-radius: 8px;
}

/* 列表头部 */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-header h2 {
    margin: 0;
}

.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input-group {
    display: flex;
    gap: 5px;
}

.search-input-group input {
    width: 200px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-input-group input:focus {
    outline: none;
    border-color: #0066cc;
}

.search-input-group button {
    padding: 6px 12px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-input-group button:hover {
    background: #0052a3;
}

.add-btn {
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.add-btn:hover {
    background: #218838;
}

.add-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 页面标题区域 */
.page-header {
    max-width: 100%;
    margin: 0 auto 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    margin: 0;
}

.back-btn {
    padding: 8px 16px;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 分页样式 */
.pagination {
    margin-top: 20px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pagination button {
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:hover {
    background: #e0e0e0;
}

.pagination button:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.pagination span {
    color: #666;
}

.pagination select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.pagination select:hover {
    border-color: #999;
}

/* 模态窗口样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 750px;  /* 原来500px的1.5倍 */
    max-width: 95%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    margin: 0;
    color: #495057;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.equipment-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 120px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.equipment-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.equipment-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.equipment-checkbox label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    user-select: none;
}

/* 标签选择器样式 */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.category-tag-option,
.equipment-tag-option {
    display: inline-block;
    padding: 6px 12px;
    background-color: #e9ecef;
    border: 1px solid #adb5bd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
}

.category-tag-option:hover,
.equipment-tag-option:hover {
    background-color: #dee2e6;
    border-color: #6c757d;
}

.category-tag-option.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.equipment-tag-option.active {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.category-tag-option.active:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.equipment-tag-option.active:hover {
    background-color: #1e7e34;
    border-color: #1e7e34;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #545b62;
}
