* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
html,
body,
#canvas {
  height: 100%;
}
body {
  margin: 0;
  background: #f4f6f8;
  color: #222;
}
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.topbar {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e1e5ea;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar .controls label {
  margin-right: 12px;
}
.topbar .canvas-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
/* 顶部工具栏样式 */
.topbar {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(to bottom, #f8fafc, #edf2f7);
  border-bottom: 1px solid #d6dbe2;
  flex-wrap: wrap;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  min-height: 40px;
}
.topbar .controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.topbar .save-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.topbar .save-controls select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #c5d0dc;
  background: white;
  box-shadow: 0 1px 2px rgba(16, 24, 64, 0.05);
  transition: all 0.2s ease;
  font-size: 12px;
}
.topbar .save-controls select:focus {
  outline: none;
  border-color: #4f8ef7;
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.2);
}
.topbar input[type="number"],
.topbar input[type="text"] {
  width: 60px;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #c5d0dc;
  background: white;
  box-shadow: 0 1px 2px rgba(16, 24, 64, 0.05);
  transition: all 0.2s ease;
}
.topbar input[type="number"]:focus,
.topbar input[type="text"]:focus {
  outline: none;
  border-color: #4f8ef7;
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.2);
}

/* 统一按钮样式 */
.topbar button,
.left-actions button,
.canvas-control-btn,
.export-control-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #c5d0dc;
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
  color: #333;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(16, 24, 64, 0.05);
  min-height: 28px;
}

/* 按钮悬停效果 */
.topbar button:hover,
.left-actions button:hover,
.canvas-control-btn:hover,
.export-control-btn:hover {
  background: linear-gradient(to bottom, #f0f5ff, #e1ebf7);
  border-color: #a8c3ec;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 按钮按下效果 */
.topbar button:active,
.left-actions button:active,
.canvas-control-btn:active,
.export-control-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 特定按钮样式 */
.export-control-btn {
  background: linear-gradient(to bottom, #6a9eff, #4a80ff);
  color: white;
  border: 1px solid #3d6bd9;
}

.export-control-btn:hover {
  background: linear-gradient(to bottom, #5a8eff, #3a70ff);
  border-color: #2d5bc9;
}

.export-control-btn:active {
  background: linear-gradient(to bottom, #4a7eff, #2a60ff);
}

/* 人物列表按钮 */
.person {
  background: white;
  border: 1px solid #d6dbe2;
  padding: 10px;
  border-radius: 8px;
  cursor: grab;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.person:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: #a8c3ec;
}
.person.dragging {
  opacity: 0.5;
}

/* 已分配列表按钮 */
.assignedItem .btn-unassign {
  background: linear-gradient(to bottom, #ff6b6b, #ff5252);
  color: white;
  border: 1px solid #d94343;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.assignedItem .btn-unassign:hover {
  background: linear-gradient(to bottom, #ff5b5b, #ff4242);
  border-color: #c93333;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.assignedItem .btn-unassign:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.left,
.right {
  width: 240px;
  background: #fff;
  padding: 16px;
  border-left: 1px solid #e1e5ea;
  overflow: auto;
  box-shadow: inset 8px 0 8px -10px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}
.left {
  border-right: 1px solid #e1e5ea;
  box-shadow: inset -8px 0 8px -10px rgba(0, 0, 0, 0.05);
}

/* 搜索框样式 */
.search-container {
  margin: 12px 0;
}

.search-container input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #c5d0dc;
  background: white;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(16, 24, 64, 0.05);
  transition: all 0.2s ease;
}

.search-container input:focus {
  outline: none;
  border-color: #4f8ef7;
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.2);
}

/* 桌子名称输入框样式 */
.table-name-input {
  width: 60px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 2px 4px;
  background: white;
}

/* 通用提示框样式 */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.notification {
  background: white;
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  padding: 14px 18px;
  min-width: 240px;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(0);
  opacity: 1;
  transition: all 0.3s ease;
  font-size: 14px;
  color: #333;
  border-left: 4px solid #4a90e2;
  backdrop-filter: blur(10px);
}

.notification.success {
  border-left-color: #5cb85c;
}

.notification.warning {
  border-left-color: #f0ad4e;
}

.notification.error {
  border-left-color: #d9534f;
}

.notification.info {
  border-left-color: #4a90e2;
}

.notification-icon {
  font-weight: bold;
  font-size: 18px;
}

.notification-content {
  flex: 1;
}

.notification-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.notification-close:hover {
  background: #f0f0f0;
  color: #666;
}

.notification.fade-out {
  opacity: 0;
  transform: translateX(100%);
}
.canvasWrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
}
.canvas {
  flex: 1;
  background: linear-gradient(#f8fafb, #f3f6f8);
  cursor: grab;
  overflow: auto;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  position: relative;
}
.canvas:active {
  cursor: grabbing;
}
.inner {
  transform-origin: 0 0;
  position: relative;
  min-height: 100%;
  min-width: 100%;
}
.hint {
  padding: 10px 14px;
  font-size: 13px;
  color: #666;
  background: rgba(248, 250, 252, 0.6);
  border-top: 1px solid #e1e5ea;
}
.peopleList {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.person {
  background: #fff;
  border: 1px solid #d6dbe2;
  padding: 8px;
  border-radius: 6px;
  cursor: grab;
}
.person.dragging {
  opacity: 0.5;
}
.table {
  border-radius: 10px;
  background: linear-gradient(to bottom, #ffffff, #f8fbff);
  border: 2px solid #c1d5f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-shadow: 0 8px 20px rgba(20, 60, 120, 0.08);
  margin: 16px;
  padding: 14px;
  transition: all 0.3s ease;
}
.table:hover {
  box-shadow: 0 10px 25px rgba(20, 60, 120, 0.12);
  transform: translateY(-2px);
}
.table .title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  color: #2c3e50;
}
.seats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.seat {
  width: 6rem;
  height: 3rem;
  border-radius: 6px;
  background: linear-gradient(to bottom, #ffffff, #f9fbfd);
  border: 1px solid #cdd6de;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #666;
  padding: 4px;
  word-wrap: break-word;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.seat:hover {
  background: linear-gradient(to bottom, #f8faff, #eef4ff);
  border-color: #a9c3e0;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.seat.occupied {
  border: 1px solid #87bbff;
  background: linear-gradient(to bottom, #e8f4ff, #d3e8ff);
  color: #024;
  font-weight: 500;
  box-shadow: inset 0 0 4px rgba(135, 187, 255, 0.3);
}
.seat.over {
  background: linear-gradient(to bottom, #f0fff0, #e0ffe0);
  border: 1px solid #5cb85c;
  box-shadow: 0 0 8px rgba(92, 184, 92, 0.3);
}
.canvasGrid {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  min-height: 100%;
  min-width: 100%;
}
.row {
  display: flex;
  gap: 24px;
  align-items: center;
}
.right .assignedList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.assignedItem {
  background: linear-gradient(to bottom, #ffffff, #f9fbfd);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e0e6eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}
.assignedItem:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  border-color: #c5d0dc;
}
.controls label,
input,
button {
  font-size: 13px;
}
textarea#peopleInput {
  width: 100%;
  height: 120px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #c5d0dc;
  background: white;
  box-shadow: 0 1px 2px rgba(16, 24, 64, 0.05);
  transition: all 0.2s ease;
  font-size: 14px;
}
textarea#peopleInput:focus {
  outline: none;
  border-color: #4f8ef7;
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.2);
}
.left-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
/* small responsive */
@media (max-width: 900px) {
  .left,
  .right {
    display: none;
  }
  .canvasWrap {
    padding: 0;
  }
}

/* custom context menu */
.context-menu {
  position: absolute;
  background: #fff;
  border: 1px solid #d7dce3;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  min-width: 160px;
  font-size: 14px;
}
.context-menu .cm-item {
  padding: 8px 12px;
  cursor: pointer;
}
.context-menu .cm-item:hover {
  background: #f2f6fb;
}

.assignedItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.assignedItem .btn-unassign {
  background: transparent;
  border: none;
  color: #c00;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
.assignedItem .btn-unassign:hover {
  background: #fee;
}

/* Canvas controls overlay - similar to Figma style */
.canvas-controls-overlay {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.canvas-controls-group {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(166, 179, 204, 0.4);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 50px);
  overflow-y: auto;
}

.zoom-control {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  font-size: 13px;
  padding: 4px 0;
}

.zoom-control input[type="range"] {
  width: 100%;
  cursor: pointer;
}

/* Style for range input to match overall design */
.zoom-control {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
  color: #333;
}

.zoom-control input[type="range"] {
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #d1d9e6, #c0ccdc);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.zoom-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #4a90e2, #2a60ff);
  cursor: pointer;
  border: 1px solid #1a4bc2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.zoom-control input[type="range"]::-webkit-slider-thumb:hover {
  background: linear-gradient(to bottom, #5a9fff, #3a70ff);
  transform: scale(1.1);
}

.zoom-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #4a90e2, #2a60ff);
  cursor: pointer;
  border: 1px solid #1a4bc2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.zoom-control input[type="range"]::-moz-range-thumb:hover {
  background: linear-gradient(to bottom, #5a9fff, #3a70ff);
  transform: scale(1.1);
}

.zoom-display {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
  border-radius: 8px;
  border: 1px solid #c5d0dc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: 50px;
  color: #333;
  transition: all 0.2s ease;
}

kbd{
  background-color: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 #bbb;
  color: #333;
  display: inline-block;
  font-size: 0.85em;
  line-height: 1;
  padding: 2px 4px;
  white-space: nowrap;
}