:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background: #202020;
  color: #fff;
}

* { box-sizing: border-box; }

body { margin: 0; }

button { font: inherit; }

.miniapp-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: #141405;
  overflow: hidden;
}

.app-chrome { background: #343434; }

.navigation-bar {
  position: relative;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navigation-bar h1 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1; }

.back-button {
  position: absolute;
  top: 3px;
  left: 11px;
  width: 48px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.back-chevron { width: 13px; height: 13px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.back-button:focus-visible, .history-tip:focus-visible, .settings-sheet button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.wechat-capsule {
  position: absolute;
  right: 10px;
  top: 4px;
  width: 90px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-radius: 23px;
  background: #2e2e2e;
  color: #f3f3f3;
}

.capsule-dots { width: 42px; text-align: center; font-size: 16px; letter-spacing: 1px; }
.capsule-divider { height: 22px; width: 1px; background: rgba(255,255,255,.12); }
.capsule-target { width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid #f3f3f3; border-radius: 50%; }
.capsule-target span { width: 11px; height: 11px; border-radius: 50%; background: #f3f3f3; }

.history-entry {
  margin: 0 16px;
  padding: 16px 0 9px;
  border-bottom: 1px dotted rgba(185, 185, 177, .38);
}

.history-time { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.35; opacity: .92; }
.history-detail { margin: 6px 0 0; font-size: 17px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.empty-message { padding: 24px 16px; color: #9b9b92; text-align: center; font-size: 14px; }

.page-footer { padding: 10px 16px 0; text-align: center; }
.history-tip { padding: 0; border: 0; background: transparent; color: #77776e; font-size: 13px; line-height: 1.5; cursor: pointer; }
.history-tip:hover { color: #a5a59a; }

.settings-overlay { position: fixed; inset: 0; z-index: 4; width: min(100%, 430px); margin: 0 auto; display: flex; align-items: end; }
.settings-overlay[hidden], .toast[hidden] { display: none; }
.settings-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.settings-sheet { position: relative; width: 100%; padding: 8px 20px max(20px, env(safe-area-inset-bottom)); background: #272727; border-radius: 8px 8px 0 0; box-shadow: 0 -8px 28px rgba(0,0,0,.24); }
.sheet-handle { width: 36px; height: 4px; margin: 0 auto 16px; border-radius: 3px; background: #777; }
.settings-sheet h2 { margin: 0 0 19px; text-align: center; font-size: 17px; font-weight: 600; }
.settings-sheet button { width: 100%; height: 46px; border: 0; border-radius: 6px; cursor: pointer; }
.import-button { background: #eee; color: #171717; font-weight: 600; }
.cancel-button { margin-top: 10px; background: #3c3c3c; color: #fff; }
.toast { position: absolute; z-index: 6; left: 50%; bottom: 36px; max-width: calc(100% - 40px); padding: 10px 14px; transform: translateX(-50%); border-radius: 6px; background: rgba(0,0,0,.85); color: #fff; font-size: 13px; text-align: center; white-space: nowrap; }

@media (min-width: 600px) {
  .miniapp-shell { box-shadow: 0 0 30px rgba(0,0,0,.25); }
}

@media (max-width: 360px) {
  .navigation-bar h1 { font-size: 18px; }
  .history-detail { font-size: 16px; }
}
