:root {
  --paper: #f7f4ee;
  --surface: #fffdfa;
  --ink: #26221e;
  --muted: #6e675e;
  --line: #e8e2d6;
  --teal: #16697a;
  --teal-soft: #e6f0f1;
  --red: #c0392b;
  --green: #3e8e5a;
  --amber: #c08a2d;
  --shadow: 0 16px 48px rgba(69, 55, 35, 0.08);
  --header-height: 72px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  --paper: #17150f;
  --surface: #201c15;
  --ink: #ede6d8;
  --muted: #aaa193;
  --line: #373127;
  --teal: #4fb3c4;
  --teal-soft: #183940;
  --red: #ef786b;
  --green: #65b27d;
  --amber: #dda94a;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 6%, color-mix(in srgb, var(--teal) 8%, transparent), transparent 28rem),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto auto minmax(240px, 430px) auto;
  gap: 28px;
  align-items: center;
  width: min(1440px, calc(100% - 48px));
  min-height: var(--header-height);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  width: max-content;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  background: var(--teal);
  border-radius: 12px;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 13px;
  letter-spacing: 0.15em;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.main-nav {
  display: flex;
  gap: 6px;
}

.main-nav a {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  border-radius: 9px;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--teal);
  background: var(--teal-soft);
}

.header-search,
.mobile-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.header-search input,
.mobile-search input {
  width: 100%;
  min-width: 0;
  padding: 11px 42px 11px 42px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.header-search:focus-within,
.mobile-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent);
}

.search-icon {
  position: absolute;
  left: 15px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  content: "";
  background: var(--muted);
  transform: rotate(45deg);
}

kbd {
  position: absolute;
  right: 10px;
  padding: 2px 7px;
  color: var(--muted);
  font-size: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 200;
  max-height: min(480px, 70vh);
  padding: 8px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.suggestion-label {
  padding: 10px 10px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.suggestion-item:hover,
.suggestion-item:focus-visible {
  background: var(--teal-soft);
}

.suggestion-item small {
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.personal-link {
  padding: 11px 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--teal);
  border-radius: 10px;
}

.mobile-search,
.mobile-groups {
  display: none;
}

.site-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 44px;
  width: min(1200px, calc(100% - 48px));
  min-height: calc(100vh - var(--header-height));
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  align-self: start;
  max-height: calc(100vh - var(--header-height) - 56px);
  padding: 32px 20px 32px 0;
  overflow: auto;
  border-right: 1px solid var(--line);
}

.sidebar-section + .sidebar-section {
  margin-top: 32px;
}

.sidebar-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.group-nav,
.popular-nav {
  display: grid;
  gap: 3px;
}

.group-link,
.popular-link {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.group-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.group-link::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  content: "";
  background: var(--group-color, var(--teal));
  border-radius: 50%;
}

.group-link span:first-of-type {
  flex: 1;
}

.group-link:hover,
.popular-link:hover {
  color: var(--ink);
  background: var(--surface);
}

.group-link[aria-current="true"] {
  color: var(--group-color, var(--teal));
  background: color-mix(in srgb, var(--group-color, var(--teal)) 12%, var(--surface));
  box-shadow: inset 3px 0 0 var(--group-color, var(--teal));
}

.group-link[aria-current="true"] small {
  color: currentColor;
}

.group-link small,
.popular-link small {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.popular-link {
  padding-block: 7px;
  font-size: 13px;
}

.popular-link span {
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-note {
  margin: 32px 10px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

#view-root {
  min-width: 0;
  padding: 56px 0 96px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  font-family: Georgia, "Songti SC", "STSong", serif;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(46px, 7vw, 82px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero-intro {
  max-width: 690px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
}

.hero-search {
  position: relative;
  display: flex;
  max-width: 760px;
  margin-top: 32px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.hero-search input {
  width: 100%;
  min-width: 0;
  padding: 18px 20px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.hero-search button {
  flex: 0 0 auto;
  padding: 0 24px;
  color: #fff;
  font-weight: 800;
  background: var(--teal);
  border: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 38px 0 0;
}

.stat-card {
  padding: 20px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stat-card dt {
  color: var(--muted);
  font-size: 12px;
}

.stat-card dd {
  margin: 8px 0 0;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.section {
  margin-top: 72px;
}

.section-heading,
.page-heading,
.toolbar,
.result-summary {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2,
.page-heading h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.section-heading p,
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.text-link {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

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

.track-card {
  position: relative;
  display: flex;
  min-height: 184px;
  padding: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.track-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  content: "";
  background: var(--group-color, var(--teal));
}

.track-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.track-card-content {
  display: flex;
  width: 100%;
  flex-direction: column;
}

.track-card-top,
.track-card-footer,
.article-meta,
.article-actions,
.account-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.group-tag,
.status-tag {
  display: inline-flex;
  width: max-content;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
}

.group-tag {
  color: var(--group-color, var(--teal));
  background: color-mix(in srgb, var(--group-color, var(--teal)) 11%, transparent);
}

.track-card h3 {
  margin: 18px 0 8px;
  font-size: 20px;
  line-height: 1.35;
}

.track-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.track-card-footer {
  margin-top: auto;
  padding-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.track-card-footer strong {
  color: var(--ink);
}

.article-list {
  display: grid;
  gap: 10px;
}

.article-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.article-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--group-color, var(--teal));
  font-family: Georgia, serif;
  font-weight: 700;
  background: color-mix(in srgb, var(--group-color, var(--teal)) 10%, transparent);
  border-radius: 10px;
}

.article-copy {
  min-width: 0;
}

.article-copy h3 {
  margin: 0 0 7px;
  overflow: hidden;
  font-family: inherit;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-meta {
  justify-content: start;
  color: var(--muted);
  font-size: 12px;
}

.meta-link {
  color: var(--teal);
  font-weight: 700;
}

.status-tag {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 11%, transparent);
}

.article-actions {
  justify-content: end;
}

.small-button {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.small-button:hover {
  color: var(--teal);
  border-color: var(--teal);
}

.small-button.primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.page-heading {
  align-items: start;
  margin-bottom: 32px;
}

.page-heading-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.page-heading-copy {
  max-width: 720px;
}

.page-heading-copy > p:last-child {
  margin-top: 14px;
  line-height: 1.75;
}

.count-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  background: var(--teal-soft);
  border-radius: 999px;
}

.toolbar {
  align-items: center;
  margin-bottom: 22px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar strong {
  color: var(--ink);
}

.toolbar label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.toolbar select {
  padding: 7px 28px 7px 9px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.account-card {
  display: flex;
  min-height: 158px;
  padding: 20px;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.account-card:hover {
  border-color: var(--teal);
}

.account-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--teal);
  font-family: Georgia, serif;
  font-weight: 800;
  background: var(--teal-soft);
  border-radius: 50%;
}

.account-card h3 {
  margin: 16px 0 6px;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card > p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-meta {
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb a:hover {
  color: var(--teal);
}

.detail-header {
  position: relative;
  padding: 28px 30px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.detail-header::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  content: "";
  background: var(--group-color, var(--teal));
}

.detail-header h1 {
  margin-top: 16px;
  font-size: clamp(36px, 6vw, 64px);
}

.detail-stats {
  display: flex;
  gap: 18px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.detail-stats strong {
  color: var(--ink);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 11px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  background: var(--teal-soft);
  border: 0;
  border-radius: 999px;
}

.empty-state {
  padding: 64px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.empty-state h2 {
  margin: 0 0 10px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.load-more {
  min-width: 180px;
  padding: 12px 18px;
  color: var(--teal);
  font-weight: 800;
  background: transparent;
  border: 1px solid var(--teal);
  border-radius: 10px;
}

.load-more:hover {
  color: #fff;
  background: var(--teal);
}

.site-footer {
  display: flex;
  gap: 32px;
  align-items: end;
  justify-content: space-between;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.site-footer strong {
  color: var(--ink);
  letter-spacing: 0.08em;
}

.site-footer p {
  margin: 8px 0 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  padding: 12px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: auto auto minmax(220px, 1fr) auto;
    gap: 14px;
  }

  .brand-copy,
  .personal-link {
    display: none;
  }

  .site-shell {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 28px;
  }

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

@media (max-width: 767px) {
  :root {
    --header-height: 60px;
  }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    width: min(100% - 32px, 720px);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .main-nav {
    justify-content: center;
  }

  .main-nav a {
    padding-inline: 9px;
    font-size: 13px;
  }

  .header-search {
    display: none;
  }

  .mobile-search {
    display: flex;
    width: calc(100% - 32px);
    margin: 14px auto 10px;
    z-index: 90;
  }

  .mobile-search input {
    padding-right: 14px;
  }

  .mobile-groups {
    display: flex;
    gap: 8px;
    width: 100%;
    padding: 0 16px 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-groups::-webkit-scrollbar {
    display: none;
  }

  .mobile-group {
    flex: 0 0 auto;
    padding: 8px 11px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .mobile-group[aria-current="true"] {
    color: var(--group-color, var(--teal));
    background: color-mix(in srgb, var(--group-color, var(--teal)) 12%, var(--surface));
    border-color: var(--group-color, var(--teal));
    box-shadow: inset 0 -2px 0 var(--group-color, var(--teal));
  }

  .site-shell {
    display: block;
    width: calc(100% - 32px);
  }

  .sidebar {
    display: none;
  }

  #view-root {
    padding: 34px 0 72px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .hero-intro {
    font-size: 16px;
  }

  .hero-search {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 28px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card dd {
    font-size: 26px;
  }

  .section {
    margin-top: 56px;
  }

  .section-heading,
  .page-heading,
  .toolbar {
    align-items: start;
  }

  .page-heading,
  .toolbar {
    flex-direction: column;
  }

  .page-heading-actions {
    width: 100%;
  }

  .page-heading-actions .small-button {
    flex: 1;
    text-align: center;
  }

  .section-heading h2,
  .page-heading h1 {
    font-size: 34px;
  }

  .section-heading > p {
    display: none;
  }

  .track-grid,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .track-card {
    min-height: 166px;
  }

  .article-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .article-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .article-actions > * {
    flex: 1;
    text-align: center;
  }

  .article-meta {
    flex-wrap: wrap;
  }

  .status-tag {
    display: none;
  }

  .detail-header {
    padding: 24px 20px;
  }

  .detail-stats {
    flex-wrap: wrap;
  }

  .site-footer {
    display: block;
    width: calc(100% - 32px);
    padding: 28px 0;
  }

  .site-footer > p {
    margin-top: 20px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
