:root {
  --bg: #f2fbf4;
  --card: #ffffff;
  --line: #b9dec0;
  --text: #14391e;
  --muted: #4f6f55;
  --green: #2f8f46;
  --green-dark: #1f6f34;
  --green-light: #e7f7eb;
  --danger-bg: #fdecee;
  --danger-line: #efb9c2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  width: min(980px, calc(100% - 24px));
  margin: 0 auto;
}

.topbar {
  background: var(--green-light);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  padding: 12px 0;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.site-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--green-dark);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.nav a {
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 600;
}

.nav-user {
  color: var(--muted);
  font-size: 0.92rem;
}

.main {
  padding: 14px 0 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.message-bar {
  padding-top: 10px;
  padding-bottom: 10px;
}

.message-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.message-bar-head h2 {
  margin-bottom: 0;
}

.msg-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.msg-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  touch-action: pan-y;
}

.msg-item-main {
  padding: 8px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  background: #fff;
  transform: translateX(0);
  transition: transform 0.18s ease;
}

.msg-item-main strong {
  min-width: 54px;
}

.msg-delete-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 74px;
  height: 100%;
  border: none;
  border-left: 1px solid #b34a4a;
  border-radius: 0;
  background: #d64f4f;
  color: #fff;
  transform: translateX(100%);
  transition: transform 0.18s ease;
}

.msg-item.is-swiped .msg-item-main {
  transform: translateX(-74px);
}

.msg-item.is-swiped .msg-delete-btn {
  transform: translateX(0);
}

.search-results {
  margin-top: 12px;
}

.search-results .panel {
  display: grid;
  gap: 4px;
}

.core-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.core-card {
  margin-bottom: 0;
}

.camera-card,
.reminder-card {
  min-height: 220px;
}

h2,
h3 {
  margin: 0 0 10px;
  color: var(--green-dark);
}

h4 {
  margin: 8px 0;
  color: var(--green-dark);
}

.muted {
  color: var(--muted);
  margin: 0 0 8px;
}

.form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.compact-form {
  max-width: 300px;
}

.camera-form {
  min-height: 160px;
  display: grid;
  place-items: center;
}

.queue-panel {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fbfffc;
  width: 100%;
}

.queue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.queue-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.88rem;
  display: grid;
  gap: 2px;
  background: #fff;
}

.queue-empty {
  color: var(--muted);
}

.queue-failed {
  border-color: var(--danger-line);
  background: var(--danger-bg);
}

.queue-error {
  color: #ad2f2f;
  font-size: 0.82rem;
}

label {
  display: grid;
  gap: 5px;
  font-size: 0.95rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

button,
.btn-link,
.btn-lite {
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-lite {
  background: #fff;
  color: var(--green-dark);
}

.camera-circle {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  border: 2px solid var(--green-dark);
  background: var(--green);
  color: #fff;
  font-size: 2rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.auth-card {
  max-width: 420px;
  margin: 18px auto;
}

.list,
.notes {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 10px;
}

.list li,
.panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.group-wrap {
  display: grid;
  gap: 10px;
}

.group-panel h3 {
  margin-bottom: 6px;
}

.member-list {
  margin: 0 0 8px;
  padding-left: 18px;
}

.inline-form {
  align-items: end;
}

.photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 8px;
}

.pre {
  white-space: pre-line;
}

.unread {
  background: #f3fff6;
  border-color: #84c895;
}

.flash-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.flash-success,
.flash-info {
  background: #ecfaef;
}

.flash-warning {
  background: #f7fbe6;
}

.flash-danger {
  background: var(--danger-bg);
  border-color: var(--danger-line);
}

@media (max-width: 760px) {
  .core-grid {
    grid-template-columns: 1fr;
  }

  .list li {
    flex-direction: column;
  }

  .message-bar-head {
    align-items: stretch;
  }
}
