:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft-muted: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --surface: rgba(255, 255, 255, 0.86);
  --canvas: #f5f5f7;
  --accent: #e31b23;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 18px 22px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(250, 250, 252, 0.78);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 34px;
}

.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-size: 13px; font-weight: 700; letter-spacing: 0.7px; }
.brand-copy span { color: var(--soft-muted); font-size: 11px; }
.module-nav { display: grid; gap: 5px; }

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 7px 12px 7px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-item:hover { background: rgba(0, 0, 0, 0.035); color: var(--ink); }
.nav-item:active { transform: scale(0.985); }

.nav-item:focus-visible,
.link-card:focus-visible,
.search-box:focus-within {
  outline: 3px solid rgba(0, 113, 227, 0.22);
  outline-offset: 2px;
}

.nav-item.active {
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.055);
  color: var(--ink);
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: var(--soft-muted);
}

.nav-icon svg { width: 18px; height: 18px; }
.nav-item.active .nav-icon { background: #f2f2f4; color: var(--ink); }
.nav-label { font-size: 13px; font-weight: 600; }
.nav-count { min-width: 18px; color: #a1a1a6; font-size: 11px; text-align: right; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 18px 11px 0;
  border-top: 1px solid var(--line);
  color: var(--soft-muted);
  font-size: 11px;
}

.sidebar-footer svg { width: 14px; height: 14px; color: #34c759; }
.main-content { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  height: 76px;
  padding: 0 clamp(28px, 5vw, 76px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.055);
  background: rgba(245, 245, 247, 0.78);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}

.mobile-brand { display: none; }

.search-box {
  display: flex;
  align-items: center;
  width: min(340px, 42vw);
  height: 40px;
  padding: 0 10px 0 13px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--soft-muted);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.search-box:focus-within { background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06); }
.search-box > svg { width: 16px; height: 16px; flex: 0 0 auto; margin-right: 9px; }

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.search-box input::placeholder { color: #a1a1a6; }

.search-box kbd {
  padding: 2px 6px;
  border: 0;
  border-radius: 5px;
  background: #eeeef0;
  color: var(--soft-muted);
  font-family: inherit;
  font-size: 10px;
  white-space: nowrap;
}

.date-block {
  display: grid;
  min-width: 55px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.date-block span { color: var(--soft-muted); font-size: 10px; }
.date-block strong { margin-top: 2px; font-size: 14px; font-weight: 650; }

.content-area {
  max-width: 1260px;
  margin: 0 auto;
  padding: clamp(52px, 7vh, 80px) clamp(28px, 5vw, 76px) 80px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 1.1px;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.08;
}

.section-description { max-width: 640px; margin: 14px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.link-count { display: flex; align-items: baseline; gap: 5px; color: var(--soft-muted); white-space: nowrap; }
.link-count strong { color: var(--ink); font-size: 23px; font-weight: 600; }
.link-count span { font-size: 11px; }

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

.link-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 224px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.025);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 240ms ease, border-color 240ms ease;
  animation: card-enter 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.link-card:nth-child(2) { animation-delay: 45ms; }
.link-card:nth-child(3) { animation-delay: 90ms; }
.link-card:nth-child(4) { animation-delay: 135ms; }

.link-card:hover { z-index: 1; border-color: rgba(0, 0, 0, 0.09); box-shadow: var(--shadow); transform: translateY(-5px); }
.link-card:active { transform: scale(0.985); }

.card-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 16px;
  background: var(--card-tint);
  color: var(--card-accent);
}

.card-icon svg { width: 25px; height: 25px; }
.card-copy { min-width: 0; padding: 23px 0 18px; }

.card-copy h2 {
  margin: 0 0 9px;
  overflow: hidden;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy p { margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }

.card-arrow {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  justify-self: end;
  border-radius: 50%;
  background: #f2f2f4;
  color: var(--ink);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.card-arrow svg { width: 15px; height: 15px; }
.link-card:hover .card-arrow { background: var(--ink); color: #fff; transform: translate(2px, -2px); }

.empty-state {
  padding: 78px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.empty-state > svg { width: 30px; height: 30px; color: var(--soft-muted); }
.empty-state h2 { margin: 16px 0 6px; font-size: 17px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }

@keyframes card-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 84px; }

  .sidebar {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: block;
    width: auto;
    height: 66px;
    padding: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    background: rgba(248, 248, 250, 0.88);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13);
  }

  .brand, .sidebar-footer { display: none; }
  .module-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }

  .nav-item {
    display: flex;
    min-width: 0;
    min-height: 52px;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    padding: 3px 1px;
    border-radius: 13px;
    text-align: center;
  }

  .nav-item.active { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
  .nav-count { display: none; }
  .nav-icon { width: 25px; height: 25px; border-radius: 7px; }
  .nav-icon svg { width: 16px; height: 16px; }
  .nav-label { width: 100%; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

  .topbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(245, 245, 247, 0.92);
  }

  .mobile-brand { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 12px; letter-spacing: 0.5px; }
  .brand-mark.small { width: 30px; height: 30px; border-radius: 8px; }
  .date-block { padding-left: 0; border-left: 0; }

  .search-box {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
  }

  .search-box kbd { display: none; }
  .content-area { padding: 38px 18px 48px; }
  .section-heading { align-items: flex-start; margin-bottom: 28px; }
  .section-heading > div:first-child { min-width: 0; }
  .link-count { display: none; }
  h1 { font-size: 36px; }
  .section-description { font-size: 13px; }
  .link-grid { grid-template-columns: 1fr; gap: 12px; }

  .link-card {
    grid-template-columns: 52px minmax(0, 1fr) 32px;
    grid-template-rows: auto;
    align-items: center;
    min-height: 110px;
    padding: 18px;
    border-radius: 16px;
  }

  .card-icon { width: 48px; height: 48px; border-radius: 14px; }
  .card-copy { padding: 0 15px; }
  .card-copy h2 { margin-bottom: 7px; font-size: 16px; }
}

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