:root {
  --bg-0: #f4f1eb;
  --bg-1: #efe8dc;
  --bg-2: #dbe6dd;
  --ink-1: #1f2625;
  --ink-2: #4d5a57;
  --line: rgba(36, 46, 44, 0.12);
  --card: rgba(255, 255, 255, 0.74);
  --brand: #0f7b73;
  --brand-2: #f08a34;
  --danger: #af2f24;
  --shadow: 0 18px 48px rgba(37, 51, 47, 0.16);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink-1);
  font-family: 'Manrope', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: radial-gradient(circle at 8% 12%, #f6d6a4 0%, transparent 32%),
    radial-gradient(circle at 88% 18%, #b0dfda 0%, transparent 30%),
    linear-gradient(130deg, var(--bg-0), var(--bg-1) 52%, var(--bg-2));
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.18;
}

.page {
  position: relative;
  width: min(1600px, 96vw);
  margin: 24px auto 32px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.85), rgba(245, 248, 247, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
}

.hero h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
}

.sub {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 720px;
}

.hero-right {
  display: grid;
  grid-template-columns: repeat(2, minmax(128px, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid rgba(18, 44, 39, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: rgba(244, 252, 251, 0.9);
  min-width: 132px;
}

.metric span {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
}

.metric label {
  font-size: 12px;
  color: var(--ink-2);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}

.search-box input {
  width: min(520px, 90vw);
  height: 44px;
  border: 1px solid rgba(25, 40, 37, 0.18);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-1);
  font-size: 14px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 123, 115, 0.14);
}

.ghost-btn {
  height: 40px;
  border: 1px solid rgba(17, 40, 38, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-1);
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

.ghost-btn:hover {
  border-color: var(--brand);
}

.table-wrap {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  overflow: auto;
}

.prompt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1200px;
}

.prompt-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  text-align: left;
  padding: 14px;
  background: rgba(236, 248, 246, 0.92);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.prompt-table td {
  vertical-align: top;
  padding: 14px;
  border-bottom: 1px solid rgba(28, 39, 37, 0.08);
  animation: rowIn 240ms ease both;
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prompt-col {
  width: 42%;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.prompt-id {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;
  font-size: 12px;
  color: var(--brand);
  background: rgba(15, 123, 115, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
}

.prompt-title {
  font-size: 14px;
  font-weight: 700;
}

.prompt-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(22, 112, 69, 0.14);
  color: #0f6c45;
}

.prompt-status.pending {
  background: rgba(175, 47, 36, 0.12);
  color: var(--danger);
}

.prompt-text {
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.56;
  font-size: 13px;
  color: #2b3936;
}

.image-box {
  min-height: 160px;
  width: 250px;
  border: 1px dashed rgba(29, 49, 45, 0.24);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #5e6f6b;
  font-size: 13px;
  text-align: center;
  background: rgba(251, 255, 254, 0.8);
  overflow: hidden;
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.action-col {
  width: 160px;
}

.gen-btn {
  height: 42px;
  width: 120px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), #136e90);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  box-shadow: 0 8px 20px rgba(15, 123, 115, 0.24);
}

.gen-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.gen-btn:focus-visible,
.ghost-btn:focus-visible {
  outline: 2px solid #101010;
  outline-offset: 2px;
}

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

.hint {
  margin: 8px 0 4px;
  font-size: 12px;
  color: var(--ink-2);
}

.log {
  margin: 0;
  min-height: 30px;
  font-size: 12px;
  color: #20312f;
  line-height: 1.4;
}

.log.error {
  color: var(--danger);
}

@media (max-width: 980px) {
  .page {
    width: min(98vw, 1200px);
    margin-top: 12px;
  }

  .hero {
    flex-direction: column;
  }

  .hero-right {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box input,
  .ghost-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
