:root {
  --navy: #102a43;
  --navy-2: #1c3a5f;
  --orange: #e67e22;
  --light: #f4f6f8;
  --dark: #333;
  --gray: #8a8f96;
  --bg: #0d1b2a;
  --line: #dfe5ec;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--dark);
  background: var(--bg);
}

a {
  color: var(--orange);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================== 首页 ============================== */
.ws-index {
  min-height: 100%;
  padding: 4vh max(4vw, 24px) 6vh;
  max-width: 1080px;
  margin: 0 auto;
}

.ws-index header h1 {
  color: #fff;
  font-size: clamp(24px, 4vh, 34px);
  letter-spacing: 0.5px;
}

.ws-index header p {
  color: #a8b8c8;
  margin-top: 8px;
  font-size: 14px;
}

.ws-index .rule {
  width: 72px;
  height: 4px;
  background: var(--orange);
  margin: 16px 0 32px;
  border-radius: 2px;
}

.ws-section {
  margin-bottom: 40px;
}

.ws-section h2 {
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ws-section h2 .count {
  font-size: 12px;
  color: var(--gray);
  font-weight: 400;
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.ws-card {
  background: #16283c;
  border: 1px solid #1e3248;
  border-radius: 10px;
  padding: 16px 18px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-card:hover {
  transform: translateY(-2px);
  border-color: var(--orange);
  background: #1a2f46;
}

.ws-card .name {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  word-break: break-all;
}

.ws-card .meta {
  color: var(--gray);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ws-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.ws-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.ws-btn:hover {
  text-decoration: none;
}

.ws-btn.primary {
  background: var(--orange);
  color: #fff;
}

.ws-btn.primary:hover {
  background: #cf6d16;
}

.ws-btn.ghost {
  border-color: #3a5572;
  color: #cfe0f0;
}

.ws-btn.ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(230, 126, 34, 0.08);
}

.ws-summary {
  color: var(--gray);
  font-size: 13px;
  border-top: 1px solid #1e3248;
  margin-top: 24px;
  padding-top: 14px;
}

/* ============================== 查看器 ============================== */
.ws-viewer {
  width: 100%;
  height: 100%;
}

.ws-fullscreen-root {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.ws-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
}

.ws-toolbar .home {
  color: #a8b8c8;
  font-size: 13px;
  white-space: nowrap;
}

.ws-toolbar .home:hover {
  color: var(--orange);
  text-decoration: none;
}

.ws-toolbar .title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-toolbar .actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-toolbar .nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #1c3a5f;
  border: 1px solid #2a4a6d;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ws-toolbar .nav-btn:hover {
  background: var(--orange);
  border-color: var(--orange);
}

.ws-counter {
  font-size: 13px;
  color: #a8b8c8;
  min-width: 62px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ws-toolbar .ws-btn {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  color: #fff;
  background: #1c3a5f;
  border-color: #2a4a6d;
}

.ws-toolbar .ws-btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  text-decoration: none;
}

.ws-stage {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  background-image: radial-gradient(circle at 50% 40%, #17293e 0%, #0d1b2a 70%);
}

.ws-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.25s ease;
}

.ws-frame.active {
  visibility: visible;
  opacity: 1;
}

.ws-frame .slide {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.ws-warn {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  max-width: min(640px, 92%);
  background: rgba(179, 58, 58, 0.95);
  color: #fff;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
}

.ws-warn a {
  color: #ffd9a0;
  font-weight: 600;
  white-space: nowrap;
}

.ws-warn a:hover {
  text-decoration: underline;
}

.ws-warn .ico {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  color: #b33a3a;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

/* 缩略图导航栏 */
.ws-rail-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 20, 34, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px;
  z-index: 20;
  scrollbar-width: thin;
}

.ws-rail {
  display: flex;
  gap: 10px;
  width: max-content;
  margin: 0 auto;
}

.ws-thumb {
  position: relative;
  flex: 0 0 auto;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  background: #12202f;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ws-thumb:hover {
  border-color: #3a5572;
  transform: translateY(-2px);
}

.ws-thumb.active {
  border-color: var(--orange);
}

.ws-thumb .inner {
  position: relative;
  transform-origin: 0 0;
  pointer-events: none;
}

.ws-thumb .num {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: rgba(10, 20, 34, 0.85);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  z-index: 2;
}

.ws-thumb .warn-badge {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e0553c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.ws-thumb:hover .inner {
  filter: none;
}

.ws-render-root {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

/* 加载 / 错误遮罩 */
.ws-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.ws-overlay.error .loader {
  display: none;
}

.ws-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #1e3248;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: ws-spin 0.9s linear infinite;
}

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

.ws-overlay .msg {
  color: #cfe0f0;
  font-size: 15px;
  max-width: 70%;
  text-align: center;
  line-height: 1.6;
  word-break: break-all;
}

.ws-overlay.error .msg {
  color: #ffb4a0;
}

.ws-overlay .hint {
  color: var(--gray);
  font-size: 13px;
  margin-top: 4px;
}

@media (max-width: 720px) {
  .ws-toolbar {
    padding: 8px 10px;
    gap: 8px;
  }

  .ws-toolbar .title {
    font-size: 13px;
  }

  .ws-toolbar .ws-btn span.txt {
    display: none;
  }
}