/* =============================================================================
 *  04-panels.css — 面板内的专用组件
 *  尺寸预设 / 色板 / 风格卡 / 图标网格 / 上传区 / 提示条 / 弹窗
 * ========================================================================== */

/* ------------------------------- 尺寸预设 ------------------------------- */
.preset-group + .preset-group { margin-top: 12px; }
.preset-group h4 {
  margin: 0 0 6px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: .4px;
}
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.preset-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--field);
  text-align: left;
  transition: border-color .14s, background .14s, box-shadow .14s;
  min-width: 0;
}
.preset-item:hover { border-color: var(--line-3); background: #fff; }
.preset-item.on {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue-line) inset;
}
.preset-item .mini {
  flex: 0 0 auto;
  display: block;
  border: 1.4px solid var(--ink-3);
  border-radius: 2px;
  opacity: .65;
}
.preset-item.on .mini { border-color: var(--blue); opacity: 1; }
.pi-txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.pi-txt b {
  font-size: 11.5px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pi-txt em {
  font-size: 10px; font-style: normal; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------- 色板 ------------------------------- */
.swatch-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.swatch {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: 1px solid rgba(16, 24, 40, .08);
  transition: transform .14s, box-shadow .14s;
}
.swatch:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px -8px rgba(16, 24, 40, .45);
}
.swatch.sm { aspect-ratio: auto; height: 26px; }

/* ------------------------------- 图标 ------------------------------- */
.search-row { display: flex; gap: 6px; margin-bottom: 9px; }
.search-row .input { flex: 1; min-width: 0; }

.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-height: 216px;
  overflow-y: auto;
  padding: 1px;
  overscroll-behavior: contain;
}
.icon-cell {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--field);
  display: grid;
  place-items: center;
  transition: border-color .12s, background .12s, box-shadow .12s;
  color: #5b6472;
}
/* 内联 SVG：保持原始宽高比，最长边不超过 26px（宽图标不会被压扁） */
.icon-cell svg {
  width: auto; height: auto;
  max-width: 26px; max-height: 26px;
  display: block;
  pointer-events: none;
}
.icon-cell:hover { border-color: var(--line-3); background: #fff; }
.icon-cell.on {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue-line) inset;
}
.loading {
  grid-column: 1 / -1;
  padding: 18px 4px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.7;
}

.icon-more {
  margin-top: 6px;
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-3);
  padding: 6px 0 2px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background .12s, color .12s;
}
.icon-more:hover { background: var(--field); color: var(--ink-2); }

.icon-license {
  margin-top: 9px;
  padding: 9px 10px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 10.5px;
  color: var(--ink-2);
  line-height: 1.65;
}
.icon-license b { font-weight: 500; color: var(--ink); }

/* ------------------------------- 上传区 ------------------------------- */
.drop {
  border: 1.5px dashed var(--line-3);
  border-radius: var(--r);
  padding: 18px 14px;
  text-align: center;
  background: var(--field);
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-soft); }
.drop-ico { width: 24px; height: 24px; color: var(--ink-3); margin-bottom: 7px; }
.drop p { font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.drop .tip { margin-top: 2px; font-size: 10.5px; color: var(--ink-3); }

/* ------------------------------- 提示与弹层 ------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 12px);
  padding: 9px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 12.5px;
  color: var(--ink);
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
  max-width: 78vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { border-color: #ffd8a8; background: #fffbf2; color: #8a5300; }

.popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-float);
  padding: 6px;
  z-index: 60;
  animation: pop .14s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.export-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  transition: background .12s;
}
.export-menu button:hover { background: var(--field); }
.export-menu b { font-weight: 500; font-size: 12.5px; }
.export-menu em { font-style: normal; font-size: 10.5px; color: var(--ink-3); }

/* 授权弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(16, 24, 40, .38);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: min(800px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 70px -20px rgba(16, 24, 40, .45);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-body h3 {
  margin: 22px 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 10px; line-height: 1.75; }
.muted { color: var(--ink-2); font-size: 12px; }
.modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--field);
}
.modal-foot p { font-size: 11px; color: var(--ink-3); line-height: 1.6; }

.lic-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.lic-table th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  font-size: 10.5px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.lic-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.lic-table td b { color: var(--ink); font-weight: 500; }
.lic-table .sub-en { display: block; font-size: 10px; color: var(--ink-3); }
.lic-table .ok { color: var(--ok); font-size: 11px; white-space: nowrap; }

/* 字体授权标签 */
.tag-lic {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 4px;
  letter-spacing: .2px;
}
.tag-lic.sys { color: #b54708; background: #fffaeb; border-color: #fedf89; }

.font-info {
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.65;
  margin-top: 6px;
}
.font-info .sep { margin: 0 4px; opacity: .6; }
