/*!
 * Licensed under the Creative Commons Attribution BY 4.0 International License. 
 * You may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at
 * 
 *     http://creativecommons.org/licenses/by/4.0/
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */

:root {
  --primary-color: #b14b43;
  --secondary-color: #f8f6f4;
  --accent-color: #4a6baf;
  --text-color: #333;
  --light-text: #777;
  --border-color: #ddd;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition-speed: 0.3s;
  --border-radius: 10px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 基础样式 */
body {
  font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* 头部样式 */
header {
  width: 100%;
  background: linear-gradient(135deg, #b14b43 0%, #d86a61 100%);
  color: white;
  padding: 40px 20px;
  text-align: center;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.slogan {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

.search-container {
  position: relative;
  max-width: 700px;
  margin: 0 auto 30px;
}

#search-bar {
  width: 100%;
  padding: 15px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-speed);
}

#search-bar:focus {
  outline: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #999;
}

.header-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: bold;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* 价值主张部分 */
.value-proposition {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  max-width: var(--max-width);
  margin: 40px auto;
  padding: 0 20px;
}

.value-item {
  display: flex;
  align-items: center;
  background-color: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  flex: 1;
  min-width: 250px;
  max-width: 350px;
  transition: transform var(--transition-speed);
}

.value-item:hover {
  transform: translateY(-5px);
}

.value-icon {
  font-size: 2rem;
  margin-right: 15px;
  color: var(--primary-color);
}

.value-text h3 {
  margin-bottom: 5px;
  color: var(--primary-color);
}

.value-text p {
  font-size: 0.9rem;
  color: var(--light-text);
}

/* 分类部分 */
.category-section {
  width: 100%;
  max-width: var(--max-width);
  margin: 20px auto;
  padding: 0 20px;
}

.section-title {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color);
  font-size: 1.8rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 10px auto 0;
}

/* 标签样式 */
#tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.tag {
  padding: 8px 16px;
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.tag:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
}

.tag.selected {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 结果容器 */
.results-container {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 20px;
}

.results-count {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1rem;
  color: var(--accent-color);
  background-color: rgba(74, 107, 175, 0.1);
  padding: 10px;
  border-radius: 5px;
  display: inline-block;
  margin: 0 auto 20px;
}

/* 内容区域 */
#content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  width: 100%;
  margin-bottom: 40px;
  position: relative;
}

/* 观察者目标样式 */
.observer-target {
  grid-column: 1 / -1;
  height: 20px;
  width: 100%;
  margin-top: 10px;
  visibility: visible;
  position: relative;
}

/* 加载动画 */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  padding: 40px 0;
  width: 100%;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(177, 75, 67, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 400px;
  position: relative;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.uppart {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
}

.data {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.datacell {
  font-size: 1.2rem;
  color: var(--accent-color);
  display: flex;
  align-items: center;
}

span.word {
  font-size: 0.8rem;
  color: var(--light-text);
  margin-left: 5px;
}

.maincontent {
  flex: 1;
  overflow: hidden;
  margin-bottom: 20px;
}

.maincontent h2 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--primary-color);
  line-height: 1.4;
}

.maincontent p {
  font-size: 0.95rem;
  color: var(--light-text);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-content h3 {
  align-self: flex-end;
  color: white;
  background-color: var(--primary-color);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-top: auto;
  transition: background-color var(--transition-speed);
}

.card:hover .card-content h3 {
  background-color: #d86a61;
}

/* 用户反馈部分 */
.testimonials {
  width: 100%;
  background-color: #f0f0f0;
  padding: 60px 20px;
  margin: 40px 0;
}

.testimonial-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.testimonial {
  background-color: white;
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  flex: 1;
  min-width: 280px;
  max-width: 350px;
  position: relative;
}

.testimonial::before {
  content: """;
  position: absolute;
  top: 10px;
  left: 15px;
  font-size: 4rem;
  color: rgba(177, 75, 67, 0.1);
  font-family: serif;
  line-height: 1;
}

.quote {
  font-style: italic;
  margin-bottom: 15px;
  position: relative;
  z-index: 1;
}

.author {
  text-align: right;
  font-weight: bold;
  color: var(--primary-color);
}

/* FAQ部分 */
.faq-section {
  width: 100%;
  max-width: var(--max-width);
  padding: 40px 20px;
  margin: 0 auto;
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.faq-item {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.faq-question {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.faq-answer {
  color: var(--light-text);
  line-height: 1.6;
}

/* 页脚样式 */
footer {
  width: 100%;
  background-color: #333;
  color: white;
  padding: 40px 20px 20px;
  margin-top: 40px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto 30px;
  gap: 30px;
}

.footer-about, .footer-links, .footer-friends {
  flex: 1;
  min-width: 250px;
}

.footer-container h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: #f8f6f4;
}

.footer-about p {
  color: #bbb;
  line-height: 1.6;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a, .footer-friends a {
  color: #bbb;
  text-decoration: none;
  transition: color var(--transition-speed);
}

.footer-links a:hover, .footer-friends a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-bottom p {
  color: #999;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.footer-bottom a {
  color: #bbb;
  text-decoration: none;
}

.update-time {
  font-style: italic;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: background-color var(--transition-speed);
  z-index: 100;
}

.back-to-top:hover {
  background-color: #d86a61;
}

/* 响应式设计 */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  .slogan {
    font-size: 1rem;
  }
  
  .header-stats {
    gap: 20px;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .value-proposition {
    flex-direction: column;
    align-items: center;
  }
  
  .value-item {
    width: 100%;
    max-width: 100%;
  }
  
  #content {
    grid-template-columns: 1fr;
  }
  
  .testimonial-container {
    flex-direction: column;
    align-items: center;
  }
  
  .testimonial {
    width: 100%;
    max-width: 100%;
  }
  
  .footer-container {
    flex-direction: column;
  }
  
  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 30px 15px;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  .header-stats {
    flex-direction: column;
    gap: 15px;
  }
  
  #search-bar {
    padding: 12px 15px;
  }
  
  .tag {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeIn 0.5s ease-out;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b14b43;
}

/* 无结果提示样式 */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--accent-color);
}

.no-results h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.no-results p {
  color: var(--light-text);
}

/* 错误消息样式 */
.error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.error-message h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.error-message p {
  color: var(--light-text);
  margin-bottom: 10px;
}

.error-details {
  font-family: monospace;
  background-color: #f8f8f8;
  padding: 10px;
  border-radius: 5px;
  font-size: 0.9rem;
  color: #d86a61;
}