:root {
  --brand: #17614e;
  --ink: #1d302b;
  --muted: #63756e;
  --paper: #f3f7f5;
  --surface: #fff;
  --line: #dfe7e2;
  --soft: #eaf4ed;
  --danger: #ad3939;
  --thumb: #9aaea4;
  --track: #f3f7f5;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.65;
  scrollbar-color: var(--thumb) var(--track);
  scrollbar-width: thin;
}
* {
  box-sizing: border-box;
  scrollbar-color: var(--thumb) var(--track);
  scrollbar-width: thin;
}
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: var(--track);
}
::-webkit-scrollbar-thumb {
  background: var(--thumb);
  border-radius: 9px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
body {
  margin: 0;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 620px;
  margin: auto;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
header span {
  font-size: 12px;
  color: var(--muted);
}
.brand {
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}
a {
  color: var(--brand);
  cursor: pointer;
}
a:hover {
  text-decoration: underline;
}
main {
  max-width: 620px;
  margin: auto;
  padding: 24px 19px 110px;
  min-height: 85vh;
}
h1 {
  font-size: 23px;
  line-height: 1.4;
  margin: 0 0 12px;
}
h2 {
  font-size: 19px;
  margin: 0 0 10px;
}
h3 {
  font-size: 16px;
  margin: 0 0 6px;
}
p {
  margin: 8px 0;
}
.muted,
small {
  color: var(--muted);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
}
.card > p:last-child {
  margin-bottom: 0;
}
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.tag,
.badge {
  display: inline-block;
  background: var(--soft);
  color: var(--brand);
  font-size: 12px;
  border-radius: 5px;
  padding: 3px 8px;
}
.badge.pending {
  background: #fff5df;
  color: #986118;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.stats a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  align-items: center;
}
.stats b {
  font-size: 22px;
  color: var(--ink);
}
.stats small {
  font-size: 11px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}
.actions > * {
  flex: 1;
  min-width: 110px;
}
button,
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: var(--brand);
  color: white;
  border: 1px solid var(--brand);
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  padding: 11px 15px;
  min-height: 46px;
  cursor: pointer;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: #104e3f;
  text-decoration: none;
}
button:active {
  transform: translateY(1px);
}
button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--line);
}
button.secondary:hover,
.button.secondary:hover {
  background: var(--soft);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.full {
  width: 100%;
}
.danger {
  color: var(--danger) !important;
}
label {
  display: block;
  font-weight: 600;
  margin: 16px 0 5px;
}
input,
textarea,
select {
  font: inherit;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  min-height: 48px;
}
textarea {
  resize: none;
  min-height: 130px;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: var(--brand);
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check input {
  flex-shrink: 0;
}
input[type="file"] {
  font-size: 12px;
}
form > button {
  margin-top: 20px;
}
nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 620px;
  width: 100%;
  padding: 15px 3px max(15px, env(safe-area-inset-bottom));
  background: white;
  border-top: 1px solid var(--line);
  z-index: 5;
}
nav a {
  text-align: center;
  text-decoration: none;
  font-size: 12px;
}
nav a[aria-current="page"] {
  font-weight: 700;
  color: var(--ink);
}
#feedback {
  position: fixed;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: 90%;
  padding: 10px 15px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  display: none;
}
#feedback.error {
  background: var(--danger);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 440px;
  width: 90%;
  padding: 24px;
  color: var(--ink);
}
dialog::backdrop {
  background: #1d302b66;
}
:focus-visible {
  outline: 3px solid #45967e;
  outline-offset: 3px;
}
.loading {
  padding: 50px 0;
  text-align: center;
}
.error-inline {
  color: var(--danger);
  background: #fff0ed;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  min-height: 45px;
}
.search {
  display: flex;
  gap: 8px;
}
.search input {
  min-width: 0;
}
.person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.person:last-child {
  border-bottom: 0;
}
.quote {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.small-id {
  font-size: 11px;
  overflow-wrap: anywhere;
}
@media (max-width: 380px) {
  header span {
    display: none;
  }
  .stats small {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  button:active {
    transform: none;
  }
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
  button {
    border: 1px solid ButtonText;
  }
}
/* V0.2 复用已确认的名片、标签、白底图文模块。 */
.business-card h1 {
  font-size: 23px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.business-contact {
  margin: 12px 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.business-contact p {
  margin: 4px 0;
  overflow-wrap: anywhere;
}
.business-module h2 {
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.business-module img,
.image-preview img,
.moderation-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  margin-top: 12px;
  border-radius: 8px;
}
.chip-editor {
  border: 0;
  padding: 0;
  margin: 16px 0;
  min-width: 0;
}
.chip-editor legend {
  font-weight: 600;
}
.chip-editor .tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.chip-editor .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chip-editor .tag button {
  min-height: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 18px;
}
.chip-editor .tag button:hover {
  background: var(--line);
}
.chip-editor .actions input {
  flex: 3;
  min-width: 0;
}
.chip-editor .actions button {
  flex: 1;
  min-width: 65px;
}
.module-editor {
  overflow-wrap: anywhere;
}
.module-editor .actions button {
  flex-basis: 40%;
  min-width: 90px;
}
.content-editor .draft-preview {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 16px;
}
.editor-error {
  font-size: 13px;
}
form[aria-busy="true"] {
  opacity: 0.8;
}
input[readonly] {
  background: var(--paper);
  color: var(--muted);
}

#app[data-view="home"] > h1 {
  font-size: 27px;
}
article.card h2 {
  font-size: 16px;
}

.password-field {
  display: flex;
  gap: 8px;
}
.password-field input {
  flex: 1;
  min-width: 0;
}
.password-field button {
  white-space: nowrap;
  flex-shrink: 0;
}

.recommendation-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.recommendation-tabs .button {
  min-width: 0;
  flex: 1;
  text-align: center;
  padding-inline: 8px;
}

.search-filters summary {
  cursor: pointer;
  color: var(--brand);
}
.search-filters summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
