/* ---- 公用链接 ---- */
a.a2 { color:#666; text-decoration:none; border: 1px solid #666; border-radius: 15px; padding:5px 10px; }
a.a2:hover, a.a2:active { color: #ff6600; border: 1px solid #ff6600; }
#aiHuihuaForm small a.a4 { text-decoration: none; color: #666; }
#aiHuihuaForm small a.a4:hover { color: #ff6600; text-decoration: underline; }

/* ---- 底部卡片区 ---- */
.bottom-controls { background-color: #2B2D31; padding: 20px; border-radius: 12px; margin: 0 10px 10px 10px; }

/* ---- 模块标题行 ---- */
.section-header { display: flex; justify-content: space-between; align-items: center; color: #fff; font-size: 14px; margin-bottom: 10px; }
.section-header span strong { color: #ff9900; font-weight: normal; margin-left: 5px; font-size: 12px; }

/* ---- 宽高比/分辨率 popup trigger ---- */
.toolbar-row { display: inline-block; }
form .pw-trigger { background: none; border: none; }

/* ---- 按钮行 ---- */
.action-buttons { display: flex; gap: 15px; align-items: center; flex-wrap: nowrap; }
.btn-preview { background-color: #666; color: white; border: none; white-space: nowrap; border-radius: 8px; padding: 15px 40px; font-size: 16px; font-weight: bold; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.btn-preview:hover { background-color: #777; }
.btn-save-tpl { background-color: #444; color: white; border: none; white-space: nowrap; border-radius: 8px; padding: 15px 30px; font-size: 16px; font-weight: bold; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.btn-save-tpl:hover { background-color: #555; }
.btn-submit { background-color: #8B5CF6; color: white; border: none; border-radius: 8px; padding: 15px; flex-grow: 1; font-size: 18px; font-weight: bold; cursor: pointer; transition: background 0.2s; text-align: center; min-width: 0; }
.btn-submit:hover { background-color: #7C3AED; }
#scoreHtml { font-size: 14px; color: #FFFF00; font-weight: normal; }

/* ---- 提示词操作按钮（SVG图标版） ---- */
.prompt-btns { position: absolute; right: 15px; top: 11px; display: flex; gap: 12px; z-index: 2; }
.prompt-btns a { display: flex; align-items: center; justify-content: center; background-color: #313338; border: 1px solid #444; color: #ccc; cursor: pointer; transition: all 0.2s; border-radius: 4px; padding: 4px; }
.prompt-btns a:hover { background-color: #444; color: #fff; border-color: #666; }
.prompt-btns a svg { fill: currentColor; }

/* ---- 我的模版区 ---- */
.tpl-links-wrap { position: relative; }
#template_links {
  flex-wrap: nowrap;
  align-items: center;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
#template_links.expanded { flex-wrap: wrap; max-height: 600px; }
#template_links .tpl-item {
  display: inline-flex;
  align-items: stretch;
  border-radius: 20px;
  border: 1px solid #3e4045;
  overflow: hidden;
  transition: border-color 0.2s;
  vertical-align: middle;
  flex-shrink: 0;
  margin-bottom: 10px;
}
#template_links.clean-mode .tpl-item { border-color: #8B0000; }
#template_links .tpl-btn {
  display: inline-block;
  padding: 5px 10px;
  color: #bbb;
  font-size: 14px;
  cursor: pointer;
  background: none;
  border: none;
  white-space: nowrap;
}
#template_links .tpl-btn:hover { color: #fff; background: #ff6600; }
#template_links .tpl-del {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0;
  overflow: hidden;
  padding: 0;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  border-left: 1px solid transparent;
  transition: width 0.25s, padding 0.25s, background 0.2s;
  white-space: nowrap;
  background: transparent;
}
#template_links.clean-mode .tpl-item .tpl-del { width: 32px; padding: 0 10px; border-left-color: rgba(255,255,255,0.15); }
#template_links.clean-mode .tpl-item .tpl-del:hover { background: rgba(200,0,0,0.35); }
#cleanTemplateBtn {
  display: inline-block;
  padding: 5px 10px;
  font-size: 13px;
  color: #777;
  cursor: pointer;
  border: 1px dashed #444;
  border-radius: 20px;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
#cleanTemplateBtn:hover { color: #ff6600; border-color: #ff6600; }
#cleanTemplateBtn.active { color: #4CAF50; border-color: #4CAF50; }
#tplExpandBtn {
  padding: 6px 14px;
  font-size: 13px;
  color: #777;
  cursor: pointer;
  border: 1px dashed #444;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  transition: color 0.2s, border-color 0.2s;
}
#tplExpandBtn:hover { color: #ff6600; border-color: #ff6600; }
#template_links .tpl-empty { color: #555; font-size: 13px; padding: 4px 0; }

/* ---- 存为模版 PopupWidget 弹出框中的输入框 ---- */
.tpl-save-name-input {
  width: 100%;
  background: #1E1F22;
  border: 1px solid #3e4045;
  border-radius: 6px;
  color: #fff;
  padding: 8px 10px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
  display: block;
  margin: 8px 0 4px 0;
}
.tpl-save-name-input:focus { border-color: #ff6600; }