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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #f5eeff 0%, #fff0f8 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.container {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(160, 60, 160, 0.13);
  padding: 32px 28px 24px;
  width: 100%;
  max-width: 520px;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  color: #2d2d2d;
  text-align: center;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 13px;
  color: #5c5c5c;
  text-align: center;
  margin-bottom: 24px;
}

/* ドロップゾーン */
.drop-zone {
  border: 2px dashed #ddb0dd;
  border-radius: 12px;
  padding: 28px 20px 20px;
  text-align: center;
  cursor: default;
  transition: border-color 0.2s, background 0.2s;
  background: #fdf6ff;
  user-select: none;
}

.drop-zone.dragover {
  border-color: #cc44cc;
  background: #f5e0ff;
}

.drop-zone-icon {
  font-size: 40px;
  margin-bottom: 10px;
  line-height: 1;
}

.drop-zone-text {
  font-size: 15px;
  color: #333;
  margin-bottom: 14px;
}

input[type="file"] { display: none; }

.btn-primary {
  display: inline-block;
  padding: 9px 22px;
  background: #ff7bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn-primary:hover { background: #cc44cc; }
.btn-primary:active { transform: scale(0.97); }

.drop-zone-hint {
  font-size: 12px;
  color: #707070;
  margin-top: 10px;
}

/* divider */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: #777;
  font-size: 13px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #eee;
}

/* URL 入力行 */
.url-row {
  display: flex;
  gap: 8px;
}

.url-row input[type="text"] {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  color: #333;
}

.url-row input[type="text"]:focus {
  border-color: #cc66cc;
}

.btn-secondary {
  padding: 9px 18px;
  background: #ff7bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}

.btn-secondary:hover { background: #cc44cc; }
.btn-secondary:active { transform: scale(0.97); }

/* ステータス */
#statusMessage {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-top: 14px;
  min-height: 18px;
  color: transparent;
  transition: color 0.2s;
}

#statusMessage.loading { color: #666; }
#statusMessage.success { color: #22aa55; }
#statusMessage.error   { color: #dd3333; }

/* プレビュー */
#preview {
  display: none;
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  margin: 12px auto 0;
  object-fit: contain;
}

/* 生成URL エリア */
#resultArea {
  display: none;
  margin-top: 18px;
  background: #f6fff8;
  border: 1.5px solid #7dd8a0;
  border-radius: 12px;
  padding: 14px 16px;
}

.result-label {
  font-size: 12px;
  color: #525252;
  margin-bottom: 6px;
}

#recentUrl {
  font-family: "Menlo", "Consolas", monospace;
  font-size: 12px;
  color: #1a55cc;
  word-break: break-all;
  margin-bottom: 10px;
  line-height: 1.5;
}

#copyButton {
  width: 100%;
  padding: 10px;
  background: #28aa55;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#copyButton:hover { background: #1f8844; }
#copyButton:active { transform: scale(0.98); }
#copyButton.copied { background: #888; }

/* プロキシ折りたたみ */
.proxy-section {
  margin-top: 22px;
  border-top: 1px solid #f0e8f0;
  padding-top: 16px;
}

.proxy-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 14px;
  background: #fcf0ff;
  border: 1px solid #e4cce4;
  border-radius: 8px;
  font-size: 13px;
  color: #994499;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.proxy-toggle:hover { background: #f5e0ff; }

.proxy-arrow {
  font-size: 11px;
  transition: transform 0.25s ease;
  display: inline-block;
}

.proxy-arrow.open { transform: rotate(90deg); }

.proxy-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}

.proxy-body.open {
  max-height: 300px;
  opacity: 1;
}

.proxy-inner {
  padding: 14px 2px 4px;
}

.proxy-desc {
  font-size: 13px;
  color: #3d3d3d;
  margin-bottom: 10px;
  line-height: 1.5;
}

.proxy-url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #faf0ff;
  border: 1px solid #ddc8dd;
  border-radius: 8px;
  padding: 8px 12px;
}

.proxy-url-text {
  flex: 1;
  font-family: "Menlo", "Consolas", monospace;
  font-size: 12px;
  color: #662299;
  word-break: break-all;
  line-height: 1.4;
}

#proxyBtn {
  flex-shrink: 0;
  padding: 5px 12px;
  background: #aa44aa;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#proxyBtn:hover { background: #882288; }
#proxyBtn.copied { background: #888; }

.proxy-hint {
  font-size: 11px;
  color: #707070;
  margin-top: 8px;
  line-height: 1.5;
}

/* アップロード注意書き */
.upload-caution {
  margin-bottom: 20px;
  padding: 10px 14px 10px 2em;
  background: #fffbe6;
  border: 1px solid #f5d97a;
  border-radius: 8px;
  font-size: 12px;
  color: #6b5000;
  line-height: 1.6;
  text-align: left;
  text-indent: -1.5em;
}

/* ヘルプリンク */
.help-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: #777;
  text-decoration: none;
  transition: color 0.2s;
}

.help-link:hover { color: #444; }
