:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Microsoft YaHei", sans-serif;
  color: #202124;
  background: #f5f6f8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f5f6f8;
}

a { color: #315efb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  min-height: 64px;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid #e6e8ec;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.container {
  width: min(900px, calc(100% - 32px));
  margin: 32px auto;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.card,
.form-card {
  background: white;
  border: 1px solid #e2e5e9;
  border-radius: 12px;
  padding: 20px;
  margin: 14px 0;
}

.form-card {
  max-width: 620px;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #6b7280;
  font-size: 14px;
}

.post-content {
  white-space: pre-wrap;
  line-height: 1.7;
  margin: 16px 0;
}

.post-actions {
  border-top: 1px solid #eef0f2;
  padding-top: 12px;
  text-align: right;
}

label {
  display: block;
  margin: 16px 0 6px;
  font-weight: 600;
}

input, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  font: inherit;
  background: white;
}

textarea { resize: vertical; }

button, .button {
  display: inline-block;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
  background: #315efb;
  color: white;
}

button.danger { background: #b42318; }

.inline { display: inline; }
.inline button { margin: 0; }

.link-button {
  padding: 0;
  margin: 0;
  background: none;
  color: #315efb;
}

.muted { color: #6b7280; }

.flash {
  background: #eef4ff;
  border: 1px solid #c9d8ff;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 14px;
}

.quote {
  border-left: 4px solid #cfd4dc;
  padding: 10px 14px;
  margin: 12px 0;
  background: #fafafa;
  white-space: pre-wrap;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.actions form { display: inline; }
.actions button { margin-top: 0; }

.table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid #e2e5e9;
  border-radius: 12px;
  margin-bottom: 28px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #eef0f2;
  text-align: left;
  vertical-align: top;
}

td form button {
  margin-top: 0;
  padding: 7px 10px;
}

@media (max-width: 700px) {
  .topbar, .hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar { padding: 16px; }
  .topbar nav { flex-wrap: wrap; }
}


.post-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.comments-section {
  margin-top: 28px;
}

.comment-form {
  background: white;
  border: 1px solid #e2e5e9;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}

.comment {
  background: white;
  border: 1px solid #e2e5e9;
  border-radius: 10px;
  padding: 16px;
  margin: 10px 0;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #6b7280;
  font-size: 14px;
}

.comment-content {
  white-space: pre-wrap;
  line-height: 1.65;
  margin-top: 10px;
}


.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
}

.search-bar input {
  flex: 1;
}

.search-bar button {
  margin-top: 0;
  white-space: nowrap;
}

.clear-search {
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: #315efb;
  font-size: 14px;
}

.tag:hover {
  text-decoration: none;
  background: #e1eaff;
}

@media (max-width: 600px) {
  .search-bar {
    align-items: stretch;
    flex-direction: column;
  }
}


.sort-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 18px;
}

.sort-tabs a {
  padding: 7px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid #dfe3e8;
  color: #4b5563;
}

.sort-tabs a.active {
  background: #111827;
  border-color: #111827;
  color: white;
}

.sort-tabs a:hover {
  text-decoration: none;
}

.post-actions-v4 {
  align-items: center;
  justify-content: space-between;
}

.left-actions,
.right-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.left-actions form {
  margin: 0;
}

.like-button {
  margin: 0;
  padding: 7px 11px;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d7dce2;
}

.like-button.liked {
  background: #eef4ff;
  color: #315efb;
  border-color: #c9d8ff;
}


.right-actions form {
  margin: 0;
}

.text-danger-button {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: #b42318;
  font: inherit;
  cursor: pointer;
}

.text-danger-button:hover {
  text-decoration: underline;
}


.pinned-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff4e5;
  color: #9a6700;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}


.daily-hero {
  max-width: 720px;
  margin: 44px auto 26px;
  text-align: center;
}

.daily-kicker {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #8b5e78;
}

.daily-hero h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 54px);
  letter-spacing: -0.04em;
}

.daily-hero p {
  margin: 14px auto 0;
  max-width: 620px;
  color: #6b7280;
  line-height: 1.8;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 28px 0 18px;
}

.fortune-card {
  position: relative;
  min-height: 390px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid #e6e1e5;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(31, 41, 55, 0.07);
}

.love-card {
  background:
    radial-gradient(circle at 90% 5%, rgba(247, 198, 216, 0.45), transparent 34%),
    linear-gradient(145deg, #fffafb, #fff4f7);
}

.warm-card {
  background:
    radial-gradient(circle at 90% 5%, rgba(255, 224, 155, 0.45), transparent 34%),
    linear-gradient(145deg, #fffdf7, #fff8e9);
}

.fortune-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 27px;
  box-shadow: 0 8px 22px rgba(31, 41, 55, 0.06);
}

.fortune-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #7c6673;
}

.fortune-card h2 {
  margin: 12px 0 10px;
  font-size: 25px;
  line-height: 1.35;
}

.fortune-hint {
  min-height: 52px;
  margin-bottom: 22px;
  color: #7a7f87;
  line-height: 1.7;
}

.fortune-result {
  margin-top: 24px;
}

.fortune-grade {
  display: inline-block;
  margin-bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: white;
  color: #a84469;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(128, 61, 86, 0.08);
}

.fortune-text,
.warm-result {
  font-size: 21px;
  line-height: 1.85;
  letter-spacing: 0.01em;
}

.warm-result {
  min-height: 185px;
  display: flex;
  align-items: center;
  padding: 18px 0 20px;
}

.draw-status {
  margin-top: 28px;
  color: #997989;
  font-size: 14px;
}

.fortune-card form {
  margin: 0;
}

.fortune-main-button {
  width: 100%;
  margin-top: 14px;
  padding: 13px 18px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
}

.love-button {
  background: #b94d73;
}

.warm-button {
  background: #9a6b16;
}

.daily-footer-note {
  margin: 22px 0 48px;
  text-align: center;
  color: #9aa0a6;
  font-size: 13px;
}

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

  .fortune-card {
    min-height: auto;
    padding: 24px;
  }

  .warm-result {
    min-height: 130px;
  }
}


.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.admin-page-header h1 {
  margin: 0;
}

.admin-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid #d9dee5;
  border-radius: 10px;
  background: white;
  color: #374151;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(31, 41, 55, 0.04);
}

.admin-home-button:hover {
  text-decoration: none;
  background: #f8fafc;
}

@media (max-width: 600px) {
  .admin-page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-home-button {
    align-self: flex-start;
  }
}


.global-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid #d9dee5;
  border-radius: 9px;
  background: #f8fafc;
  color: #374151;
  font-weight: 700;
}

.global-home-button:hover {
  text-decoration: none;
  background: #eef2f7;
}
