/* Configuration-only glass layout: compact toolbar, native tabs and scaled link cards. */
#page_wrapper {
  --space-panel: rgba(17, 26, 32, 0.56);
  --space-border: rgba(218, 237, 235, 0.22);
  --space-text: #ecf1ed;
  --space-muted: #a5b4b6;
  --space-accent: #a9c6ae;
  background: transparent;
}

/* The scroll surface spans the viewport; content width never moves its rail. */
#inner_wrapper {
  width: 100%;
  max-width: none;
  margin: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-color: #718789 #101b22;
  scrollbar-width: auto;
  background: linear-gradient(110deg, rgba(6, 14, 22, 0.65), rgba(7, 15, 22, 0.5));
}

#inner_wrapper > .container {
  width: auto;
  max-width: 1320px;
  height: auto;
  min-height: 100%;
  margin: 0 auto;
  padding: 32px 32px 0;
}

#inner_wrapper::-webkit-scrollbar {
  width: 12px;
}

#inner_wrapper::-webkit-scrollbar-track {
  background: #101b22;
}

#inner_wrapper::-webkit-scrollbar-thumb {
  border: 3px solid #101b22;
  border-radius: 12px;
  background: #718789;
}

#information-widgets {
  min-height: 64px;
  margin: 0 0 16px;
  padding: 14px 156px 14px 18px;
  border: 1px solid var(--space-border);
  border-radius: 16px;
  background: rgba(17, 26, 32, 0.5);
  box-shadow: inset 0 1px 0 rgba(236, 249, 244, 0.08);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
}

#widgets-wrap {
  align-items: center;
  gap: 12px;
}


#information-widgets-right {
  flex-grow: 1;
  margin: 0;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
}

.information-widget-datetime {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.information-widget-datetime span {
  color: #dfebe6;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.information-widget-datetime:first-child span {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.information-widget-datetime:last-child {
  padding-left: 14px;
  border-left: 1px solid var(--space-border);
}

#tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 0 24px;
  padding-block: 8px;
  background: rgba(14, 25, 31, 0.62);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  backdrop-filter: blur(20px) saturate(135%);
}

[role="tablist"] {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--space-border);
  border-radius: 16px;
  background: var(--space-panel);
}

[role="tablist"] > li {
  flex: 1 1 70px;
  width: auto;
  height: auto;
  min-width: 0;
}

[role="tab"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--space-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 150ms ease, background-color 150ms ease;
}

[role="tab"]::before {
  content: "";
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  background: currentColor;
  mask: var(--nav-icon) no-repeat center / contain;
}

[role="tablist"] > li:nth-child(1) { --nav-icon: url('/images/icons/home.svg'); }
[role="tablist"] > li:nth-child(2) { --nav-icon: url('/images/icons/ai.svg'); }
[role="tablist"] > li:nth-child(3) { --nav-icon: url('/images/icons/work.svg'); }
[role="tablist"] > li:nth-child(4) { --nav-icon: url('/images/icons/fun.svg'); }
[role="tablist"] > li:nth-child(5) { --nav-icon: url('/images/icons/apps.svg'); }
[role="tablist"] > li:nth-child(6) { --nav-icon: url('/images/icons/study.svg'); }
[role="tablist"] > li:nth-child(7) { --nav-icon: url('/images/icons/server.svg'); }

[role="tab"][aria-selected="true"] {
  color: #e4f2e5;
  border-color: rgba(172, 206, 175, 0.16);
  background: rgba(154, 191, 161, 0.13);
  box-shadow: none;
}

#layout-groups {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
  margin: 0;
}

.services-group,
.bookmark-group {
  width: auto;
  min-width: 0;
  --visible-links: 5;
  --link-row-height: 72px;
  --link-row-gap: 8px;
  --group-padding: 20px;
  display: flex;
  flex-direction: column;
  height: calc(2 * var(--group-padding) + 2px + 36px + 14px + var(--visible-links) * var(--link-row-height) + (var(--visible-links) - 1) * var(--link-row-gap));
  min-height: 0;
  overflow: hidden;
  padding: var(--group-padding);
  grid-column: span 2;
  border: 1px solid var(--space-border);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(225, 241, 237, 0.065), rgba(225, 241, 237, 0.01)), var(--space-panel);
  box-shadow: inset 0 1px 0 rgba(236, 249, 244, 0.12), 0 12px 36px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
}

/* Only link lists scroll; group headings stay outside the scroll area. */
.services-group > div,
.bookmark-group > div {
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: auto;
  scrollbar-width: auto;
  scrollbar-color: #8ba6a2 rgba(13, 24, 30, 0.38);
}

.services-group > div::-webkit-scrollbar,
.bookmark-group > div::-webkit-scrollbar {
  width: 10px;
}

.services-group > div::-webkit-scrollbar-track,
.bookmark-group > div::-webkit-scrollbar-track {
  border-radius: 8px;
  background: rgba(13, 24, 30, 0.38);
}

.services-group > div::-webkit-scrollbar-thumb,
.bookmark-group > div::-webkit-scrollbar-thumb {
  border: 2px solid rgba(13, 24, 30, 0.5);
  border-radius: 8px;
  background: #8ba6a2;
}

.services-group > div::-webkit-scrollbar-thumb:hover,
.bookmark-group > div::-webkit-scrollbar-thumb:hover {
  background: #bdd5cd;
}

.services-group {
  grid-column: 1 / -1;
}

.bookmark-group:not(:has(.bookmark-list)) {
  grid-column: span 3;
}


.services-group > button,
.bookmark-group > button {
  flex-shrink: 0;
  height: 36px;
  gap: 10px;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(209, 228, 229, 0.09);
}

.service-group-name,
.bookmark-group-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--space-text);
}

.bookmark-group-icon,
.services-group > button > div {
  width: 19px;
  height: 19px;
  margin: 0;
  opacity: 0.75;
}

.bookmark-group-icon > div,
.services-group > button > div > div {
  width: 19px;
  height: 19px;
}

.services-list {
  gap: 12px;
  margin: 18px 0 0;
}

/* Shared card surface; bookmark entries use smaller dimensions below. */
.service-card,
.bookmark > a {
  border: 1px solid rgba(207, 226, 229, 0.07);
  border-radius: 13px;
  background: rgba(210, 231, 227, 0.035);
  box-shadow: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.service-card {
  height: 100%;
  min-height: 96px;
  margin: 0;
  padding: 12px 6px;
}

.service-title {
  min-height: 70px;
  align-items: center;
}

.service-icon {
  width: 48px;
  margin-left: 4px;
}

.service-icon img[src$="/robot.svg"],
.service-icon img[src$="/activity.svg"],
.bookmark-icon img[src$="/linux-do.svg"] {
  filter: invert(85%) sepia(10%) saturate(300%) hue-rotate(105deg);
}

.service-name {
  padding: 6px 10px;
  color: var(--space-text);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

.service-description {
  margin-top: 6px;
  color: var(--space-muted);
  font-size: 11px;
  line-height: 1.6;
}

/* A single column and fixed row slots make five complete links visible. */
.bookmark-group ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: var(--link-row-height);
  margin: 14px 0 0;
  gap: var(--link-row-gap);
}

.bookmark > a {
  height: 100%;
  min-height: var(--link-row-height);
  margin: 0;
  padding: 8px 6px;
}

.bookmark > a > div {
  min-height: 54px;
  align-items: center;
}

.bookmark-icon {
  width: 36px;
  height: 28px;
  margin-left: 4px;
  border-radius: 0;
  background: transparent;
  color: var(--space-muted);
  font-size: 11px;
  font-weight: 600;
}

.bookmark-icon img {
  width: 24px;
  height: 24px;
}

.bookmark-text {
  display: block;
  min-width: 0;
  padding: 0 8px;
}

.bookmark-name {
  padding: 0;
  color: var(--space-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.bookmark-description {
  padding: 4px 0 0;
  color: var(--space-muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
}

#footer {
  margin-top: auto;
  padding: 32px 0 24px;
  opacity: 0.65;
}

@media (hover: hover) and (pointer: fine) {
  [role="tab"]:hover {
    background: rgba(188, 211, 202, 0.07);
  }

  .service-card:hover,
  .bookmark > a:hover {
    border-color: rgba(172, 206, 175, 0.28);
    background: rgba(188, 211, 202, 0.07);
  }
}

.bookmark > a:focus-visible,
.service-card a:focus-visible,
[role="tab"]:focus-visible {
  outline: 2px solid var(--space-accent);
  outline-offset: 2px;
}


@media (min-width: 641px) and (max-width: 1000px) {
  #layout-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .bookmark-group {
    grid-column: auto;
  }

  .bookmark-group:not(:has(.bookmark-list)) {
    grid-column: 1 / -1;
  }
}



@media (max-width: 640px) {
  #inner_wrapper > .container {
    padding: 20px 16px 0;
  }

  #information-widgets {
    min-height: 60px;
    margin-bottom: 12px;
    padding: 10px 128px 10px 12px;
    border-radius: 14px;
  }

  #widgets-wrap {
    align-items: center;
    gap: 0;
  }

  #information-widgets-right {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .information-widget-datetime span {
    font-size: 10px;
    letter-spacing: 0;
  }

  .information-widget-datetime:first-child span {
    font-size: 18px;
  }

  .information-widget-datetime:last-child {
    padding-left: 0;
    border-left: 0;
  }

  #tabs {
    margin-bottom: 16px;
    padding-block: 6px;
  }

  [role="tablist"] {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
  }

  [role="tab"] {
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 8px 4px;
    font-size: 12px;
  }

  [role="tab"]::before {
    width: 15px;
    height: 15px;
  }

  #layout-groups {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .services-group,
  .bookmark-group {
    grid-column: 1 / -1;
    --group-padding: 16px;
    border-radius: 15px;
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    backdrop-filter: blur(18px) saturate(130%);
  }

  .bookmark-group:not(:has(.bookmark-list)) {
    grid-column: 1 / -1;
  }

  .services-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .service-card {
    min-height: 116px;
    padding: 12px 8px;
  }

  .service-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 90px;
  }

  .service-icon {
    justify-content: flex-start;
    margin: 0;
  }

  .service-name {
    padding: 0;
    font-size: 12px;
  }

  .service-description {
    font-size: 10px;
    margin-top: 4px;
  }

}

@media (prefers-reduced-motion: reduce) {
  [role="tab"],
  .service-card,
  .bookmark > a {
    transition: none;
  }
}

/* Keep native Quick Launch in the page header instead of floating over cards. */
[role="dialog"][aria-modal="true"] + button {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  top: 42px;
  right: 44px;
  bottom: auto;
  border: 1px solid rgba(183, 214, 193, 0.24);
  border-radius: 11px;
  background: rgba(168, 204, 179, 0.12);
  box-shadow: inset 0 1px 0 rgba(235, 248, 239, 0.06);
  color: #e4f2e5;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

[role="dialog"][aria-modal="true"] + button::after {
  content: "快速搜索";
  font-size: 13px;
  font-weight: 500;
}

[role="dialog"][aria-modal="true"] dialog {
  border: 1px solid rgba(218, 237, 235, 0.25);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(17, 29, 35, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

[role="dialog"][aria-modal="true"] input {
  background: transparent;
  color: #ecf1ed;
}

[role="dialog"][aria-modal="true"] dialog button > div:last-child {
  color: #b8c9ca;
}

[role="dialog"][aria-modal="true"] dialog button .text-xs {
  color: #b8c9ca;
}

[role="dialog"][aria-modal="true"] + button:focus-visible {
  outline: 2px solid #a9c6ae;
  outline-offset: 3px;
}


@media (max-width: 640px) {
  [role="dialog"][aria-modal="true"] + button {
    top: 28px;
    right: 24px;
    padding-inline: 12px;
    gap: 7px;
    border-radius: 10px;
  }
}

/* Keep readable surfaces on browsers without backdrop-filter support. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .services-group,
  .bookmark-group,
  #tabs {
    background: rgba(17, 26, 32, 0.94);
  }
}