:root {
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #171717;
  background: #fafafa;
  scroll-behavior: smooth;
}

:root[data-theme="dark"] {
  color: #f5f5f5;
  background: #212121;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 3;
  display: flex;
  width: 78px;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-right: 1px solid #e5e5e5;
  background: #f7f7f7;
}
.side-links { display: flex; width: 100%; flex: 1; flex-direction: column; align-items: center; gap: 8px; }
.side-link {
  display: flex;
  width: 62px;
  min-height: 66px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 16px;
  color: #737373;
  font-size: 11px;
  transition: background .15s, color .15s;
}
.side-link:hover, .side-link.active { color: #171717; background: #e6e6e6; }
.side-icon { font-size: 22px; line-height: 1; }
.theme-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  color: #777;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
}
.theme-button:hover { background: #e6e6e6; }

.page { min-height: 100vh; margin-left: 78px; padding: 1px 28px 22px; }
.top-nav {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  color: #666;
  background: #fff;
  font-size: 13px;
}
.top-nav a { white-space: nowrap; }
.top-nav a:hover { color: #171717; }
.content { width: min(1116px, 100%); margin: 0 auto; }
.search {
  display: flex;
  width: min(768px, 100%);
  height: 58px;
  align-items: center;
  margin: 96px auto 42px;
  padding: 7px;
  border: 1px solid #dedede;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 42px #00000010;
}
.search-provider {
  display: flex;
  min-width: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-right: 1px solid #e5e5e5;
  font-size: 14px;
  white-space: nowrap;
}
.search-provider span { color: #777; }
.search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
}
.search input::placeholder { color: #858585; }
.search button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #171717;
  background: #f4f4f4;
  cursor: pointer;
}
.search button svg { width: 18px; height: 18px; }
.section { margin: 0 0 46px; scroll-margin-top: 26px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: 17px; line-height: 1.4; }
.section-heading a { color: #888; font-size: 12px; }
.section-heading a:hover { color: inherit; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.link-card {
  display: flex;
  min-width: 0;
  min-height: 79px;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border: 1px solid #e3e3e3;
  border-radius: 16px;
  background: #fff;
  transition: background .15s, border-color .15s, transform .15s;
}
.link-card:hover, .link-card:focus-visible { border-color: #bcbcbc; background: #f4f4f4; transform: translateY(-2px); }
.card-icon { display: grid; width: 32px; flex: none; place-items: center; font-size: 24px; line-height: 1; }
.card-copy { display: block; min-width: 0; }
.card-copy strong, .card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-copy strong { font-size: 14px; line-height: 1.5; }
.card-copy small { margin-top: 3px; color: #737373; font-size: 12px; line-height: 1.4; }
footer { width: min(1116px, 100%); margin: 20px auto 0; color: #909090; font-size: 12px; }

:root[data-theme="dark"] .sidebar { border-color: #ffffff1a; background: #171717; }
:root[data-theme="dark"] .side-link { color: #aaa; }
:root[data-theme="dark"] .side-link:hover, :root[data-theme="dark"] .side-link.active { color: #fff; background: #333; }
:root[data-theme="dark"] .theme-button { color: #aaa; }
:root[data-theme="dark"] .theme-button:hover { background: #333; }
:root[data-theme="dark"] .top-nav { border-color: #414141; color: #aaa; background: #2b2b2b; }
:root[data-theme="dark"] .top-nav a:hover { color: #fff; }
:root[data-theme="dark"] .search { border-color: #414141; background: #2b2b2b; box-shadow: 0 18px 42px #0003; }
:root[data-theme="dark"] .search-provider { border-color: #414141; }
:root[data-theme="dark"] .search button { color: #171717; background: #fff; }
:root[data-theme="dark"] .link-card { border-color: #414141; background: #272727; }
:root[data-theme="dark"] .link-card:hover, :root[data-theme="dark"] .link-card:focus-visible { border-color: #777; background: #303030; }
:root[data-theme="dark"] .card-copy small { color: #aaa; }

@media (max-width: 1100px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .sidebar { display: none; }
  .page { margin: 0; padding: 1px 18px 22px; }
  .top-nav { position: static; width: fit-content; max-width: 100%; margin: 16px auto 0; gap: 18px; }
  .search { margin: 28px auto 40px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .top-nav { gap: 14px; padding: 0 14px; }
  .search { height: 56px; }
  .section { margin-bottom: 38px; }
  .card-grid { grid-template-columns: 1fr; gap: 10px; }
  .link-card { min-height: 75px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
