:root {
  --accent: #2b6cb0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #dfe3e8;
  --text: #24292f;
  --muted: #6a737d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 32px 16px 80px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.sub {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

label.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 18px;
  transition: border-color .15s, background .15s;
}
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(43,108,176,.06);
}
.dropzone input { display: none; }

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.file-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fafbfc;
  position: relative;
}
.file-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}
.file-item .idx {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 11px;
  border-radius: 4px;
  padding: 0 5px;
}
.file-item .ops {
  display: flex;
  justify-content: space-between;
  padding: 4px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.file-item .ops button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  padding: 2px 4px;
}
.file-item .ops button:hover { color: var(--accent); }

.btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn:disabled { opacity: .5; cursor: default; }

.progress-wrap {
  margin-top: 18px;
  display: none;
}
.progress-wrap.active { display: block; }
.progress-bar {
  height: 8px;
  border-radius: 4px;
  background: #eaeef2;
  overflow: hidden;
}
.progress-bar > div {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .15s ease;
}
.progress-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.result {
  display: none;
  border-color: #b7dfc3;
  background: #f2fbf4;
}
.result.active { display: block; }
.result h2 { font-size: 16px; margin: 0 0 10px; color: #1a7f37; }
.result .url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.result input[type="text"] {
  margin: 0;
  background: #fff;
}
.result a.open-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
}

.error-box {
  display: none;
  border-color: #f0b3b3;
  background: #fdf3f3;
  color: #a02020;
  font-size: 14px;
}
.error-box.active { display: block; }

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: -8px;
  margin-bottom: 18px;
}
