:root {
  color-scheme: light;
  --ink: #302820;
  --muted: #746a5f;
  --line: #cfc1ac;
  --green: #3d514b;
  --paper: #f7f3eb;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button, input, select { font: inherit; }

main {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.glow {
  position: absolute;
  pointer-events: none;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  filter: blur(58px);
  opacity: .55;
}

.glow-left { left: -7rem; top: -5rem; background: #dfcda8; }
.glow-right { right: -6rem; top: 14rem; background: #c5d8d0; }

.shell {
  position: relative;
  width: min(100% - 2rem, 48rem);
  margin: 0 auto;
  padding: 3rem 0 2.5rem;
}

.hero { text-align: center; margin-bottom: 1.75rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .8rem;
  border: 1px solid rgba(185,155,99,.3);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: #7a6341;
  font-size: .75rem;
  letter-spacing: .18em;
  box-shadow: 0 2px 8px rgba(70,55,35,.06);
}

.eyebrow span { width: .4rem; height: .4rem; border-radius: 50%; background: #a27b3f; }

h1, h2, .result-time {
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
}

h1 {
  margin: 1rem 0 .6rem;
  color: #33291f;
  font-size: clamp(2rem, 6vw, 2.6rem);
  letter-spacing: .08em;
}

.hero > p {
  max-width: 38rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: .96rem;
  line-height: 1.9;
}

.card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 1.65rem;
  background: rgba(255,255,255,.8);
  box-shadow: 0 20px 70px rgba(70,55,35,.12);
  backdrop-filter: blur(16px);
}

.card-head {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid rgba(216,200,173,.45);
  background: linear-gradient(90deg,#f4ead7,#edf3ef);
}

.card-head strong { color: #554839; font-size: .9rem; }
.card-head span { color: #8a7d6e; font-size: .75rem; }

form { display: grid; gap: 1.25rem; padding: 1.75rem; }
label { display: block; }
label > span { display: block; margin-bottom: .55rem; color: #51463b; font-size: .88rem; font-weight: 600; }
label small { display: block; margin-top: .45rem; color: #8a775a; }

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

select, input {
  width: 100%;
  min-height: 3.35rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  outline: none;
  color: #322a22;
  background: #fffdf9;
  transition: border-color .2s, box-shadow .2s;
}

select:focus, input:focus { border-color: #9a7540; box-shadow: 0 0 0 4px rgba(198,168,111,.15); }
select:disabled, button:disabled { cursor: not-allowed; opacity: .55; }

.picker-field { position: relative; }

.picker-field input {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-right: 3rem;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.picker-field::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 1rem;
  background: #fffdf9;
  content: "";
}

.picker-placeholder {
  position: absolute;
  top: 50%;
  left: 1rem;
  z-index: 2;
  max-width: calc(100% - 4rem);
  overflow: hidden;
  color: #322a22;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-50%);
  pointer-events: none;
}

.picker-field.has-value .picker-placeholder { display: none; }

.picker-arrow {
  position: absolute;
  top: 50%;
  right: 1.35rem;
  z-index: 2;
  width: .65rem;
  height: .65rem;
  border-right: .18rem solid #171512;
  border-bottom: .18rem solid #171512;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.picker-field input::-webkit-date-and-time-value {
  min-height: 1.5em;
  text-align: left;
}

.picker-field input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

button {
  min-height: 3.5rem;
  border: 0;
  border-radius: 1rem;
  color: white;
  background: var(--green);
  box-shadow: 0 8px 20px rgba(61,81,75,.2);
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

button:hover { background: #31443e; }
button:active { transform: scale(.99); }

.error {
  padding: .75rem 1rem;
  border: 1px solid rgba(219,165,157,.5);
  border-radius: 1rem;
  color: #974b42;
  background: #fff2ef;
  font-size: .88rem;
  line-height: 1.6;
}

.result { margin-top: 1.5rem; }

.result-panel {
  padding: 1.75rem;
  border: 1px solid #c6d7d0;
  border-radius: 1.65rem;
  background: #eff6f2;
  box-shadow: 0 16px 50px rgba(53,80,70,.1);
}

.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.result-kicker { margin: 0; color: #607b71; font-size: .72rem; font-weight: 700; letter-spacing: .18em; }
h2 { margin: .25rem 0 0; color: #2f443d; font-size: 1.35rem; }
.place { padding: .35rem .75rem; border-radius: 999px; color: #61736c; background: rgba(255,255,255,.75); font-size: .75rem; }

.ambiguous {
  margin: 1.25rem 0 0;
  padding: .75rem 1rem;
  border: 1px solid rgba(217,187,117,.6);
  border-radius: 1rem;
  color: #7b5b21;
  background: #fff8e5;
  font-size: .88rem;
  line-height: 1.7;
}

.options { display: grid; gap: 1rem; margin-top: 1.25rem; }
.option { padding: 1.25rem; border: 1px solid white; border-radius: 1rem; background: rgba(255,255,255,.88); box-shadow: 0 2px 8px rgba(35,56,49,.06); }
.possibility { margin: 0 0 .5rem; color: #9a7133; font-size: .75rem; font-weight: 700; }
.result-time { margin: 0; color: #263c35; font-size: clamp(1.55rem,5vw,2rem); font-weight: 700; letter-spacing: .04em; }
.day-shift { margin: .45rem 0 0; color: #6e7e77; font-size: .88rem; font-weight: 600; }

.details { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1.15rem 0 0; padding-top: 1rem; border-top: 1px solid #dce7e2; }
.details dt { color: #89958f; font-size: .72rem; }
.details dd { margin: .3rem 0 0; color: #43534d; font-size: .86rem; }
.dst-note { margin: 1rem 0 0; padding: .55rem .75rem; border-radius: .75rem; color: #806a43; background: #f7f1e5; font-size: .75rem; line-height: 1.6; }
.warning { margin: 1rem 0 0; color: #776c5f; font-size: .75rem; line-height: 1.6; }

.explanation {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid #d9cdbb;
  border-radius: 1rem;
  color: #7d7267;
  background: rgba(255,255,255,.55);
  font-size: .75rem;
  line-height: 1.75;
}

.explanation strong { color: #5d5247; }
.explanation p { margin: .35rem 0 0; }
footer { padding-top: 2rem; text-align: center; color: #9b9186; font-size: .72rem; letter-spacing: .08em; }
[hidden] { display: none !important; }

@media (max-width: 620px) {
  .shell { padding-top: 2rem; }
  .hero > p { font-size: .88rem; }
  form, .result-panel { padding: 1.25rem; }
  .card-head { padding: 1rem 1.25rem; }
  .field-grid, .details { grid-template-columns: 1fr; }
  select, input { min-height: 3.7rem; font-size: 1rem; }
}
