:root {
  --bg: #f4efe8;
  --bg-deep: #efe3d1;
  --panel: rgba(255, 251, 246, 0.82);
  --panel-solid: rgba(255, 250, 244, 0.96);
  --line: rgba(93, 61, 28, 0.1);
  --text: #1f1a16;
  --muted: #726456;
  --accent: #0b7a75;
  --accent-strong: #055b57;
  --warm: #c76d2b;
  --danger: #bf3d2c;
  --shadow: 0 24px 70px rgba(78, 57, 33, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(11, 122, 117, 0.16), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(199, 109, 43, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

.page-bg {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.42;
  pointer-events: none;
}

.page-bg-a {
  width: 320px;
  height: 320px;
  top: 48px;
  left: 32px;
  background: rgba(11, 122, 117, 0.18);
}

.page-bg-b {
  width: 360px;
  height: 360px;
  right: 20px;
  bottom: 40px;
  background: rgba(199, 109, 43, 0.16);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warm);
  font-weight: 700;
}

.hero h1,
.panel-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.96;
}

.panel-head h2 {
  font-size: 1.5rem;
  line-height: 1.05;
}

.hero-copy {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.72);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.92rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  padding: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.82);
  border: 1px solid rgba(11, 122, 117, 0.14);
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field small {
  color: var(--muted);
  line-height: 1.6;
}

.field-full {
  grid-column: 1 / -1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(93, 61, 28, 0.14);
  background: var(--panel-solid);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.picker-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 250, 244, 0.78);
  border: 1px solid rgba(93, 61, 28, 0.08);
}

.picker-control {
  position: static;
  width: 100%;
  min-width: 0;
}

.date-range-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.date-range-inputs > * {
  min-width: 0;
}

.picker-caption {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
  font-weight: 700;
}

.range-separator {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.picker-display {
  display: none;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(93, 61, 28, 0.14);
  background: var(--panel-solid);
  overflow: hidden;
}

.picker-display-value {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
  font-size: 16px;
  color: var(--text);
}

.picker-input-overlay {
  position: static;
  width: 100%;
  height: auto;
  margin: 0;
  min-height: 56px;
  padding: 14px 16px;
  opacity: 1;
  appearance: auto;
  -webkit-appearance: auto;
  border: 1px solid rgba(93, 61, 28, 0.14);
  border-radius: 14px;
  background: var(--panel-solid);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.2;
  color-scheme: light;
  cursor: pointer;
}

.picker-input-overlay::-webkit-calendar-picker-indicator {
  opacity: 0.82;
  cursor: pointer;
}

.picker-input-overlay::-webkit-datetime-edit {
  cursor: pointer;
}

.picker-input-overlay:focus,
.picker-control:focus-within .picker-display,
input:focus,
textarea:focus {
  border-color: rgba(11, 122, 117, 0.38);
  box-shadow: 0 0 0 4px rgba(11, 122, 117, 0.11);
  transform: translateY(-1px);
}

textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.7;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.download-link {
  appearance: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 18px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 16px 30px rgba(11, 122, 117, 0.24);
}

.ghost-btn {
  background: rgba(255, 250, 244, 0.84);
  color: var(--accent-strong);
  border: 1px solid rgba(11, 122, 117, 0.16);
  box-shadow: none;
}

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

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

.form-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(93, 61, 28, 0.14);
  background: var(--panel-solid);
}

.file-name {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.status-panel {
  position: sticky;
  top: 24px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
}

.status-badge.idle {
  background: rgba(114, 100, 86, 0.12);
  color: var(--muted);
}

.status-badge.queued,
.status-badge.running {
  background: rgba(11, 122, 117, 0.14);
  color: var(--accent-strong);
}

.status-badge.succeeded {
  background: rgba(11, 122, 117, 0.18);
  color: var(--accent-strong);
}

.status-badge.failed {
  background: rgba(191, 61, 44, 0.12);
  color: var(--danger);
}

.status-block {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.status-row span {
  color: var(--muted);
}

.status-row strong {
  text-align: right;
}

.timeline {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(11, 122, 117, 0.06);
  border: 1px solid rgba(11, 122, 117, 0.12);
}

.timeline-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.timeline-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.error-text {
  margin: 12px 0 0;
  color: var(--danger);
  line-height: 1.75;
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

.download-box {
  margin-top: 16px;
}

.download-link {
  width: 100%;
  background: linear-gradient(135deg, #c76d2b, #9d4815);
  color: #fff;
  box-shadow: 0 16px 30px rgba(157, 72, 21, 0.24);
}

.history-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 250, 244, 0.78);
  border: 1px solid var(--line);
}

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.history-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(11, 122, 117, 0.1);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.history-empty {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.history-item {
  padding: 14px;
  border-radius: 18px;
  background: var(--panel-solid);
  border: 1px solid rgba(93, 61, 28, 0.1);
}

.history-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-item-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
  word-break: break-all;
}

.history-item-meta {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.history-item-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-item-meta-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

.history-item-meta-row strong {
  text-align: right;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.history-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.history-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(11, 122, 117, 0.1);
  border: 1px solid rgba(11, 122, 117, 0.14);
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.history-download.disabled {
  pointer-events: none;
  background: rgba(114, 100, 86, 0.08);
  border-color: rgba(93, 61, 28, 0.08);
  color: var(--muted);
}

.notes {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 250, 244, 0.72);
  border: 1px solid var(--line);
}

.notes ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.75;
}

.notes li + li {
  margin-top: 8px;
}

@media (max-width: 980px) {
  .hero-copy {
    max-width: 100%;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .status-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .shell {
    padding: 18px 14px 34px;
  }

  .page-bg-a {
    width: 220px;
    height: 220px;
    top: 20px;
    left: -24px;
  }

  .page-bg-b {
    width: 240px;
    height: 240px;
    right: -36px;
    bottom: 120px;
  }

  .hero {
    margin-bottom: 18px;
  }

  .hero h1 {
    font-size: 2.15rem;
    line-height: 0.98;
  }

  .hero-copy {
    margin-top: 12px;
    font-size: 0.96rem;
    line-height: 1.62;
  }

  .hero-tags {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
  }

  .hero-tags span {
    width: auto;
    min-height: 42px;
    justify-content: flex-start;
    padding: 10px 12px;
    font-size: 0.84rem;
  }

  .panel {
    padding: 16px;
    border-radius: 22px;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
  }

  .panel-head h2 {
    font-size: 1.34rem;
  }

  .ghost-link {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .field {
    gap: 7px;
  }

  .field small {
    font-size: 0.87rem;
    line-height: 1.55;
  }

  .date-range-inputs {
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .range-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    text-align: center;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .picker-field {
    width: 100%;
    padding: 10px;
    border-radius: 18px;
  }

  .picker-control {
    position: relative;
    overflow: hidden;
  }

  .picker-display {
    display: flex;
    min-height: 54px;
    padding: 13px 14px;
  }

  .picker-display-value {
    font-size: 15px;
  }

  .picker-input-overlay {
    position: absolute;
    inset: 0;
    height: 100%;
    min-height: 0;
    padding: 0;
    opacity: 0.01;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    border-radius: 0;
    background: transparent;
    color: transparent;
    z-index: 2;
  }

  .picker-caption {
    font-size: 0.74rem;
  }

  textarea {
    min-height: 168px;
  }

  .file-picker {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .ghost-btn {
    width: 100%;
  }

  .file-name {
    padding: 0 2px;
    white-space: normal;
    line-height: 1.45;
  }

  .actions {
    gap: 8px;
  }

  .action-row {
    gap: 10px;
  }

  .primary-btn,
  .download-link {
    width: 100%;
    min-height: 56px;
  }

  .form-message {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .status-panel .panel-head {
    gap: 10px;
  }

  .status-block {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
  }

  .status-row {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding: 14px 12px;
    min-height: 96px;
    border-radius: 18px;
    background: var(--panel-solid);
    border: 1px solid var(--line);
  }

  .status-row strong {
    text-align: left;
    font-size: 0.94rem;
    line-height: 1.45;
    word-break: break-word;
  }

  .timeline,
  .history-box,
  .notes {
    margin-top: 12px;
    padding: 16px;
    border-radius: 18px;
  }

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

  .history-note {
    align-self: flex-start;
  }

  .history-item {
    padding: 13px;
  }

  .history-item-head,
  .history-item-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-item-meta-row strong {
    text-align: left;
  }

  .history-actions {
    flex-direction: column;
  }

  .history-download {
    width: 100%;
    justify-content: center;
  }

  .timeline-copy,
  .error-text,
  .notes ul {
    line-height: 1.62;
  }
}

@media (max-width: 460px) {
  .hero h1 {
    font-size: 1.92rem;
  }

  .hero-tags {
    grid-template-columns: 1fr 1fr;
  }

  .hero-tags span {
    min-height: 40px;
    font-size: 0.8rem;
    padding: 9px 10px;
  }

  .status-block {
    grid-template-columns: 1fr;
  }

  .status-row {
    min-height: auto;
  }
}
