* { box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  background: #f4f6f9;
  color: #1a1a1a;
}
.navbar {
  background: #1a3a6b;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.navbar a, .navbar .link-btn {
  color: #fff;
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
}
.navbar .brand { font-weight: 700; font-size: 16px; margin-left: 0; }
.nav-right { display: flex; align-items: center; flex-wrap: wrap; }
.nav-user { font-size: 13px; opacity: 0.85; margin-left: 16px; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.login-box {
  max-width: 360px;
  margin: 80px auto;
  background: #fff;
  padding: 32px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 24px; }
.login-box input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}
.login-box button {
  width: 100%;
  padding: 11px;
  background: #1a3a6b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.error-msg { color: #c0392b; font-size: 13px; margin-bottom: 12px; text-align: center; }

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.section-card {
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 20px 14px;
  text-align: center;
  text-decoration: none;
  color: #1a1a1a;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.15s;
}
.section-card:active { transform: scale(0.97); }
.section-card .icon { font-size: 28px; margin-bottom: 8px; }
.section-card .name { font-size: 14px; font-weight: 600; }
.section-card .freq { font-size: 11px; color: #888; margin-top: 4px; }
.new-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 70% 30%;
  animation: new-badge-shake 1.8s ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
}
.new-badge-fire {
  position: absolute;
  inset: 0;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.new-badge-text {
  position: relative;
  z-index: 1;
  font-size: 6.5px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.2px;
  margin-top: 5px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.35);
}
@keyframes new-badge-shake {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(-12deg); }
  20% { transform: rotate(10deg); }
  30% { transform: rotate(-8deg); }
  40% { transform: rotate(6deg); }
  50% { transform: rotate(-4deg); }
  60%, 100% { transform: rotate(0deg); }
}

.report-list { list-style: none; padding: 0; margin: 16px 0; }
.report-item {
  background: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.report-item a { text-decoration: none; color: #1a3a6b; font-weight: 600; font-size: 15px; }
.report-item .meta { font-size: 12px; color: #888; margin-top: 4px; }
.report-item .summary { font-size: 13px; color: #444; margin-top: 6px; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  background: #1a3a6b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn.secondary { background: #888; }
.btn.danger { background: #c0392b; }

table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; font-size: 13px; }
table.admin-table th, table.admin-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; }
table.admin-table th { background: #f0f2f5; }
table.page-views-table { font-size: 12.5px; table-layout: fixed; border-collapse: collapse; }
table.page-views-table th, table.page-views-table td { text-align: center; width: 110px; min-width: 110px; max-width: 160px; white-space: normal; word-break: break-word; padding: 10px 10px; vertical-align: middle; }
table.page-views-table td:first-child, table.page-views-table th:first-child { text-align: left; white-space: nowrap; width: 100px; min-width: 100px; }
table.page-views-table th { writing-mode: horizontal-tb; line-height: 1.4; background: #f0f2f5; }
.page-views-scroll { overflow-x: auto; }
.pv-cell .pv-count { font-weight: 600; color: #1a3a6b; font-size: 14px; }
.pv-cell .pv-last { font-size: 10.5px; color: #999; margin-top: 2px; }
.pv-cell .pv-zero { color: #ccc; }
.pv-total { font-weight: 700; color: #c0392b; background: #fdf6f6; }

.form-block { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.form-block label { display: block; font-size: 13px; margin-bottom: 4px; color: #555; }
.filter-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.filter-form .filter-field { display: flex; flex-direction: column; min-width: 150px; }
.filter-form .filter-field label { font-size: 12px; color: #666; margin-bottom: 4px; height: 16px; line-height: 16px; }
.filter-form .filter-field input, .filter-form .filter-field select { height: 38px; padding: 6px 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; }
.filter-form .filter-actions { display: flex; gap: 8px; height: 38px; align-items: center; }
.form-block input[type=text], .form-block input[type=password], .form-block select {
  width: 100%; padding: 8px 10px; margin-bottom: 12px; border: 1px solid #ccc; border-radius: 5px;
}
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.checkbox-group label { display: flex; align-items: center; gap: 4px; font-size: 13px; background: #f0f2f5; padding: 5px 10px; border-radius: 14px; }
.checkbox-group input { width: auto; margin: 0; }

.report-html-frame { background: #fff; border-radius: 8px; padding: 10px; margin-top: 16px; }
.back-link { display:inline-block; margin-bottom:14px; color:#1a3a6b; font-size:13.5px; text-decoration:none; }
.back-link:hover { text-decoration:underline; }
.badge { display:inline-block; font-size:11px; padding:2px 8px; border-radius:10px; color:#fff; }
.badge.daily { background:#c0392b; }
.badge.weekly { background:#1a3a6b; }
.badge.twice_weekly { background:#c77c1a; }

.persona-group { margin-bottom: 30px; }
.persona-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1a3a6b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.persona-icon { font-size: 18px; }

@media (max-width: 480px) {
  .section-grid { grid-template-columns: repeat(2, 1fr); }
}
