/* ============================================================
   layout.css — 页面骨架、头部、Tab、容器、响应式断点
   ============================================================ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- 头部 ---------- */
.app-header {
  background: linear-gradient(135deg, var(--c-primary) 0%, #2b7de9 100%);
  color: #fff;
  padding: 28px 0 20px;
}

.app-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  position: relative;
}

.app-header__logo-link {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app-header__logo {
  height: 40px;
  width: auto;
  display: block;
}

.app-header__brand {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  line-height: 1.2;
  white-space: nowrap;
}

.app-header__titles {
  min-width: 0;
  text-align: center;
}

.app-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.app-header__sub {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.9;
}

.app-header__meta {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.8;
}

/* ---------- Tab 导航 ---------- */
.tab-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.tab-bar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text-2);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.tab::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}

.tab[aria-selected="true"] {
  color: var(--c-primary);
  font-weight: 600;
}

.tab[aria-selected="true"]::after {
  background: var(--c-primary);
}

/* ---------- 主内容 ---------- */
.app-main {
  padding: 20px 0 56px;
}

.panel[hidden] {
  display: none;
}

/* ---------- 页脚 ---------- */
.app-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-3);
  font-size: 12px;
  padding: 20px 0;
  text-align: center;
}
.app-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}
.app-footer p {
  margin: 4px 0;
  line-height: 1.6;
}
.app-footer__copy {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--c-text-2);
}
.app-footer__copy a {
  color: inherit;
  text-decoration: none;
}
.app-footer__copy a:hover {
  opacity: 0.8;
}
.app-footer__src {
  font-size: 11px;
  opacity: 0.85;
}
.app-footer__disclaimer {
  color: #0b3d91;
  font-weight: 600;
}
.app-footer__src a {
  color: inherit;
  text-decoration: none;
}
.app-footer__src a:hover {
  opacity: 0.8;
}
.app-footer__views {
  white-space: nowrap;
}
.app-footer__views #view-count {
  font-weight: 600;
  color: inherit;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .app-header {
    padding: 20px 0 16px;
  }
  .app-header__inner {
    position: static;
    justify-content: flex-start;
  }
  .app-header__logo-link {
    position: static;
    top: auto;
    left: auto;
    transform: none;
  }
  .app-header__titles {
    text-align: left;
  }
  .app-header h1 {
    font-size: 19px;
  }
  .tab {
    flex: 1;
    padding: 12px 6px;
    font-size: 14px;
  }
  .tab::after {
    left: 10px;
    right: 10px;
  }
  .app-main {
    padding: 14px 0 40px;
  }
}
