:root {
  --color-bg: #0a0a0f;
  --color-surface: #12121a;
  --color-surface-elevated: #1a1a24;
  --color-border: #2a2a3a;
  --color-text: #e8e8ed;
  --color-text-muted: #8888a0;
  --color-primary: #6366f1;
  --color-primary-hover: #818cf8;
  --color-accent: #22d3ee;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  
  --font-sans: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(34, 211, 238, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--color-bg) 0%, #0d0d14 100%);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 0.6s ease-out;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: left;
  line-height: 1.4;
}

.logo-icon {
  font-size: 2.8rem;
  animation: float 3s ease-in-out infinite;
}

.logo-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  font-weight: 400;
}

.main {
  flex: 1;
}

.input-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-wrapper-vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.url-input-multi {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  background: var(--color-surface-elevated);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: all 0.2s ease;
  resize: vertical;
  min-height: 200px;
  line-height: 2;
}

.url-input-multi:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.url-input-multi::placeholder {
  color: var(--color-text-muted);
  opacity: 0.5;
}

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.url-count {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.url-count.warning {
  color: var(--color-warning);
}

.url-count.error {
  color: var(--color-error);
}

/* URLステータスリスト */
.url-status-list {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--color-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.url-status-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.url-status-item:last-child {
  border-bottom: none;
}

.url-status-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.url-status-icon.loading {
  animation: spin 1s linear infinite;
  color: var(--color-accent);
}

.url-status-icon.complete {
  color: var(--color-success);
}

.url-status-icon.waiting {
  color: var(--color-text-muted);
}

.url-status-icon.error {
  color: var(--color-error);
}

.url-status-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.url-status-label {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.url-status-label.loading {
  background: rgba(34, 211, 238, 0.15);
  color: var(--color-accent);
}

.url-status-label.complete {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.url-status-label.waiting {
  background: rgba(136, 136, 160, 0.15);
  color: var(--color-text-muted);
}

.url-status-label.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

.capture-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--color-primary), #4f46e5);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.capture-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-primary-hover), var(--color-primary));
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.capture-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 1.2rem;
}

.hidden {
  display: none !important;
}

.preview-section {
  animation: fadeInUp 0.6s ease-out;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.preview-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-count {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.print-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background: var(--color-success);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.print-btn:hover {
  background: #0ea572;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.a4-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.a4-page {
  width: 210mm;
  height: 297mm;
  background: white;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  transform-origin: top center;
}

.a4-page-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: white;
}

.a4-page img {
  display: block;
}

.page-number {
  position: absolute;
  bottom: 5mm;
  right: 5mm;
  font-size: 9pt;
  color: #999;
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.8);
  padding: 2px 6px;
  border-radius: 3px;
}

.footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

.print-container {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  body {
    background: white !important;
    margin: 0;
    padding: 0;
  }
  
  body::before {
    display: none !important;
  }
  
  .container,
  .header,
  .input-section,
  .preview-section,
  .footer {
    display: none !important;
  }
  
  .print-container {
    display: block !important;
  }
  
  .print-page {
    width: 210mm;
    height: 297mm;
    page-break-after: always;
    page-break-inside: avoid;
    overflow: hidden;
    background: white !important;
  }
  
  .print-page:last-child {
    page-break-after: avoid;
  }
  
  .print-page img {
    display: block;
  }
}

@media (max-width: 900px) {
  .a4-page {
    width: 100%;
    height: auto;
    aspect-ratio: 210 / 297;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }
  
  .capture-btn {
    justify-content: center;
  }
  
  .preview-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
