* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

[v-cloak] {
  display: none;
}

body {
  background: #f9e9b8;
  color: #3e2d16;
  font-size: 15px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: #f7d997;
  border-bottom: 1px solid #f0c97c;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #f48b16;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff5df;
  box-shadow: 0 4px 10px rgba(244, 139, 22, 0.18);
}

.brand-name {
  font-size: 22px;
}

.nav {
  display: flex;
  gap: 24px;
  font-size: 15px;
}

.nav-link {
  color: #6f5b35;
  text-decoration: none;
  cursor: pointer;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coin-pill {
  padding: 6px 12px;
  background: #fff7e6;
  border-radius: 16px;
  border: 1px solid #f1d599;
  font-size: 13px;
}

.avatar {
  background: #ff9f2e;
  color: #fff;
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 13px;
}

.page {
  max-width: 1180px;
  margin: 22px auto 60px;
  padding: 0 24px;
}

.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.tab {
  border: 1px solid #f0c97c;
  background: #fff3d4;
  padding: 10px 22px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: #ff9f2e;
  color: #fff;
  border-color: #ff9f2e;
}

.layout {
  display: grid;
  grid-template-columns: 1.05fr 1.1fr 0.95fr;
  gap: 16px;
}

.card {
  background: #fff8eb;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 16px rgba(216, 165, 77, 0.22);
  border: 1px solid #f0d7a8;
}

.card-title {
  font-size: 17px;
  margin-bottom: 12px;
  font-weight: 700;
}

.upload-hint {
  font-size: 13px;
  color: #8b7447;
  margin-bottom: 12px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.upload-slot {
  background: #fffdf8;
  border: 1px dashed #f0c97c;
  border-radius: 14px;
  padding: 10px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.upload-input {
  display: none;
}

.upload-empty {
  text-align: center;
  color: #f3a646;
  font-size: 13px;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.upload-empty .plus {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.upload-preview {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
}

.upload-footer {
  margin-top: 10px;
  background: #fff3d4;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: #7a6034;
}

.model-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.model-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  padding: 9px 12px;
  border: 1px solid #f0c97c;
  background: #fff;
  cursor: pointer;
}

.model-item.active {
  background: #ff9f2e;
  color: #fff;
  border-color: #ff9f2e;
}

.model-tag {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.3);
  padding: 2px 6px;
  border-radius: 8px;
}

.section-title {
  margin: 8px 0 8px;
  font-size: 14px;
  color: #8b7447;
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}

.size-item {
  border: 1px solid #f0c97c;
  background: #fff;
  border-radius: 10px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
}

.size-item.active {
  background: #ff9f2e;
  color: #fff;
  border-color: #ff9f2e;
}

.resolution-list {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.res-item {
  border: 1px solid #f0c97c;
  background: #fff;
  border-radius: 8px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 13px;
}

.res-item.active {
  background: #1cb56b;
  color: #fff;
  border-color: #1cb56b;
}

.prompt-tip {
  font-size: 13px;
  color: #8b7447;
  margin-bottom: 8px;
}

.prompt-input {
  width: 100%;
  border: 1px solid #f0c97c;
  border-radius: 10px;
  padding: 12px;
  height: 104px;
  resize: none;
  background: #fff;
  font-size: 14px;
}

.prompt-warning {
  color: #ff5c5c;
  font-size: 12px;
  margin: 8px 0 12px;
}

.generate-btn {
  width: 100%;
  border: none;
  background: #ff9f2e;
  color: #fff;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

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

.result-body {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-empty {
  text-align: center;
  color: #8b7447;
}

.result-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.result-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.result-sub {
  font-size: 13px;
  color: #a48a5f;
}

.result-content {
  width: 100%;
  text-align: center;
}

.result-image {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 12px;
  cursor: zoom-in;
}

.result-text {
  font-size: 14px;
  margin-bottom: 10px;
  color: #6c5430;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.action {
  border: 1px solid #f0c97c;
  background: #fff;
  padding: 9px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}

.action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.action.primary {
  background: #ff9f2e;
  color: #fff;
  border-color: #ff9f2e;
}

.batch {
  display: grid;
  gap: 18px;
}

.batch-settings {
  padding: 20px;
}

.batch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.batch-tabs {
  display: flex;
  gap: 8px;
}

.batch-tab {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #f0c97c;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.batch-tab.active {
  background: #ff9f2e;
  color: #fff;
  border-color: #ff9f2e;
}

.batch-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.field select {
  border: 1px solid #f0c97c;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-size: 13px;
}

.apply-btn {
  border: none;
  background: #ff9f2e;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  height: 40px;
  align-self: end;
}

.batch-meta {
  display: flex;
  gap: 16px;
  color: #8b7447;
  font-size: 13px;
  margin-bottom: 12px;
}

.batch-actions {
  display: flex;
  gap: 10px;
}

.batch-action {
  border: 1px solid #f0c97c;
  background: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}

.batch-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.batch-action.primary {
  background: #ff9f2e;
  color: #fff;
  border-color: #ff9f2e;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.task-card {
  display: grid;
  gap: 12px;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.task-status {
  background: #ffe7c2;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.task-uploads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.task-slot {
  background: #fffdf8;
  border: 1px dashed #f0c97c;
  border-radius: 10px;
  height: 78px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #f0a94c;
  position: relative;
  cursor: pointer;
}

.task-input {
  display: none;
}

.task-preview {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
}

.task-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.task-prompt {
  border: 1px solid #f0c97c;
  border-radius: 10px;
  padding: 10px;
  height: 98px;
  resize: none;
  background: #fff;
  font-size: 14px;
  width: 100%;
  margin-top: 6px;
}

.task-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.task-body {
  display: grid;
  gap: 8px;
}

.task-result {
  background: #fff8eb;
  border: 1px solid #f0d7a8;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 6px;
  min-height: 140px;
}

.task-result-image {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  cursor: zoom-in;
  max-height: 140px;
}

.task-result-text {
  font-size: 13px;
  color: #6c5430;
}

.preview-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  z-index: 999;
  padding: 24px;
}

.preview-card {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.preview-image {
  max-width: 88vw;
  max-height: 84vh;
  display: block;
  border-radius: 12px;
}

.preview-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}

.history-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  z-index: 998;
  padding: 24px;
}

.history-panel {
  width: min(960px, 92vw);
  max-height: 86vh;
  background: #fff8eb;
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 12px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-header h3 {
  font-size: 16px;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}

.history-empty {
  text-align: center;
  color: #8b7447;
  padding: 20px 0;
}

.history-list {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.history-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #f0d7a8;
}

.history-thumb {
  width: 140px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  background: #fff7e6;
  display: grid;
  place-items: center;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-info {
  display: grid;
  gap: 6px;
}

.history-title {
  font-weight: 600;
}

.history-time {
  font-size: 12px;
  color: #8b7447;
}

.history-prompt {
  font-size: 12px;
  color: #6c5430;
  line-height: 1.4;
  max-height: 40px;
  overflow: hidden;
}

.history-ops {
  display: flex;
  gap: 8px;
}

.history-btn {
  border: 1px solid #f0c97c;
  background: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

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

@media (max-width: 768px) {
  .history-item {
    grid-template-columns: 1fr;
  }
  .history-thumb {
    width: 100%;
    height: 160px;
  }
}

.task-footer {
  display: flex;
  gap: 8px;
}

.task-footer select {
  flex: 1;
  border: 1px solid #f0c97c;
  border-radius: 8px;
  padding: 7px 8px;
  background: #fff;
  font-size: 13px;
}

.task-buttons {
  display: flex;
  gap: 8px;
}

.task-btn {
  flex: 1;
  border: 1px solid #f0c97c;
  background: #fff;
  border-radius: 10px;
  padding: 9px;
  cursor: pointer;
  font-size: 13px;
}

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

.task-btn.primary {
  background: #ff9f2e;
  color: #fff;
  border-color: #ff9f2e;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .task-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    gap: 10px;
  }
  .task-grid {
    grid-template-columns: 1fr;
  }
}
