:root {
  color-scheme: dark;
  --bg: #11131a;
  --panel: #191d27;
  --panel-soft: #202635;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f0e7;
  --muted: #b8bdc9;
  --gold: #d9b56d;
  --cyan: #7bd4e8;
  --rose: #e89aa8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(123, 212, 232, 0.18), transparent 28rem),
    radial-gradient(circle at 85% 8%, rgba(217, 181, 109, 0.16), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 24px;
}

.input-panel,
.result-panel {
  border: 1px solid var(--line);
  background: rgba(25, 29, 39, 0.86);
  backdrop-filter: blur(16px);
  border-radius: 8px;
}

.input-panel {
  position: sticky;
  top: 28px;
  align-self: start;
  padding: 24px;
}

.result-panel {
  padding: 24px;
}

.brand {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.16;
  margin-bottom: 12px;
}

h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.intro,
#statusText,
.notice {
  color: var(--muted);
  line-height: 1.65;
}

.birth-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1219;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

input:focus {
  border-color: var(--cyan);
}

.grid {
  display: grid;
  gap: 12px;
}

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

.three {
  grid-template-columns: 1fr 1fr 1.35fr;
}

.actions,
.result-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.result-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

button {
  border: 0;
  border-radius: 6px;
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
  color: #12141a;
  font-weight: 700;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary {
  background: var(--gold);
}

.secondary {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(320px, 54%) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

#chartCanvas {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1118;
}

.summary {
  display: grid;
  gap: 18px;
}

.big-three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.big-three div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px;
  background: var(--panel-soft);
}

.big-three span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.big-three strong {
  font-size: 18px;
}

.interpretation {
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
}

.tables {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
}

th {
  color: var(--gold);
  font-size: 13px;
  background: var(--panel-soft);
}

td {
  color: var(--muted);
  font-size: 14px;
}

.notice {
  margin: 22px 0 0;
  font-size: 13px;
}

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

  .input-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 14px;
  }

  .input-panel,
  .result-panel {
    padding: 18px;
  }

  .two,
  .three,
  .big-three {
    grid-template-columns: 1fr;
  }

  .actions,
  .result-head {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}

