/* ============================================
   Base Layout — 全局基础布局
   ============================================ */

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body {
  font-family: var(--font-stack);
  color: #333;
  background: #fff;
}

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
@media (min-width: 1280px) {
  .container {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only:focus:not(.sr-only) {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: #fff;
  color: var(--primary-500);
  z-index: 50;
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* 跳转链接 */
.skip-link:focus {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 50;
  background: #fff;
  color: var(--primary-500);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  width: auto;
  height: auto;
  clip: auto;
  white-space: normal;
}

/* 主内容区 */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* 骨架屏加载动画 */
.skeleton {
  background-color: #e5e7eb;
  border-radius: 0.375rem;
}
.skeleton-full {
  background-color: #e5e7eb;
  border-radius: 0.375rem;
  width: 100%;
  height: 100%;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 通用文字截断 */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 文字平衡 */
.text-balance {
  text-wrap: balance;
}
