:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-soft: #eef5f6;
  --text: #17212b;
  --muted: #536473;
  --line: #d6e0e4;
  --primary: #176b87;
  --primary-strong: #0f4f64;
  --accent: #8a5a22;
  --warning-bg: #fff7e6;
  --shadow: 0 8px 20px rgba(23, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.site-header,
.service-home,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 18px;
}

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

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 20px;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.brand p,
.section-heading p,
.guide-item p,
.template-item p,
.site-footer {
  color: var(--muted);
}

.brand p {
  margin: 4px 0 0;
  font-size: 14px;
}

.header-note {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--primary-strong);
  font-size: 14px;
  white-space: nowrap;
}

.service-home {
  display: grid;
  gap: 18px;
  padding-bottom: 84px;
}

.home-view {
  display: grid;
  gap: 18px;
}

.search-section,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-section {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.section-number {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: 0;
}

.section-heading p {
  margin: 4px 0 0;
  line-height: 1.6;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--text);
}

.search-box input::placeholder {
  color: #5d6f7e;
}

.primary-button,
.download-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 0 18px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
}

.secondary-button {
  width: 100%;
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.primary-button:hover,
.download-button:hover {
  background: var(--primary-strong);
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.compact-search {
  margin-bottom: 12px;
}

.result-list {
  display: grid;
  gap: 12px;
}

.result-item,
.guide-item,
.template-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.result-item {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.result-item h3,
.guide-item h3,
.template-item h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.result-item p,
.guide-item p,
.template-item p {
  margin: 0;
  line-height: 1.7;
}

.source-line {
  color: var(--accent);
  font-size: 13px;
  line-height: 1.5;
}

.result-download {
  width: fit-content;
  min-height: 40px;
  margin-top: 4px;
  padding: 0 14px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.guide-list,
.template-list,
.guide-shortcuts {
  display: grid;
  gap: 12px;
}

.guide-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
  color: var(--text);
  text-align: left;
}

.guide-shortcut span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.guide-item {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.guide-item ol {
  margin: 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.7;
}

.template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  margin-bottom: 8px;
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-size: 12px;
}

.empty-state {
  padding: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer {
  padding: 4px 0 28px;
  font-size: 13px;
  line-height: 1.6;
}

.detail-view {
  display: grid;
  gap: 14px;
}

.detail-header {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-kicker {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  margin-bottom: 10px;
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-size: 12px;
}

.detail-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.detail-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.bottom-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 12px 0 0;
  background: linear-gradient(to top, var(--bg) 72%, rgba(244, 247, 248, 0));
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .content-grid,
  .search-box,
  .template-item {
    grid-template-columns: 1fr;
  }

  .download-button {
    width: 100%;
  }

  .result-download {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .site-header,
  .service-home,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .brand h1 {
    font-size: 19px;
  }

  .search-section,
  .panel {
    padding: 14px;
  }

  .section-heading h2 {
    font-size: 19px;
  }
}
