/* CGC SPR Format Maker - 网页版布局（主站入口用 index.php 引入主站导航，主体框架不改） */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "MS Sans Serif", "Segoe UI", Tahoma, sans-serif;
  font-size: 12px;
  background-color: #f0f0f0;
  background-image: url('../images/bg_body.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  overflow-x: hidden;
  overflow-y: auto;
}

/* 编辑器内容区：独立打开 index.html 时无导航，整页可用 */
.spr-editor-page .main-dialog {
  margin-top: 0;
  height: 100vh;
}
/* 主站入口 index.php / index.html：有主站导航时整体下移，整体框架上移 110px */
.spr-editor-page-with-nav {
  padding-top: 100px;
  margin-top: -110px;
  min-height: 100vh;
  box-sizing: border-box;
}
.spr-editor-page-with-nav .main-dialog {
  margin-top: 0;
  min-height: calc(100vh - 100px + 110px);
  height: auto;
}

/* 编辑器主体框架：文字黑色，确保不被导航栏遮挡 */
.spr-editor-page .main-dialog,
.spr-editor-page .main-dialog * {
  color: #000;
}
.spr-editor-page .main-dialog input::placeholder {
  color: #666;
}

.main-dialog {
  width: 820px;
  max-width: 820px;
  min-height: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  background: #f0f0f0;
}

.path-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.label-spr { width: 70px; flex-shrink: 0; }
.path-combo-wrap { flex: 1; min-width: 0; }
.path-combo { width: 100%; padding: 4px 6px; border: 1px solid #888; }
.btn-icon { width: 28px; height: 24px; padding: 0; cursor: pointer; border: 1px solid #888; background: #ddd; }

.sprite-info { margin-bottom: 6px; padding: 8px; border: 1px solid #888; }
.sprite-info legend { padding: 0 4px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 12px; }
.info-item label { display: block; font-size: 10px; color: #444; }
.info-item input, .info-item select { width: 100%; padding: 2px 4px; border: 1px solid #aaa; }

.quickview-wrap {
  margin-top: 8px;
  width: 800px; height: 600px;
  min-width: 800px; min-height: 600px;
  max-width: 800px; max-height: 600px;
  border: 1px solid #888;
  background: #fff;
  flex-shrink: 0;
}
.quickview {
  width: 100%; height: 100%;
  background: #e8e8e8;
  display: flex; align-items: center; justify-content: center;
  color: #666; font-size: 10px;
}

.preview-zoom-container { cursor: grab; user-select: none; }
.preview-zoom-inner { flex-shrink: 0; }

.tab-bar { display: flex; gap: 0; margin-bottom: 4px; border-bottom: 1px solid #888; }
.tab-btn { padding: 6px 10px; border: 1px solid #888; border-bottom: none; background: #ddd; cursor: pointer; font-size: 11px; }
.tab-btn.active { background: #fff; margin-bottom: -1px; }
.tab-btn:hover:not(.active) { background: #e8e8e8; }

.toolbar { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 6px; }
.tb-btn { padding: 4px 8px; min-width: 28px; border: 1px solid #888; background: #ddd; cursor: pointer; font-size: 11px; }
.tb-btn:hover { background: #ccc; }

.list-wrap { flex: 1; min-height: 120px; border: 1px solid #888; overflow: auto; background: #fff; }
.data-list { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-list th, .data-list td { border: 1px solid #ddd; padding: 2px 6px; text-align: left; }
.data-list th { background: #e0e0e0; position: sticky; top: 0; }
.data-list tbody tr.selected { background: #b0d0ff; }
.data-list tbody tr.multi-selected { background: #c8e0f0; }
.data-list tbody tr:hover { background: #e8f0ff; }

.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal.hidden { display: none; }
.modal-content { background: #fff; padding: 20px; border-radius: 8px; min-width: 280px; }
.edit-modal-content { min-width: 320px; }
.edit-form .edit-row { margin-bottom: 8px; }
.edit-form .edit-row label { display: inline-block; width: 80px; }
.edit-form .edit-row input { width: 180px; padding: 4px; }
.edit-extra.hidden { display: none; }
.modal-buttons { margin-top: 16px; display: flex; gap: 8px; }
.btn-cancel, .btn-close { padding: 6px 16px; cursor: pointer; }

.context-menu {
  position: fixed; z-index: 2000;
  min-width: 140px; padding: 4px 0;
  background: #fff; border: 1px solid #888;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
  font-size: 12px;
}
.context-menu.hidden { display: none; }
.context-menu ul { margin: 0; padding: 0; list-style: none; }
.context-menu li { padding: 6px 16px; cursor: pointer; }
.context-menu li:hover { background: #e0e8f0; }
.context-menu li.hidden { display: none; }

/* 温馨提示警示弹窗 */
.warn-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: warnModalFadeIn 0.35s ease-out;
}
.warn-modal.hidden { display: none; }
@keyframes warnModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.warn-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.warn-modal-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(165deg, #1c1c1e 0%, #252528 50%, #1a1a1c 100%);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow:
    0 0 0 1px rgba(255, 165, 0, 0.35),
    0 0 40px rgba(255, 140, 0, 0.15),
    0 25px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: warnBoxPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes warnBoxPop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.warn-modal-glow {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 100px;
  background: radial-gradient(ellipse at center, rgba(255, 165, 0, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.warn-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #ff9500;
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.2) 0%, rgba(255, 100, 0, 0.08) 100%);
  border-radius: 50%;
  border: 2px solid rgba(255, 165, 0, 0.5);
  box-shadow: 0 0 24px rgba(255, 149, 0, 0.25);
  animation: warnIconPulse 2s ease-in-out infinite;
}
@keyframes warnIconPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(255, 149, 0, 0.25); }
  50% { box-shadow: 0 0 32px rgba(255, 149, 0, 0.4); }
}

.warn-modal-title {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: 0.5px;
  text-shadow: 0 0 20px rgba(255, 165, 0, 0.3);
}

.warn-modal-body {
  margin-bottom: 28px;
}
.warn-modal-body p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.65;
  color: #c8c8cc;
}
.warn-modal-body p:last-child { margin-bottom: 0; }
.warn-modal-body strong {
  color: #ff9500;
  font-weight: 600;
}

.warn-modal-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.warn-btn {
  min-width: 120px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.warn-btn:hover {
  transform: translateY(-2px);
}
.warn-btn-ok {
  background: linear-gradient(135deg, #ff9500 0%, #e68600 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 149, 0, 0.35);
}
.warn-btn-ok:hover {
  box-shadow: 0 6px 24px rgba(255, 149, 0, 0.45);
}
.warn-btn-close {
  background: rgba(255, 255, 255, 0.08);
  color: #999;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.warn-btn-close:hover {
  background: rgba(255, 80, 80, 0.15);
  color: #e55;
  border-color: rgba(255, 80, 80, 0.3);
}
