/* 全局基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, #1e293b 0, #020617 40%, #000 100%);
  color: #e5e7eb;
}

/* 容器：居中 + 玻璃拟态卡片 */
.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 18px 20px 22px;
  background: rgba(15, 23, 42, 0.92);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
}

/* 顶部导航 */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.9);
}

/* 左侧 LOGO 文案 */
.logo {
  position: relative;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #e5e7eb;
  padding-left: 40px;
}

.logo::before {
  content: "N";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 12px;
  background: conic-gradient(from 150deg, #22d3ee, #6366f1, #a855f7, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #020617;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.8);
}

/* 顶部中间标题 */
.title-center {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9ca3af;
}

/* 顶部右侧 - 任务进度看板按钮感 */
.title-right {
  font-size: 13px;
  color: #e5e7eb;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background:
    radial-gradient(circle at top, rgba(148, 163, 184, 0.18), transparent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease-out;
  position: relative;
  overflow: hidden;
}

.title-right::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle, #22c55e 0, #16a34a 45%, transparent 100%);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
}

.title-right:hover {
  border-color: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.65);
}

/* 主体布局 */
.main {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1.2fr) minmax(260px, 290px);
  gap: 18px;
}

@media (max-width: 1100px) {
  .main {
    grid-template-columns: 1fr;
  }
}

/* 三个面板公共样式：卡片 + 渐变 */
.left-panel,
.mid-panel,
.right-panel {
  position: relative;
  padding: 14px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.5), rgba(15, 23, 42, 0.98));
  overflow: hidden;
}

.left-panel::before,
.mid-panel::before,
.right-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(circle at bottom right, rgba(147, 51, 234, 0.25), transparent 60%);
  opacity: 0.8;
  mix-blend-mode: screen;
  pointer-events: none;
}

.left-panel > *,
.mid-panel > *,
.right-panel > * {
  position: relative;
  z-index: 1;
}

/* 面板标题 */
.left-panel h2,
.mid-panel h2,
.right-panel h2 {
  font-size: 15px;
  color: #cbd5f5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* 表单样式 */
label {
  display: block;
  margin: 8px 0 4px;
  font-size: 13px;
  color: #e5e7eb;
}

textarea,
select,
input[type="number"],
input[type="text"],
input[type="file"] {
  width: 100%;
  font-size: 13px;
  border-radius: 9px;
  border: 1px solid rgba(75, 85, 99, 0.9);
  background: radial-gradient(circle at top left, #020617, #020617);
  color: #e5e7eb;
  padding: 8px 10px;
  outline: none;
  transition: all 0.18s ease-out;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

textarea::placeholder,
input::placeholder {
  color: #6b7280;
  font-size: 12px;
}

textarea:focus,
select:focus,
input[type="number"]:focus,
input[type="text"]:focus,
input[type="file"]:focus {
  border-color: #38bdf8;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.9),
    0 0 16px rgba(37, 99, 235, 0.7);
}

select {
  cursor: pointer;
}

/* file input 简单优化 */
input[type="file"] {
  padding: 6px 10px;
  font-size: 12px;
}

/* 左侧提示区 */
#uploadStatus {
  font-size: 11px;
  color: #9ca3af;
}

/* 按钮 - 科技感 */
.btn {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #020617;
  background: radial-gradient(circle at top left, #22c55e, #16a34a);
  box-shadow:
    0 0 24px rgba(34, 197, 94, 0.9),
    0 10px 20px rgba(15, 23, 42, 0.85);
  transition: all 0.2s ease-out;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 30px rgba(45, 212, 191, 0.95),
    0 12px 22px rgba(15, 23, 42, 0.96);
  filter: brightness(1.03);
}

.btn:active {
  transform: translateY(0);
  box-shadow:
    0 0 18px rgba(34, 197, 94, 0.7),
    0 6px 14px rgba(15, 23, 42, 0.9);
}

/* 右侧下载按钮（二级按钮，深色描边） */
.result-download {
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.8);
  box-shadow: none;
  font-size: 12px;
  padding: 7px 12px;
}

.result-download:hover {
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.75);
  border-color: #60a5fa;
}

/* 加载状态 */
.btn.btn-loading {
  position: relative;
  color: #0f172a;
  background: radial-gradient(circle at top left, #4ade80, #22c55e);
  box-shadow:
    0 0 20px rgba(74, 222, 128, 0.85),
    0 8px 18px rgba(15, 23, 42, 0.9);
}

.btn.btn-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.2);
  border-top-color: rgba(15, 23, 42, 0.95);
  position: absolute;
  right: 14px;
  animation: spin 0.7s linear infinite;
}

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

/* 中间预览区域 */
.preview-grid {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), #020617);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.preview-grid::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), transparent 55%),
    radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.22), transparent 55%);
  opacity: 0.8;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.preview-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.85);
  box-shadow:
    0 0 16px rgba(15, 23, 42, 0.9),
    0 0 30px rgba(56, 189, 248, 0.7);
  object-fit: contain;
}

.no-preview {
  font-size: 13px;
  color: #6b7280;
}

/* 右侧生成结果列表 */
.result-list {
  margin-top: 10px;
  font-size: 13px;
}

.results-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.result-item {
  padding: 8px 8px 10px;
  border-radius: 12px;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(55, 65, 81, 0.95);
}

.result-item p {
  font-size: 12px;
  margin-bottom: 4px;
  color: #9ca3af;
}

.result-thumb {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.85);
  box-shadow:
    0 0 12px rgba(15, 23, 42, 0.9),
    0 0 18px rgba(96, 165, 250, 0.7);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}

.result-thumb:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 18px rgba(15, 23, 42, 0.9),
    0 0 26px rgba(129, 140, 248, 0.85);
}

/* 错误提示 */
.error {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.9);
  background: rgba(127, 29, 29, 0.85);
  color: #fee2e2;
  font-size: 12px;
}

/* 右侧文字信息 */
.right-panel p {
  font-size: 13px;
  margin-bottom: 6px;
  color: #e5e7eb;
}

/* 响应式调整：小屏幕下卡片之间留点空 */
@media (max-width: 768px) {
  .container {
    margin: 12px;
    padding: 12px 12px 16px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .logo {
    padding-left: 34px;
    font-size: 20px;
  }

  .title-center {
    align-self: center;
  }

  .title-right {
    align-self: flex-end;
  }
}
/* ========== 历史记录面板 ========== */
.history-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.history-panel.hidden {
  display: none;
}

.history-panel-content {
  width: min(1080px, 92vw);
  max-height: 82vh;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(15, 23, 42, 0.85);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
}

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.history-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cbd5f5;
}

.history-subtitle {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #9ca3af;
}

.history-close-btn {
  border: none;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
  color: #e5e7eb;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 16px;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease-out;
}

.history-close-btn:hover {
  border-color: #f97316;
  color: #fed7aa;
  box-shadow: 0 0 16px rgba(248, 171, 85, 0.75);
}

.history-empty {
  font-size: 13px;
  color: #9ca3af;
  padding: 10px 2px;
}

.history-list {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(51, 65, 85, 0.9);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  overflow-y: auto;
}

.history-item {
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.95);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.99));
  padding: 8px 8px 10px;
  font-size: 12px;
  color: #9ca3af;
}

.history-item-title {
  font-size: 12px;
  margin-bottom: 4px;
  color: #e5e7eb;
}

.history-item-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #6b7280;
}

.history-thumb {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  cursor: pointer;
  box-shadow:
    0 0 12px rgba(15, 23, 42, 0.9),
    0 0 20px rgba(96, 165, 250, 0.75);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}

.history-thumb:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 18px rgba(15, 23, 42, 0.95),
    0 0 28px rgba(129, 140, 248, 0.9);
}

/* 让“任务进度看板”变成可点击手型 */
.title-right {
  cursor: pointer;
}
