body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: linear-gradient(180deg, #f4f8fb 0%, #edf6f8 100%);
  color: #172536;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.title h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.title p {
  margin: 10px 0 0;
  color: #65778d;
  font-size: 15px;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d8e3ef;
  color: #475b73;
  font-size: 14px;
  font-weight: 700;
  box-sizing: border-box;
}

.pill.secondary {
  background: rgba(248, 251, 253, 0.98);
}

.nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d8e3ef;
  font-size: 18px;
  font-weight: 800;
}

.nav a.active {
  background: #121a2b;
  border-color: #121a2b;
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(18, 26, 43, 0.18);
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 18px;
}

.subtab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d8e3ef;
  color: #52667e;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(32, 52, 84, 0.05);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.subtab:hover {
  transform: translateY(-1px);
  border-color: #c8d7e6;
}

.subtab.active {
  background: #121a2b;
  border-color: #121a2b;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(18, 26, 43, 0.16);
}

.subtab.preview {
  border-style: dashed;
  color: #7a6171;
  background: linear-gradient(180deg, #fffdfd 0%, #fff6f8 100%);
}

.subtab.preview.active {
  background: #3f3140;
  border-color: #3f3140;
  color: #ffffff;
}

.grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
}

.stack {
  display: grid;
  gap: 18px;
}

.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e2ebf3;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 14px 40px rgba(32, 52, 84, 0.07);
}

.hero-card {
  padding: 22px 24px;
}

.card h2,
.card h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card h2 {
  font-size: 22px;
}

.card h3 {
  font-size: 19px;
}

.muted {
  color: #6d7f94;
  line-height: 1.65;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.summary-item,
.record,
.rank-item,
.post-card,
.detail-block,
.reply-card,
.sidebar-stat {
  border: 1px solid #e3ebf4;
  border-radius: 18px;
  padding: 16px;
  background: #f8fbfd;
}

.summary-item strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 900;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.toolbar.spread {
  justify-content: space-between;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar input,
.toolbar select {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #d8e3ef;
  background: #ffffff;
  color: #304458;
  font-size: 14px;
}

.toolbar input {
  min-width: 220px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.weekday {
  padding: 8px 0;
  color: #6f8095;
  font-weight: 800;
  text-align: center;
}

.day {
  min-height: 84px;
  padding: 12px 10px;
  border-radius: 18px;
  border: 1px solid #e4edf5;
  background: #f9fbfd;
}

.day.checked {
  background: linear-gradient(180deg, #eefaf2, #f7fdf9);
  border-color: #bbe3c4;
}

.day.today {
  box-shadow: inset 0 0 0 2px #7fd7cc;
}

.day .number {
  font-size: 22px;
  font-weight: 800;
}

.day .amount {
  margin-top: 20px;
  color: #109487;
  font-size: 14px;
  font-weight: 800;
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.record .date,
.rank-item .label,
.reply-card .meta,
.post-meta {
  color: #6d8097;
  font-size: 13px;
  font-weight: 700;
}

.record .amount,
.rank-item .value {
  margin-top: 10px;
  color: #109487;
  font-size: 28px;
  font-weight: 900;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #1ab2a4, #0d9688);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.button.secondary {
  background: #ffffff;
  color: #40556f;
  border: 1px solid #d8e3ef;
}

.button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.message {
  margin-top: 14px;
  color: #4c5f77;
}

.hidden {
  display: none !important;
}

.error {
  color: #b42318;
}

.success {
  color: #027a48;
}

.forum-layout {
  display: grid;
  grid-template-columns: 1.65fr 0.95fr;
  gap: 18px;
}

.forum-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.forum-lede {
  margin-top: 10px;
  color: #667a92;
  font-size: 15px;
  line-height: 1.7;
}

.post-link {
  display: block;
}

.post-shell {
  display: grid;
  gap: 10px;
}

.post-card {
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.post-link:hover .post-card {
  transform: translateY(-1px);
  border-color: #c8d7e6;
  box-shadow: 0 16px 36px rgba(36, 52, 80, 0.08);
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.post-title {
  margin: 8px 0 8px;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.post-excerpt {
  color: #5d7188;
  line-height: 1.75;
  white-space: pre-wrap;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
}

.chip.pinned {
  background: #fff0c9;
  color: #9d6400;
}

.chip.category {
  background: #eef6ff;
  color: #2e5ea7;
}

.chip.priority {
  background: #f3efff;
  color: #6449b8;
}

.chip.status {
  background: #f5f7fb;
  color: #60758d;
}

.chip.visibility {
  background: #eef9f5;
  color: #16865d;
}

.forum-side-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.sidebar-stat {
  font-size: 14px;
  font-weight: 700;
  color: #304458;
}

.my-post-link {
  display: block;
}

.my-post-link:hover .sidebar-stat {
  border-color: #c8d7e6;
}

.detail-title {
  margin: 12px 0 8px;
  font-size: 34px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.detail-content {
  color: #42566d;
  line-height: 1.85;
  font-size: 15px;
  white-space: pre-wrap;
}

.reply-card .reply-content {
  margin-top: 8px;
  color: #42566d;
  line-height: 1.7;
  white-space: pre-wrap;
}

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

.form-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field.inline {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.field label {
  color: #40546b;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px 14px;
  color: #24384f;
  font-size: 14px;
  box-sizing: border-box;
}

.field textarea {
  min-height: 180px;
  resize: vertical;
}

.ranking-settings {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.ranking-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #e3ebf4;
  border-radius: 18px;
  padding: 14px 16px;
  background: #f8fbfd;
}

.ranking-setting-main {
  min-width: 0;
}

.ranking-setting-title {
  font-size: 15px;
  font-weight: 800;
  color: #24384f;
}

.ranking-setting-key {
  margin-top: 4px;
  color: #71839a;
  font-size: 12px;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.ranking-setting-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.ranking-setting-toggle,
.ranking-setting-order {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #40546b;
  font-size: 13px;
  font-weight: 700;
}

.ranking-setting-order input {
  width: 88px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #d8e3ef;
  background: #ffffff;
  color: #24384f;
  font-size: 14px;
}

.helper {
  color: #74869b;
  font-size: 13px;
  line-height: 1.7;
}

.empty-card {
  border: 1px dashed #d5e2ee;
  border-radius: 18px;
  padding: 18px;
  background: #fbfdff;
  color: #6b7f97;
}

@media (max-width: 960px) {
  .layout {
    padding: 22px 16px 32px;
  }

  .topbar {
    flex-direction: column;
  }

  .nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid,
  .forum-layout,
  .field.inline,
  .ranking-setting-row {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .subtabs {
    gap: 8px;
  }

  .subtab {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }

  .ranking-setting-actions {
    justify-content: flex-start;
  }
}
