/* =============================================
 * 通用样式（前台 + 后台）
 * ============================================= */

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f6f7fb;
  color: #222;
  margin: 0;
  padding: 0;
}

/* 容器布局 */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px;
}

/* 顶部导航 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 99;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.topbar .wrap {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.topbar .brand {
  font-weight: 700;
  font-size: 17px;
}

.topbar nav {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar a {
  color: #111;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: 0.15s;
}

.topbar a:hover {
  background: #f0f0f0;
}

.topbar a.act {
  background: #111;
  color: #fff;
}

@media (max-width: 768px) {
  .topbar .wrap {
    padding: 8px 10px;
  }
  .topbar a {
    padding: 6px 8px;
    font-size: 14px;
  }
}

/* 通用卡片 */
.card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  margin-bottom: 12px;
}

.title {
  font-size: 18px;
  font-weight: 700;
  margin: 6px 0 10px;
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.85;
}

.muted {
  color: #666;
  font-size: 13px;
}

/* 方形网格布局（广告、分类、任务卡） */
.square-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .square-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

.square {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}

.square:hover {
  transform: scale(1.02);
}

.square .inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.square img {
  width: 70%;
  height: auto;
  object-fit: contain;
}

.square .caption {
  margin-top: 6px;
  font-size: 13px;
  text-align: center;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 通用提示框 */
.notice {
  padding: 10px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #065f46;
  margin-bottom: 12px;
}

.err {
  padding: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #991b1b;
  margin-bottom: 12px;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th, table td {
  border: 1px solid #eee;
  padding: 8px 10px;
  text-align: center;
}

table th {
  background: #f9fafb;
  font-weight: 600;
}

table tr:nth-child(even) {
  background: #fafafa;
}
