:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #5d6877;
  --line: #d8e0ea;
  --paper: #ffffff;
  --panel: rgba(255, 255, 255, 0.88);
  --red: #dd4b39;
  --red-dark: #a9342a;
  --green: #0f7661;
  --blue: #245f9f;
  --gold: #c58a16;
  --shadow: 0 22px 54px rgba(26, 32, 44, 0.14);
  font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(239, 244, 249, 0.92)),
    linear-gradient(135deg, rgba(36, 95, 159, 0.1), rgba(15, 118, 97, 0.08)),
    #eef3f7;
}

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

button {
  cursor: pointer;
}

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

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.intro {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
  min-width: 280px;
}

.summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(26, 32, 44, 0.06);
}

.summary strong,
.summary span {
  display: block;
}

.summary strong {
  font-size: 22px;
}

.summary span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(340px, 0.92fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 24px;
}

.wheel-panel,
.control-panel,
.discussion-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.wheel-panel {
  padding: 26px;
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 640px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 18px 34px rgba(24, 32, 42, 0.24));
}

.pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 36px solid #121821;
  filter: drop-shadow(0 6px 8px rgba(24, 32, 42, 0.2));
}

.spin-button {
  position: absolute;
  width: 112px;
  height: 112px;
  border: 6px solid #121821;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 14px 28px rgba(169, 52, 42, 0.28);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.spin-button:hover:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.spin-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.result-card {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(36, 95, 159, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 246, 252, 0.96));
  box-shadow: 0 16px 34px rgba(24, 32, 42, 0.1);
  transform-origin: center;
}

.result-card.is-bouncing {
  animation: result-bounce 680ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.result-label,
.result-question span {
  color: var(--muted);
  font-size: 14px;
}

.result-card strong {
  display: block;
  color: var(--ink);
  font-size: clamp(26px, 5vw, 44px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.result-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.result-question[hidden] {
  display: none;
}

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

.danger-action,
.quiet-action {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 800;
}

.danger-action {
  color: #fff;
  border-color: var(--red-dark);
  background: var(--red-dark);
}

.quiet-action {
  color: var(--ink);
  background: #fff;
}

@keyframes result-bounce {
  0% {
    transform: translateY(0) scale(1);
  }

  35% {
    transform: translateY(-10px) scale(1.025);
  }

  68% {
    transform: translateY(2px) scale(0.992);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

.control-panel {
  overflow: hidden;
}

.control-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.control-section:last-child {
  border-bottom: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
select,
textarea {
  min-width: 0;
  border: 1px solid #c8ced8;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 104, 168, 0.18);
}

.inline-form button,
.secondary {
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.inline-form button:hover,
.secondary:hover,
.danger-action:hover,
.quiet-action:hover {
  transform: translateY(-1px);
}

.danger-form button {
  border-color: var(--red-dark);
  background: var(--red-dark);
}

.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}

.status,
.empty {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.status[data-tone="success"] {
  color: var(--green);
  font-weight: 800;
}

.status[data-tone="warn"] {
  color: var(--red-dark);
  font-weight: 800;
}

.empty {
  color: var(--red-dark);
  font-weight: 800;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.control-section .chips {
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 32px;
  border: 1px solid rgba(31, 37, 45, 0.14);
  border-left: 7px solid var(--chip-color, var(--blue));
  border-radius: 8px;
  padding: 5px 9px 5px 7px;
  background: #fff;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 18px rgba(24, 32, 42, 0.05);
}

.chip button {
  width: 24px;
  height: 24px;
  margin-left: 6px;
  border: 0;
  border-radius: 50%;
  color: var(--red-dark);
  background: rgba(223, 77, 54, 0.1);
  font-weight: 900;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.discussion-panel {
  padding: 22px;
}

.discussion-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.discussion-heading h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.discussion-intro {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.discussion-heading select {
  min-width: 136px;
}

.discussion-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(160px, 1fr) 120px;
  gap: 10px;
  align-items: start;
}

.discussion-form textarea {
  grid-column: 1 / 3;
}

.discussion-submit {
  min-height: 92px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 850;
  transition: transform 150ms ease, background 150ms ease;
}

.discussion-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #1e4f86;
}

.discussion-submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.discussion-status,
.discussion-empty {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.discussion-status[data-tone="success"] {
  color: var(--green);
  font-weight: 800;
}

.discussion-status[data-tone="warn"] {
  color: var(--red-dark);
  font-weight: 800;
}

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

.discussion-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(24, 32, 42, 0.1);
  border-left: 6px solid var(--green);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
}

.discussion-card.is-avoid {
  border-left-color: var(--red-dark);
}

.discussion-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.discussion-card strong {
  overflow-wrap: anywhere;
}

.discussion-card span {
  color: var(--muted);
  font-size: 13px;
}

.discussion-card p {
  margin: 0;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.discussion-type {
  flex: 0 0 auto;
  min-width: 44px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff !important;
  background: var(--green);
  text-align: center;
  font-weight: 850;
}

.discussion-card.is-avoid .discussion-type {
  background: var(--red-dark);
}

@media (max-width: 900px) {
  .app-header {
    display: block;
  }

  .summary {
    margin-top: 16px;
    min-width: 0;
    max-width: 520px;
  }

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

  .discussion-heading {
    display: grid;
  }

  .discussion-form,
  .discussion-list {
    grid-template-columns: 1fr;
  }

  .discussion-form textarea {
    grid-column: auto;
  }

  .discussion-submit {
    min-height: 46px;
  }
}

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

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

  .wheel-panel {
    padding: 12px;
  }

  .spin-button {
    width: 92px;
    height: 92px;
    font-size: 20px;
  }

  .result-card,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .result-question {
    display: grid;
  }
}
