/* 通用控件：按钮、输入、标签、开关、空态、加载 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--glass-edge);
  border-radius: 9px;
  background: var(--glass-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease);
}

.btn[hidden] {
  display: none;
}

.btn:hover:not(:disabled) {
  border-color: rgba(16, 21, 38, .13);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 1px 2px rgba(29, 67, 204, .3), 0 8px 22px rgba(47, 95, 255, .26);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #3d6bff, #2246d6);
  box-shadow: 0 2px 4px rgba(29, 67, 204, .3), 0 14px 32px rgba(47, 95, 255, .34);
}

.btn-accent {
  border-color: transparent;
  background: var(--lemon);
  color: #1b2200;
  box-shadow: 0 1px 2px rgba(120, 140, 20, .22), 0 8px 22px rgba(216, 239, 74, .4);
}

.btn-accent:hover:not(:disabled) {
  background: #e2f65c;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, .7);
  box-shadow: none;
  transform: none;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn-danger {
  color: var(--coral);
}

.btn-danger:hover:not(:disabled) {
  border-color: rgba(255, 106, 77, .34);
  background: rgba(255, 106, 77, .08);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

.field-hint {
  color: var(--ink-4);
  font-size: 13px;
}

.input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--solid-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
  font: inherit;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}

.input:hover {
  border-color: #d2d7e6;
}

.input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-wash);
  outline: none;
}

.input::placeholder {
  color: var(--ink-4);
}

textarea.input {
  min-height: 84px;
  padding: 9px 11px;
  line-height: 1.6;
  resize: vertical;
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b7590' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  display: none;
}

.switch-track {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #d3d8e6;
  transition: background .2s var(--ease);
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 21, 38, .26);
  content: "";
  transition: transform .2s var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(16, 21, 38, .06);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tag-dot::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.tag-blue {
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.tag-mint {
  background: rgba(16, 179, 154, .12);
  color: #0a7f6d;
}

.tag-amber {
  background: rgba(240, 167, 44, .15);
  color: #96620a;
}

.tag-coral {
  background: rgba(255, 106, 77, .13);
  color: #c33c1f;
}

.tag-quiet {
  background: rgba(16, 21, 38, .05);
  color: var(--ink-3);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 34px 22px;
  color: var(--ink-4);
  text-align: center;
}

.empty-title {
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
}

.empty-text {
  max-width: 300px;
  font-size: 13px;
  line-height: 1.7;
}

.admin-subtabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--glass-edge);
  border-radius: 10px;
  background: rgba(255, 255, 255, .58);
}

.credit-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.6fr) repeat(3, minmax(82px, .7fr)) minmax(110px, .8fr) minmax(130px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  padding: 11px;
  border: 1px solid var(--solid-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.credit-user,
.credit-metric,
.image-job-row > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.credit-user b,
.image-job-row b {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-user span,
.credit-metric span,
.image-job-row span {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-metric b {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.credit-adjust-input,
.credit-reason-input {
  min-width: 0;
}

.image-job-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 11px;
}

.image-job-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.6fr) minmax(90px, .7fr) minmax(170px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--solid-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.image-job-error {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid var(--solid-line);
  color: var(--coral);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .credit-row {
    grid-template-columns: minmax(150px, 1.3fr) repeat(3, minmax(76px, .7fr));
  }

  .credit-adjust-input,
  .credit-reason-input,
  .credit-row .btn {
    grid-column: span 2;
  }
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 2px;
  border: 1px solid var(--glass-edge);
  border-radius: 14px;
  background: var(--glass-quiet);
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .34);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.spinner-ink {
  border-color: rgba(16, 21, 38, .18);
  border-top-color: var(--accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 进入动画：面板与列表项轻微上浮 */
.rise {
  animation: rise .34s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

.fade {
  animation: fade .26s var(--ease) both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.memo-reminder {
  pointer-events: auto;
  width: 340px;
}

.memo-reminder-time {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 14px;
}

.memo-reminder .toast-title,
.memo-reminder .toast-text {
  font-size: 14px;
}

.memo-reminder-close {
  margin-top: 10px;
  padding: 6px 12px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--ink-1);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 380px;
  padding: 11px 14px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-md);
  background: var(--glass-strong);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-line);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  animation: toast-in .28s var(--ease) both;
}

.toast-mark {
  flex: none;
  width: 4px;
  align-self: stretch;
  border-radius: 3px;
  background: var(--accent);
}

.toast-ok .toast-mark {
  background: var(--mint);
}

.toast-warn .toast-mark {
  background: var(--amber);
}

.toast-error .toast-mark {
  background: var(--coral);
}

.toast-body {
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
}

.toast-text {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 13px;
  word-break: break-word;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px) scale(.97);
  }
}

.toast-out {
  animation: toast-out .22s var(--ease) both;
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(14px);
  }
}

/* Ozon 官方属性：按必填、选填分组，仅展示属性名称和可编辑值。 */
.official-attributes .section-body { padding: 20px; }
.official-group { margin-top: 20px; }
.official-group:first-child { margin-top: 0; }
.official-group-head { margin-bottom: 9px; color: #17232c; font-size: 16px; }
.official-field-list { border: 1px solid #dce5e8; border-radius: 8px; background: #fff; overflow: hidden; }
.official-attribute-row { display: grid; grid-template-columns: minmax(150px, 30%) minmax(0, 1fr); align-items: center; gap: 16px; min-height: 61px; padding: 10px 14px; border-bottom: 1px solid #e8eeef; }
.official-attribute-row:last-child { border-bottom: 0; }
.official-attribute-title { color: #17232c; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.official-field-input, .official-picker-trigger { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cddadc; border-radius: 6px; background: #fff; color: #17232c; font: inherit; font-size: 14px; }
.official-field-input:focus, .official-picker-trigger:focus-visible { outline: none; border-color: #087b72; box-shadow: 0 0 0 3px rgba(8, 123, 114, .1); }
textarea.official-field-input { min-height: 76px; resize: vertical; }
.official-picker-trigger { display: flex; justify-content: space-between; gap: 8px; align-items: center; text-align: left; cursor: pointer; }
.official-picker-popover { position: fixed; z-index: 1200; width: min(470px, calc(100vw - 24px)); max-height: min(440px, calc(100vh - 24px)); display: flex; flex-direction: column; border: 1px solid #b9d2d2; border-radius: 8px; background: #fff; box-shadow: 0 16px 50px rgba(19, 43, 47, .2); color: #17232c; font-size: 14px; }
.official-picker-head { display: flex; justify-content: space-between; gap: 12px; padding: 13px 15px 9px; }
.official-picker-head strong, .official-picker-head small { display: block; }
.official-picker-head small { margin-top: 2px; color: #60717d; font-size: 14px; }
.official-picker-head button { border: 0; background: transparent; color: #60717d; font-size: 22px; cursor: pointer; }
.official-picker-search-wrap { padding: 0 15px 10px; }
.official-picker-search-wrap input { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid #cddadc; border-radius: 5px; font: inherit; }
.official-picker-count { padding: 0 15px 8px; color: #60717d; }
.official-picker-options { min-height: 80px; overflow-y: auto; border-top: 1px solid #e8eeef; }
.official-option { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; min-height: 42px; padding: 8px 15px; border: 0; border-bottom: 1px solid #f0f3f3; background: #fff; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.official-option:hover, .official-option.selected { background: #e9f5f1; }
.official-option small { color: #8a9aa2; font-size: 14px; }
.official-option-empty { padding: 24px 15px; color: #60717d; text-align: center; }
.official-picker-more { min-height: 36px; border: 0; background: #f5f8f8; color: #087b72; font: inherit; cursor: pointer; }
.official-picker-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 15px; border-top: 1px solid #e8eeef; }
.official-picker-foot button { min-height: 36px; padding: 6px 12px; border: 1px solid #cddadc; border-radius: 5px; background: #fff; color: #17232c; font: inherit; cursor: pointer; }
.official-picker-foot [data-picker-save] { border-color: #087b72; background: #087b72; color: #fff; }
@media (max-width: 760px) { .official-attribute-row { grid-template-columns: 1fr; gap: 10px; } }
