* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background:#f5f5f5; color:#333; line-height:1.5; }

header {
  background: #d32f2f;
  color: white;
  padding: 1rem;
  text-align: center;
}
.search-bar { margin-top:0.8rem; }
.search-bar input {
  padding:0.6rem;
  width:70%;
  max-width:320px;
  border:none;
  border-radius:4px 0 0 4px;
}
.search-bar button {
  padding:0.6rem 1rem;
  border:none;
  background:#b71c1c;
  color:white;
  border-radius:0 4px 4px 0;
}

.category-nav {
  display: flex;
  overflow-x: auto;
  padding: 0.8rem;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  white-space: nowrap;
}
.category-nav button {
  padding: 0.6rem 1.2rem;
  margin: 0 0.4rem;
  border: 1px solid #ddd;
  border-radius: 2rem;
  background: white;
  cursor: pointer;
}
.category-nav button.active {
  background: #d32f2f;
  color: white;
  border-color: #d32f2f;
}

.carousel {
  position: relative;
  height: 220px;
  overflow: hidden;
  margin: 1rem 0;
}
.carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}
.carousel-item {
  flex: 0 0 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  color: white;
  text-shadow: 1px 1px 3px black;
  font-weight: bold;
}
.carousel-item h3 { font-size: 1.3rem; margin:0; }
.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  padding: 0.8rem;
  cursor: pointer;
  font-size: 1.8rem;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

.news-list {
  padding: 0 1rem 2rem;
}
.news-card {
  background: white;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  cursor: pointer;          /* ← 新增这一行 */
  transition: transform 0.15s ease, box-shadow 0.15s ease;  /* 可选：增加hover反馈 */
  /*新增这四行*、
  /*display: flex;*/
  align-items: flex-start;   /* 顶部对齐 */
  gap: 1rem;                 /* 有图时图片和文字间距 */
  flex-direction: row;       /* 明确从左到右（默认就是，但写上更清晰） */
  flex-wrap: nowrap;         /* 不要换行 */
}
.news-card img {
  order: -1;                 /* ← 关键：把图片移到 flex 顺序的最前面 */
  width: 120px;
  height: 90px;
  object-fit: cover;
  /*新增这二行*/、
  border-radius: 4px;
  flex-shrink: 0;
}
.news-info {
  flex: 1;
  padding: 0.8rem;
}
/*新增这二块*/
/* 无图时让 info 占满宽度 */
.news-info:not(.has-thumb) {
  /* 可选：无图时可以稍微调整内边距 */
  padding: 1rem;
}

/* 有图时保持原有 padding */
.news-info.has-thumb {
  padding: 0.8rem 0.8rem 0.8rem 0;
}

.news-info h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.news-meta {
  font-size: 0.8rem;
  color: #777;
  display: flex;
  justify-content: space-between;
}
.loading { text-align:center; padding:2rem; color:#888; }

@media (min-width: 768px) {
  .news-list { columns: 2; column-gap: 1rem; }
  .news-card { break-inside: avoid; margin-bottom: 1.2rem; }
  .carousel { height: 360px; }
}