* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; }
body { font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:#f2f4f8; color:#2b3038; -webkit-font-smoothing:antialiased; }
#app { max-width:520px; margin:0 auto; min-height:100%; background:#f2f4f8; padding-bottom:40px; }

.top { position:sticky; top:0; z-index:10; background:rgba(242,244,248,0.94); backdrop-filter:blur(8px);
  padding:calc(env(safe-area-inset-top) + 12px) 18px 12px; display:flex; align-items:center; justify-content:space-between; }
.logo { font-size:21px; font-weight:800; letter-spacing:1px; }
.tagline { font-size:11px; color:#9aa3b0; margin-top:2px; }
.add-btn { width:40px; height:40px; border-radius:50%; background:#5b7fd4; color:#fff; font-size:26px; font-weight:300;
  display:flex; align-items:center; justify-content:center; box-shadow:0 3px 10px rgba(91,127,212,0.35); cursor:pointer; }

.screen { display:none; padding:0 18px; }
.screen.active { display:block; }

.filters { display:flex; gap:8px; overflow-x:auto; padding:4px 0 12px; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.filters::-webkit-scrollbar { display:none; }
.fchip { flex-shrink:0; padding:7px 14px; border-radius:16px; background:#fff; border:1px solid #e2e7ef;
  font-size:13px; color:#6b7482; cursor:pointer; }
.fchip.on { background:#5b7fd4; border-color:#5b7fd4; color:#fff; font-weight:700; }

.ev-card { background:#fff; border-radius:14px; padding:14px; margin-bottom:10px; box-shadow:0 1px 4px rgba(43,48,56,0.05);
  cursor:pointer; display:flex; gap:12px; align-items:flex-start; }
.ev-card.pinned { border-left:3px solid #5b7fd4; }
.ev-datebox { min-width:52px; text-align:center; background:#f0f3fa; border-radius:10px; padding:8px 4px; }
.ev-datebox.soon { background:#fdeee6; }
.ev-datebox.today { background:#5b7fd4; }
.ev-datebox.today .ev-d, .ev-datebox.today .ev-m { color:#fff; }
.ev-d { font-size:22px; font-weight:800; color:#2b3038; line-height:1.1; }
.ev-m { font-size:10px; color:#9aa3b0; }
.ev-body { flex:1; min-width:0; }
.ev-title { font-size:15px; font-weight:700; margin-bottom:4px; word-break:break-all; }
.ev-meta { font-size:11px; color:#9aa3b0; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.ev-cat { font-size:10px; padding:2px 8px; border-radius:8px; background:#f0f3fa; color:#5b7fd4; font-weight:600; }
.ev-range { font-size:11px; color:#6b7482; margin-top:3px; }
.ev-countdown { text-align:right; flex-shrink:0; }
.cd-num { font-size:20px; font-weight:800; color:#c25e3a; }
.cd-num.past { color:#b9c0cb; }
.cd-lbl { font-size:10px; color:#9aa3b0; }
.cd-num.today2 { color:#5b7fd4; }
.pin-toggle { margin-top:6px; font-size:11px; color:#9aa3b0; }
.pin-toggle.on { color:#5b7fd4; font-weight:700; }
.empty { text-align:center; padding:60px 20px; color:#b9c0cb; font-size:13px; line-height:1.8; }
.empty .big { font-size:40px; margin-bottom:8px; }

.back-row { margin-top:14px; }
.back-btn { font-size:14px; color:#6b7482; cursor:pointer; background:none; border:none; font-family:inherit; padding:6px 0; }
.form-card { background:#fff; border-radius:16px; padding:16px; margin-top:8px; box-shadow:0 1px 4px rgba(43,48,56,0.05); }
.f-label { font-size:13px; font-weight:700; margin:14px 0 8px; display:flex; align-items:center; gap:6px; }
.f-label:first-child { margin-top:0; }
.f-label .opt { font-size:11px; color:#b9c0cb; font-weight:400; }
.f-input { width:100%; border:1px solid #e2e7ef; border-radius:10px; padding:12px 14px; font-size:15px; font-family:inherit;
  background:#f8f9fc; outline:none; }
.f-input:focus { border-color:#5b7fd4; background:#fff; }
textarea.f-input { min-height:80px; resize:none; line-height:1.6; }
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip { padding:8px 13px; border-radius:18px; background:#f8f9fc; border:1.5px solid #e2e7ef;
  font-size:13px; color:#6b7482; cursor:pointer; user-select:none; -webkit-user-select:none; }
.chip.on { background:#e8eefb; border-color:#5b7fd4; color:#5b7fd4; font-weight:700; }
.btn-primary { width:100%; padding:14px; border:none; border-radius:12px; background:#5b7fd4; color:#fff; font-size:16px;
  font-weight:700; cursor:pointer; font-family:inherit; }
.btn-danger { width:100%; padding:12px; border:none; border-radius:12px; background:#fdf0ed; color:#c0574a; font-size:14px;
  font-weight:700; cursor:pointer; font-family:inherit; margin-top:10px; }
.toast { position:fixed; left:50%; bottom:100px; transform:translateX(-50%); background:rgba(43,48,56,0.88); color:#fff;
  padding:10px 18px; border-radius:10px; font-size:13px; z-index:99; opacity:0; transition:opacity 0.25s; pointer-events:none;
  max-width:80%; text-align:center; }
.toast.show { opacity:1; }

.home-fab { position:fixed; left:14px; bottom:calc(20px + env(safe-area-inset-bottom)); width:44px; height:44px;
  border-radius:50%; background:rgba(43,48,56,.82); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:20px; text-decoration:none; box-shadow:0 2px 8px rgba(0,0,0,.25); z-index:90; }
