.hub-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(91, 141, 239, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(62, 207, 142, 0.08), transparent 50%),
    var(--bg);
}

.hub-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.25rem 3rem;
}

.hub-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hub-brand {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent2);
}

.hub-header h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hub-sub {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.hub-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hub-card {
  display: block;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.hub-card:hover {
  border-color: var(--accent);
  background: #1e2430;
  transform: translateY(-2px);
}

.hub-card__label {
  display: block;
  font-size: 1.15rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.hub-card__desc {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.tool-page-nav {
  margin: 0 0 0.75rem;
}

.tool-page-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.tool-page-nav a:hover {
  color: var(--accent);
}

.mp4-tool .drop {
  min-height: 180px;
}

.mp4-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 1rem 0;
  align-items: flex-end;
}

.mp4-options label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.mp4-options input[type="number"] {
  width: 7rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.mp4-range-row {
  align-items: flex-end;
}

.mp4-range-sep {
  color: var(--muted);
  font-size: 1.1rem;
  padding-bottom: 0.45rem;
}

.mp4-range-info {
  margin: 0;
  flex: 1 1 100%;
  color: var(--muted);
  font-size: 0.85rem;
}

.mp4-result {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.mp4-result.hidden {
  display: none;
}

.mp4-preview-block {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12151c;
}

.mp4-preview-filename {
  margin: 0 0 0.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.mp4-preview-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  max-height: 420px;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #1a1e26;
  background-image:
    linear-gradient(45deg, #252a34 25%, transparent 25%),
    linear-gradient(-45deg, #252a34 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #252a34 75%),
    linear-gradient(-45deg, transparent 75%, #252a34 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  overflow: hidden;
}

.mp4-preview-main img {
  display: block;
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.35);
  background: #fff;
}

.mp4-timeline-wrap {
  overflow-x: auto;
  padding-bottom: 1.6rem;
}

.mp4-timeline {
  position: relative;
  min-width: 100%;
  user-select: none;
  touch-action: none;
}

.mp4-timeline-track {
  display: flex;
  gap: 1px;
  min-height: 64px;
  border-radius: 6px;
  overflow: hidden;
  background: #0a0c10;
}

.mp4-timeline-thumb {
  flex: 1 1 0;
  min-width: 0;
  height: 64px;
  padding: 0;
  border: none;
  background: #1a1e26;
  cursor: pointer;
  overflow: hidden;
}

.mp4-timeline-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.92;
}

.mp4-timeline-thumb.is-active img {
  opacity: 1;
}

.mp4-timeline-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mp4-timeline-dim {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(8, 10, 14, 0.72);
  pointer-events: none;
}

.mp4-timeline-dim--left {
  left: 0;
}

.mp4-timeline-dim--right {
  right: 0;
}

.mp4-timeline-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 2px solid #3ecf8e;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.mp4-timeline-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  cursor: ew-resize;
  pointer-events: auto;
  z-index: 2;
}

.mp4-timeline-handle::before {
  content: "⋮";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #1a1e26;
  font-size: 0.85rem;
  line-height: 1;
}

.mp4-timeline-handle--start {
  left: -7px;
  border-radius: 4px 0 0 4px;
}

.mp4-timeline-handle--end {
  right: -7px;
  border-radius: 0 4px 4px 0;
}

.mp4-timeline-time {
  position: absolute;
  bottom: -1.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

.mp4-timeline-time--start {
  left: 0;
  transform: translateX(-20%);
}

.mp4-timeline-time--end {
  right: 0;
  transform: translateX(20%);
}

.mp4-timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 3;
}

.mp4-timeline-playhead.hidden {
  display: none;
}

.mp4-png-count {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.mp4-hint {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.mp4-status {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.92rem;
}

.mp4-status.is-error {
  color: #f07178;
}

.mp4-status.is-ok {
  color: var(--accent2);
}

.png-file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 320px;
  overflow: auto;
}

.png-file-list li {
  margin: 0;
  padding: 0;
  border: none;
}

.png-thumb-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.png-thumb-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background-color: #1a1e26;
  background-image:
    linear-gradient(45deg, #252a34 25%, transparent 25%),
    linear-gradient(-45deg, #252a34 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #252a34 75%),
    linear-gradient(-45deg, transparent 75%, #252a34 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.png-thumb-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.png-thumb-name {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.png-thumb-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.png-check-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
  color: var(--text) !important;
  font-size: 0.9rem !important;
}

.png-check-label input {
  width: auto;
}

#resize-options select {
  min-width: 14rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}
