/* input: 前端页面结构、下载交互与视觉设计目标。 */
/* output: 页面布局、配色、组件状态、下载操作区与响应式样式。 */
/* pos: 前端样式层，定义整个工具的视觉语言。 */
/* 一旦我被更新，务必更新我的开头注释，以及所属的文件夹的md。 */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root {
  --bg-ink: #14110f;
  --bg-deep: #1e1915;
  --panel: rgba(255, 248, 239, 0.78);
  --panel-line: rgba(34, 24, 16, 0.08);
  --text-main: #241d18;
  --text-soft: rgba(36, 29, 24, 0.72);
  --accent: #ef5b2a;
  --accent-2: #ffb84d;
  --accent-dark: #1f6d67;
  --shadow: 0 24px 60px rgba(43, 23, 5, 0.16);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 207, 111, 0.32), transparent 32%),
    radial-gradient(circle at 85% 15%, rgba(33, 136, 122, 0.22), transparent 28%),
    linear-gradient(135deg, #fff4e4 0%, #f4ebdf 42%, #ebe3d8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 24, 16, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 24, 16, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 70%);
}

#root {
  min-height: 100vh;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 32px;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(31, 109, 103, 0.96), rgba(19, 50, 69, 0.92)),
    var(--bg-deep);
  color: #fff8ef;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -42px;
  width: 180px;
  height: 180px;
  border-radius: 42px;
  background: linear-gradient(135deg, rgba(255, 184, 77, 0.9), rgba(239, 91, 42, 0.15));
  transform: rotate(14deg);
}

.eyebrow {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: rgba(255, 248, 239, 0.78);
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 760px;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.02;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 16px 0 0;
  color: rgba(255, 248, 239, 0.84);
  font-size: 1rem;
  line-height: 1.8;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 24px;
}

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

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

.panel-head h2 {
  margin: 0;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 1.15rem;
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.field span {
  font-size: 0.95rem;
  color: var(--text-soft);
}

input,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(36, 29, 24, 0.12);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--text-main);
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

input:focus,
textarea:focus {
  border-color: rgba(31, 109, 103, 0.38);
  box-shadow: 0 0 0 4px rgba(31, 109, 103, 0.08);
}

.color-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
}

input[type="color"] {
  width: 100%;
  height: 54px;
  padding: 6px;
  border: 1px solid rgba(36, 29, 24, 0.12);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.92);
  cursor: pointer;
}

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

.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.primary-btn {
  width: 100%;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1d140f;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-weight: 700;
}

.ghost-btn {
  padding: 10px 16px;
  background: rgba(31, 109, 103, 0.08);
  color: var(--accent-dark);
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.primary-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.note {
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

.status-card {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
}

.status-card.error {
  background: rgba(196, 43, 28, 0.08);
  color: #8a2418;
}

.preview-card {
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 244, 228, 0.92));
  border: 1px solid rgba(36, 29, 24, 0.08);
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 24px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 184, 77, 0.2), transparent 40%),
    linear-gradient(180deg, rgba(36, 29, 24, 0.03), rgba(36, 29, 24, 0.06));
}

.preview-stage svg {
  width: min(100%, 280px);
  height: auto;
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.meta-row div {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.92);
}

.meta-row strong,
.meta-row span {
  display: block;
}

.meta-row strong {
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.source-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.action-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.source-row a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 28px;
  border: 1px dashed rgba(36, 29, 24, 0.14);
  border-radius: 24px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.8;
}

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

  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .hero,
  .form-panel,
  .preview-panel {
    border-radius: 24px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 24px;
  }

  .panel-head,
  .source-row {
    flex-direction: column;
    align-items: stretch;
  }

  .action-group {
    justify-content: stretch;
  }

  .action-group .ghost-btn {
    width: 100%;
  }

  .meta-row {
    grid-template-columns: 1fr;
  }

  .color-row {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    min-height: 240px;
  }
}
