:root {
  color-scheme: light;
  --ink: #142a25;
  --muted: #56675f;
  --paper: #f1f3ed;
  --white: #fbfcf8;
  --line: #dbe2d9;
  --green: #185342;
  --deep: #123a31;
  --mint: #cdf291;
  --error: #8e292f;
  font: 400 100% / 1.55 "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body { color: var(--ink); background: var(--paper); margin: 0; min-height: 100svh; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.25rem; line-height: 1.35; letter-spacing: .01em; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #577d28; outline-offset: 3px; }
.frame { max-width: 43rem; width: calc(100% - 2rem); margin-inline: auto; }

.masthead { color: white; background: var(--deep); padding-top: env(safe-area-inset-top); }
.masthead-inner { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.brand { display: flex; align-items: center; gap: .65rem; font: 650 1.4rem / 1 "Avenir Next", sans-serif; letter-spacing: -.045em; }
.brand-mark {
  width: 1.7rem; height: 1.7rem; display: inline-grid; place-content: center; gap: 2px;
  background: var(--mint); border-radius: .45rem; transform: rotate(-5deg);
}
.brand-mark i { width: .72rem; height: 2px; background: var(--deep); border-radius: 2px; }
.brand-mark i:nth-child(2) { width: .5rem; }
.connection { color: #e2efdd; font-size: .875rem; }
.connection::before {
  content: ""; background: #9ea99c; width: .45rem; height: .45rem; border-radius: 50%; display: inline-block;
  margin-inline-end: .4rem; vertical-align: .08rem;
}
.connection[data-online="true"]::before { background: var(--mint); }

.main { padding-block: 1rem max(2rem, env(safe-area-inset-bottom)); }
.intro {
  background: var(--deep); color: white; padding: 2rem 1.3rem 1.85rem; min-height: 10rem;
  border-radius: .95rem; position: relative; isolation: isolate; overflow: hidden; display: grid; align-content: end;
}
.intro h1 { font-size: clamp(2rem, 8vw, 3.5rem); line-height: 1.13; letter-spacing: -.07em; }
.intro p { color: #e2efdd; margin-top: .45rem; }
.intro-pattern {
  position: absolute; inset: 0; z-index: -1; opacity: .9; pointer-events: none;
  background: repeating-radial-gradient(ellipse at 106% -18%, transparent 0 14px, #b9df7042 15px 16px, transparent 17px 26px);
  mask-image: linear-gradient(108deg, transparent 36%, #000 98%);
}
.panel { margin-top: .85rem; padding: 1.15rem; background: var(--white); border: 1px solid var(--line); border-radius: .95rem; }
.panel-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.panel-head { margin-bottom: .8rem; }
.muted { color: var(--muted); font-size: .875rem; }
.pairing > .muted, .panel-head .muted { margin-top: .28rem; }
form { display: grid; gap: .45rem; }
.pairing form { margin-top: .85rem; }
label { margin-top: .3rem; font-weight: 630; }
label .muted { font-weight: 400; }
input, textarea {
  width: 100%; min-height: 2.85rem; padding: .65rem .8rem; color: var(--ink); background: white;
  border: 1px solid #aebcb1; border-radius: .52rem; font-size: 1rem;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #627369; }
.code { font-family: ui-monospace, monospace; letter-spacing: .08em; }
.primary {
  color: white; background: var(--green); border: 1px solid var(--green); border-radius: .55rem;
  min-height: 2.8rem; padding: .45rem .9rem; font-weight: 650; white-space: nowrap;
}
.primary:hover { background: var(--deep); }
form > .primary { margin-top: .55rem; }
.notice, .form-error { color: var(--error); font-size: .9rem; }
.notice { margin-top: .85rem; padding: .65rem .8rem; border: 1px solid #e7c4c4; background: #fff4f3; border-radius: .55rem; }
.refresh { color: var(--green); background: transparent; border: 0; min-height: 2.75rem; padding: .25rem 0; text-decoration: underline; text-underline-offset: .22em; font-size: .875rem; }

.empty { display: grid; justify-items: center; text-align: center; gap: .2rem; padding: 2.2rem .5rem 1.6rem; border-top: 1px solid var(--line); }
.empty > p { font-weight: 650; }
.empty-mark {
  width: 2.3rem; height: 2.65rem; margin-bottom: .5rem; border: 2px solid #6c8779; border-radius: .45rem;
  background: linear-gradient(#6c8779, #6c8779) center .75rem / 1rem 2px no-repeat,
    linear-gradient(#6c8779, #6c8779) center 1.2rem / 1rem 2px no-repeat;
}
.requirement-list details { border-top: 1px solid var(--line); }
.requirement-list summary { display: grid; gap: .22rem; position: relative; cursor: pointer; padding: .72rem 2rem .72rem 0; list-style: none; overflow-wrap: anywhere; }
.requirement-list summary::-webkit-details-marker { display: none; }
.requirement-list summary::after { content: "+"; position: absolute; inset: .8rem .15rem auto auto; color: var(--green); font-size: 1.25rem; line-height: 1; }
.requirement-list details[open] > summary::after { content: "−"; }
.record-title { font-weight: 650; }
.record-note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 .85rem; padding: .7rem .8rem; background: var(--paper); border-radius: .45rem; }
.record-note:empty::before { content: "暂无备注"; color: var(--muted); }
dialog { border: 1px solid var(--line); border-radius: .95rem; color: var(--ink); background: var(--white); padding: 1.05rem; width: min(calc(100% - 2rem), 32rem); max-height: 85dvh; }
dialog::backdrop { background: #112b25a6; }
.close { color: var(--green); background: var(--paper); border: 0; border-radius: .45rem; font-size: 1.45rem; line-height: 1; width: 2.75rem; height: 2.75rem; }

@media (min-width: 42rem) {
  .main { padding-top: 1.65rem; }
  .intro { padding-inline: 1.85rem; min-height: 12rem; }
  .panel { padding: 1.4rem 1.85rem; }
}
