.page-home {
  --home-panel-pad: 1.25rem;
  --home-gap: 1.25rem;
  --home-radius: 2px;
  --home-gold-soft: rgba(212, 175, 55, 0.08);
  --home-purple-soft: rgba(157, 78, 221, 0.14);
}

.page-home::before {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple), var(--gold), transparent);
  opacity: 0.55;
}

.page-home {
  padding-bottom: 2rem;
}

.page-home .section-annotation {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  border-left: 2px solid var(--gold);
  padding-left: 0.6rem;
  line-height: 1.4;
}

.page-home h2 {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.3;
  margin: 0.5rem 0 0.4rem;
  color: var(--text-primary);
}

.page-home a:focus-visible,
.page-home summary:focus-visible,
.page-home .btn:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.home-hero {
  padding: 1.5rem 0 0.75rem;
}

.home-hero .breadcrumb {
  margin-bottom: 1.25rem;
}

.home-hero-grid {
  display: grid;
  gap: 1.5rem;
}

.home-hero-copy h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.65rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0.6rem 0 0.8rem;
  color: var(--text-primary);
}

.home-hero-desc {
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-secondary);
  max-width: 46rem;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.home-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 0;
}

.home-stat {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-fine);
  border-left: 2px solid var(--gold);
  border-radius: var(--home-radius);
  padding: 1rem 1.1rem;
}

.home-stat dt {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.home-stat dd {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.01em;
}

.home-directory {
  display: grid;
  gap: var(--home-gap);
  align-items: start;
  margin-top: 1.5rem;
}

.home-record-panel,
.home-category-panel,
.home-quick-panel {
  scroll-margin-top: 6rem;
}

.home-record-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(74, 14, 78, 0.5), rgba(10, 17, 40, 0.92));
  border: 1px solid var(--border-fine);
  border-radius: var(--home-radius);
  box-shadow: inset 0 0 42px var(--home-purple-soft);
}

.home-record-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
  pointer-events: none;
}

.home-record-inner {
  position: relative;
  padding: var(--home-panel-pad);
}

.home-panel-note,
.home-quick-sub {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.home-record-range {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.home-range-btn {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-fine);
  border-radius: var(--home-radius);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.home-range-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.home-range-btn.is-active {
  border-color: var(--gold);
  color: var(--gold);
}

.home-record-panel:has(.home-record-group:target) .home-range-btn {
  opacity: 0.55;
  border-color: var(--border-fine);
  color: var(--text-secondary);
}

.home-record-panel:has(#record-week:target) .home-range-btn[href="#record-week"],
.home-record-panel:has(#record-month:target) .home-range-btn[href="#record-month"],
.home-record-panel:has(#record-year:target) .home-range-btn[href="#record-year"] {
  opacity: 1;
  border-color: var(--gold);
  color: var(--gold);
}

.home-record-groups {
  margin-top: 1rem;
}

.home-record-group {
  scroll-margin-top: 6rem;
  display: none;
}

.home-record-group:first-child {
  display: block;
}

.home-record-panel:has(.home-record-group:target) .home-record-group:not(:target) {
  display: none;
}

.home-record-panel:has(.home-record-group:target) .home-record-group:target {
  display: block;
}

@supports not selector(:has(*)) {
  .home-record-group {
    display: block;
  }
}

.home-record-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(42, 63, 95, 0.6);
  transition: background-color 0.2s ease;
}

.home-record-item:hover {
  background: var(--home-gold-soft);
}

.home-record-floor {
  flex: 0 0 auto;
  min-width: 2.4rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bg-primary);
  background: var(--gold);
  padding: 0.2rem 0.4rem;
  border-radius: var(--home-radius);
}

.home-record-body h3 {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--text-primary);
}

.home-record-body p {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.home-record-stale {
  margin: 1rem 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-secondary);
  border-left: 2px solid var(--purple);
  padding-left: 0.6rem;
  line-height: 1.7;
}

.home-record-more {
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

.home-category-panel {
  background: rgba(10, 17, 40, 0.6);
  border: 1px solid var(--border-fine);
  border-radius: var(--home-radius);
  padding: 1rem;
}

.home-category-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--home-radius);
  border: 1px solid var(--border-fine);
  min-height: 220px;
  display: flex;
  align-items: flex-end;
}

.home-category-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.home-category-banner-text {
  position: relative;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(6, 13, 31, 0.94), rgba(6, 13, 31, 0.15), transparent);
  width: 100%;
}

.home-category-banner-text p {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin: 0.35rem 0 0;
  line-height: 1.6;
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.home-cat-card {
  background: rgba(22, 42, 69, 0.72);
  border: 1px solid var(--border-fine);
  border-radius: var(--home-radius);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.home-cat-card:hover {
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(22, 42, 69, 0.96);
  box-shadow: 0 0 18px rgba(157, 78, 221, 0.16);
}

.home-cat-card summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.home-cat-card summary::-webkit-details-marker {
  display: none;
}

.home-cat-no {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.45);
  padding: 0.12rem 0.35rem;
  border-radius: var(--home-radius);
  line-height: 1.3;
}

.home-cat-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.home-cat-meta {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.home-cat-card summary::after {
  content: "展开";
  font-size: 0.6875rem;
  color: var(--text-secondary);
  flex: 0 0 auto;
}

.home-cat-card[open] summary::after {
  content: "收起";
  color: var(--gold);
}

.home-cat-subs {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.9rem 0.85rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem 0.75rem;
  border-top: 1px dashed var(--border-fine);
}

.home-cat-subs li {
  min-width: 0;
}

.home-cat-subs a {
  color: var(--text-secondary);
  font-weight: 300;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.2s ease;
  line-height: 1.4;
}

.home-cat-subs a:hover {
  color: var(--gold-bright);
}

.home-quick-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 42, 69, 0.92), rgba(10, 17, 40, 0.97));
  border: 1px solid var(--border-fine);
  border-radius: var(--home-radius);
  padding: 1.25rem 1.25rem 1.5rem;
  scroll-margin-top: 6rem;
}

.home-quick-bg {
  position: absolute;
  top: -2.5rem;
  right: -2.5rem;
  width: 150px;
  height: 150px;
  object-fit: cover;
  opacity: 0.16;
  border-radius: 50%;
  pointer-events: none;
}

.home-quick-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.home-quick-entry {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: rgba(10, 17, 40, 0.6);
  border: 1px solid var(--border-fine);
  border-radius: var(--home-radius);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.home-quick-entry:hover {
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(22, 42, 69, 0.96);
}

.home-quick-no {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
}

.home-quick-body {
  min-width: 0;
}

.home-quick-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.home-quick-desc {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
  transition: max-height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.home-quick-entry:hover .home-quick-desc,
.home-quick-entry:focus .home-quick-desc,
.home-quick-entry:focus-within .home-quick-desc {
  max-height: 4.5rem;
  margin-top: 0.3rem;
  opacity: 1;
}

.home-quick-note {
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px dashed var(--border-fine);
  padding-top: 0.8rem;
}

.home-update {
  padding-top: 2.5rem;
  scroll-margin-top: 6rem;
}

.home-update-head {
  margin-bottom: 1rem;
}

.home-update-lead {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 40rem;
  margin: 0;
}

.home-update-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1rem;
}

.home-update-table-wrap {
  position: relative;
  overflow-x: auto;
  background: rgba(22, 42, 69, 0.5);
  border: 1px solid var(--border-fine);
  border-radius: var(--home-radius);
  padding: 0.75rem 0.5rem;
}

.home-floor-pointer {
  display: none;
}

.home-update-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.home-update-table th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold);
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  white-space: nowrap;
}

.home-update-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-fine);
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-primary);
}

.home-update-table tr:last-child td {
  border-bottom: none;
}

.home-update-table tr:hover td {
  background: var(--home-gold-soft);
}

.home-update-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.home-update-img {
  max-width: 200px;
  width: 100%;
  height: auto;
  border-radius: var(--home-radius);
  border: 1px solid var(--border-fine);
}

.home-update-note {
  align-self: stretch;
  background: var(--home-purple-soft);
  border: 1px solid rgba(157, 78, 221, 0.35);
  border-radius: var(--home-radius);
  padding: 1rem;
}

.home-update-note h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 0.4rem;
}

.home-update-note p {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0;
}

.home-extension {
  padding-top: 2.5rem;
}

.home-extension-head {
  margin-bottom: 1rem;
}

.home-extension-list {
  display: grid;
  gap: 0.75rem;
}

.home-ext-card {
  display: block;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(140deg, rgba(22, 42, 69, 0.85), rgba(10, 17, 40, 0.92));
  border: 1px solid var(--border-fine);
  border-radius: var(--home-radius);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.home-ext-card:hover {
  border-color: rgba(212, 175, 55, 0.5);
  background: linear-gradient(140deg, rgba(22, 42, 69, 0.96), rgba(10, 17, 40, 0.96));
}

.home-ext-title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gold);
}

.home-ext-desc {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (min-width: 700px) {
  .home-hero-grid {
    grid-template-columns: 1fr 320px;
    align-items: end;
  }

  .home-directory {
    grid-template-columns: minmax(260px, 320px) 1fr;
  }

  .home-quick-panel {
    grid-column: 1 / -1;
  }

  .home-quick-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .home-quick-desc {
    max-height: none;
    opacity: 1;
    margin-top: 0.3rem;
  }

  .home-update-grid {
    grid-template-columns: 1fr 230px;
    align-items: start;
  }

  .home-update-side {
    align-items: flex-start;
  }

  .home-extension-list {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1100px) {
  .home-directory {
    grid-template-columns: minmax(280px, 320px) 1fr 280px;
  }

  .home-quick-panel {
    grid-column: auto;
  }

  .home-quick-list {
    display: flex;
    flex-direction: column;
  }

  .home-quick-desc {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
  }

  .home-quick-entry:hover .home-quick-desc,
  .home-quick-entry:focus .home-quick-desc,
  .home-quick-entry:focus-within .home-quick-desc {
    max-height: 4.5rem;
    margin-top: 0.3rem;
    opacity: 1;
  }

  .home-update-grid {
    grid-template-columns: 1fr 260px;
  }

  .home-update-table-wrap {
    display: flex;
    gap: 1rem;
    padding: 1rem;
  }

  .home-floor-pointer {
    display: block;
    flex: 0 0 40px;
    width: 40px;
    height: 200px;
    margin-top: 0.5rem;
  }

  .home-update-table {
    min-width: 0;
  }
}
