:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #13201c;
  --muted: #68746f;
  --line: #dfe7e2;
  --brand: #0f766e;
  --brand-dark: #0b514c;
  --accent: #ef7d3c;
  --soft: #e8f4f1;
  --danger: #b42318;
  --shadow: 0 14px 36px rgba(20, 40, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.community-app {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 18px 14px 86px;
}

.community-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.quote-link,
.actions button,
.load-more,
.sheet-card button[type="submit"] {
  min-height: 44px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.quote-link {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  white-space: nowrap;
}

.admin-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-link {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--brand-dark);
}

.quote-return {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.quote-return span {
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
}

.notice,
.dm-rule,
.post-card,
.panel,
.sheet-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.notice {
  padding: 13px;
  line-height: 1.65;
}

.notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-dark);
  font-size: 15px;
}

.notice span,
.dm-rule,
.sheet-note,
.form-message,
.post-meta,
.post-actions button {
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 116px 64px;
  gap: 9px;
  margin: 12px 0;
}

.actions button.ghost,
.feed-head button,
.post-actions button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--brand-dark);
}

.actions button.tiny {
  padding: 0 8px;
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.session-bar button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.dm-rule {
  padding: 10px 12px;
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff4f2;
  color: var(--danger);
  line-height: 1.55;
  font-weight: 700;
}

.dm-rule strong {
  color: var(--danger);
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 2px 10px;
}

.feed-head button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 700;
}

.admin-filter {
  width: auto;
  min-width: 116px;
  min-height: 36px;
  font-size: 14px;
}

.feed-list {
  display: grid;
  gap: 10px;
}

.loading,
.empty {
  padding: 28px 10px;
  color: var(--muted);
  text-align: center;
}

.post-card {
  padding: 13px;
}

.post-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.role {
  display: inline-flex;
  min-width: 42px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.role.seller {
  background: #fff3e8;
  color: #91400f;
}

.post-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-content {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.68;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.post-actions button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  font-weight: 700;
}

.post-actions .primary-action {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.post-actions a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.post-actions .disabled-action {
  background: #eef2ef;
  color: var(--muted);
}

.license-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.seller-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 10px;
}

.license-thumb,
.license-preview,
.license-empty {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.license-thumb {
  display: block;
  object-fit: cover;
}

.license-preview,
.license-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.admin-detail {
  max-height: min(86vh, 780px);
  overflow: auto;
}

.seller-detail-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 16px;
  align-items: start;
}

.seller-detail-grid .license-thumb,
.seller-detail-grid .license-preview,
.seller-detail-grid .license-empty {
  width: 100%;
  height: auto;
  min-height: 220px;
}

.detail-fields {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

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

.detail-actions button {
  min-height: 44px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.detail-actions .danger-button {
  background: var(--danger);
}

.radar-admin-source {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-size: 14px;
  line-height: 1.6;
}

.radar-admin-source a {
  color: var(--brand-dark);
  font-weight: 800;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
}

.checkbox-line span {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.load-more {
  width: 100%;
  margin-top: 12px;
}

.panel {
  padding: 13px;
}

.admin-token-panel {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.admin-token-panel button {
  min-height: 44px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.admin-token-panel .form-message {
  grid-column: 1 / -1;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.admin-summary article {
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.admin-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.floating-post {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 5;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.26);
  font-weight: 900;
}

.sheet {
  width: min(520px, calc(100% - 24px));
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.sheet::backdrop {
  background: rgba(19, 32, 28, 0.38);
}

.sheet-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 22px;
  line-height: 1;
}

.sheet-note {
  padding-right: 28px;
  line-height: 1.55;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

label small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

.form-message {
  min-height: 18px;
  line-height: 1.5;
  text-align: center;
}

.form-message.error {
  color: var(--danger);
}

.form-message.ok {
  color: var(--brand);
}

footer {
  padding: 26px 8px 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.site-record {
  color: var(--muted);
  text-decoration: none;
}

@media (max-width: 430px) {
  .community-app {
    padding-inline: 12px;
  }

  h1 {
    font-size: 23px;
  }

  .actions {
    grid-template-columns: 1fr 108px 58px;
  }

  .admin-token-panel,
  .admin-summary {
    grid-template-columns: 1fr;
  }

  .seller-row,
  .seller-detail-grid {
    grid-template-columns: 1fr;
  }

  .license-thumb,
  .license-preview,
  .license-empty {
    width: 100%;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }
}
