:root {
  --bg-dark: #0d0d0f;
  --bg-panel: #1a1a1e;
  --bg-panel-hover: #222228;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a8;
  --border-blue: #3b82f6;
  --accent-blue: #2563eb;
  --accent-orange: #ea580c;
  --accent-orange-hover: #f97316;
  --link-green: #22c55e;
  --border-gray: #2d2d32;
  --highlight: #3b82f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { overflow-x: hidden; max-width: 100vw; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-gray);
}

.logo-section { display: flex; align-items: center; gap: 1rem; }
.logo-icon { font-size: 2rem; line-height: 1; }
.header h1 { font-size: 1.5rem; font-weight: 700; }
.subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.25rem; }
.user-status { color: var(--text-secondary); font-size: 0.875rem; }

.main { max-width: 1200px; margin: 0 auto; padding: 1rem 2rem; width: 100%; }

.description-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid var(--border-blue);
  border-radius: 8px;
  margin-bottom: 2rem;
}

.description-text { flex: 1; font-size: 0.95rem; color: var(--text-primary); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-orange { background: var(--accent-orange); color: white; }
.btn-orange:hover { background: var(--accent-orange-hover); }
.btn-blue { background: var(--accent-blue); color: white; }
.btn-blue:hover { background: #1d4ed8; }
.btn-gray { background: var(--border-gray); color: white; }
.btn-gray:hover { background: #3d3d44; }
.btn-icon { font-size: 0.8rem; }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2.5rem; }
@media (max-width: 700px) { .panels { grid-template-columns: 1fr; } }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 2rem;
}

.upload-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
  padding: 1.5rem;
  border: 2px dashed var(--border-gray);
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.drop-zone.dragover { border-color: var(--accent-blue); background: rgba(59, 130, 246, 0.05); }
.drop-zone.has-file { border-color: var(--link-green); background: rgba(34, 197, 94, 0.05); }

.folder-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.9; }
.drop-text { font-size: 1rem; font-weight: 500; margin-bottom: 0.5rem; }
.formats { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; }

.access-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.padlock { font-size: 1.25rem; }
.access-header h2 { font-size: 1.1rem; font-weight: 600; }
.access-text { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 1rem; }
.access-steps { margin-left: 1.25rem; margin-bottom: 1.5rem; color: var(--text-secondary); font-size: 0.9rem; }
.access-steps li { margin-bottom: 0.5rem; }

.link { color: var(--link-green); text-decoration: none; }
.link:hover { text-decoration: underline; }

.access-buttons { display: flex; flex-direction: column; gap: 0.75rem; }
.access-buttons .btn { width: 100%; justify-content: center; }

.faq h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }
.accordion { display: flex; flex-direction: column; gap: 0.5rem; }

.accordion-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
  transition: background 0.2s;
}

.accordion-header:hover { background: var(--bg-panel-hover); }
.accordion-icon { color: var(--text-secondary); font-size: 1.25rem; flex-shrink: 0; margin-left: 0.5rem; }

.accordion-content {
  padding: 0 1.25rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  display: none;
}

.accordion-item.open .accordion-content { display: block; }
.accordion-item:not(.open) .accordion-icon::before { content: '+'; }
.accordion-item.open .accordion-icon::before { content: '−'; }

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: var(--link-green); }
.toast.error { border-color: #ef4444; }

.loading .drop-text::after { content: '...'; animation: dots 1s infinite; }
@keyframes dots { 0%, 20% { content: '.'; } 40% { content: '..'; } 60%, 100% { content: '...'; } }

.hidden { display: none !important; }
.editor-section { margin-bottom: 2.5rem; }

.editor-layout { display: grid; grid-template-columns: 1fr 400px; gap: 1.5rem; }
@media (max-width: 900px) { .editor-layout { grid-template-columns: 1fr; } }

.editor-left { display: flex; flex-direction: column; gap: 1rem; }

.preview-box {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  min-height: 300px;
  overflow: hidden;
}

.preview-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  z-index: 10;
}

.preview-close:hover { background: rgba(0,0,0,0.8); }

.preview-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 1rem;
}

.preview-media img, .preview-media video {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.status-badges { display: flex; gap: 0.5rem; }

.badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-green { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.badge-gray { background: rgba(160, 160, 168, 0.2); color: var(--text-secondary); }
.badge-red { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-blue { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }

.tech-report {
  background: var(--bg-panel);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  overflow: hidden;
}

.tech-report-header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  background: var(--bg-panel-hover);
  border-bottom: 1px solid var(--border-gray);
}

.tech-report-content {
  padding: 1rem;
  font-size: 0.8rem;
  font-family: 'Consolas', monospace;
  color: var(--link-green);
  max-height: 150px;
  overflow: auto;
  overflow-wrap: break-word;
  word-break: break-all;
  white-space: pre-wrap;
  margin: 0;
}

.editor-right { display: flex; flex-direction: column; gap: 1.5rem; }
.metadata-section h3 { font-size: 1rem; margin-bottom: 0.75rem; }

.preset-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }

.preset-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-gray);
  background: var(--bg-panel);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.preset-btn:hover, .preset-btn.active { background: var(--border-gray); color: var(--text-primary); }

.field { margin-bottom: 0.75rem; }
.field label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.25rem; }

.field input, .field textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.field textarea { resize: vertical; }

.action-buttons { display: flex; flex-direction: column; gap: 0.75rem; margin-top: auto; }
.btn-large { padding: 0.85rem 1.5rem; font-size: 1rem; justify-content: center; }
