<template>
  <section class="app-view-loading-state" aria-live="polite">
    <div class="app-view-loading-copy">
      <span class="app-view-loading-spinner" aria-hidden="true"></span>
      <div>
        <strong>正在加载页面内容</strong>
        <p>页面框架已就绪，正在载入当前模块的数据和控件。</p>
      </div>
    </div>
    <div class="app-view-loading-skeleton" aria-hidden="true">
      <span></span>
      <span></span>
      <span></span>
    </div>
  </section>
</template>

<style scoped>
.app-view-loading-state {
  display: grid;
  gap: 16px;
  width: min(760px, 100%);
  margin: 24px auto;
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.app-view-loading-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1f2937;
}

.app-view-loading-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.app-view-loading-copy p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.app-view-loading-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid rgba(59, 130, 246, 0.18);
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: app-view-loading-spin 0.8s linear infinite;
}

.app-view-loading-skeleton {
  display: grid;
  gap: 10px;
}

.app-view-loading-skeleton span {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e5e7eb 0%, #f8fafc 48%, #e5e7eb 100%);
  background-size: 200% 100%;
  animation: app-view-loading-shimmer 1.4s ease-in-out infinite;
}

.app-view-loading-skeleton span:nth-child(2) {
  width: 86%;
}

.app-view-loading-skeleton span:nth-child(3) {
  width: 68%;
}

@keyframes app-view-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes app-view-loading-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-view-loading-spinner,
  .app-view-loading-skeleton span {
    animation: none;
  }
}
</style>
