:root {
  color-scheme: light;
  --bg: #f4f9ff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --line: rgba(24, 77, 145, 0.14);
  --text: #16324f;
  --muted: #557089;
  --brand: #0d6bc7;
  --brand-deep: #0a4d9a;
  --brand-soft: #d9ebff;
  --accent: #28b3d6;
  --shadow: 0 20px 50px rgba(15, 68, 122, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 107, 199, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(40, 179, 214, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar,
.hero,
.section,
.footer {
  backdrop-filter: blur(14px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 18px;
  border-radius: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
}

.brand-text {
  display: grid;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 1rem;
}

.brand-text small,
.section-desc,
.lead,
.form-note,
.footer p,
.footer span,
.panel-note {
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.95rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.member-status {
  display: grid;
  gap: 2px;
  text-align: right;
}

.member-status strong {
  font-size: 0.98rem;
}

.member-status small {
  color: var(--muted);
  font-size: 0.82rem;
}

.member-role {
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
}

.nav a {
  padding: 10px 0;
}

.hero {
  margin-top: 18px;
  border-radius: 24px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1,
.section h2 {
  margin: 0;
  line-height: 1.12;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  color: #0e3e78;
}

.lead {
  max-width: 60ch;
  margin: 16px 0 0;
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  box-shadow: 0 14px 24px rgba(13, 107, 199, 0.24);
}

.button.secondary,
.button.ghost {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(13, 107, 199, 0.18);
  color: var(--brand-deep);
}

.hero-panel {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 14px;
}

.logo-preview {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
}

.panel-note {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: center;
  font-size: 0.95rem;
  max-width: 44ch;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(40, 179, 214, 0.15);
  flex: 0 0 auto;
}

.section {
  margin-top: 18px;
  border-radius: 24px;
  padding: 24px 24px 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.section h2 {
  font-size: clamp(1.4rem, 2.8vw, 2.05rem);
}

.section-desc {
  max-width: 44ch;
  margin: 0;
  line-height: 1.7;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-nav .nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(13, 107, 199, 0.06);
  border: 1px solid rgba(13, 107, 199, 0.12);
  color: var(--brand-deep);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.18s ease;
}

.section-nav .nav-link:hover {
  background: rgba(13, 107, 199, 0.1);
  border-color: rgba(13, 107, 199, 0.22);
  transform: translateY(-1px);
}

.app-grid,
.material-grid {
  display: grid;
  gap: 16px;
}

.app-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.material-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-card,
.material-card,
.message-form,
.message-feed-panel {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(13, 64, 118, 0.08);
}

.app-card,
.material-card {
  padding: 18px;
  min-height: 190px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(13, 107, 199, 0.12), rgba(40, 179, 214, 0.2));
  color: var(--brand-deep);
  font-size: 1.2rem;
  font-weight: 700;
}

.app-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.app-card p,
.material-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(13, 107, 199, 0.08);
  color: var(--brand-deep);
  font-size: 0.82rem;
}

.app-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--brand);
  font-weight: 700;
}

.app-link.is-disabled {
  color: var(--muted);
  cursor: default;
}

.app-link::after {
  content: "→";
  margin-left: 6px;
}

.material-toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.material-toolbar label,
.material-field-grid label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

.material-toolbar select,
.material-field-grid input,
.material-field-grid select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(13, 107, 199, 0.18);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.material-card {
  display: flex;
  flex-direction: column;
}

.material-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.material-card h3 {
  margin: 4px 0 0;
  line-height: 1.25;
}

.material-type {
  margin: 0;
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 700;
}

.status-badge {
  flex: 0 0 auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(40, 179, 214, 0.12);
  color: #087692;
  font-size: 0.82rem;
  font-weight: 700;
}

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

.material-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(23, 132, 91, 0.09);
  color: #126a4c;
  font-size: 0.82rem;
}

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

.button.is-disabled,
.button.is-disabled:hover {
  cursor: default;
  transform: none;
  color: var(--muted);
}

.message-area {
  display: grid;
  gap: 20px;
}

.message-form {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.message-form label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.message-form span {
  font-weight: 700;
}

.message-form .full {
  grid-column: 1 / -1;
}

.material-fields {
  border: 1px solid rgba(13, 107, 199, 0.16);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(13, 107, 199, 0.04);
}

.material-fields legend {
  padding: 0 8px;
  color: var(--brand-deep);
  font-weight: 700;
}

.material-fields .form-note {
  margin: 0 0 14px;
}

.material-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.message-form input,
.message-form select,
.message-form textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(13, 107, 199, 0.18);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.message-form textarea {
  resize: vertical;
  min-height: 140px;
}

.message-form input:focus,
.message-form select:focus,
.message-form textarea:focus,
.material-toolbar select:focus,
.material-field-grid input:focus,
.material-field-grid select:focus {
  border-color: rgba(13, 107, 199, 0.42);
  box-shadow: 0 0 0 4px rgba(13, 107, 199, 0.08);
}

.form-actions,
.form-note {
  grid-column: 1 / -1;
}

.message-feed-panel {
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.feed-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.feed-panel-head h3 {
  margin: 0;
  line-height: 1.15;
  font-size: 1.18rem;
}

.feed-panel-head .section-desc {
  max-width: 20ch;
  margin: 0;
  text-align: right;
}

.message-feed {
  display: grid;
  gap: 12px;
  max-height: 540px;
  overflow: auto;
  padding-right: 2px;
}

.message-item {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(13, 64, 118, 0.08);
}

.message-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.message-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.message-item-meta span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(13, 107, 199, 0.08);
  color: var(--brand-deep);
  font-size: 0.8rem;
}

.message-item p {
  margin: 10px 0 0;
  line-height: 1.7;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(13, 107, 199, 0.1);
  color: var(--brand-deep);
  font-size: 0.92rem;
  font-weight: 600;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(40, 179, 214, 0.12);
  color: #087692;
  font-size: 0.86rem;
  font-weight: 700;
}

/* Footer locked to viewport bottom */
.footer {
  margin-top: auto;
  border-radius: 18px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.footer span,
.footer p {
  font-size: 0.9rem;
}

.footer-meta {
  text-align: right;
}

.footer-meta p {
  margin: 4px 0 0;
}

.footer-public-security a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.footer-public-security img {
  width: 18px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}

.admin-shell {
  width: min(1380px, calc(100% - 32px));
}

.admin-grid {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.admin-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 20px;
}

.admin-stats > div {
  display: grid;
  gap: 6px;
  text-align: center;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: rgba(13, 107, 199, 0.06);
  border: 1px solid rgba(13, 107, 199, 0.12);
}

.admin-stats strong {
  font-size: 1.8rem;
  color: var(--brand-deep);
}

.admin-stats span {
  font-size: 0.88rem;
  color: var(--muted);
}

.section.is-locked {
  position: relative;
}

.section.is-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  border-radius: var(--radius);
  pointer-events: none;
}

.admin-meta-box {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(13, 107, 199, 0.04);
  border: 1px solid rgba(13, 107, 199, 0.12);
  margin-bottom: 16px;
}

.admin-meta-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-deep);
}

.admin-meta-box p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-form-grid label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.admin-form-grid span {
  font-weight: 700;
}

.admin-form-grid .full {
  grid-column: 1 / -1;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(13, 107, 199, 0.18);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.admin-form-grid input:focus,
.admin-form-grid select:focus,
.admin-form-grid textarea:focus {
  border-color: rgba(13, 107, 199, 0.42);
  box-shadow: 0 0 0 4px rgba(13, 107, 199, 0.08);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.admin-actions.full {
  grid-column: 1 / -1;
}

.stack-list {
  display: grid;
  gap: 14px;
}

.admin-card {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(13, 64, 118, 0.08);
  display: grid;
  gap: 14px;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.section-tools {
  display: flex;
  gap: 12px;
}

.json-preview {
  width: 100%;
  min-height: 320px;
  border-radius: 14px;
  border: 1px solid rgba(13, 107, 199, 0.18);
  background: #fff;
  color: var(--text);
  padding: 14px;
  outline: none;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  resize: vertical;
}

.json-preview:focus {
  border-color: rgba(13, 107, 199, 0.42);
  box-shadow: 0 0 0 4px rgba(13, 107, 199, 0.08);
}

.file-button {
  position: relative;
  cursor: pointer;
}

.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.permission-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(13, 107, 199, 0.08);
  border: 1px solid rgba(13, 107, 199, 0.12);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.permission-chip:hover {
  background: rgba(13, 107, 199, 0.12);
  border-color: rgba(13, 107, 199, 0.2);
}

.permission-chip input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.key-form {
  display: grid;
  gap: 14px;
}

.key-form label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.key-form span {
  font-weight: 700;
}

.key-form input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(13, 107, 199, 0.18);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.key-form input:focus {
  border-color: rgba(13, 107, 199, 0.42);
  box-shadow: 0 0 0 4px rgba(13, 107, 199, 0.08);
}

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

  .app-grid,
  .material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-hero {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
  }

  .hero {
    padding: 20px;
  }

  .app-grid,
  .material-grid {
    grid-template-columns: 1fr;
  }

  .material-toolbar {
    grid-template-columns: 1fr;
  }

  .message-form {
    grid-template-columns: 1fr;
  }

  .material-field-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }

  .footer-meta {
    text-align: center;
  }

  .footer-public-security a {
    justify-content: center;
  }
}

/* Home portal visual refresh */
.home-page {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --line: #dce5ee;
  --text: #17283a;
  --muted: #607387;
  --brand: #1269b0;
  --brand-deep: #0b477c;
  --brand-soft: #e5f1fa;
  --accent: #18a999;
  --shadow: 0 12px 32px rgba(23, 53, 82, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  font-family: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, #f8fafc 0, #eef3f8 540px, #f5f7fa 100%);
}

.home-page .page-shell {
  width: min(1320px, calc(100% - 40px));
  padding: 0 0 32px;
}

.home-page .topbar,
.home-page .hero,
.home-page .section,
.home-page .footer {
  backdrop-filter: none;
}

.home-page .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(210, 222, 233, 0.9);
  border-radius: 0;
  background: rgba(248, 250, 252, 0.94);
  box-shadow: none;
}

.home-page .brand-mark {
  width: 46px;
  height: 46px;
}

.home-page .brand-text strong {
  color: #0d3e69;
  font-size: 1.08rem;
}

.home-page .brand-text small {
  margin-top: 4px;
  font-size: 0.75rem;
}

.home-page .topbar-badge {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cde6e1;
  border-radius: 4px;
  background: #edf8f6;
  color: #08776b;
  font-size: 0.78rem;
}

.home-page .nav {
  gap: 4px;
  margin-left: auto;
}

.home-page .nav a {
  padding: 9px 12px;
  border-radius: 4px;
  color: #42586c;
  font-size: 0.9rem;
  font-weight: 600;
}

.home-page .nav a:hover {
  background: #e8eff5;
  color: var(--brand-deep);
}

.home-page .topbar-user {
  gap: 10px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.home-page .member-status small {
  font-size: 0.76rem;
}

.home-page .button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 5px;
  font-weight: 700;
}

.home-page .button.primary {
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(18, 105, 176, 0.2);
}

.home-page .button.primary:hover {
  background: #0e5b9b;
}

.home-page .button.secondary,
.home-page .button.ghost {
  background: #fff;
  border-color: #cbd9e5;
}

.home-page .hero {
  position: relative;
  min-height: 400px;
  margin-top: 24px;
  padding: 56px 64px;
  overflow: hidden;
  grid-template-columns: minmax(0, 760px);
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(100deg, rgba(8, 58, 102, 0.97) 0%, rgba(12, 82, 137, 0.95) 54%, rgba(17, 115, 161, 0.8) 100%),
    var(--hbnfp-hero-logo, url("./assets/logo-animated.gif")) right 4% center / 54% auto no-repeat;
  box-shadow: 0 22px 52px rgba(15, 57, 91, 0.16);
}

.home-page .hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, #18a999 0 34%, #53b9db 34% 68%, #f1b24a 68% 100%);
}

.home-page .hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
}

.home-page .eyebrow {
  color: #7be0d3;
  font-size: 0.84rem;
  font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace;
}

.home-page .hero h1 {
  color: #fff;
  font-size: clamp(3rem, 5vw, 4.8rem);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 800;
}

.home-page .lead {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.05rem;
  line-height: 1.85;
}

.home-page .hero-pills {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, max-content);
  width: max-content;
  gap: 0;
  padding-top: 15px;
}

.home-page .hero-pills::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 10px;
  left: 7px;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
}

.home-page .hero-pills span {
  position: relative;
  min-height: 22px;
  padding: 0 24px 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 600;
}

.home-page .hero-pills span::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 7px;
  width: 5px;
  height: 10px;
  background: #64ddd0;
}

.home-page .hero-pills span:nth-child(2)::before {
  height: 15px;
  background: #67c7e8;
}

.home-page .hero-pills span:nth-child(3)::before {
  height: 7px;
  background: #f0b44d;
}

.home-page .hero .button.primary {
  color: #0b477c;
  background: #fff;
  box-shadow: none;
}

.home-page .hero .button.secondary {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.34);
}

.home-page .section {
  margin-top: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-page .section-head {
  align-items: end;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.home-page .section-kicker {
  margin-bottom: 7px;
  color: #148879;
  font-size: 0.78rem;
  font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace;
}

.home-page .section h2 {
  color: #183b5b;
  font-size: 1.65rem;
}

.home-page .app-grid,
.home-page .material-grid {
  gap: 14px;
}

.home-page .app-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-page .app-card,
.home-page .material-card,
.home-page .message-form,
.home-page .message-feed-panel {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(33, 60, 83, 0.06);
}

.home-page .app-card {
  --tool-accent: #00a89b;
  position: relative;
  min-height: 218px;
  padding: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-page .app-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--tool-accent);
  opacity: 0.82;
  transition: opacity 0.2s ease;
}

.home-page .app-card:hover {
  transform: translateY(-3px);
  border-color: #bfd4e5;
  box-shadow: 0 14px 28px rgba(28, 63, 91, 0.11);
}

.home-page .app-card:hover::before {
  opacity: 1;
}

.home-page .app-card[data-icon="chart"] {
  --tool-accent: #0e86c6;
}

.home-page .app-card[data-icon="brand"] {
  --tool-accent: #f0b44d;
}

.home-page .app-card[data-icon="poster"] {
  --tool-accent: #e56b55;
}

.home-page .app-card[data-icon="config"] {
  --tool-accent: #00a89b;
}

.home-page .app-card[data-icon="message"] {
  --tool-accent: #5977a7;
}

.home-page .app-card h3 {
  margin: 3px 0 0;
  color: #173b5d;
  font-size: 1.03rem;
  line-height: 1.45;
}

.home-page .app-domain {
  display: block;
  margin-top: 7px;
  color: #718497;
  font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.2;
}

.home-page .app-icon {
  width: 44px;
  height: 44px;
  border: 1px solid #d7e6f0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tool-accent) 9%, white);
  color: var(--tool-accent);
}

.home-page .app-card p,
.home-page .material-card p {
  font-size: 0.9rem;
  line-height: 1.65;
}

.home-page .card-tags {
  gap: 6px;
  margin-top: 14px;
}

.home-page .app-card .card-tags {
  margin-bottom: 2px;
}

.home-page .tag,
.home-page .status-badge,
.home-page .material-meta span,
.home-page .message-item-meta span {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 0.74rem;
}

.home-page .app-link {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.88rem;
}

.home-page .app-link::after {
  transition: transform 0.18s ease;
}

.home-page .app-link:hover::after {
  transform: translateX(3px);
}

.home-page a:focus-visible,
.home-page button:focus-visible,
.home-page input:focus-visible,
.home-page select:focus-visible,
.home-page textarea:focus-visible {
  outline: 3px solid rgba(240, 180, 77, 0.72);
  outline-offset: 3px;
}

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

.home-page .hero-copy > * {
  animation: portal-rise 0.55s both;
}

.home-page .hero-copy > :nth-child(2) {
  animation-delay: 0.06s;
}

.home-page .hero-copy > :nth-child(3) {
  animation-delay: 0.12s;
}

.home-page .hero-copy > :nth-child(4) {
  animation-delay: 0.18s;
}

.home-page .hero-copy > :nth-child(5) {
  animation-delay: 0.24s;
}

.home-page .app-card {
  animation: portal-rise 0.45s both;
}

.home-page .app-card:nth-child(2) { animation-delay: 0.04s; }
.home-page .app-card:nth-child(3) { animation-delay: 0.08s; }
.home-page .app-card:nth-child(4) { animation-delay: 0.12s; }
.home-page .app-card:nth-child(5) { animation-delay: 0.16s; }
.home-page .app-card:nth-child(6) { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .home-page *,
  .home-page *::before,
  .home-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.home-page .material-toolbar {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.home-page .material-toolbar select,
.home-page .material-field-grid input,
.home-page .material-field-grid select,
.home-page .message-form input,
.home-page .message-form select,
.home-page .message-form textarea {
  border-radius: 5px;
}

.home-page .material-card {
  min-height: 210px;
}

.home-page .message-area {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  align-items: start;
}

.home-page .message-area > .section-head,
.home-page .message-area > .section-nav {
  grid-column: 1 / -1;
}

.home-page .message-form,
.home-page .message-feed-panel {
  padding: 22px;
}

.home-page .message-item {
  border-radius: 6px;
  box-shadow: none;
}

.home-page .section-nav {
  margin-top: 20px;
  padding-top: 16px;
}

.home-page .section-nav .nav-link {
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.85rem;
}

.home-page .section-nav .nav-link:hover {
  background: transparent;
}

.home-page .footer {
  margin-top: 56px;
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 1080px) {
  .home-page .topbar-badge,
  .home-page .member-status {
    display: none;
  }

  .home-page .hero {
    padding: 48px;
    grid-template-columns: minmax(0, 700px);
  }

  .home-page .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .home-page .page-shell {
    width: min(100% - 28px, 720px);
  }

  .home-page .topbar {
    position: static;
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .home-page .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .home-page .nav a {
    flex: 0 0 auto;
  }

  .home-page .topbar-user {
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
  }

  .home-page .hero {
    min-height: 500px;
    padding: 42px 34px;
    grid-template-columns: 1fr;
  }

  .home-page .app-grid,
  .home-page .material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-page .material-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-page .message-area {
    grid-template-columns: 1fr;
  }

  .home-page .message-area > .section-head,
  .home-page .message-area > .section-nav {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  .home-page .page-shell {
    width: min(100% - 20px, 520px);
  }

  .home-page .brand-text small {
    display: none;
  }

  .home-page .topbar-user .button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .home-page .hero {
    min-height: 0;
    margin-top: 14px;
    padding: 28px 22px 30px;
    background-size: auto, 76% auto;
    background-position: center, center bottom;
  }

  .home-page .hero h1 {
    font-size: 2.35rem;
  }

  .home-page .lead {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.88rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .home-page .hero-pills {
    display: none;
  }

  .home-page .hero-actions {
    gap: 8px;
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .home-page .hero-actions .button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.84rem;
  }

  .home-page .hero-actions .button:first-child {
    grid-column: 1 / -1;
  }

  .home-page .section {
    margin-top: 38px;
  }

  .home-page .section-head {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .home-page .section h2 {
    font-size: 1.25rem;
    line-height: 1.35;
  }

  .home-page .app-grid,
  .home-page .material-grid,
  .home-page .material-toolbar {
    grid-template-columns: 1fr;
  }

  .home-page .app-card {
    min-height: 0;
  }

  .home-page .message-form {
    padding: 18px;
  }
}
