﻿:root {
  --pc-bg: #f7f8fb;
  --pc-card: #ffffff;
  --pc-border: #d9dfe8;
  --pc-accent: #2f6fed;
  --pc-text: #1b1f24;
  --pc-muted: #6b7785;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--pc-bg);
  color: var(--pc-text);
}

.pc-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--pc-card);
  border-bottom: 1px solid var(--pc-border);
}

.pc-header h1 {
  font-size: 20px;
  margin: 0;
}

.pc-home {
  text-decoration: none;
  color: var(--pc-accent);
  font-weight: 600;
}

.pc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--pc-border);
  background: var(--pc-card);
}

.pc-file {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--pc-muted);
}

.pc-file-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.pc-file-name {
  font-size: 12px;
  color: var(--pc-text);
}

.pc-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--pc-border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.pc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pc-primary {
  background: var(--pc-accent);
  color: #fff;
  border-color: var(--pc-accent);
}

.pc-status {
  margin-left: auto;
  color: var(--pc-muted);
  font-size: 13px;
}

.pc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 16px 20px 40px;
}

.pc-viewer {
  background: var(--pc-card);
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  padding: 12px;
  min-height: 60vh;
  max-height: calc(100vh - 210px);
  overflow: auto;
  position: relative;
}

.pc-viewer.pc-loading {
  overflow: hidden;
}

.pc-viewer.pc-loading .pc-pages {
  pointer-events: none;
  opacity: 0.6;
}

.pc-pages {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pc-page {
  position: relative;
  display: inline-block;
  margin: 0 auto;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.pc-canvas {
  display: block;
  background: #fff;
}

.pc-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.pc-overlay.pc-disabled {
  cursor: default;
}

.pc-selection {
  position: absolute;
  border: 2px solid #ff4d4f;
  background: rgba(255, 77, 79, 0.08);
  pointer-events: none;
}

.pc-page-indicator {
  font-size: 13px;
  color: var(--pc-muted);
}

.pc-dropzone {
  border: 2px dashed var(--pc-border);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  color: var(--pc-muted);
  margin-bottom: 16px;
  background: #fcfdff;
}

.pc-dropzone.active {
  border-color: var(--pc-accent);
  color: var(--pc-accent);
  background: #f1f6ff;
}

.pc-drop-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--pc-text);
}

.pc-drop-sub {
  font-size: 12px;
  margin-top: 6px;
}

.pc-progress.hidden {
  display: none;
}

.pc-progress {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
}

.pc-progress-bar {
  height: 8px;
  background: #e7ecf4;
  border-radius: 999px;
  overflow: hidden;
}

.pc-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--pc-accent);
  transition: width 0.2s ease;
}

.pc-progress-text {
  font-size: 12px;
  color: var(--pc-muted);
}

.pc-sidebar {
  background: var(--pc-card);
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  padding: 12px;
  max-height: calc(100vh - 210px);
  overflow: auto;
}


.pc-side-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.pc-fragment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pc-fragment {
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fdfdfd;
}

.pc-fragment span {
  font-size: 13px;
}

.pc-fragment button {
  border: none;
  background: transparent;
  color: #c0392b;
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .pc-layout {
    grid-template-columns: 1fr;
  }

  .pc-sidebar {
    max-height: none;
  }

  .pc-status {
    width: 100%;
    margin-left: 0;
  }
}
