/* Layout — refresh bar, nav, panels, footer */

/* 顶部固定刷新提示栏 */
.refresh-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--refresh-bar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-hairline);
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
  color: var(--color-ink-muted);
  letter-spacing: 0.02em;
}

.refresh-bar.is-success {
  color: var(--color-success);
}

.refresh-bar.is-error {
  color: var(--color-primary-hover);
}

.top-nav {
  position: fixed;
  top: var(--refresh-bar-height);
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-hairline);
}

.top-nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.brand {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--color-ink);
  flex-shrink: 0;
}

.brand span {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  font-size: var(--text-body-sm);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-ink-subtle);
}

.nav-link:hover {
  color: var(--color-ink);
  background: var(--color-surface-1);
}

.nav-link.is-active {
  color: var(--color-ink);
  background: var(--color-surface-2);
}

.nav-toggle {
  display: none;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 6px 10px;
  color: var(--color-ink);
}

.main {
  min-height: calc(100vh - var(--nav-height) - var(--refresh-bar-height));
  padding-block: var(--space-xl);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.section-header {
  margin-bottom: var(--space-xl);
}

.section-header .eyebrow {
  margin-bottom: var(--space-sm);
}

.section-header .body-lg {
  margin-top: var(--space-sm);
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.search-bar {
  display: flex;
  gap: var(--space-sm);
  flex: 1;
  min-width: 240px;
  max-width: 520px;
}

.search-bar .text-input {
  flex: 1;
}

.panel-meta {
  font-size: var(--text-body-sm);
  color: var(--color-ink-subtle);
}

.weekly-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.daily-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.daily-timeline {
  position: sticky;
  top: calc(var(--refresh-bar-height) + var(--nav-height) + 24px);
  max-height: calc(100vh - var(--nav-height) - var(--refresh-bar-height) - 48px);
  overflow-y: auto;
  padding-right: var(--space-xs);
}

.footer {
  padding: var(--space-section) var(--space-xl) var(--space-xl);
  border-top: 1px solid var(--color-hairline);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: var(--space-xl);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-display-md);
  font-weight: 600;
  letter-spacing: -1px;
  margin-bottom: var(--space-md);
  color: var(--color-ink);
}

.footer__col-title {
  font-size: var(--text-caption);
  color: var(--color-ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-md);
}

.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__links a,
.footer__links button {
  font-size: var(--text-body-sm);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: var(--color-ink-subtle);
}

.footer__links a:hover,
.footer__links button:hover {
  color: var(--color-ink);
}

.footer__bottom {
  margin-top: var(--space-xxl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-hairline);
  font-size: var(--text-body-sm);
  color: var(--color-ink-tertiary);
}

@media (max-width: 960px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: calc(var(--refresh-bar-height) + var(--nav-height));
    left: 0;
    right: 0;
    background: var(--color-canvas);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-hairline);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s, opacity 0.2s;
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .weekly-layout,
  .daily-layout {
    grid-template-columns: 1fr;
  }

  .daily-timeline {
    position: static;
    max-height: none;
    margin-bottom: var(--space-lg);
  }
}

@media (max-width: 560px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }

  .panel-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar {
    max-width: none;
  }
}
