:root {
  --ws-primary: #1cbf73;
  --ws-primary-dark: #17a865;
  --ws-bg: #f5f6f8;
  --ws-surface: #fff;
  --ws-text: #1a1a1a;
  --ws-muted: #888;
  --ws-border: #e8e8e8;
  --ws-shadow: rgba(0, 0, 0, 0.06);
  --ws-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ws-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ws-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.ws-body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #e8ecf1;
  background-image:
    radial-gradient(ellipse 90% 60% at 0% 0%, rgba(28, 191, 115, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(28, 191, 115, 0.1), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.5), transparent 70%),
    linear-gradient(165deg, #e9eef3 0%, #f4f6f9 45%, #e8f5ee 100%);
  color: var(--ws-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

.ws-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ws-surface);
  animation: ws-app-in 0.5s var(--ws-ease-out);
  position: relative;
  z-index: 1;
}

@keyframes ws-app-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ws-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ws-view-enter {
  animation: ws-view-in 0.38s var(--ws-ease-out);
}

@keyframes ws-view-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ws-main-leave {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ws-animate-item {
  animation: ws-item-in 0.42s var(--ws-ease-out) backwards;
  animation-delay: calc(var(--ws-i, 0) * 42ms);
}

@keyframes ws-item-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ws-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.98) 100%);
  border-bottom: 1px solid var(--ws-border);
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  box-shadow: 0 1px 0 rgba(28, 191, 115, 0.08);
}

.ws-header-title {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  transition: opacity 0.25s ease, transform 0.25s var(--ws-ease-out);
}

.ws-header-title::after {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--ws-primary), transparent);
  opacity: 0.85;
}

.ws-header-title.ws-title-change {
  animation: ws-title-pop 0.35s var(--ws-ease-out);
}

@keyframes ws-title-pop {
  0% { opacity: 0.5; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

.ws-hero {
  position: relative;
  flex-shrink: 0;
}

.ws-hero-banner {
  position: relative;
  height: calc(148px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  overflow: hidden;
}

.ws-hero-banner-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.42) 100%);
  pointer-events: none;
}

.ws-hero-banner-track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  width: max-content;
  animation: ws-banner-scroll 50s linear infinite;
  will-change: transform;
}

@keyframes ws-banner-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ws-hero-slide {
  width: 84px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  transform: rotate(-3deg);
}

.ws-hero-slide:nth-child(even) {
  transform: rotate(3deg);
}

.ws-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ws-hero-slide-fallback {
  background: linear-gradient(
    145deg,
    hsl(var(--ws-hue, 140) 55% 72%),
    hsl(calc(var(--ws-hue, 140) + 45) 45% 58%)
  );
}

.ws-header-hero {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: transparent;
  border-bottom: none;
  padding: 10px 14px 14px;
  box-shadow: none;
}

.ws-header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 36px;
}

.ws-header-hero .ws-header-title {
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  padding-right: 72px;
}

.ws-header-hero .ws-header-title::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

.ws-home-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ws-text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ws-home-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.ws-home-btn:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%) scale(1.02);
}

.ws-home-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.ws-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(76px + var(--ws-safe-bottom));
}

.ws-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ws-muted);
  font-size: 14px;
}

.ws-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--ws-border);
  border-top-color: var(--ws-primary);
  border-radius: 50%;
  animation: ws-spin 0.7s linear infinite;
}

.ws-loading p {
  animation: ws-pulse 1.4s ease-in-out infinite;
}

@keyframes ws-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes ws-spin { to { transform: rotate(360deg); } }

.ws-stats-bar {
  display: flex;
  gap: 10px;
  padding: 14px 16px 12px;
  background: transparent;
}

.ws-stat-item {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  background: var(--ws-surface);
  border: 1px solid rgba(28, 191, 115, 0.12);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.25s var(--ws-ease-spring), box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.ws-stat-item:hover {
  border-color: rgba(28, 191, 115, 0.28);
  box-shadow: 0 6px 16px rgba(28, 191, 115, 0.1);
}

.ws-stat-item.is-active {
  border-color: var(--ws-primary);
  background: linear-gradient(180deg, rgba(28, 191, 115, 0.12) 0%, #fff 100%);
  box-shadow: 0 6px 18px rgba(28, 191, 115, 0.16);
}

.ws-stat-num {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--ws-primary);
  transition: transform 0.35s var(--ws-ease-spring);
}

.ws-stat-item:hover .ws-stat-num {
  transform: scale(1.06);
}

.ws-stat-label {
  font-size: 11px;
  color: var(--ws-muted);
}

.ws-filters {
  display: flex;
  gap: 8px;
  padding: 4px 16px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ws-filters::-webkit-scrollbar {
  display: none;
}

.ws-filter {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 13px;
  border: 1px solid var(--ws-border);
  border-radius: 20px;
  background: var(--ws-surface);
  color: var(--ws-muted);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
    transform 0.2s var(--ws-ease-spring), box-shadow 0.25s ease;
}

.ws-filter:active {
  transform: scale(0.94);
}

.ws-filter.active {
  background: var(--ws-primary);
  color: #fff;
  border-color: var(--ws-primary);
  box-shadow: 0 4px 12px rgba(28, 191, 115, 0.35);
}

.ws-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ws-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
  color: var(--ws-muted);
  font-size: 14px;
}

.ws-grid-virtual-scroller {
  position: relative;
  min-height: 120px;
}

.ws-grid-virtual-spacer {
  width: 100%;
  pointer-events: none;
}

.ws-grid-virtual-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  will-change: transform;
}

.ws-book {
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
  transition: transform 0.28s var(--ws-ease-spring);
}

.ws-book:active {
  transform: scale(0.94);
}

@media (hover: hover) {
  .ws-book:hover {
    transform: translateY(-3px);
  }
  .ws-book:hover .ws-cover-wrap {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  }
  .ws-book:hover .ws-cover {
    transform: scale(1.04);
  }
}

.ws-cover-wrap {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #eef2f6, #e2e8f0);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  margin-bottom: 8px;
  transition: box-shadow 0.3s ease, transform 0.3s var(--ws-ease-out);
}

.ws-cover-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    #e8ecf1 8%,
    #f4f7fa 18%,
    #e8ecf1 33%
  );
  background-size: 200% 100%;
  animation: ws-skeleton-shine 1.2s ease-in-out infinite;
  z-index: 1;
  transition: opacity 0.35s ease;
}

.ws-cover-wrap:has(.ws-cover.loaded) .ws-cover-skeleton {
  opacity: 0;
  pointer-events: none;
}

@keyframes ws-skeleton-shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.ws-cover.is-error {
  opacity: 0;
}

.ws-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
  transition: transform 0.35s var(--ws-ease-out), opacity 0.35s ease;
}

.ws-cover-articles {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 28px;
}

.ws-badge {
  position: absolute;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.4;
}

.ws-badge-top { top: 4px; left: 4px; background: #faad14; color: #fff; }
.ws-badge-done { bottom: 4px; left: 4px; background: var(--ws-primary); color: #fff; }
.ws-badge-album { top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; }
.ws-badge-secret { bottom: 4px; right: 4px; background: rgba(0,0,0,.5); color: #fff; }

.ws-book-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ws-book-author {
  font-size: 11px;
  color: var(--ws-muted);
  margin-top: 2px;
}

.ws-book-time {
  font-size: 10px;
  color: #aaa;
  margin-top: 2px;
}

.ws-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 10px 16px calc(14px + var(--ws-safe-bottom));
  background: linear-gradient(180deg, transparent 0%, rgba(232, 236, 241, 0.65) 35%, rgba(232, 236, 241, 0.92) 100%);
  border: none;
  pointer-events: none;
}

.ws-tabbar-inner {
  max-width: 320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 999px;
  box-shadow:
    0 10px 40px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.9);
  pointer-events: auto;
}

.ws-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ws-muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  transition:
    color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s var(--ws-ease-spring);
}

.ws-tab::after {
  display: none;
}

.ws-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #1cbf73 0%, #17a865 100%);
  box-shadow: 0 6px 16px rgba(28, 191, 115, 0.38);
}

.ws-tab:not(.active):hover {
  color: var(--ws-primary-dark);
  background: rgba(28, 191, 115, 0.08);
}

.ws-tab:active {
  transform: scale(0.96);
}

.ws-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 1;
  transition: transform 0.3s var(--ws-ease-spring);
}

.ws-tab-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.ws-tab-label {
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.ws-tab.active .ws-tab-icon {
  transform: scale(1.05);
}

.ws-stats-page { padding: 16px; overflow-y: auto; flex: 1; }
.ws-mode-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.ws-mode-btn {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  border: 1px solid var(--ws-border);
  border-radius: 8px;
  background: var(--ws-surface);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
    transform 0.2s var(--ws-ease-spring), box-shadow 0.25s ease;
}

.ws-mode-btn:active {
  transform: scale(0.96);
}

.ws-mode-btn.active {
  background: var(--ws-primary);
  color: #fff;
  border-color: var(--ws-primary);
  box-shadow: 0 4px 12px rgba(28, 191, 115, 0.3);
}

.ws-hero-card {
  background: linear-gradient(135deg, #1cbf73, #17a865);
  border-radius: 16px;
  padding: 24px 20px;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(28,191,115,.3);
  animation: ws-hero-in 0.55s var(--ws-ease-out);
}

@keyframes ws-hero-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ws-hero-value { font-size: 28px; font-weight: 700; margin: 4px 0 16px; }
.ws-hero-sub { display: flex; gap: 24px; }
.ws-hero-sub span { display: block; font-size: 20px; font-weight: 700; }
.ws-hero-sub small { font-size: 12px; opacity: .85; }

.ws-section { margin-bottom: 16px; }
.ws-section-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.ws-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ws-stat-card {
  background: var(--ws-surface);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px var(--ws-shadow);
  transition: transform 0.25s var(--ws-ease-spring), box-shadow 0.25s ease;
}

.ws-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--ws-shadow);
}
.ws-stat-card .num { font-size: 22px; font-weight: 700; color: var(--ws-primary); }
.ws-stat-card .name { font-size: 13px; color: var(--ws-muted); margin-top: 4px; }

.ws-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ws-surface);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px var(--ws-shadow);
  transition: transform 0.25s var(--ws-ease-spring), box-shadow 0.25s ease;
}

.ws-rank-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 14px var(--ws-shadow);
}
.ws-rank-cover { width: 40px; height: 54px; border-radius: 4px; object-fit: cover; }
.ws-rank-title { font-size: 14px; font-weight: 600; }
.ws-rank-time { font-size: 12px; color: var(--ws-muted); }

.ws-cat-item {
  background: var(--ws-surface);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px var(--ws-shadow);
}
.ws-cat-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.ws-cat-bar { height: 4px; background: var(--ws-bg); border-radius: 2px; overflow: hidden; }
.ws-cat-fill {
  height: 100%;
  background: var(--ws-primary);
  border-radius: 2px;
  width: 0;
  transition: width 0.8s var(--ws-ease-out);
}

.ws-auth-page { padding: 24px 20px; flex: 1; }
.ws-auth-card {
  background: var(--ws-surface);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px var(--ws-shadow);
  margin-bottom: 16px;
}
.ws-auth-card h3 { font-size: 15px; margin-bottom: 8px; }
.ws-auth-card p { font-size: 13px; color: var(--ws-muted); line-height: 1.7; margin-bottom: 12px; }
.ws-auth-input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--ws-border);
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 12px;
}
.ws-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.ws-btn-primary { background: var(--ws-primary); color: #fff; }
.ws-btn-dark { background: var(--ws-text); color: #fff; }
.ws-btn-outline { background: var(--ws-surface); color: var(--ws-primary); border: 1px solid var(--ws-primary); }

.ws-error {
  text-align: center;
  padding: 40px 20px;
  color: #ff4d4f;
  font-size: 14px;
}
.ws-retry {
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--ws-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s var(--ws-ease-spring), box-shadow 0.25s ease;
}

.ws-retry:active {
  transform: scale(0.96);
}

.ws-retry:hover {
  box-shadow: 0 4px 14px rgba(28, 191, 115, 0.4);
}

.ws-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

.ws-modal:not([hidden]) {
  pointer-events: auto;
}

.ws-modal[hidden] { display: none; }

.ws-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ws-modal:not([hidden]) .ws-modal-backdrop {
  opacity: 1;
}

.ws-modal.ws-modal-closing .ws-modal-backdrop {
  opacity: 0;
}

.ws-modal-sheet {
  position: relative;
  width: 100%;
  max-height: 85dvh;
  background: var(--ws-surface);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(20px + var(--ws-safe-bottom));
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s var(--ws-ease-out);
}

.ws-modal:not([hidden]) .ws-modal-sheet {
  transform: translateY(0);
}

.ws-modal.ws-modal-closing .ws-modal-sheet {
  transform: translateY(100%);
}

.ws-detail-cover {
  animation: ws-cover-pop 0.45s var(--ws-ease-spring);
}

@keyframes ws-cover-pop {
  from {
    opacity: 0;
    transform: scale(0.88) rotate(-2deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
.ws-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ws-bg);
  border: none;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s var(--ws-ease-spring), background 0.2s ease;
}

.ws-modal-close:active {
  transform: scale(0.9);
  background: var(--ws-border);
}
.ws-detail-head { display: flex; gap: 16px; margin-bottom: 16px; }
.ws-detail-cover { width: 96px; height: 128px; border-radius: 8px; object-fit: cover; box-shadow: 0 4px 12px var(--ws-shadow); }
.ws-detail-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.ws-detail-author { font-size: 14px; color: var(--ws-muted); margin-bottom: 10px; }
.ws-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ws-bg);
  margin-right: 6px;
  margin-bottom: 4px;
}
.ws-progress-box {
  background: var(--ws-bg);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.ws-progress-bar {
  height: 6px;
  background: var(--ws-border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.ws-progress-fill {
  height: 100%;
  background: var(--ws-primary);
  border-radius: 3px;
  width: 0;
  transition: width 0.9s var(--ws-ease-out);
}
.ws-info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--ws-border);
  font-size: 14px;
}
.ws-notice { text-align: center; font-size: 12px; color: var(--ws-muted); margin-top: 12px; }

.ws-qr-box {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #f8faf9 0%, #fff 100%);
  border: 1px solid var(--ws-border);
  border-radius: 14px;
  text-align: center;
}

.ws-qr-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ws-text);
  margin-bottom: 4px;
}

.ws-qr-hint {
  font-size: 12px;
  color: var(--ws-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.ws-qr-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 10px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px var(--ws-shadow);
}

.ws-qr-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transition: opacity 0.35s ease, transform 0.35s var(--ws-ease-out);
}

.ws-qr-img.is-refreshing {
  opacity: 0.35;
  transform: scale(0.96);
}

.ws-qr-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ws-qr-spinner.show {
  opacity: 1;
}

.ws-qr-spinner::after {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid var(--ws-border);
  border-top-color: var(--ws-primary);
  border-radius: 50%;
  animation: ws-spin 0.7s linear infinite;
}

.ws-qr-timer {
  font-size: 11px;
  color: #aaa;
}

.ws-detail-extra {
  margin-top: 4px;
}

.ws-ambient {
  display: none;
}

@media (min-width: 481px) {
  .ws-body {
    padding: 16px;
  }

  .ws-app {
    max-width: 520px;
    min-height: calc(100dvh - 32px);
    border-radius: 20px;
    box-shadow:
      0 20px 60px rgba(15, 23, 42, 0.1),
      0 0 0 1px rgba(255, 255, 255, 0.8);
    overflow: hidden;
  }

  .ws-tabbar {
    padding: 12px 20px calc(16px + var(--ws-safe-bottom));
  }

  .ws-tabbar-inner {
    max-width: 340px;
  }
}

@media (min-width: 768px) {
  .ws-body {
    padding: 28px 32px;
  }

  .ws-ambient {
    display: block;
    position: fixed;
    width: 260px;
    height: 380px;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    opacity: 1;
  }

  .ws-ambient-shadow {
    position: absolute;
    bottom: -30px;
    left: 4%;
    right: 4%;
    height: 64px;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.38) 0%, transparent 70%);
    filter: blur(20px);
    transform: scaleY(0.6);
    z-index: 0;
    pointer-events: none;
  }

  .ws-ambient-scene {
    position: absolute;
    inset: 0;
    perspective: 980px;
    perspective-origin: 48% 40%;
    z-index: 1;
  }

  .ws-ambient-volume {
    --ws-depth: 24px;
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
  }

  .ws-ambient-left .ws-ambient-volume {
    transform: rotateY(24deg) rotateX(7deg);
  }

  .ws-ambient-right .ws-ambient-volume {
    transform: rotateY(-24deg) rotateX(7deg);
  }

  .ws-ambient-face {
    position: absolute;
    backface-visibility: hidden;
  }

  .ws-ambient-face-front {
    inset: 0;
    transform: translateZ(calc(var(--ws-depth) / 2));
    border-radius: 3px 11px 11px 3px;
    overflow: hidden;
    background: #fff;
    box-shadow:
      0 3px 6px rgba(15, 23, 42, 0.12),
      0 22px 50px -10px rgba(15, 23, 42, 0.3);
  }

  .ws-ambient-face-front::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 16px 0 26px -8px rgba(0, 0, 0, 0.24);
  }

  .ws-ambient-face-spine {
    left: 0;
    top: 3px;
    width: var(--ws-depth);
    height: calc(100% - 6px);
    transform-origin: left center;
    transform: rotateY(-90deg);
    background-color: #2a2a2a;
    background-size: 640% auto;
    background-position: left center;
    background-repeat: no-repeat;
    filter: brightness(0.56) saturate(1.1);
    box-shadow: inset -5px 0 12px rgba(0, 0, 0, 0.38);
    border-radius: 3px 0 0 3px;
  }

  .ws-ambient-face-spine::after {
    content: '';
    position: absolute;
    inset: 8% 0 8% 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 65%);
    border-radius: 1px;
  }

  .ws-ambient-face-pages {
    right: 0;
    top: 5px;
    width: var(--ws-depth);
    height: calc(100% - 10px);
    transform-origin: right center;
    transform: rotateY(90deg);
    background:
      linear-gradient(90deg, #d2cdc4 0%, #f8f5ee 22%, #ebe6dd 48%, #d8d3ca 72%, #c8c3ba 100%),
      repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0) 0px,
        rgba(255, 255, 255, 0) 1px,
        rgba(0, 0, 0, 0.07) 1px,
        rgba(0, 0, 0, 0.07) 2px
      );
    box-shadow: inset 4px 0 8px rgba(0, 0, 0, 0.1);
    border-radius: 0 2px 2px 0;
  }

  .ws-ambient-face-pages::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.3) 0%,
      transparent 18%,
      transparent 82%,
      rgba(0, 0, 0, 0.08) 100%
    );
    pointer-events: none;
  }

  .ws-ambient-face-top {
    left: 3px;
    right: 3px;
    top: 0;
    height: var(--ws-depth);
    transform-origin: top center;
    transform: rotateX(90deg);
    background: linear-gradient(90deg, #d5d0c7, #f3f0e8 45%, #d5d0c7);
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.07);
  }

  .ws-ambient-face-bottom {
    left: 3px;
    right: 3px;
    bottom: 0;
    height: var(--ws-depth);
    transform-origin: bottom center;
    transform: rotateX(-90deg);
    background: linear-gradient(90deg, #bbb6ad, #e2ded6 45%, #bbb6ad);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .ws-ambient-right .ws-ambient-face-front {
    border-radius: 11px 3px 3px 11px;
  }

  .ws-ambient-right .ws-ambient-face-front::after {
    box-shadow: inset -16px 0 26px -8px rgba(0, 0, 0, 0.24);
  }

  .ws-ambient-right .ws-ambient-face-spine {
    left: auto;
    right: 0;
    transform-origin: right center;
    transform: rotateY(90deg);
    background-position: right center;
    box-shadow: inset 5px 0 12px rgba(0, 0, 0, 0.38);
    border-radius: 0 3px 3px 0;
  }

  .ws-ambient-right .ws-ambient-face-spine::after {
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.18), transparent 65%);
  }

  .ws-ambient-right .ws-ambient-face-pages {
    right: auto;
    left: 0;
    transform-origin: left center;
    transform: rotateY(-90deg);
    border-radius: 2px 0 0 2px;
    box-shadow: inset -4px 0 8px rgba(0, 0, 0, 0.1);
  }

  .ws-ambient-book-gloss {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background: linear-gradient(
      128deg,
      rgba(255, 255, 255, 0.34) 0%,
      rgba(255, 255, 255, 0.06) 34%,
      transparent 54%,
      rgba(0, 0, 0, 0.09) 100%
    );
  }

  .ws-ambient-cover {
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  .ws-ambient-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    will-change: opacity, filter;
  }

  .ws-ambient-cover img.ws-ambient-current {
    opacity: 1;
    filter: blur(0);
    z-index: 1;
  }

  .ws-ambient-cover img.ws-ambient-enter {
    z-index: 2;
    animation: ws-ambient-in 1.8s ease-in-out forwards;
  }

  .ws-ambient-cover img.ws-ambient-leave {
    z-index: 1;
    animation: ws-ambient-out 1.8s ease-in-out forwards;
  }

  @keyframes ws-ambient-in {
    from {
      opacity: 0;
      filter: blur(10px);
    }
    to {
      opacity: 1;
      filter: blur(0);
    }
  }

  @keyframes ws-ambient-out {
    from {
      opacity: 1;
      filter: blur(0);
    }
    to {
      opacity: 0;
      filter: blur(8px);
    }
  }

  .ws-ambient-left {
    left: 3%;
    top: 14%;
    animation: ws-ambient-float-left 6s ease-in-out infinite;
    will-change: transform;
  }

  .ws-ambient-right {
    right: 3%;
    top: 24%;
    animation: ws-ambient-float-right 6.8s ease-in-out infinite;
    will-change: transform;
  }

  @keyframes ws-ambient-float-left {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
  }

  @keyframes ws-ambient-float-right {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
  }

  .ws-app {
    max-width: 720px;
    min-height: calc(100dvh - 56px);
    border-radius: 24px;
  }

  .ws-header {
    padding: 18px 24px;
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
  }

  .ws-header-title {
    font-size: 20px;
  }

  .ws-stats-bar {
    gap: 12px;
    padding: 16px 24px;
  }

  .ws-stat-item {
    padding: 12px 8px;
    border-radius: 12px;
  }

  .ws-stat-num {
    font-size: 24px;
  }

  .ws-filters {
    padding: 14px 24px;
  }

  .ws-grid-wrap {
    padding: 0 24px 24px;
  }

  .ws-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .ws-book-title {
    font-size: 14px;
  }

  .ws-tabbar {
    position: sticky;
    padding: 14px 24px calc(18px + var(--ws-safe-bottom));
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.9) 40%, #fff 100%);
    box-shadow: none;
  }

  .ws-tabbar-inner {
    max-width: 360px;
  }

  .ws-main {
    padding-bottom: 0;
  }

  .ws-stats-page {
    padding: 0 24px 24px;
  }

  .ws-mode-tabs {
    margin-bottom: 4px;
  }
}

@media (min-width: 1024px) {
  .ws-body {
    padding: 32px 48px;
  }

  .ws-app {
    max-width: 960px;
    min-height: calc(100dvh - 64px);
  }

  .ws-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
  }

  .ws-stats-bar {
    padding: 18px 28px;
  }

  .ws-filters {
    padding: 16px 28px;
  }

  .ws-grid-wrap {
    padding: 0 28px 28px;
  }

  .ws-stats-page {
    padding: 0 28px 28px;
  }
}

@media (min-width: 1280px) {
  .ws-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
