:root {
  --blue: #174ea6;
  --text: #111;
  --muted: #666;
  --line: #e5e5e5;
  --soft: #f6f7f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: var(--blue);
  text-decoration: none;
}

input,
button {
  font: inherit;
}

.classifieds-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px max(16px, calc((100vw - 1120px) / 2));
}

.classifieds-brand {
  display: grid;
  color: var(--text);
  line-height: 1.15;
}

.classifieds-brand strong {
  font-size: 20px;
}

.classifieds-brand span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.classifieds-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  font-size: 14px;
  font-weight: 800;
}

.classifieds-main {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.classifieds-post-banner {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #d7c15a;
  background: #fff4c2;
  padding: 12px 16px;
  text-align: center;
}

.classifieds-post-banner a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 260px);
  margin: 0 auto;
  min-height: 44px;
  padding: 10px 24px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.classifieds-post-banner a:hover,
.classifieds-post-banner a:focus-visible {
  background: var(--blue);
  border-color: var(--blue);
}

.hero-panel,
.panel,
.auth-card,
.category-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.post-bottom-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.post-bottom-panel h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.post-bottom-panel p {
  margin: 0;
}

.post-bottom-panel .primary-action {
  width: min(100%, 260px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
}

h1,
h2,
p {
  margin-top: 0;
}

.hero-panel h1,
.auth-card h1,
.panel h1 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.2;
}

.hero-panel p,
.muted,
.form-note {
  color: var(--muted);
  line-height: 1.6;
}

.primary-action,
button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
  font-weight: 900;
  cursor: pointer;
}

.panel,
.auth-card {
  margin-top: 18px;
  padding: 22px;
}

.search-form,
.auth-card form {
  display: grid;
  gap: 14px;
}

.search-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: #333;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 0 12px;
  background: #fff;
}

input[type="file"] {
  min-height: auto;
  padding: 12px;
}

select,
textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: #fff;
  font: inherit;
}

select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.is-hidden {
  display: none !important;
}

legend {
  padding: 0 6px;
  font-size: 18px;
  font-weight: 900;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.category-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 18px;
  color: var(--text);
  overflow: hidden;
  border-color: var(--category-border, var(--line));
  background: linear-gradient(180deg, var(--category-bg, #fff), #fff 72%);
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--category-color, var(--blue));
}

.category-card.housing {
  --category-color: #1f7a4d;
  --category-bg: #f0faf5;
  --category-border: #b9e3cc;
}

.category-card.restaurant {
  --category-color: #b45309;
  --category-bg: #fff7ed;
  --category-border: #fed7aa;
}

.category-card.jobs {
  --category-color: #174ea6;
  --category-bg: #eff6ff;
  --category-border: #bfdbfe;
}

.category-card.secondhand {
  --category-color: #7c3aed;
  --category-bg: #f5f3ff;
  --category-border: #ddd6fe;
}

.category-card.services {
  --category-color: #0f766e;
  --category-bg: #f0fdfa;
  --category-border: #99f6e4;
}

.category-card.other {
  --category-color: #4b5563;
  --category-bg: #f8fafc;
  --category-border: #d1d5db;
}

.category-card strong {
  font-size: 20px;
}

.category-card span {
  color: var(--muted);
  font-size: 14px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.section-title h2 {
  margin-bottom: 0;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.auth-card {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.auth-card.wide-form {
  max-width: 780px;
}

.flash {
  margin: 12px 0;
  border-radius: 5px;
  padding: 12px;
  font-weight: 800;
}

.flash.success {
  background: #e8f3ec;
  color: #116329;
}

.flash.error {
  background: #fdecec;
  color: #9d1c1c;
}

.flash.warning {
  background: #fff4d6;
  color: #684b00;
}

.account-panel dl {
  display: grid;
  gap: 12px;
}

.account-panel dl div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.account-panel dt {
  color: var(--muted);
  font-weight: 900;
}

.account-panel dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.placeholder-box {
  margin-top: 18px;
  border: 1px dashed #bbb;
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
}

.classifieds-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 18px;
  text-align: center;
  font-size: 13px;
}

.primary-action.small {
  min-height: 38px;
  font-size: 14px;
}

.safety-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.safety-row article {
  border: 1px solid var(--line);
  border-left: 4px solid #777;
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
}

.safety-row strong {
  display: block;
  font-size: 17px;
}

.safety-row p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.listing-list,
.admin-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.listing-row,
.admin-card {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.listing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.listing-row.has-thumb {
  grid-template-columns: 112px minmax(0, 1fr) auto;
}

.listing-thumb {
  display: block;
  width: 112px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  overflow: hidden;
}

.listing-thumb img,
.listing-image-grid img,
.image-manage-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-row h3,
.admin-card h2 {
  margin: 8px 0;
  line-height: 1.35;
}

.listing-row p,
.listing-description {
  color: #333;
  line-height: 1.75;
}

.listing-row b,
.listing-price {
  color: var(--blue);
  font-weight: 900;
  white-space: nowrap;
}

.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.listing-meta > span:not(.verification-badge) {
  border-radius: 999px;
  background: var(--soft);
  padding: 4px 8px;
}

.verification-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.verification-badge.verified {
  background: #e6f4ea;
  color: #137333;
}

.verification-badge.unverified {
  background: #fdecec;
  color: #b3261e;
}

.listing-detail h1 {
  margin-top: 12px;
}

.classifieds-share-zone {
  margin: 14px 0 20px;
}

.v2-share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.v2-share-bar span {
  color: #555;
  font-weight: 900;
}

.v2-share-bar button {
  min-height: 34px;
  border: 1px solid var(--blue);
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 0 12px;
}

.v2-share-bar button:hover,
.v2-share-bar button:focus-visible {
  background: #0f3f88;
  border-color: #0f3f88;
}

.v2-share-bar small {
  min-height: 18px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.classifieds-self-promo-ad {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 22px 0;
  border: 3px solid #174ea6;
  border-top: 8px solid #174ea6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8d8 0%, #ffffff 56%, #f3f7ff 100%);
  box-shadow: 0 10px 24px rgba(23, 78, 166, 0.14);
  color: #111;
  padding: clamp(26px, 5vw, 42px) clamp(16px, 4vw, 30px) clamp(22px, 4vw, 34px);
  text-align: center;
}

.classifieds-self-promo-ad::before {
  content: "AD";
  position: absolute;
  top: 10px;
  left: 12px;
  border-radius: 4px;
  background: #174ea6;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  padding: 5px 7px;
}

.classifieds-self-promo-ad .v2-article-promo-kicker {
  border-radius: 999px;
  background: #ffd84d;
  color: #111;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 6px 12px;
}

.classifieds-self-promo-ad strong {
  max-width: 620px;
  color: #111;
  font-size: clamp(24px, 4.2vw, 38px);
  line-height: 1.18;
  font-weight: 950;
}

.classifieds-self-promo-ad p,
.classifieds-self-promo-ad small {
  margin: 0;
}

.classifieds-self-promo-ad p {
  max-width: 620px;
  color: #404040;
  font-size: clamp(15px, 2.5vw, 18px);
  line-height: 1.55;
  font-weight: 800;
}

.classifieds-self-promo-ad small {
  color: #666;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.v2-article-promo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.v2-article-promo-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 6px;
  padding: 10px 22px;
  background: #174ea6;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(23, 78, 166, 0.2);
}

.v2-article-promo-actions a:first-child {
  border: 2px solid #174ea6;
  background: #fff;
  color: #174ea6;
}

.v2-article-promo-actions a:hover,
.v2-article-promo-actions a:focus-visible {
  background: #0f3f88;
  color: #fff;
}

.listing-image-grid,
.image-manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.listing-image-grid a,
.image-manage-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  overflow: hidden;
}

.listing-image-grid a {
  aspect-ratio: 4 / 3;
}

.admin-image-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.image-manage-card {
  display: grid;
  gap: 8px;
  padding: 8px;
  color: var(--text);
  font-weight: 800;
}

.image-manage-card img {
  aspect-ratio: 4 / 3;
  border-radius: 5px;
}

.image-manage-card span {
  display: flex;
  gap: 8px;
  align-items: center;
}

.image-manage-card input {
  width: auto;
  min-height: auto;
}

.verification-note,
.contact-box,
.admin-verification-box {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
  color: #444;
  line-height: 1.65;
}

.contact-box h2,
.admin-verification-box h3 {
  margin: 0 0 8px;
}

.checkbox-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
}

.checkbox-row input {
  width: auto;
  min-height: auto;
}

.row-actions,
.admin-actions,
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.verification-checklist {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.row-actions form,
.admin-actions form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.danger-button {
  background: #b3261e;
}

.error-text {
  color: #b3261e;
  font-weight: 800;
}

.admin-tabs {
  margin: 16px 0;
}

.admin-tabs a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--blue);
  font-weight: 900;
}

.admin-card {
  display: grid;
  gap: 12px;
}

.admin-detail-grid {
  display: grid;
  gap: 10px;
  margin: 0;
}

.admin-detail-grid div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.admin-detail-grid dt {
  color: var(--muted);
  font-weight: 900;
}

.admin-detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.reject-form {
  flex: 1 1 320px;
}

@media (max-width: 720px) {
  .classifieds-header,
  .hero-panel,
  .search-form,
  .safety-row,
  .listing-row,
  .listing-row.has-thumb,
  .admin-detail-grid div,
  .account-panel dl div {
    grid-template-columns: 1fr;
  }

  .listing-thumb {
    width: 100%;
    max-width: none;
  }

  .listing-image-grid,
  .image-manage-grid,
  .admin-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-bottom-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .classifieds-header {
    align-items: start;
  }

  .classifieds-header nav {
    justify-content: start;
  }

  .hero-panel {
    padding: 18px;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-action,
  .search-form button,
  .auth-card button {
    width: 100%;
  }
}
