body {
  background-color: #f2f2f2;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.title {
  text-align: center;
  font-size: 1vw;
  margin: 0.5vw 0;
}

.container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  margin: 1vw;
  gap: 20px;
}

.floor-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5vw;
  margin-top: 1.5vw;
}

.floor-buttons button,
.building-buttons button {
  padding: 0.4vh 0.5vw;
  font-size: 0.7vw;
  background-color: #888;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.floor-buttons button.active,
.building-buttons button.active {
  background-color: white;
  color: black;
  border: 2px solid gray;
}

.building-buttons{
  display: flex;
  flex-wrap: wrap;   /* 允许换行 */
  gap: 10px;
  margin-bottom: 10px;
  max-height: 6.5rem;     /* 视需要限制高度 */
  overflow-y: auto;       /* 多行时可竖向滚动 */
}

/* style.css */

.map-wrapper {
  width: 70vw;
  aspect-ratio: 17 / 11;
  position: relative;
  background: #fff;
  padding: 30px;
  box-sizing: border-box;
  overflow: hidden;   
}




.sheet-inner {
  width: 100%;
  height: 100%;
  border: 4px solid #222;
  background: #fff;
  position: relative;
  box-sizing: border-box;
}


.svg-container {
  position: absolute;
  top: 7%;   /* 200px / 1265px */
  left: 4%;   /* 100px / 1265px */
  width: 64.7%; /* 1265px / 1955px */
  height: 81.8%;/* 1035px / 1265px */
  z-index: 3;
}

.svg-container svg {
  width:100%;
  height: 100%;
  z-index: 3; 
}

/* PNG 平面图层 */
.map-wrapper img {
  z-index: 2;    /* PNG 层 */
  pointer-events: none; /* 保证可以点到 SVG 上的元素 */
}

.map-wrapper svg foreignObject {
  /* SVG 里的标签本身在 SVG 内部就高于 polygon */
  /* 如果仍被盖住，可再加个 z-index （但大部分浏览器支持）： */
  position: relative;
  z-index: 3;     /* 顶层 Tag */
}


.side-panel {
  width: 30vw;
  height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.legend-container {
  position: absolute;
  top: 30px;
  right: 50px;
  font-size: 0.6vw;   /* 相对缩放 */
  background: white;
  padding: 0.6em;

}


.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.legend-color {
  width: 35px;
  height: 16px;
  border: 1px solid #aaa;
}

.category-tabs {
  display: flex;
  justify-content: center;
  gap: 160px;
  margin: 10px 0 20px;
}

.category-tabs button {
  background: none;
  border: none;
  font-size: 1vw;
  font-weight: bold;
  color: #bbb;
  cursor: pointer;
}

.category-tabs button.active {
  color: #000;
}



.export-body {
  display: flex;
  flex: 1;
  gap: 20px;
}

.export-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: 320px;
  margin: 0 auto 0 0;
}
.sheet-list {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 8px;
  margin-top: 8px;
  font-size: 14px;
  margin-bottom: 8px;
}
.sheet-list label {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 16px;
  cursor: pointer;
}
.sheet-list input[type="checkbox"] {
  margin-right: 8px;
}


.sheet-preview-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.sheet-preview {
  margin-top: 20px;
  border: 1px solid #aaa;
  padding: 10px;
  background: white;
}

.fixed-room-format {
  display: flex;
  align-items: center;
  gap: 0.5vw;
  flex-wrap: nowrap;
}

.narrow-btn {
  flex: 0 0 auto;           /* 按内容撑开 */
  padding: 6px 16px;        /* 按钮内边距 */
  font-size: 0.5vw;
  max-width: 80px;         /* 限制最大宽度 */
}

.narrow-input {
  width: 0.2vw;
  font-size: 0.6vw;
}

.narrow-span {
  font-size: 0.6vw;
  white-space: nowrap;
}


.info-row {
  margin-top: 30px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
}

.info-row label {
  width: 140px;
  font-weight: bold;
}

.info-row input {
  flex: 1;
  padding: 3px;
}

.sheet-footer {
  position: absolute;
  bottom: 3%;
  left: 3%;
  width: 94%;
  height: 12%;
  display: flex;
  justify-content:flex-start; 

  gap: 1.2vw;
  align-items: flex-start;  /* ✅ 从顶部对齐 */
  padding-top: 0.8vw;       /* ✅ 给一点上边距（可调） */
  box-sizing: border-box;
}


#payette-logo {
  height: 40%;
  max-height: 40%;
  object-fit: contain;
  
}

.sheet-info {
  display: flex;
  flex-direction: row;
  gap: 0.4vw;
  font-size: 1vw;
}

.sheet-info-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0.4vw;
}

.sheet-info-col > div {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  margin-bottom: 6px;
  min-height: 1.2em;
}

.sheet-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr  1fr; /* 两列，每列一个row */
  column-gap: 9vw;
  row-gap: 0.7vw;
  font-size: 0.7vw;
}

.sheet-info-row {
  display: flex;
  min-width: 0;  
  white-space: nowrap;
}

.sheet-info-row.note-row{
  align-items: flex-start;   /* ✅ NOTE 标签顶到第一行 */
}

.sheet-info-row.note-row .sheet-info-label{
  padding-top: 0.05em;       /* 可选：微调让字更贴第一行基线 */
}

#infoNote {
  white-space: normal;         /* ✅ NOTE 单独允许换行 */
  overflow-wrap: anywhere;     /* ✅ 超长单词/无空格也能断行 */
  word-break: break-word;
  display: inline-block;       /* ✅ 确保 max-width 生效 */
  max-width: 100%;             /* ✅ 限制在本列宽度内 */
}

.sheet-info-label {
  font-weight: bold;
}

.sheet-info-value {
  min-width: 0;
  margin-left: 0.5vw; /* 控制 value 与冒号的间距 */
}




.note-cell {
  grid-row: 1 / span 2;
  grid-column: 3;
  align-self: start;
  display: grid;
  grid-template-columns: 200px 1fr;
}

#infoNote {
  grid-row: 1 / span 2;
  grid-column: 6;
  align-self: start;
}

.sheet-list-item {
  margin-bottom: 6px;
  font-family: sans-serif;
  font-size: 14px;
}



/* —— 全局点击无边框按钮基类 —— */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* —— 返回 Splash 的箭头按钮 —— */
.nav-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 28px;
}

/* —— 楼层 / 楼栋 编辑“三点”按钮 —— */
.floor-buttons-edit,
.building-buttons-edit {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0;
}
.floor-buttons-edit button,
.building-buttons-edit button {
  padding: 6px 10px;
  font-size: 18px;
  background: #f0f0f0;
  border: 1px solid #ccc;
}
.floor-buttons-edit button:hover,
.building-buttons-edit button:hover {
  background: #e0e0e0;
}


/* —— Tooltip —— */
.tooltip {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  pointer-events: none;
  display: none;
  font-family: sans-serif;
  font-size: 14px;
  z-index: 1000;
}

/* Modal 遮罩 */
.modal {
  position: fixed;
  top: 0; left: 0; right:0; bottom:0;
  background: rgba(0,0,0,0.3);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal.show { display: flex; }

/* Modal 内容 */
.modal-content {
  background: white;
  padding: 20px;
  width: 300px;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.modal-content h3 { margin-top: 0; }

/* 列表项 */
#editList li {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
}
#editList li input {
  flex: 1;
  margin-right: 8px;
}

/* 按钮行 */
.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}
.modal-actions button {
  padding: 6px 12px;
  cursor: pointer;
}


/* === Upload Modal Overlay === */
#uploadModal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  display: none;               /* JS 加 .show 时改为 flex */
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
/* 打开弹窗时 */
#uploadModal.show {
  display: flex;
}

/* === 弹窗主体 === */
#uploadModal .modal-content {
  background: #f0f0f0;
  border-radius: 8px;
  padding: 24px 32px;
  width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  box-sizing: border-box;
}

/* 标题 */
#uploadModal .modal-content h3 {
  margin: 0 0 24px;
  font-size: 1.3rem;
  text-align: center;
}

/* 每一行文件输入 */
#uploadModal .modal-content .info-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
#uploadModal .modal-content .info-row label {
  flex: 0 0 100px;
  font-weight: bold;
}
#uploadModal .modal-content .info-row input[type="file"] {
  flex: 1;
  cursor: pointer;
}

/* 底部操作按钮 */
#uploadModal .modal-content .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
#uploadModal .modal-content .modal-actions button {
  padding: 8px 16px;
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
/* Cancel 按钮 */
#uploadModal .modal-content #uploadCancelBtn:hover {
  background: #eee;
}
/* Confirm 按钮 */
#uploadModal .modal-content #uploadConfirmBtn {
  background: #4a90e2;
  border-color: #4a90e2;
  color: #fff;
}
#uploadModal .modal-content #uploadConfirmBtn:hover {
  background: #357ab8;
}

.btn {
  appearance: none;
  border: 0;
  padding: 10px 16px;
  border-radius: 10px;
  font: 600 14px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
 
.btn-solid {
  background: #1f6feb;          /* 主色 */
  color: #fff;
  box-shadow: 0 6px 14px rgba(31, 111, 235, .25),
              0 2px 4px rgba(31, 111, 235, .18);
}
.btn-solid:hover { background:#1a63d4; transform: translateY(-1px); }
.btn-solid:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(31,111,235,.25); }
.btn-solid:disabled { opacity:.6; cursor:not-allowed; transform:none; box-shadow:none; }

/* —— 通用 Modal 遮罩 & 布局 —— */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal.show {
  display: flex;
}

/* —— Modal 内容 区域 —— */
.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.modal-content h3 {
  margin-top: 0;
  margin-bottom: 16px;
  text-align: center;
  font-size: 1.3rem;
}

/* —— 每行字段 —— */
.modal-content .info-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.modal-content .info-row label {
  flex: 0 0 100px;
  font-weight: bold;
}
.modal-content .info-row input[type="file"],
.modal-content .info-row input[type="text"],
.modal-content .info-row input[type="number"] {
  flex: 1;
}

/* —— 底部按钮 —— */
.modal-content .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.modal-content .modal-actions button {
  padding: 8px 16px;
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
.modal-content .modal-actions button:hover {
  background: #eee;
}

/* —— 特殊按钮样式 —— */
/* Upload Confirm */
#saveEditBtn {
  background: #4a90e2;
  border-color: #4a90e2;
  color: #fff;
}
#saveEditBtn:hover {
  background: #357ab8;
}


/* Update & Export 按钮，与 Upload Confirm 一致 */
#updateBtn,
#exportBtn {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 16px;
  border: 1px solid #4a90e2;
  background: #4a90e2;
  color: #fff;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

#updateBtn:hover,
#exportBtn:hover {
  background: #357ab8;
}

/* 让 side-panel-controls 里的按钮垂直排列 */
.side-panel-controls {
  display: flex;
  flex-direction: column;
}

/* 按钮样式（跟 uploadConfirmBtn 保持一致） */
.side-panel-controls button {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 16px;
  border: 1px solid #4a90e2;
  background: #4a90e2;
  color: #fff;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

/* 去掉最后一个按钮多余的下边距 */
.side-panel-controls button:last-child {
  margin-bottom: 0;
}

/* Hover 效果 */
.side-panel-controls button:hover {
  background: #357ab8;
}

.header-selector {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 8px;
  margin-top: 8px;
  font-size: 14px;
  margin-bottom: 8px;
}
.header-selector label {
  display: block;
  cursor: pointer;
  margin-bottom: 4px;
}



/* ─── Slider inside info-form ─── */
.info-form #scaleControl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;           /* smaller label text */
}

.info-form #scaleControl label {
  flex: 0 0 auto;
  font-weight: bold;
  width: 120px;              /* match your other labels */
}

.info-form #scaleControl input[type="range"] {
  flex: 1;
  accent-color: #007bff;     /* blue track & thumb */
}

.info-form #scaleControl #scaleValue {
  flex: 0 0 3ch;
  text-align: right;
  font-size: 14px;
}

/* —— Save 按钮 —— */
#saveInfoBtn {
  padding: 8px 16px;
  border: 1px solid #4a90e2;
  background: #4a90e2;
  color: #fff;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
#saveInfoBtn:hover {
  background: #357ab8;
}




#editTagBtn,
#fixRoomNumberBtn {
  width: 20%;
  margin-bottom: 8px;
  padding: 8px 16px;
  border: 1px solid #4a90e2;
  background: #4a90e2;
  color: #fff;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
#editTagBtn:hover,
#fixRoomNumberBtn:hover {
  background: #357ab8;
}

/* 4. 给 room-tag 表格加上边框并自动换行 */
.map-wrapper foreignObject div table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;     /* 强制单元格固定宽度以便换行 */
}
.map-wrapper foreignObject div table td {
  border: 1px solid #000;
  padding: 2px;
  word-wrap: break-word;   /* 自动换行 */
}

/* ——— 方形玻璃质感 Nav 按钮 ——— */
.nav-btn {
  position: absolute;
  top: 16px;
  width: 48px;
  height: 32px;
  padding: 0;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 8px;           /* 从 50% 改成 8px 圆角方块 */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  color: #00283a;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

/* 水平位置 */
#backToSplash { left: 20px;  }
#undoBtn      { left: 80px;  }
#redoBtn      { left: 140px; }

/* Hover & Active 效果 */
.nav-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.nav-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}


#csvConfirmBtn {
  padding: 8px 16px;
  border: 1px solid #4a90e2;
  background: #4a90e2;
  color: #fff;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
#csvConfirmBtn:hover {
  background: #357ab8;
}

#colorConfirmBtn {
  padding: 8px 16px;
  border: 1px solid #4a90e2;
  background: #4a90e2;
  color: #fff;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
#colorConfirmBtn:hover {
  background: #357ab8;
}

#existingFilesList {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
  overflow-y: auto;
}


/* styles.css */

/* 整个拖拽区外层容器 */
.drop-zone-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 标题文字下方留 8px 间距 */
.drop-zone-container > label {
  margin-bottom: 8px;
}

/* 拖放区 */
.drop-zone {
  flex: 1;
  border: 2px dashed #aaa;
  border-radius: 4px;
  display: flex;
  flex-direction: column;    /* 竖向排列文件名 */
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;                  /* 文件名间距 */
  padding: 8px;              /* 内边距，防止文字贴边 */
  color: #666;
  font-size: 14px;
  overflow-y: auto;          /* 如果文件多可滚动 */
}

body.exporting .map-wrapper,
body.exporting .sheet-inner,
body.exporting #svgContainer {
  overflow: visible !important;
}