/* ============================================================
   观潮海报网 · 页面骨架 (Layout)
   themes/default/assets/css/layout.css
   ------------------------------------------------------------
   .container / .sidebar / .main / .top-nav / 搜索区 / 骨架屏布局
   ============================================================ */

/* ---------- 页面容器 ---------- */
.container {
  position: relative;
  display: flex;
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 40px);
  background-color: var(--hb-surface);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-r-2xl);
  box-shadow: var(--hb-shadow-lg);
  overflow: hidden;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex-shrink: 0;
  width: 220px;
  max-height: 100vh;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  background-color: var(--hb-surface);
  border-right: 1px solid var(--hb-line);
  overflow-y: auto;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  margin-bottom: 26px;
  padding: 0 8px;
}

.sidebar .logo .icon {
  width: 34px;
  height: 34px;
  margin-right: 10px;
  flex-shrink: 0;
}

.sidebar .logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin-right: 10px;
  font-size: 18px;
  color: #fff;
  background: var(--hb-green-grad);
  border-radius: 50%;
}

.sidebar .logo-text {
  font-size: 1.5em;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--hb-ink-900);
}

.sidebar .menu {
  display: flex;
  flex-direction: column;
}

.sidebar .menu a {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 10px 14px;
  margin-bottom: 2px;
  font-size: .95rem;
  font-weight: 500;
  color: var(--hb-ink-600);
  border-radius: var(--hb-r-md);
  transition: background-color .2s, color .2s;
}

.sidebar .menu a:hover {
  color: var(--hb-green-600);
  background-color: var(--hb-green-50);
}

.sidebar .menu a.active {
  color: var(--hb-green-600);
  font-weight: 700;
  background-color: var(--hb-green-50);
}

/* 选中项的左侧绿色指示条 */
.sidebar .menu a.active::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 3px;
  height: 16px;
  background: var(--hb-green-grad);
  border-radius: var(--hb-r-full);
  transform: translateY(-50%);
}

/* ---------- 更多分类 ---------- */
.category-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 16px 14px 10px;
  margin-top: 8px;
  font-size: .95rem;
  font-weight: 500;
  color: var(--hb-ink-400);
  border-top: 1px solid var(--hb-line);
  border-radius: var(--hb-r-md);
  cursor: pointer;
  transition: color .2s, background-color .2s;
}

.category-toggle:hover {
  color: var(--hb-green-600);
  background: var(--hb-surface-muted);
}

.category-toggle .arrow {
  font-size: .65rem;
  transition: transform .3s var(--hb-ease);
}

.category-toggle.expanded .arrow {
  transform: rotate(180deg);
}

.category-extra {
  overflow: hidden;
  max-height: 0;
  transition: max-height .4s var(--hb-ease);
}

.category-extra.expanded {
  max-height: 800px;
}

/* ---------- 主内容区 ---------- */
.main {
  flex: 1;
  min-width: 0;
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  background: var(--hb-surface-soft);
}

/* ---------- 顶部导航 ---------- */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.top-nav .links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav .links a {
  position: relative;
  padding: 8px 16px;
  font-size: .93rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--hb-ink-600);
  border-radius: var(--hb-r-md);
  transition: color .2s, background-color .2s;
}

.top-nav .links a:hover {
  color: var(--hb-green-600);
  background: var(--hb-green-50);
}

.top-nav .links a.active {
  color: var(--hb-green-600);
  font-weight: 600;
  background: var(--hb-green-50);
}

.nav-line {
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--hb-green-500);
  border-radius: var(--hb-r-full);
  transition: all .3s var(--hb-ease);
}

/* ---------- 搜索区 ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input {
  display: flex;
  align-items: center;
  width: 220px;
  height: 38px;
  padding: 0 12px;
  background: var(--hb-surface-muted);
  border: 1px solid var(--hb-line-strong);
  border-radius: var(--hb-r-md);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.search-input:focus-within {
  background: var(--hb-surface);
  border-color: var(--hb-green-400);
  box-shadow: 0 0 0 3px var(--hb-green-ring);
}

.search-input input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--hb-ink-700);
  background: transparent;
  border: none;
  outline: none;
}

.search-input input::placeholder {
  color: var(--hb-ink-400);
}

.search-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  fill: var(--hb-ink-400);
}

/* ---------- 主行动按钮 ---------- */
.api-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  background: var(--hb-green-grad-cta);
  border: none;
  border-radius: var(--hb-r-md);
  box-shadow: 0 2px 8px rgba(34, 197, 94, .28);
  transition: transform .2s, box-shadow .2s, opacity .2s;
}

.api-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(34, 197, 94, .36);
}

/* ============================================================
   骨架屏（首屏占位，其布局与真实页面保持一致）
   ============================================================ */
#skeleton-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--hb-page);
  overflow-y: auto;
}

.skeleton-container {
  display: flex;
  width: 90%;
  max-width: 1400px;
  margin: 20px auto;
  min-height: calc(100vh - 40px);
  background: var(--hb-surface);
  border-radius: var(--hb-r-2xl);
  box-shadow: var(--hb-shadow-lg);
  overflow: hidden;
}

.skeleton-block {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  border-radius: var(--hb-r-sm);
  animation: skeleton-loading 1.4s ease infinite;
}

@keyframes skeleton-loading {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 220px;
  padding: 22px 15px;
  gap: 12px;
  border-right: 1px solid var(--hb-line);
}

.skeleton-logo {
  width: 140px;
  height: 40px;
  margin: 0 0 20px 8px;
  border-radius: var(--hb-r-md);
}

.skeleton-menu-item {
  width: 100%;
  height: 40px;
  border-radius: var(--hb-r-md);
}

.skeleton-main {
  flex: 1;
  min-width: 0;
  padding: 26px 30px;
  background: var(--hb-surface-soft);
}

.skeleton-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.skeleton-nav-link {
  width: 80px;
  height: 38px;
  border-radius: var(--hb-r-md);
}

.skeleton-search {
  width: 260px;
  height: 38px;
  margin-left: auto;
  border-radius: var(--hb-r-md);
}

.skeleton-carousel {
  width: 100%;
  height: 400px;
  margin-bottom: 24px;
  border-radius: var(--hb-r-xl);
}

.skeleton-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 20px;
  background: var(--hb-surface);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-r-xl);
  box-shadow: var(--hb-shadow-md);
}

.skeleton-title {
  width: 120px;
  height: 24px;
  border-radius: 6px;
}

.skeleton-count {
  width: 100px;
  height: 18px;
  border-radius: 6px;
}

.skeleton-poster-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px;
  background: var(--hb-surface);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-r-xl);
  box-shadow: var(--hb-shadow-md);
}

.skeleton-poster-item {
  padding: 10px;
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-r-lg);
}

.skeleton-poster-img {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-bottom: 8px;
  border-radius: var(--hb-r-sm);
  overflow: hidden;
}

.skeleton-poster-name {
  width: 80%;
  height: 16px;
  margin: 0 auto;
  border-radius: 4px;
}
