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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  min-height: 100vh;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1d1d1f;
}

.subtitle {
  color: #86868b;
  font-size: 14px;
  margin-top: 4px;
}

.hint {
  color: #86868b;
  font-size: 13px;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed #c7c7cc;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #007aff;
  background: #f0f5ff;
}

.drop-zone-content svg {
  color: #86868b;
  margin-bottom: 12px;
}

.drop-zone-content p {
  font-size: 16px;
  margin-bottom: 4px;
}

/* File List */
#file-list-section {
  margin-top: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: 20px;
}

.badge {
  background: #e8e8ed;
  color: #636366;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
}

#file-list {
  list-style: none;
  margin: 12px 0 20px;
}

#file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: box-shadow 0.2s ease;
}

#file-list li:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.drag-handle {
  cursor: grab;
  color: #c7c7cc;
  font-size: 18px;
  user-select: none;
  flex-shrink: 0;
}

.drag-handle:active {
  cursor: grabbing;
}

.file-name {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-count {
  background: #007aff;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.remove-btn {
  background: none;
  border: none;
  color: #ff3b30;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}

.remove-btn:hover {
  color: #d70015;
}

/* Sortable states */
.sortable-ghost {
  opacity: 0.4;
}

.sortable-chosen {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Buttons */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #007aff;
  color: #fff;
}

.btn-primary:hover {
  background: #0066d6;
}

.btn-secondary {
  background: #e8e8ed;
  color: #1d1d1f;
}

.btn-secondary:hover {
  background: #d1d1d6;
}

.btn-danger {
  background: #fff;
  color: #ff3b30;
  border: 1px solid #ff3b30;
}

.btn-danger:hover {
  background: #fff5f5;
}

/* Result */
#result-section {
  margin-top: 24px;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e5ea;
}

#result-section h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

#result-info {
  font-size: 14px;
  color: #636366;
  margin-bottom: 16px;
}

#pdf-preview {
  width: 100%;
  height: 600px;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  margin-top: 16px;
}

/* Loading */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(245,245,247,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e8e8ed;
  border-top-color: #007aff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

.loading p {
  font-size: 15px;
  color: #636366;
}
