:root {
  --bg: #f4f1ea;
  --ink: #1f1f1f;
  --muted: #5e584f;
  --brand: #1f7a53;
  --brand-deep: #124b33;
  --gold: #c89b3c;
  --paper: #fffdf7;
  --line: #e3dac8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(200, 155, 60, 0.2), transparent 32%),
    radial-gradient(circle at 85% 80%, rgba(31, 122, 83, 0.2), transparent 34%),
    linear-gradient(135deg, #f8f5ef, #f1ece2 55%, #ece4d6);
  z-index: -1;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.hero {
  text-align: center;
  margin-bottom: 18px;
}

.brand {
  font-family: "ZCOOL QingKe HuangYou", cursive;
  margin: 0;
  font-size: 30px;
  color: var(--brand-deep);
  letter-spacing: 2px;
}

h1 {
  margin: 8px 0 4px;
  font-size: clamp(28px, 5vw, 44px);
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.tab-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 15px;
}

.tab-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.checkin-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}

.label {
  color: var(--muted);
  margin: 0;
}

.days {
  margin: 10px 0;
  font-size: clamp(32px, 7vw, 56px);
  color: var(--brand-deep);
  font-weight: 700;
}

.hint {
  margin: 0;
}

.checkin-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary,
.ghost,
.download {
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  border: 0;
  font-size: 14px;
  text-decoration: none;
}

.primary {
  background: linear-gradient(90deg, var(--brand), #279f6c);
  color: #fff;
}

.ghost {
  background: #efe7d8;
  color: #5c4a22;
}

.poster-wrap {
  margin-top: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

#posterPreview {
  width: min(100%, 360px);
  border-radius: 12px;
  border: 1px solid #ddd4c2;
  justify-self: center;
}

.download {
  justify-self: center;
  color: #fff;
  background: #111;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.article-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--paper);
  cursor: pointer;
}

.article-card h3 {
  margin: 8px 0 6px;
  font-size: 18px;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tag {
  display: inline-block;
  font-size: 12px;
  color: #6e5525;
  background: #f5e7c7;
  border-radius: 999px;
  padding: 3px 8px;
}

.article-detail {
  margin-top: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.article-cover {
  height: 220px;
  background: linear-gradient(120deg, #1f7a53, #c89b3c);
  width: 100%;
  object-fit: cover;
  display: block;
}

.article-body {
  padding: 18px;
  line-height: 1.8;
}

.article-body h2 {
  margin: 0 0 6px;
}

.article-body h3 {
  margin: 18px 0 8px;
}

.article-body ul {
  margin: 8px 0 16px;
  padding-left: 20px;
}

.back-btn {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.reveal {
  animation: rise 0.55s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 680px) {
  .app {
    padding: 16px 12px 32px;
  }

  .poster-wrap {
    padding: 12px;
  }
}
