* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #eef3f9;
  color: #1f2d3d;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  background: linear-gradient(180deg, #174b8a 0%, #184784 100%);
  color: #fff;
  padding: 22px 0 26px;
  box-shadow: 0 2px 10px rgba(18, 52, 92, 0.12);
}

.topbar-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.subtitle {
  margin: 10px 0 0;
  font-size: 14px;
  opacity: 0.92;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 12px 18px;
  border-radius: 14px;
  min-width: 92px;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.main-content {
  padding: 28px 0 40px;
}

.card {
  background: #fff;
  border: 1px solid #d9e3f0;
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(19, 53, 96, 0.06);
  padding: 26px 24px;
  margin-bottom: 22px;
}

.card h2 {
  margin: 0 0 18px;
  font-size: 20px;
  color: #143d73;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 14px;
  align-items: center;
}

.search-row input {
  width: 100%;
  height: 46px;
  border: 1px solid #c9d5e4;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 16px;
  outline: none;
  background: #fff;
}

.search-row input:focus {
  border-color: #2a67b4;
  box-shadow: 0 0 0 3px rgba(42, 103, 180, 0.12);
}

.search-row button {
  height: 46px;
  border: none;
  border-radius: 14px;
  background: #1e5396;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.search-row button:hover {
  background: #184784;
}

.hint {
  margin: 14px 0 0;
  color: #6b7b8f;
  font-size: 14px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: #eaf1fb;
  color: #23589b;
  font-size: 14px;
  white-space: nowrap;
}

.results-box {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.empty-state {
  min-height: 180px;
  border: 1px dashed #cfd9e8;
  border-radius: 18px;
  background: #f9fbfe;
  color: #6f8094;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 16px;
}

.result-item {
  background: #f9fbff;
  border: 1px solid #d8e3f2;
  border-radius: 18px;
  padding: 20px 20px 18px;
  box-shadow: 0 2px 8px rgba(26, 70, 126, 0.04);
}

.filename-box {
  display: inline-block;
  background: #e9f0fb;
  color: #24579b;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 15px;
  margin-bottom: 14px;
}

.result-item h3 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.5;
  color: #154a8a;
  word-break: break-all;
}

.result-item .hint {
  margin: 0 0 12px;
  color: #6c7f95;
  font-size: 14px;
}

.excerpt {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: #fff;
  border-left: 4px solid #2b69b8;
  border-radius: 10px;
  color: #33465d;
  font-size: 16px;
  line-height: 1.9;
  word-break: break-word;
}

.excerpt:last-child {
  margin-bottom: 0;
}

.more-tip {
  margin-top: 8px;
  color: #6d7f94;
  font-size: 14px;
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 20px, 100%);
  }

  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-row button {
    width: 100%;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .result-item {
    padding: 16px;
  }

  .excerpt {
    font-size: 15px;
    line-height: 1.8;
  }
}
.kw-highlight {
  background: #fff3a3;
  color: #9a2f00;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 700;
}

.hidden-excerpts {
  display: none;
  margin-top: 6px;
}

.hidden-excerpts.show {
  display: block;
}

.toggle-more-btn {
  margin-top: 10px;
  background: #eef4fc;
  color: #1f5aa6;
  border: 1px solid #c9d8ee;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.toggle-more-btn:hover {
  background: #e1ecfa;
}

.result-item {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.result-item:hover {
  box-shadow: 0 6px 18px rgba(21, 74, 138, 0.08);
}