@view-transition {
  navigation: auto;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
  line-height: 1.5;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

h1 a {
  color: #1f6b3a;
  text-decoration: none;
}

h1 a:hover {
  text-decoration: underline;
}

.subtitle {
  margin: 0 0 1.5rem;
  color: #555;
  font-size: 0.95rem;
}

.page-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e0e3e8;
  border-radius: 10px;
  overflow: hidden;
}

.page-list li {
  border-bottom: 1px solid #eef0f3;
}

.page-list li:last-child {
  border-bottom: none;
}

.page-list a {
  display: block;
  padding: 0.85rem 1rem;
  color: #1a1a1a;
  text-decoration: none;
  transition: background 0.15s;
}

.page-list a:hover {
  background: #dceee2;
}

.page-list .page-name {
  font-weight: 500;
  color: #1f6b3a;
}

.page-list .page-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: #555;
}

.dropzone {
  border: 2px dashed #b0b8c4;
  border-radius: 10px;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #1f6b3a;
  background: #dceee2;
}

.dropzone p {
  margin: 0 0 0.75rem;
  color: #444;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

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

.btn-primary {
  background: #1f6b3a;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #185a30;
}

.btn-secondary {
  background: #e8eaed;
  color: #333;
}

.btn-secondary:hover:not(:disabled) {
  background: #d8dbe0;
}

.btn-danger {
  background: transparent;
  color: #c0392b;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

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

#file-input { display: none; }

.file-list {
  margin-top: 1.25rem;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e0e3e8;
}

.file-list:empty { display: none; }

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: #f8f9fb;
  border-bottom: 1px solid #e0e3e8;
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #eef0f3;
  font-size: 0.9rem;
}

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

.actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.status.visible { display: block; }

.status.info {
  background: #dceee2;
  color: #123d1f;
  border: 1px solid #9bc9a8;
}

.status.success {
  background: #e6f4ea;
  color: #1e5c2e;
  border: 1px solid #b7dfc3;
}

.status.error {
  background: #fdecea;
  color: #8b1a10;
  border: 1px solid #f5c4bf;
}

.status ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.status li { margin: 0.2rem 0; }

@media (prefers-color-scheme: dark) {
  body { background: #1a1c20; color: #e8eaed; }
  h1 a { color: #4a9e68; }
  .subtitle { color: #9aa0a8; }
  .page-list { background: #252830; border-color: #3a3f4a; }
  .page-list li { border-color: #333842; }
  .page-list a { color: #e8eaed; }
  .page-list a:hover { background: #243328; }
  .page-list .page-name { color: #4a9e68; }
  .page-list .page-desc { color: #9aa0a8; }
  .dropzone { background: #252830; border-color: #444; }
  .dropzone:hover, .dropzone.dragover { background: #243328; border-color: #4a9e68; }
  .dropzone p { color: #c4c8ce; }
  .file-list { background: #252830; border-color: #3a3f4a; }
  .file-list-header { background: #2a2e38; border-color: #3a3f4a; color: #9aa0a8; }
  .file-item { border-color: #333842; }
  .btn-secondary { background: #3a3f4a; color: #e8eaed; }
  .btn-secondary:hover:not(:disabled) { background: #4a5060; }
  .status.info { background: #152a1e; color: #6bb884; border-color: #234d32; }
  .status.success { background: #1e3326; color: #8fd4a0; border-color: #2d5a3c; }
  .status.error { background: #3a1f1c; color: #f0a8a0; border-color: #6b3028; }
}
