@charset "UTF-8";
:root {
  --brand: #5D87A3;
  --page: #FAF9F6;
  --surface: #fff;
  --tint: #EFF4F7;
  --text: #292A2D;
  --secondary: #707A80;
  --line: #E7EBED;
  --expired: #D94B43;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; min-height: 44px; }
#app {
  max-width: 420px;
  margin: auto;
  padding: env(safe-area-inset-top) 20px calc(104px + env(safe-area-inset-bottom));
  min-height: 100dvh;
}
.nav { min-height: 44px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 8px; }
.nav small { display: block; color: var(--secondary); font-size: 13px; line-height: 18px; }
.nav h1 { font: 32px/40px "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif; margin: 0; font-weight: 400; }
.link { color: var(--secondary); min-width: 44px; min-height: 44px; }
.subtle, .guide { margin: 4px 0 0; color: var(--secondary); font-size: 12px; line-height: 16px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 0; }
.stat { text-align: left; padding: 8px 8px 10px; border-right: 1px solid var(--line); min-height: 74px; }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-size: 28px; line-height: 34px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; line-height: 18px; color: var(--secondary); }
.stat.selected { box-shadow: inset 0 -2px 0 var(--brand); }
.stat.expired strong { color: var(--expired); }
.locations { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 0 0 16px; }
.loc { padding: 0 0 6px; text-align: center; font-size: 12px; line-height: 16px; color: var(--secondary); }
.loc i { font-style: normal; border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; margin: 0 auto 4px; color: var(--text); font-size: 14px; }
.loc span, .loc small { display: block; }
.loc.active { font-weight: 600; color: var(--text); }
.loc.active i { border: 1.5px solid var(--brand); background: transparent; }
.searchrow { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.searchrow input, .form input { height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 14px; min-width: 0; width: 100%; outline: none; }
.searchrow input { flex: 1; }
.searchrow input:focus, .form input:focus { border-color: var(--brand); }
.searchrow span { font-size: 13px; white-space: nowrap; color: var(--secondary); font-variant-numeric: tabular-nums; }
.tabs { height: 46px; display: flex; gap: 26px; border-bottom: 1px solid var(--line); }
.tabs button { color: var(--secondary); padding: 0; }
.tabs .active { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); font-weight: 600; }
.group-title { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 0; font-size: 14px; line-height: 20px; font-weight: 500; }
.group-title small { font-size: 12px; color: var(--secondary); font-weight: 400; }
.group-title.expired span { color: var(--expired); }
.row { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); touch-action: pan-y; }
.actions { position: absolute; inset: 0 0 0 auto; display: flex; }
.actions button { width: 72px; height: 100%; min-height: 52px; background: var(--page); border-left: 1px solid var(--line); color: var(--text); font-size: 13px; }
.actions .discard { background: var(--text); color: #fff; }
.item { position: relative; z-index: 1; background: var(--page); min-height: 52px; padding: 8px 0; transition: transform .16s ease; }
.row.open .item { transform: translateX(-144px); }
.line1 { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.item-name { font-weight: 500; font-size: 16px; line-height: 22px; }
.item-meta { font-size: 13px; line-height: 18px; color: var(--secondary); margin-top: 2px; }
.item-date { font-size: 13px; line-height: 18px; color: var(--secondary); white-space: nowrap; }
.item-date.expired { color: var(--expired); }
.footer-note, .sentinel { text-align: center; color: var(--secondary); font-size: 12px; line-height: 16px; }
.footer-note { padding: 18px; }
.sentinel { height: 24px; }
.fab {
  position: fixed; z-index: 5;
  right: max(20px, calc((100vw - 420px) / 2 + 20px));
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--text); color: #fff; font-size: 32px; line-height: 56px; padding: 0;
}
.page-title { font-size: 20px; line-height: 28px; font-weight: 500; margin: 12px 0 16px; }
.entry-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.entry-buttons button { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 64px; font-size: 15px; }
.hint, .notice { color: var(--secondary); font-size: 13px; line-height: 18px; }
.hint { margin: 16px 0 8px; }
.form label { display: block; font-size: 13px; line-height: 18px; color: var(--secondary); margin: 16px 0 6px; }
.date-big { font-size: 22px; line-height: 30px; margin: 4px 0 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 0 8px; }
.quick button { min-height: 44px; padding: 0 8px; color: var(--text); }
.quick .active { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.location-options { display: flex; flex-wrap: wrap; gap: 8px; }
.location-options button { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 22px; }
.location-options .active { border: 1.5px solid var(--brand); color: var(--brand); font-weight: 600; background: transparent; }
.savebar { position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--page) 28%); }
.savebar button { display: block; width: min(100%, 380px); margin: auto; background: var(--brand); color: #fff; border-radius: 12px; height: 48px; font-weight: 500; }
.savebar button:disabled { opacity: .8; }
.feedback { color: var(--secondary); font-size: 13px; line-height: 18px; min-height: 18px; margin-top: 8px; }
.back { min-height: 44px; padding: 0; color: var(--secondary); }
.settings { display: flex; flex-direction: column; }
.settings h3 { margin: 18px 0 4px; font-size: 14px; line-height: 20px; font-weight: 500; }
.settings button { text-align: left; border-bottom: 1px solid var(--line); padding: 0; }
.settings .danger { color: var(--expired); }
#toast { position: fixed; z-index: 6; left: 20px; bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 112px); background: var(--text); color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 13px; line-height: 18px; }
#toast[hidden] { display: none; }
#toast button { color: #fff; text-decoration: underline; min-height: 44px; padding: 0; }
@media (max-width: 360px) {
  #app { padding-left: 16px; padding-right: 16px; }
  .nav h1 { font-size: 28px; line-height: 36px; }
}
