:root {
  --color-paper: #f4f1e8;
  --color-paper-deep: #ece7d9;
  --color-ink: #1c1b18;
  --color-ink-soft: #6b665b;
  --color-line: #d9d3c3;
  --color-accent: #d8442a;
  --color-accent-deep: #b0331d;
  --color-mark: #e0a92e;
  --font-display: Inter, Noto Sans TC, sans-serif;
  --font-body: Inter, Noto Sans TC, sans-serif;
  --font-mono: Inter, Noto Sans TC, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tool-intro {
  max-width: 64ch;
  margin-block: 24px 40px;
  color: #6b665b;
}

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

.editor-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-toolbar-label {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: #6b665b;
  font-variant-numeric: tabular-nums;
}

.editor-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-area {
  width: 100%;
  min-height: 420px;
  padding: 24px;
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  color: #1c1b18;
  background: #f4f1e8;
  border: 1.5px solid #1c1b18;
  border-radius: 2px;
  box-shadow: 6px 6px 0 rgba(28, 27, 24, 0.12);
  resize: vertical;
  transition: border-color 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.text-area::placeholder {
  color: #6b665b;
}
.text-area:focus {
  outline: none;
  border-color: #d8442a;
}

.copy-hint {
  min-height: 1.4em;
  margin: 0;
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  color: #d8442a;
}

.pangu-pane {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #ece7d9;
  border: 1px solid #d9d3c3;
  border-radius: 2px;
}
.pangu-pane .section-rule {
  margin-top: 0;
}

.pangu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.pangu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: #f4f1e8;
  border: 1px solid #d9d3c3;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.pangu-btn:hover {
  border-color: #d8442a;
  transform: translateY(-2px);
}
.pangu-btn:active {
  transform: translateY(0);
}
.pangu-btn:focus-visible {
  outline: 2px solid #d8442a;
  outline-offset: 2px;
}

.pangu-btn-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1.25rem;
  line-height: 1;
  color: #1c1b18;
  height: 2rem;
}

.pangu-btn:not(.is-remove) .demo-gap {
  display: inline-block;
  width: 6px;
  height: 1.2em;
  margin: 0 2px;
  background: #d8442a;
  border-radius: 1px;
  opacity: 0.35;
  vertical-align: middle;
  flex-shrink: 0;
}

.pangu-btn.is-remove .pangu-btn-demo {
  position: relative;
}
.pangu-btn.is-remove .pangu-btn-demo::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 100%;
  background: #d8442a;
  opacity: 0.3;
}

.pangu-btn-label {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  color: #1c1b18;
  line-height: 1.3;
}

.pangu-btn-sub {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: #6b665b;
}

.pangu-stat {
  margin: 8px 0 16px;
  padding: 8px 16px;
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: #6b665b;
  background: #f4f1e8;
  border: 1px solid #d9d3c3;
  border-radius: 2px;
  line-height: 1.5;
}
.pangu-stat[data-type=added] {
  color: #d8442a;
  border-color: #d8442a;
}
.pangu-stat[data-type=removed] {
  border-color: #e0a92e;
}
.pangu-stat[data-type=none] {
  color: #6b665b;
}

.pangu-note {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #6b665b;
}
.pangu-note p {
  margin: 0 0 8px;
}
.pangu-note ul {
  margin: 0 0 8px 16px;
  padding: 0;
}
.pangu-note ul li {
  list-style: disc;
  margin-bottom: 2px;
}

.pangu-note-hint {
  color: #6b665b;
  opacity: 0.75;
}

@media (max-width: 860px) {
  .pangu-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .pangu-pane {
    position: static;
  }
  .text-area {
    min-height: 320px;
  }
}
