/* ===== 全局样式重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== 页面容器 ===== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ===== 导航栏 ===== */
.header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 64px;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1890ff;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: #666;
  font-size: 0.95rem;
  transition: color 0.3s;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: #1890ff;
  border-bottom-color: #1890ff;
}

.nav-auth {
  display: flex;
  gap: 12px;
}

.nav-auth a {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.nav-auth .login-btn {
  color: #1890ff;
  border: 1px solid #1890ff;
}

.nav-auth .login-btn:hover {
  background: #1890ff;
  color: #fff;
}

.nav-auth .register-btn {
  background: #1890ff;
  color: #fff;
}

.nav-auth .register-btn:hover {
  background: #40a9ff;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: #333;
  transition: all 0.3s;
}

/* ===== 底部 ===== */
.footer {
  background: #001529;
  color: #fff;
  padding: 24px 20px;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer p {
  font-size: 0.9rem;
}

/* ===== 首页样式 ===== */
.hero {
  background: linear-gradient(135deg, #1890ff 0%, #001529 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.section-title {
  font-size: 1.5rem;
  color: #001529;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid #1890ff;
  display: inline-block;
}

.section {
  margin-bottom: 48px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #e6e6e6;
}

.card-content {
  padding: 16px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #001529;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-author {
  font-size: 0.9rem;
  color: #666;
}

.card-category {
  display: inline-block;
  padding: 4px 8px;
  background: #e6f7ff;
  color: #1890ff;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

/* ===== 列表页样式 ===== */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.list-header h2 {
  font-size: 1.5rem;
  color: #001529;
}

.breadcrumb {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 24px;
}

.breadcrumb a {
  color: #1890ff;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state p {
  font-size: 1.1rem;
}

/* ===== 详情页样式 ===== */
.detail-container {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-header {
  margin-bottom: 24px;
}

.detail-title {
  font-size: 1.8rem;
  color: #001529;
  margin-bottom: 16px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: #666;
  font-size: 0.95rem;
}

.detail-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 24px;
}

.detail-description {
  line-height: 1.8;
  color: #333;
  margin-bottom: 24px;
}

.detail-description h3 {
  font-size: 1.2rem;
  color: #001529;
  margin-bottom: 12px;
}

.detail-description p {
  margin-bottom: 16px;
}

.contact-box {
  background: #f0f5ff;
  border: 1px solid #adc6ff;
  border-radius: 8px;
  padding: 20px;
}

.contact-box h4 {
  color: #001529;
  margin-bottom: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.phone-reveal {
  background: #1890ff;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.3s;
}

.phone-reveal:hover {
  background: #40a9ff;
}

.phone-number {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1890ff;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1890ff;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* ===== 发布页样式 ===== */
.publish-container {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.publish-title {
  font-size: 1.5rem;
  color: #001529;
  margin-bottom: 8px;
  text-align: center;
}

.publish-notice {
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 24px;
  text-align: center;
  color: #d46b00;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #001529;
}

.form-group label .required {
  color: #ff4d4f;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: #1890ff;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.file-upload {
  border: 2px dashed #d9d9d9;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s;
}

.file-upload:hover {
  border-color: #1890ff;
}

.file-upload input {
  display: none;
}

.file-upload-icon {
  font-size: 2rem;
  color: #999;
  margin-bottom: 8px;
}

.file-upload-text {
  color: #666;
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: #1890ff;
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: #40a9ff;
}

.btn-secondary {
  background: #fff;
  color: #666;
  border: 1px solid #d9d9d9;
}

.btn-secondary:hover {
  color: #1890ff;
  border-color: #1890ff;
}

/* ===== 登录/注册页样式 ===== */
.auth-container {
  max-width: 400px;
  margin: 40px auto;
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-title {
  font-size: 1.5rem;
  color: #001529;
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form .btn-primary {
  margin-top: 8px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: #666;
  font-size: 0.95rem;
}

.auth-footer a {
  color: #1890ff;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links,
  .nav-auth {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 20px;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active,
  .nav-auth.active {
    display: flex;
  }

  .nav-auth {
    border-top: 1px solid #f0f0f0;
  }

  .hero {
    padding: 40px 20px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .detail-container {
    padding: 20px;
  }

  .detail-title {
    font-size: 1.4rem;
  }

  .auth-container {
    margin: 20px;
    padding: 24px;
  }

  .publish-container {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .detail-meta {
    flex-direction: column;
    gap: 8px;
  }
}
