:root {
  --paper: #f5f1e9;
  --paper-deep: #e8e2d7;
  --ink: #24211d;
  --muted: #787064;
  --line: rgba(36, 33, 29, 0.1);
  --accent: #b88a55;
  --accent-dark: #7b5630;
  --white: #fffdf8;
  --shadow-dark: rgba(125, 108, 84, 0.24);
  --shadow-light: rgba(255, 255, 255, 0.9);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.95), transparent 28rem),
    radial-gradient(circle at 80% 18%, rgba(210, 184, 146, 0.34), transparent 24rem),
    linear-gradient(135deg, #fbf8f1 0%, var(--paper) 52%, #ece5d9 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(36, 33, 29, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(36, 33, 29, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 75%);
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.58);
  box-shadow: 18px 18px 42px var(--shadow-dark), -18px -18px 42px var(--shadow-light), inset 1px 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 28px;
  align-items: end;
  padding: 36px;
  overflow: hidden;
}

.hero h1 {
  max-width: 760px;
  margin: 8px 0 14px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.8;
}

.hero-card {
  position: relative;
  min-height: 190px;
  padding: 26px;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(231, 222, 207, 0.74));
  box-shadow: inset 10px 10px 24px rgba(156, 137, 111, 0.2), inset -10px -10px 24px rgba(255, 255, 255, 0.86);
}

.hero-card::after {
  content: "♪";
  position: absolute;
  right: 22px;
  bottom: 0;
  color: rgba(184, 138, 85, 0.28);
  font-size: 8rem;
  line-height: 1;
}

.hero-card span,
.hero-card small {
  display: block;
  color: var(--muted);
}

.hero-card strong {
  display: block;
  margin: 22px 0 10px;
  font-size: 2rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  margin-top: 24px;
}

.controls,
.guide,
.status-panel {
  padding: 28px;
}

.field-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.15fr 1.2fr;
  gap: 16px;
}

label {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

select,
input,
textarea,
button {
  font: inherit;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 6px 6px 14px rgba(156, 137, 111, 0.16), inset -6px -6px 14px rgba(255, 255, 255, 0.82);
  outline: none;
}

select,
input {
  height: 50px;
  padding: 0 16px;
}

input[type="range"] {
  accent-color: var(--accent);
  padding: 0;
}

textarea {
  min-height: 360px;
  margin-top: 18px;
  padding: 20px;
  resize: vertical;
  line-height: 1.75;
  font-family: Consolas, "Microsoft YaHei", monospace;
}

.textarea-label.compact textarea {
  min-height: 150px;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(184, 138, 85, 0.55);
  box-shadow: 0 0 0 4px rgba(184, 138, 85, 0.13), inset 6px 6px 14px rgba(156, 137, 111, 0.16), inset -6px -6px 14px rgba(255, 255, 255, 0.82);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(145deg, #fffaf0, #e7dfd2);
  box-shadow: 8px 8px 18px rgba(125, 108, 84, 0.22), -8px -8px 18px rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
  box-shadow: inset 5px 5px 12px rgba(125, 108, 84, 0.2), inset -5px -5px 12px rgba(255, 255, 255, 0.78);
}

button.primary {
  color: #fffaf0;
  background: linear-gradient(145deg, #c99b62, #8e6135);
}

button:disabled {
  color: #aaa197;
  cursor: wait;
  transform: none;
}

.guide h2 {
  margin: 0 0 18px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 2rem;
}

.rule-grid {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px 12px;
  align-items: center;
}

.rule-grid span {
  color: var(--muted);
  font-weight: 700;
}

code {
  padding: 3px 7px;
  border-radius: 9px;
  color: var(--accent-dark);
  background: rgba(184, 138, 85, 0.12);
}

.hint {
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.status-panel {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: center;
  margin-top: 24px;
}

.status-panel strong,
.status-panel span {
  display: block;
}

.status-panel span {
  margin-top: 4px;
  color: var(--muted);
}

.progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 33, 29, 0.08);
  box-shadow: inset 4px 4px 10px rgba(125, 108, 84, 0.18), inset -4px -4px 10px rgba(255, 255, 255, 0.72);
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  margin: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #d0a065, #8f6235);
  transition: width 180ms linear;
}

@media (max-width: 900px) {
  .hero,
  .workspace,
  .status-panel {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-height: 150px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1160px);
    padding: 18px 0;
  }

  .hero,
  .controls,
  .guide,
  .status-panel {
    padding: 20px;
    border-radius: 24px;
  }

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

  .actions button {
    width: 100%;
  }
}
