* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.container .footer{
  height: 50px;
}


header {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
  padding: 1rem 0;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}

.nav-links a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #666;
}

.nav-links a:hover {
  color: #000;
}

.search-box {
  text-align: center;
  padding: 2rem 1rem;
}

.search-input-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 1rem;
}

.search-input {
  width: 100%;
  max-width: 600px;
  padding: 1rem;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* 多行输入框 */
textarea.search-input {
  display: block;
  min-height: 120px;
  padding-bottom: 3rem;
  margin-bottom: 0;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
}

textarea.search-input:focus {
  outline: none;
  border-color: #00a7ff;
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.4rem 1rem;
  font-size: 0.95rem;
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

.search-clear:hover {
  background: #eaeaea;
  color: #333;
}

.search-button {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  background: #00a7ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.search-button:hover {
  background: #00a7ff;
}

.recent-questions {
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.recent-questions h2{
  padding: 0 0 1rem 0;
}

.search-questions {
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.search-questions h2{
  padding: 0 0 1rem 0;
}

.question-list {
  list-style: none;
}

.question-list li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.question-list a {
  text-decoration: none;
  color: #333;
}

.question-list em {
  color: red;
}

.question-list a:hover {
  color: #00a7ff;
}

.ad-space {
  background: #eee;
  padding: 0.1rem;
  /* margin: 2rem 0; */
  text-align: center;
}

.ad-space-detail {
  background: #eee;
  padding: 0.1rem;
  margin: 2rem 0;
  text-align: center;
}

.question-detail {
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
  /* margin: 2rem 0; */
}

.question-detail h1{
  font-size: 1.1rem;
}

.related-questions {
  margin-top: 2rem;
}

.related-questions h2{
  padding: 0 0 1rem 0;
}

.login-form {
  max-width: 400px;
  margin: 3rem auto;
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .nav-links {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
  }
  
  .nav-links a {
      margin-top: 0.5rem;
  }
  
  .search-box {
      padding: 2rem 1rem;
  }
}


/* 在文件末尾添加以下样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  gap: 0.5rem;
}

.page-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: #00a7ff;
  border: 1px solid #00a7ff;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.page-link:hover {
  background-color: #00a7ff;
  color: #fff;
}

.page-link.current {
  background-color: #00a7ff;
  color: #fff;
  cursor: default;
}

@media (max-width: 768px) {
  .pagination {
      flex-wrap: wrap;
  }
  
  .page-link {
      padding: 0.3rem 0.8rem;
      font-size: 0.9rem;
  }
}

/* 添加返回顶部按钮样式 */
.back-to-top {
  position: fixed;
  bottom: 50px;
  right: 30px;
  width: 40px;
  height: 40px;
  background-color: #00a7ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #0056b3;
  transform: translateY(-3px);
}

.back-to-top svg {
  color: white;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .back-to-top {
      bottom: 40px;
      right: 20px;
      width: 35px;
      height: 35px;
  }
  
  .back-to-top svg {
      width: 20px;
      height: 20px;
  }
}

.error-message {
  background-color: #ffebee;
  color: #c62828;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid #ffcdd2;
}


/* 用户中心 */
.user-center {
  padding: 2rem 0;
}

.user-header {
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.avatar-container {
  position: relative;
  width: 100px;
  height: 100px;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-upload {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #00a7ff;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-info {
  flex: 1;
}

.checkin-btn {
  padding: 0.5rem 1.5rem;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.checkin-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}
.logout-btn {
  padding: 0.5rem 1.5rem;
  background: #dd6161;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.user-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.5rem 1.5rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

.tab-btn.active {
  background: #00a7ff;
  color: #fff;
  border-color: #00a7ff;
}

.tab-content {
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.record-item {
  padding: 1rem;
  border-bottom: 1px solid #eee;
}

.record-item:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  .user-header {
      flex-direction: column;
      text-align: center;
      gap: 1rem;
  }

  .user-tabs {
      justify-content: center;
  }
}


/* 模态对话框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
}

.modal-buttons button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#confirmAnswer {
  background-color: #00a7ff;
  color: white;
}

#cancelAnswer {
  background-color: #6c757d;
  color: white;
}

.checkbox-container {
  margin: 1rem 0;
}

.show-answer-btn {
  padding: 0.5rem 1rem;
  background-color: #00a7ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}


.answer p, #answerContent p {
  background: #f8f9fa;
  font-size: 1.5rem;
  line-height: 1.8;
  padding: 1.2rem;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
  .answer p, #answerContent p {
    font-size: 1rem;
    padding: 1rem;
    line-height: 1.6;
    margin: 0.8rem 0;
  }
}

@media (max-width: 480px) {
  .answer p, #answerContent p {
    font-size: 0.95rem;
    padding: 0.8rem;
    line-height: 1.5;
    margin: 0.6rem 0;
  }
}


.error-page {
  text-align: center;
  padding: 4rem 1rem;
  background: #fff;
  border-radius: 4px;
  margin: 2rem 0;
}

.error-page h1 {
  font-size: 6rem;
  color: #00a7ff;
  margin-bottom: 1rem;
}

.error-page p {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 2rem;
}

.home-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: #00a7ff;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.home-button:hover {
  background: #0056b3;
}

@media (max-width: 768px) {
  .error-page h1 {
      font-size: 4rem;
  }

  .error-page p {
      font-size: 1rem;
  }
}


.login-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
}

.login-methods {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.login-tab {
  padding: 10px 20px;
  cursor: pointer;
  margin-right: 10px;
}

.login-tab.active {
  border-bottom: 2px solid #00a7ff;
  color: #00a7ff;
}

.login-panel {
  display: none;
}

.login-panel.active {
  display: block;
}

.qrcode-container {
  text-align: center;
}

.qrcode-container img {
  width: 200px;
  height: 200px;
  margin: 20px 0;
}


/* 广告内容 */

.ad-container {
  height: 170px;
  background-color: #00a7ff;
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
}

.content {
  flex: 2;
  padding: 12px;
  color: white;
}

.title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
  font-size: 12px;
  margin-bottom: 5px;
  opacity: 0.9;
}

.features {
  font-size: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.features li {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}

.features li:before {
  content: "✓";
  margin-right: 5px;
  color: #7fff00;
}

.qr-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: white;
  padding: 15px;
}

.qr-code {
  width: 130px;
  height: 130px;
  background: repeating-conic-gradient(#000 0deg 90deg, #fff 90deg 180deg);

  margin-bottom: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-code img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.scan-text {
  font-size: 12px;
  color: #0056b3;
  text-align: center;
  font-weight: bold;
}

.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.circle {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.circle:nth-child(1) {
  width: 60px;
  height: 60px;
  top: -20px;
  left: -20px;
}

.circle:nth-child(2) {
  width: 40px;
  height: 40px;
  bottom: 20px;
  left: 50px;
}
