* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f6f8;
  color: #1f2329;
  padding-bottom: 64px;
  -webkit-tap-highlight-color: transparent;
}

header {
  background: #1677ff;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 { font-size: 18px; font-weight: 600; }

#installBtn {
  padding: 8px 14px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  font-size: 13px;
  display: none;
}

.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e5e6eb;
  position: sticky;
  top: 53px;
  z-index: 9;
}

.tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  font-size: 15px;
  color: #4e5969;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.tab.active { color: #1677ff; border-bottom-color: #1677ff; font-weight: 600; }

main { padding: 12px; }

.panel { display: none; }
.panel.active { display: block; }

form {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

input, select, textarea, button[type="submit"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  font-family: inherit;
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: #1677ff; }

textarea { resize: vertical; min-height: 60px; }

button[type="submit"] {
  background: #1677ff;
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

button[type="submit"]:active { background: #0958d9; }

#list { list-style: none; }

.item {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4e5969;
  margin-bottom: 6px;
}

.item-head .time { margin-left: auto; font-size: 12px; color: #86909c; }

.badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.badge.ok { background: #e8ffea; color: #00a854; }
.badge.pending { background: #fff7e8; color: #f77234; }

.item-body { font-size: 14px; line-height: 1.5; }
.item-body img { max-width: 100%; border-radius: 6px; margin-top: 6px; }

.sync-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e5e6eb;
  padding: 12px 16px;
  font-size: 13px;
  color: #4e5969;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
}

.dot.on { background: #00a854; }
.dot.off { background: #f53f3f; }

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  max-width: 80%;
  text-align: center;
}

.toast.show { opacity: 1; }
