:root {
  color-scheme: light;
  --ink: #1f252d;
  --muted: #64707f;
  --line: #d8dee6;
  --paper: #fffdf8;
  --panel: rgba(255, 255, 255, 0.84);
  --red: #df4d36;
  --red-dark: #bd3724;
  --green: #137a5b;
  --blue: #2f68a8;
  --yellow: #f4c95d;
  font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 14%, rgba(244, 201, 93, 0.28), transparent 30%),
    linear-gradient(135deg, rgba(47, 104, 168, 0.12), transparent 38%),
    #f4f0e7;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.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;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  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: 10px;
  background: var(--panel);
}

.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;
}

.wheel-panel,
.control-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(38, 36, 31, 0.12);
}

.wheel-panel {
  padding: 24px;
}

.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 16px 30px rgba(31, 37, 45, 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 var(--ink);
}

.spin-button {
  position: absolute;
  width: 112px;
  height: 112px;
  border: 6px solid var(--ink);
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 10px 20px rgba(189, 55, 36, 0.3);
}

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

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

.result-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.result-strip span {
  color: var(--muted);
}

.result-strip strong {
  font-size: clamp(22px, 4vw, 34px);
  text-align: right;
}

.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 {
  min-width: 0;
  height: 44px;
  border: 1px solid #c8ced8;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input: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;
}

.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;
}

.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;
}

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

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

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

@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-strip,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .result-strip {
    display: grid;
  }

  .result-strip strong {
    text-align: left;
  }
}
