:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #172026;
  --muted: #687781;
  --line: #dfe6e2;
  --panel: #fff;
  --accent: #00796b;
  --accent-dark: #00695c;
  --accent-soft: #e3f3ef;
  --blue: #2f6f9f;
  --danger: #b42318;
  --shadow: 0 10px 28px rgba(24, 32, 38, .07);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  background:
    linear-gradient(180deg, #fff 0, #eef8f5 330px, var(--bg) 650px),
    var(--bg);
  color: var(--ink);
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.topbar {
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  height: 64px;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  height: 34px;
  object-fit: contain;
  width: 34px;
}

.brand-copy {
  align-items: baseline;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.brand-copy strong {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 22px;
}

.brand-copy em {
  color: var(--accent);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 18px;
}

.feedback-trigger {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #27343c;
  cursor: pointer;
  display: inline-flex;
  gap: 7px;
  font-size: 14px;
  font-weight: 760;
  min-height: 36px;
  padding: 0 8px;
}

.feedback-icon {
  display: block;
  flex: 0 0 auto;
  height: 19px;
  width: 19px;
}

.feedback-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.feedback-trigger:hover {
  color: var(--accent);
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #66737d 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, #66737d 50%, transparent 50%) calc(100% - 13px) 50% / 6px 6px no-repeat,
    #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #26343e;
  min-height: 42px;
  min-width: 118px;
  padding: 0 38px 0 16px;
}

.hero {
  border-bottom: 1px solid var(--line);
  margin: 0 0 28px;
  padding: 58px 24px 44px;
  text-align: center;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.hero h1 {
  color: #162027;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  margin: 0 auto 14px;
  max-width: 920px;
}

.hero p:not(.eyebrow) {
  color: #52636d;
  font-size: 16px;
  line-height: 1.72;
  margin: 0 auto;
  max-width: 850px;
}

.hero-search {
  margin: 26px auto 0;
  max-width: 760px;
  position: relative;
}

.hero-search span {
  color: #8a969d;
  font-size: 22px;
  left: 20px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.hero-search input {
  background: #fff;
  border: 1px solid #d8dfdc;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(15, 123, 108, .1);
  color: #162027;
  font-size: 16px;
  min-height: 54px;
  outline: 0;
  padding: 0 22px 0 54px;
  width: 100%;
}

.hero-search input:focus {
  border-color: var(--accent);
}

.directory-shell {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 240px minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1320px;
  padding: 0 22px 46px;
}

.sidebar,
.directory-section,
.empty {
  background: #fff;
  border: 1px solid #e4e8e6;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 16px;
  position: sticky;
  top: 82px;
}

.sidebar h2 {
  color: #27343c;
  font-size: 18px;
  margin: 0 0 12px;
}

.sidebar nav {
  display: grid;
  gap: 7px;
}

.sidebar a {
  align-items: center;
  border-radius: 6px;
  color: #52616b;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  padding: 9px 10px;
}

.sidebar a:hover {
  background: #eef8f5;
  color: var(--accent-dark);
}

.sidebar a.muted {
  opacity: .45;
}

.sidebar strong {
  color: #84949c;
  font-size: 12px;
}

.directory-wrap {
  display: grid;
  gap: 18px;
}

.directory-section {
  padding: 16px;
}

.directory-section-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.directory-section-head h2 {
  color: #1d2a32;
  font-size: 18px;
  margin: 0;
}

.directory-section-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.directory-section-head span {
  background: #edf5f2;
  border: 1px solid #d4e5df;
  border-radius: 999px;
  color: #0f655d;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.resource-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.resource-card {
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e0e6e3;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  min-height: 168px;
  padding: 16px;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.resource-card:hover {
  border-color: var(--accent);
  background: #f0faf7;
  box-shadow: 0 10px 20px rgba(0, 121, 107, .08);
  transform: translateY(-1px);
}

.resource-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 6px;
  color: var(--accent);
  display: inline-flex;
  flex: 0 0 46px;
  font-size: 14px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  overflow: hidden;
  width: 46px;
}

.resource-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.resource-title {
  color: #1b2931;
  display: inline-block;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.resource-title:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.resource-url {
  align-self: flex-start;
  background: #edf8f5;
  border: 1px solid #d4e7e1;
  border-radius: 999px;
  color: var(--accent-dark);
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 7px;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-url:hover {
  text-decoration: underline;
}

.resource-copy p {
  color: #31434e;
  display: -webkit-box;
  font-size: 13.5px;
  font-weight: 540;
  line-height: 1.62;
  margin: 11px 0 0;
  min-height: 44px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.resource-copy mark {
  background: #edf2ee;
  border: 1px solid #d5ded8;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: #24443d;
  display: inline;
  font-weight: 760;
  line-height: 1;
  padding: .03em .3em .07em;
}

.resource-foot {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tag-row em {
  background: #f4f6f5;
  border-radius: 999px;
  color: #687781;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  padding: 4px 7px;
}

.empty {
  color: var(--muted);
  padding: 30px;
  text-align: center;
}

.topic-entry-section,
.topic-page-shell {
  margin: 0 auto;
  max-width: 1320px;
  padding: 0 22px 48px;
}

.directory-pending .topic-entry-section {
  visibility: hidden;
}

.topic-entry-head {
  margin: 0 0 18px;
  max-width: 860px;
}

.topic-entry-head h2,
.topic-copy h2,
.topic-related h2 {
  color: #1d2a32;
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 10px;
}

.topic-entry-head p:not(.eyebrow),
.topic-copy p,
.topic-copy li,
.topic-link-grid span {
  color: var(--muted);
  line-height: 1.72;
}

.topic-link-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}

.topic-link-grid a {
  background: #fff;
  border: 1px solid #e0e6e3;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 18px;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.topic-link-grid a:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(0, 121, 107, .08);
  transform: translateY(-1px);
}

.topic-link-grid strong {
  color: #1b2931;
  font-size: 17px;
  line-height: 1.32;
}

.topic-link-grid span {
  font-size: 14px;
}

.topic-back-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #26343e;
  font-size: 14px;
  font-weight: 760;
  padding: 10px 14px;
}

.topic-back-link:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.topic-hero {
  margin-bottom: 0;
}

.topic-page-shell {
  display: grid;
  gap: 22px;
  padding-top: 28px;
}

.topic-copy,
.topic-related {
  background: #fff;
  border: 1px solid #e4e8e6;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.topic-copy p {
  margin: 14px 0 0;
}

.topic-copy h2:not(:first-child) {
  margin-top: 22px;
}

.topic-copy .topic-intent {
  background: #f0faf7;
  border: 1px solid #d7ebe5;
  border-radius: 8px;
  color: #31574f;
  font-weight: 700;
  margin-top: 0;
  padding: 14px 16px;
}

.topic-copy ul {
  margin: 10px 0 0;
  padding-left: 1.2em;
}

.topic-resource-section {
  box-shadow: var(--shadow);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 14px;
  justify-items: center;
  margin-top: 10px;
  padding: 34px 20px 40px;
  text-align: center;
}

.site-footer p {
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: center;
}

.site-footer a {
  color: var(--accent);
  font-size: 15px;
  font-weight: 760;
}

.site-footer a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.friend-links {
  align-items: center;
  color: #6b7a72;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
}

.friend-links strong {
  color: #52655c;
  font-size: 14px;
}

.friend-links nav {
  gap: 18px;
}

.friend-links a {
  color: #60756c;
  font-size: 14px;
  font-weight: 650;
}

.site-footer small {
  color: #8b969d;
  font-size: 13px;
}

.feedback-modal[hidden] {
  display: none !important;
}

.feedback-modal {
  inset: 0;
  position: fixed;
  z-index: 50;
}

.feedback-backdrop {
  background: transparent;
  inset: 0;
  position: absolute;
}

.feedback-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(23, 32, 38, .14);
  left: var(--feedback-left, auto);
  max-width: 460px;
  padding: 18px;
  position: absolute;
  top: var(--feedback-top, 76px);
  width: var(--feedback-width, min(calc(100vw - 24px), 460px));
}

.feedback-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.feedback-head h2 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
}

.feedback-close {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #52616b;
  cursor: pointer;
  font-size: 20px;
  height: 34px;
  line-height: 1;
  width: 34px;
}

.feedback-form {
  display: grid;
  gap: 12px;
}

.feedback-form label {
  color: #172026;
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
}

.feedback-form label em {
  color: var(--danger);
  font-style: normal;
}

.feedback-form input,
.feedback-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
  border-color: rgba(15, 123, 108, .55);
  box-shadow: 0 0 0 3px rgba(15, 123, 108, .12);
  outline: 0;
}

.feedback-form textarea {
  min-height: 112px;
  resize: vertical;
}

.feedback-submit {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  min-height: 42px;
}

.feedback-submit:disabled {
  cursor: wait;
  opacity: .72;
}

.feedback-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 12px;
}

.feedback-status[data-state="ok"] {
  color: var(--accent);
}

.feedback-status[data-state="error"] {
  color: var(--danger);
}

@media (max-width: 1080px) {
  .directory-shell,
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    padding: 12px 16px;
  }

  .top-actions {
    gap: 8px;
  }

  .feedback-trigger span {
    display: none;
  }

  .hero {
    padding: 38px 16px 30px;
  }

  .directory-shell,
  .resource-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .directory-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topic-entry-section,
  .topic-page-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topic-link-grid {
    grid-template-columns: 1fr;
  }

  .resource-card {
    min-height: 0;
  }

  .resource-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .tag-row {
    justify-content: flex-start;
  }

}
