:root {
  --bg: #f5efe5;
  --bg-deep: #e7dac5;
  --panel: rgba(255, 251, 244, 0.82);
  --ink: #1d1a16;
  --muted: #786d61;
  --accent: #ae492c;
  --accent-dark: #85361f;
  --secondary: #365b56;
  --line: rgba(29, 26, 22, 0.1);
  --soft: rgba(29, 26, 22, 0.05);
  --warn: #8f2e2e;
  --shadow: 0 22px 50px rgba(71, 48, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hiragino Sans GB", "PingFang SC", "Yu Gothic", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(174, 73, 44, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(54, 91, 86, 0.16), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--bg-deep));
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.84), transparent);
}

.shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.hero,
.panel {
  animation: rise 520ms ease-out;
}

.hero {
  padding: 16px 2px 26px;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif CJK SC", "Hiragino Mincho ProN", serif;
}

h1 {
  max-width: 11em;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.06;
}

h3 {
  font-size: 1.05rem;
}

.intro {
  max-width: 62rem;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.44);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 18px;
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.mode-panel,
.form-panel {
  min-width: 0;
}

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

.section-head p {
  margin: 0;
  color: var(--muted);
}

.mode-list {
  display: grid;
  gap: 16px;
}

.flow-step {
  display: grid;
  gap: 10px;
}

.flow-step-heading {
  padding: 0 2px;
}

.flow-step-heading h3 {
  font-size: 1rem;
}

.flow-step-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.flow-option-list {
  display: grid;
  gap: 10px;
}

.flow-option {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.flow-option:hover,
.flow-option.active {
  transform: translateY(-1px);
  border-color: rgba(174, 73, 44, 0.42);
  background: rgba(174, 73, 44, 0.08);
}

.flow-option span {
  display: block;
}

.flow-option-title {
  font-weight: 700;
}

.flow-option-meta {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

.flow-summary {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(54, 91, 86, 0.08);
  border: 1px solid rgba(54, 91, 86, 0.12);
}

.flow-summary-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--secondary);
  font-size: 0.8rem;
  font-weight: 700;
}

.flow-summary p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
}

.notice-strip,
.notice-box,
.meta {
  border-radius: 18px;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.75;
}

.notice-strip {
  padding: 14px 16px;
  margin-bottom: 18px;
}

.collector-form {
  display: grid;
  gap: 18px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 26px 22px;
  border-radius: 22px;
  border: 1px dashed rgba(29, 26, 22, 0.14);
  background: rgba(255, 255, 255, 0.54);
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.field label,
.card-title {
  font-size: 0.92rem;
  color: var(--muted);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

input[readonly] {
  background: rgba(29, 26, 22, 0.05);
  color: #5c5248;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(174, 73, 44, 0.54);
  box-shadow: 0 0 0 4px rgba(174, 73, 44, 0.12);
  transform: translateY(-1px);
}

.field-help {
  font-size: 0.84rem;
  color: var(--muted);
}

.converter-row,
.action-row,
.summary-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.meta {
  margin-top: 14px;
  padding: 14px 16px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(29, 26, 22, 0.08);
}

.card-title {
  font-size: 0.92rem;
  color: var(--muted);
}

.kana {
  margin: 8px 0 0;
  min-height: 38px;
  font-size: 1.1rem;
  line-height: 1.6;
  word-break: break-word;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fffaf5;
  font-weight: 700;
}

.ghost-button {
  background: rgba(29, 26, 22, 0.06);
  color: var(--ink);
}

.ghost-button.danger {
  color: var(--warn);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.submissions-panel {
  margin-top: 20px;
}

.notice-box {
  padding: 14px 16px;
}

.submission-pre {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(29, 26, 22, 0.05);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.7;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: rgba(29, 26, 22, 0.04);
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 1220px);
    padding-top: 20px;
  }

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

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

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

  .submission-head {
    flex-direction: column;
  }

  h1 {
    max-width: none;
  }
}
