/* ==================== Reset & Base ==================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: #f5f5f7;
  color: #1f1f1f;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, button { font-family: inherit; }

/* ==================== 顶部 Header（原站 .layout_header：height 64px(antd 默认)、padding 0 20px、bg #f1f1f1） ==================== */
.site-header {
  height: 64px;
  background: #f1f1f1;
  border-bottom: 1px solid #f1f1f1;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  color: #1f1f1f;
  /* logo 区不被导航挤压（避免窄屏下标题被压成竖排） */
  flex: 0 0 auto;
  /* 整块可点击回首页（<a class="site-logo" href="/">） */
  text-decoration: none;
  cursor: pointer;
}
/* logo 图标（assets/img/logo.png）40×40 */
.site-logo img {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 6px;
  object-fit: cover;
}
/* 站点名（原站 .layout_name 逐值：18px/500/#333；与 logo 的 10px 间距由 .site-logo 的 gap 提供）
   font-family 逐值照搬原站 antd 全局字体栈，保证 500 字重落到与原站同一字面 */
.site-title {
  margin-left: 0;
  font-size: 18px;
  font-weight: 500;
  color: #333;
  /* 标题单行显示，窄屏不逐字换行 */
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}
@media (max-width: 1023px) {
  .site-title { font-size: 14px; }
}
/* 顶部导航（原站 antd 水平菜单：右对齐、hover/选中蓝色、微信为可展开子菜单） */
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #333;
}
.site-nav .nav-item {
  padding: 0 16px;
  line-height: 64px;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  border: none; /* 移除按钮默认边框 */
  background: transparent; /* 移除背景 */
}
.site-nav .nav-item:hover,
.site-nav .nav-item.active { color: #1677ff; }
.site-nav .nav-disabled { color: #c0c0c0; cursor: not-allowed; pointer-events: none; }
/* 微信 子菜单（hover 或 click 展开下拉） */
.nav-submenu { position: relative; }
.nav-arrow {
  display: inline-block;
  width: 0; height: 0;
  margin-left: 6px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  vertical-align: middle;
  transition: transform .2s;
}
.nav-submenu:hover .nav-arrow,
.nav-submenu.open .nav-arrow { transform: rotate(180deg); }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 190px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
  z-index: 200;
}
.nav-submenu:hover .nav-dropdown,
.nav-submenu.open .nav-dropdown { display: block; }
.nav-dropdown-item {
  display: block;
  padding: 8px 16px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown-item:hover { background: #f5f5f5; color: #1677ff; }
.nav-dropdown-item.nav-disabled { color: #c0c0c0; pointer-events: none; }

/* ==================== 整体 Layout ==================== */
.app {
  display: grid;
  /* 原站 .main_sideContent 宽 400（图标栏 80 另计） */
  grid-template-columns: 80px 400px 1fr;
  height: calc(100vh - 104px);
  background: #fff;
}

/* ==================== 底部 Footer（原站 .layout_footer：height 40px、bg #f1f1f1、居中） ==================== */
.site-footer {
  height: 40px;
  padding: 0;
  background-color: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.88);
}

/* ==================== 左侧边栏 ==================== */
.sidebar {
  background: #F1F1F1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sidebar-item {
  width: 100%;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 400;
  color: #000;
  cursor: pointer;
}
.sidebar-item.active,
.sidebar-item:hover {
  background: #F9F9F9;
}
.sidebar-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  margin-bottom: 5px;
  fill: currentColor;
}

/* ==================== 表单区 ==================== */
/* 左侧设置区（原站 .main_sideContent：宽 400、标题 40px 在滚动区外） */
.panel-form {
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.panel-form h2 {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: #000;
  line-height: 40px;
  height: 40px;
  flex: 0 0 40px;
  margin: 0;
  background-color: #f9f9f9;
  border-bottom: 1px solid #f5f5f5;
}
/* 滚动区（原站 .sidebar_bar：padding 20、overflow-y scroll、flex 1） */
.panel-form form {
  flex: 1 1;
  min-height: 0;
  overflow-y: scroll;
  padding: 20px;
  background: #f9f9f9;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.panel-form form::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
/* 原站全局滚动条（b86d）：宽 10px，保证滚动区内容宽 = 400-40-10 = 350 */
@media (min-width: 768px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-button { width: 0; height: 0; }
  ::-webkit-scrollbar-thumb {
    min-height: 28px;
    background-color: rgba(0, 0, 0, .2);
    background-clip: padding-box;
    border-radius: 5px;
  }
  ::-webkit-scrollbar-track { background-color: #fff; }
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}
legend {
  display: none;
}

.form-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  gap: 0;
}
.form-row label {
  flex: 0 1 auto;
  color: #000;
  font-size: 14px;
}
.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="datetime-local"],
.form-row select {
  flex: 1;
  min-width: 0;
  padding: 4px 11px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: rgba(0,0,0,0.88);
  outline: none;
  transition: border-color .2s;
}
.form-row input:focus,
.form-row select:focus { border-color: #1677ff; }
.form-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #07c160;
}

/* ==================== Toggle Switch（Ant Design 风格） ==================== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  min-width: 44px;
  flex-shrink: 0;
  cursor: pointer;
  margin-left: auto;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.25);
  border-radius: 100px;
  transition: background .2s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 9px;
  transition: left .2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0,35,11,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: #1677ff;
}
.toggle-switch input:checked + .toggle-slider::before {
  left: calc(100% - 20px);
}

/* ==================== Custom Select（Ant Design 风格下拉） ==================== */
.custom-select {
  width: 100px;
  flex: none;
  position: relative;
  margin-left: auto;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 11px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: rgba(0,0,0,0.88);
  transition: border-color .2s;
  user-select: none;
}
.custom-select-trigger:hover {
  border-color: #1677ff;
}
.custom-select.open .custom-select-trigger {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}
.custom-select-arrow {
  color: rgba(0,0,0,0.25);
  font-size: 12px;
  margin-left: 4px;
}
.custom-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
  z-index: 200;
  padding: 4px 0;
  min-width: 100px;
}
.custom-select.open .custom-select-dropdown {
  display: block;
}
.custom-select-option {
  padding: 5px 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .15s;
}
.custom-select-option:hover {
  background: #f5f5f5;
}
.custom-select-option.selected {
  color: #1677ff;
  font-weight: 500;
}
.custom-select-option.selected::after {
  content: "✓";
  color: #1677ff;
  font-size: 14px;
  font-weight: 600;
}

/* ==================== Time Picker（时间输入） ==================== */
.time-picker-wrap {
  width: 100px;
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
}
.time-input {
  width: 100%;
  padding: 4px 11px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  color: rgba(0,0,0,0.88);
  background: #fff;
  outline: none;
  transition: border-color .2s;
  height: 32px;
}
.time-input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}
.time-icon {
  display: none;
}

/* ==================== Slider（Ant Design 风格） ==================== */
.slider-wrap {
  width: 70%;
  flex: none;
  display: flex;
  align-items: center;
  margin-left: auto;
}
.slider-wrap input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(0,0,0,0.04);
  border-radius: 2px;
  outline: none;
}
.slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 2px #91CAFF;
}
.slider-wrap input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 2px #91CAFF;
}
.slider-value {
  display: none;
}

/* 电量滑块 */
input[type="range"] {
  flex: 1;
  accent-color: #1677ff;
}

/* ==================== 预览区 ==================== */
.panel-preview {
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* 手机框缩放容器 — 原站 #content：padding 20px 滚动区 */
.phone-frame-wrap {
  position: relative;
  flex: 1 1;
  overflow: auto;
  padding: 20px;
}

/* 型号标题 — 原站 h3.main_title computed：16.38px/700/40px 高/#000/#fdfdfd，margin 0 */
.device-label {
  flex: 0 0 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: #fdfdfd;
  font-size: 16.38px;
  font-weight: 700;
  color: rgb(0, 0, 0);
}

/* ==================== 右侧悬浮固定按钮 ==================== */
.float-tools {
  position: fixed;
  right: 40px;
  bottom: 100px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.float-slider-wrap {
  width: 54px;
  height: 150px;
  padding: 10px;
  display: flex;
  justify-content: center;
}
.v-slider {
  position: relative;
  width: 12px;
  height: 130px;
  margin: 5px 11px;
  cursor: pointer;
  touch-action: none;
}
.v-slider-rail {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,0.04);
}
.v-slider-track {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 4px;
  border-radius: 2px;
  background: #91CAFF;
}
.v-slider-handle {
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #91CAFF;
}
/* 当前缩放比例气泡（原站 antd Slider tooltip：悬停/拖动时显示） */
.v-slider-tooltip {
  position: absolute;
  left: 22px;
  bottom: 0;
  transform: translateY(50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  visibility: hidden;
  z-index: 10;
}
.v-slider-tooltip::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  margin-top: -4px;
  border: 4px solid transparent;
  border-right-color: rgba(0, 0, 0, 0.85);
}
.float-slider-wrap:hover .v-slider-tooltip,
.v-slider.dragging .v-slider-tooltip { visibility: visible; }
.float-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgb(45,164,71);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: rgba(0,0,0,0.14) 0 2px 2px 0, rgba(0,0,0,0.12) 0 1px 5px 0, rgba(0,0,0,0.2) 0 3px 1px -2px;
  position: relative;
}
/* 原站 antd Tooltip（placement=left）：hover 按钮左侧显示文字气泡 */
.float-btn::before {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  border-radius: 6px;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: none;
  z-index: 10;
}
.float-btn::after {
  content: "";
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-left-color: rgba(0, 0, 0, 0.85);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: none;
  z-index: 10;
}
.float-btn:hover::before,
.float-btn:hover::after {
  visibility: visible;
  opacity: 1;
}
.float-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.float-slider-wrap[hidden],
.float-btn[hidden] { display: none; }
/* 生成中：相机钮置灰且不可重复点击 */
.float-btn.is-generating { opacity: .55; pointer-events: none; }
.float-btn-normal {
  background-color: rgb(186,186,186);
}
/* 原站 .button_itemDownload：仅预览打开时出现的蓝色下载钮 */
.float-btn-download {
  background-color: rgb(3,169,244);
}
.float-btn-download svg {
  width: 25px;
  height: 25px;
}
/* ==================== 生成图片弹窗（原站 antd Modal.confirm） ==================== */
.ant-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  overflow: auto;
}
.ant-modal-mask[hidden] { display: none; }
.anticon {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  font-style: normal;
  vertical-align: -0.125em;
}
.anticon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}
.ant-modal-confirm {
  position: relative;
  width: 416px;
  margin: 100px auto 0;
  padding: 20px 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05);
}
/* 右上 X 关闭按钮（antd Modal close） */
.ant-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  color: rgba(0,0,0,0.45);
  cursor: pointer;
  outline: none;
  transition: color .2s;
}
.ant-modal-close:hover {
  color: rgba(0,0,0,0.88);
}
.ant-modal-close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.ant-modal-confirm-body > .anticon {
  float: left;
  margin-right: 16px;
  font-size: 22px;
  color: #faad14;
}
.ant-modal-confirm-title {
  display: block;
  overflow: hidden;
  color: rgba(0,0,0,0.88);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}
.ant-modal-confirm-content {
  margin-left: 38px;
  margin-top: 8px;
  color: rgba(0,0,0,0.88);
  font-size: 14px;
}
.ant-modal-confirm-btns {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.ant-btn {
  height: 32px;
  padding: 4px 15px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: rgba(0,0,0,0.88);
  cursor: pointer;
}
.ant-btn:disabled {
  color: rgba(0,0,0,0.25);
  background: rgba(0,0,0,0.04);
  border-color: #d9d9d9;
  cursor: not-allowed;
}
.ant-btn-primary {
  background: #1677ff;
  border-color: #1677ff;
  color: #fff;
}
.ant-btn-sm { height: 24px; padding: 0 7px; border-radius: 4px; }
.ant-btn-primary.ant-btn-dangerous { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }
.ant-btn-link { border-color: transparent; background: transparent; color: #1677ff; }
.ant-btn-link:hover { color: #4096ff; }
.ant-input {
  width: 100%; padding: 4px 11px; font-size: 14px; line-height: 1.5;
  border: 1px solid #d9d9d9; border-radius: 6px; background: #fff; color: rgba(0,0,0,0.88);
}
.ant-input:focus { border-color: #1677ff; outline: none; box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1); }
.ant-tag { display: inline-block; padding: 0 7px; font-size: 12px; line-height: 20px; border-radius: 4px; border: 1px solid rgba(5,5,5,0.06); }
.ant-tag-has-color { color: #fff; }
.ant-tag-borderless { border: none; }

/* ==================== Ant Design List（split） ==================== */
.ant-list { font-size: 14px; }
.ant-list-header { border-bottom: 1px solid rgba(5, 5, 5, 0.06); }
.ant-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; color: rgba(0, 0, 0, 0.88); font-size: 14px;
}
.ant-list-split .ant-list-item { border-bottom: 1px solid rgba(5, 5, 5, 0.06); }
.ant-list-split .ant-list-item:last-child { border-bottom: none; }
.ant-list-item-meta { display: flex; flex: 1 1; align-items: center; min-width: 0; }
.ant-list-item-meta-avatar { margin-right: 16px; }
.ant-list-item-meta-content { flex: 1 1; min-width: 0; }
.ant-list-item-meta-title { margin: 0; font-size: 14px; font-weight: 400; color: rgba(0, 0, 0, 0.88); }
.ant-list-item-action { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; flex: none; }
.ant-list-item-action > li { display: flex; align-items: center; }
.ant-list-item-action-split { width: 1px; height: 14px; margin: 0 8px; background: rgba(5, 5, 5, 0.06); }
.ant-btn-loading {
  cursor: default;
}
.ant-btn-loading-icon {
  display: inline-block;
  width: 14px;
  margin-right: 8px;
  vertical-align: -2px;
}
.anticon-spin {
  display: inline-block;
  animation: loadingCircle 1s infinite linear;
}
@keyframes loadingCircle {
  to { transform: rotate(360deg); }
}

/* ==================== 生成图片预览层（原站 rc-image Preview） ==================== */
.shot-preview-root[hidden] { display: none; }
.shot-preview-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.8);
}
.shot-preview-wrap {
  position: fixed;
  inset: 0;
  overflow: auto;
  z-index: 1080;
}
.shot-preview-body {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.shot-preview-img-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
  overflow: hidden;
}
.shot-preview-img {
  max-width: 100%;
  max-height: 100%;
  vertical-align: middle;
  transform: scale3d(1, 1, 1);
  cursor: grab;
  transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
  user-select: none;
  pointer-events: auto;
}
.shot-preview-operations-wrapper {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1081;
  width: 100%;
}
.shot-preview-operations {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  background: rgba(0, 0, 0, 0.1);
  height: 46px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #fff;
  font-size: 14px;
  line-height: 22px;
}
.shot-preview-operations-operation {
  margin-inline-start: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s;
  user-select: none;
}
.shot-preview-operations-operation:last-of-type {
  margin-inline-start: 0;
}
.shot-preview-operations-operation:hover {
  background: rgba(0, 0, 0, 0.2);
}
.shot-preview-operations-operation-disabled {
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}
.shot-preview-operations-icon {
  display: inline-flex;
  font-size: 18px;
  line-height: 0;
  width: 18px;
  height: 18px;
}

/* ==================== Buttons ==================== */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 12px;
  transition: background .15s;
}
.btn-primary:hover { background: #06ad56; }
.btn-secondary { background: #576b95; }
.btn-secondary:hover { background: #4a5d83; }

/* ==================== Tab 面板切换 ==================== */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* ==================== 型号选择（Ant Design Tabs + List） ==================== */
.ant-tabs-nav {
  display: flex;
  position: relative;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(5,5,5,0.06);
}
.ant-tab {
  display: flex;
  align-items: center;
  padding: 12px 0;
  font-size: 14px;
  color: rgba(0,0,0,0.88);
  cursor: pointer;
  user-select: none;
  margin-right: 32px;
  transition: color .2s;
}
.ant-tab svg {
  width: 14px;
  height: 14px;
  margin-right: 12px;
  vertical-align: -0.125em;
  fill: currentColor;
}
.ant-tab.active {
  color: #1677ff;
}
.ant-ink-bar {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: #1677ff;
  transition: left .2s, width .2s;
}
.model-list {
  display: none;
  flex-direction: column;
}
.model-list.active {
  display: flex;
}
.model-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(5,5,5,0.06);
}
.model-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: rgba(0,0,0,0.88);
  line-height: 22px;
  margin: 0 0 4px;
}
.model-info p {
  font-size: 14px;
  color: rgba(0,0,0,0.45);
  line-height: 22px;
  margin: 0;
}
.model-btn {
  padding: 4px 15px;
  height: 32px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: rgba(0,0,0,0.88);
  transition: all .2s;
  white-space: nowrap;
}
.model-btn:hover {
  border-color: #1677ff;
  color: #1677ff;
}
.model-btn.selected {
  background: #1677ff;
  color: #fff;
  border-color: transparent;
}

/* ==================== 详情设置 ==================== */
.input-220 {
  width: 220px !important;
  flex: none !important;
  margin-left: auto;
}
.form-row-avatar {
  align-items: flex-start;
  padding: 8px 0;
}
.form-row-textarea {
  align-items: flex-start;
  padding: 8px 0;
}
.form-row-textarea textarea.input-220 {
  width: 220px;
  height: 54px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 14px;
  color: rgba(0,0,0,0.88);
  background: #fff;
  resize: vertical;
  outline: none;
  line-height: 22px;
  margin-left: auto;
  transition: border-color .2s;
}
.form-row-textarea textarea.input-220:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}

/* ==================== 头像上传 ==================== */
.avatar-upload {
  cursor: pointer;
  margin-left: auto;
}
.avatar-preview {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: #eee center/cover no-repeat;
  background-image: url('/assets/img/face.png');
}

.mc-avatar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.mc-avatar-actions .avatar-upload {
  margin-left: 0;
}

.mc-avatar-random-btn {
  white-space: nowrap;
}

/* ==================== 移动端自适应（参考原站 max-width:480px 断点） ==================== */
@media screen and (max-width: 480px) {
  /* 允许整页纵向滚动 */
  html, body { height: auto; }

  /* 三栏 grid → 纵向堆叠：[侧栏 | 表单] 一行，预览整行在下 */
  .app {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: 500px auto;
    grid-template-areas:
      "sidebar form"
      "preview preview";
    height: auto;
  }
  .sidebar { grid-area: sidebar; height: 500px; }
  .sidebar-icon { width: 18px; height: 18px; }
  .panel-form {
    grid-area: form;
    height: 500px;
    overflow: hidden;
  }
  .panel-preview {
    grid-area: preview;
    height: 800px;
    position: relative;
    overflow: auto;
  }

  /* header 收缩，隐藏站点名文字防横向溢出（标题在 .site-logo 内，需用后代选择器） */
  .site-header { padding: 0 12px; }
  .site-logo .site-title { display: none; }
  .site-logo { font-size: 14px; gap: 8px; }
  .site-logo img { width: 32px; height: 32px; flex: 0 0 32px; }
  .site-nav { gap: 0; font-size: 13px; }
  .site-nav .nav-item { padding: 0 8px; }
  .header-user-nav { margin-left: 4px; }

  /* 表单控件在移动端保持与桌面/原站一致的固定宽（原站控件宽为 inline style：
     select 100px、slider 70%、input 220px，其 max-width:480px 媒体查询不改控件宽），
     不得拉伸为 flex:1，否则窄屏下控件占满整行与原站观感不一致 */

  /* 悬浮工具条：固定右下、按钮缩小（始终可达） */
  .float-tools { position: fixed; right: 10px; bottom: 10px; }
  .float-btn { width: 50px; height: 50px; }
  .float-btn svg { width: 18px; height: 18px; }
  .float-slider-wrap { width: 46px; height: 130px; padding: 8px; }
  .v-slider { height: 110px; }

  /* 预览层 wrapper 的 padding 原站任何断点均为 50px（.shot-preview-img-wrapper），
     窄屏不覆盖：图片由 max-width/max-height:100% 自然约束（393px 视口下约 293px 宽），
     与原站移动端预览观感一致 */
}

/* ==================== 用户头像导航 ==================== */
.header-user-nav {
  margin-left: auto;
  position: relative;
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  object-fit: cover;
}

.header-user-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ==================== 登录/注册弹窗 ==================== */
.auth-modal-mask[hidden] { display: none; }

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-content {
  background: #fff;
  border-radius: 8px;
  width: 420px;
  max-width: 90%;
  padding: 24px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  position: relative;
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.45);
  font-size: 20px;
}

.auth-modal-close:hover {
  color: rgba(0, 0, 0, 0.88);
}

.auth-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.88);
  margin-bottom: 20px;
  text-align: center;
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(5, 5, 5, 0.06);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  cursor: pointer;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.88);
  transition: all 0.2s;
  position: relative;
}

.auth-tab.active {
  color: #1677ff;
  font-weight: 500;
}

.auth-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #1677ff;
}

.auth-form-group {
  margin-bottom: 16px;
}

.auth-form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.88);
}

.auth-form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.auth-form-input:focus {
  border-color: #1677ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.auth-form-input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.auth-submit-btn {
  width: 100%;
  padding: 10px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.auth-submit-btn:hover {
  background: #4096ff;
}

.auth-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.guest-mode-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
  text-align: center;
}

.guest-mode-btn {
  width: 100%;
  padding: 10px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.guest-mode-btn:hover {
  background: #06ad56;
}

/* ==================== 用户信息编辑弹窗 ==================== */
.profile-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.profile-avatar-section {
  text-align: center;
  margin-bottom: 24px;
}

.profile-avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  margin: 0 auto 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.profile-avatar-preview:hover {
  transform: scale(1.05);
}

.profile-refresh-btn {
  padding: 6px 16px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.profile-refresh-btn:hover {
  background: #4096ff;
}

.profile-field {
  margin-bottom: 16px;
}

/* 标签独占一行 + 输入框满宽，保证各字段行布局一致 */
.profile-field label {
  display: block; margin-bottom: 8px;
  font-size: 14px; color: rgba(0, 0, 0, 0.88);
}
.profile-field input { width: 100%; }

.profile-field.disabled input {
  background: #f5f5f5;
  color: rgba(0, 0, 0, 0.45);
  cursor: not-allowed;
}

/* 底部双按钮等宽平分：覆盖 .auth-submit-btn 的 width:100% 避免挤占 */
.profile-modal-actions .auth-submit-btn {
  flex: 1 1 0; width: auto; margin-top: 0;
}

/* ==================== 未登录提示 / 成功提示 ==================== */
.login-required-toast,
.success-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  z-index: 1100;
  font-size: 14px;
}

/* ==================== 反馈弹窗 ==================== */
.feedback-modal .auth-modal-content {
  width: 480px;
}

.feedback-modal .auth-modal-header h3 {
  text-align: center;
}

.auth-form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s;
}

.auth-form-textarea:focus {
  border-color: #1677ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

/* ==================== 反馈图片上传 ==================== */
/* uploader 作为 flex 容器，让缩略图列表与「上传图片」按钮同行横排（按钮在缩略图右侧） */
.feedback-image-uploader {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.feedback-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* 列表为空时不占位，避免 uploader 的 gap 在按钮左侧产生多余空隙 */
.feedback-image-list:empty {
  display: none;
}
.feedback-image-item {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  overflow: hidden;
}
.feedback-image-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feedback-image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
}
.feedback-image-remove:hover {
  background: rgba(0, 0, 0, 0.78);
}
.feedback-image-add {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 72px;
  height: 72px;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  background: #fafafa;
  color: rgba(0, 0, 0, 0.45);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.feedback-image-add:hover:not(:disabled) {
  border-color: #1677ff;
  color: #1677ff;
}
.feedback-image-add:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.feedback-image-add-icon {
  font-size: 20px;
  line-height: 1;
}

/* ==================== 建议反馈未读徒标 ==================== */
#feedback-btn {
  position: relative;
}
/* 包住按钮文字，徒标相对文字定位（落在文字右上角）。 */
.feedback-btn-label {
  position: relative;
}
.feedback-badge {
  position: absolute;
  top: -9px;
  right: -14px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 1px #fff;
  pointer-events: none;
  white-space: nowrap;
}
/* 反馈弹窗内「我的反馈」按钮上的未读条数徒标。 */
.my-fb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff4d4f;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-sizing: border-box;
}
/* 反馈弹窗底部「我的反馈」入口：单独一行，按钮铺满宽度。 */
.feedback-my-entry {
  margin-top: 20px;
}
.feedback-my-entry .auth-submit-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* 「我的反馈」与下方取消/提交行间距略收紧。 */
.feedback-my-entry + .profile-modal-actions {
  margin-top: 12px;
}

/* ==================== 我的反馈弹窗 ==================== */
.my-feedback-modal .auth-modal-content {
  width: 480px;
}
.my-feedback-modal .auth-modal-header h3 {
  text-align: center;
}
/* 我的反馈弹窗滚动区：细滚动条，避免默认粗滚动条遮挡内容。 */
.my-feedback-modal .auth-modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}
.my-feedback-modal .auth-modal-body::-webkit-scrollbar {
  width: 6px;
}
.my-feedback-modal .auth-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
}
.my-feedback-modal .auth-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
}
.my-feedback-modal .auth-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.my-feedback-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.my-feedback-item {
  padding: 12px 14px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.my-feedback-item:hover {
  border-color: #1677ff;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.12);
}
.my-feedback-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.my-feedback-cat {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.my-feedback-status {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 10px;
  background: #f0f0f0;
  color: #888;
}
.my-feedback-status.status-processed {
  background: #e6f7e6;
  color: #389e0d;
}
.my-feedback-status.status-planning {
  background: #e6f0ff;
  color: #1677ff;
}
.my-feedback-content {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.my-feedback-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.my-feedback-time {
  font-size: 12px;
  color: #aaa;
}
.my-fb-unread {
  font-size: 12px;
  color: #ff4d4f;
  font-weight: 600;
}

/* 对话线程 */
.my-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.my-thread-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: #1677ff;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.my-thread-origin {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f5f7fa;
  border: 1px solid #eee;
}
.my-thread-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}
.my-thread-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}
.my-thread-msg.other {
  align-self: flex-start;
  align-items: flex-start;
}
.my-thread-msg.mine {
  align-self: flex-end;
  align-items: flex-end;
}
.my-thread-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.my-thread-msg.other .my-thread-bubble {
  background: #fff;
  border: 1px solid #e5e5e5;
  color: #333;
}
.my-thread-msg.mine .my-thread-bubble {
  background: #1677ff;
  color: #fff;
}
.my-thread-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #aaa;
}
.my-thread-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  border-top: 1px solid #eee;
  padding-top: 10px;
}
.my-thread-input textarea {
  flex: 1;
  min-height: 60px;
  max-height: 120px;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  resize: vertical;
}
.my-thread-input textarea:focus {
  border-color: #1677ff;
  outline: none;
}
.my-thread-input button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: 6px;
  background: #1677ff;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.my-thread-input button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
