body {
  background: #f6f8fa;
  font-family: 'Segoe UI', 'Meiryo', sans-serif;
  margin: 0;
  padding: 0;
}

.form-container {
  background: #fff;
  max-width: 820px;
  margin: 40px auto;
  padding: 32px 40px 28px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

h2 {
  text-align: center;
  color: #1a6d5a;
  margin: 0 0 16px;
}

.btn-return {
  display: inline-block;
  padding: 8px 16px;
  margin-bottom: 16px;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s, color 0.2s;
}

.btn-return:hover {
  background-color: #ccc;
  color: #000;
}

.workflow-hint {
  margin: 0 0 24px;
  padding: 12px 14px;
  background: #f0f8f6;
  border-left: 4px solid #26a69a;
  color: #1a3d36;
  font-size: 0.95em;
  line-height: 1.5;
}

.import-box {
  margin-bottom: 28px;
  padding: 16px 18px;
  background: #f7fbfa;
  border: 1px solid #b2dfdb;
  border-radius: 8px;
}

.import-box label {
  display: block;
  color: #1a6d5a;
  font-weight: bold;
  margin-bottom: 8px;
}

.hp-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.hp-list-head label {
  margin-bottom: 0;
}

.btn-refresh {
  background: #fff;
  border: 1px solid #9e9e9e;
  color: #444;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.85em;
  cursor: pointer;
}

.btn-refresh:hover {
  background: #eee;
}

.hp-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}

.hp-list-status {
  margin: 0;
  padding: 12px;
  color: #666;
  font-size: 0.92em;
}

.hp-post-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid #cfd8dc;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.hp-post-item:hover {
  border-color: #26a69a;
  background: #f1fdfc;
}

.hp-post-item.is-selected {
  border-color: #26a69a;
  background: #e0f2f1;
  box-shadow: inset 3px 0 0 #26a69a;
}

.hp-post-item.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.hp-thumb,
.hp-thumb img,
.hp-thumb-placeholder {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #eceff1;
}

.hp-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8em;
  color: #607d8b;
  margin-bottom: 4px;
}

.hp-cat {
  background: #e0f2f1;
  color: #00695c;
  border-radius: 4px;
  padding: 0 6px;
}

.hp-post-title {
  font-weight: bold;
  color: #1a3d36;
  font-size: 0.95em;
  line-height: 1.35;
}

.hp-post-excerpt {
  margin-top: 4px;
  font-size: 0.82em;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hp-url-label {
  margin-top: 4px;
}

.import-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.import-row input {
  flex: 1;
}

.import-row .ai-btn {
  margin-top: 0;
  white-space: nowrap;
}

.field-note {
  margin: 8px 0 0;
  color: #666;
  font-size: 0.88em;
}

.form-group .field-note {
  margin: -4px 0 8px;
}

#fetch-status {
  display: block;
  margin-top: 8px;
  font-size: 0.92em;
}

.status-working { color: #1a6d5a; }
.status-ok { color: #2e7d32; }
.status-error { color: #c62828; }

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #1a6d5a;
  font-weight: bold;
  margin-bottom: 8px;
}

input[type="text"],
input[type="url"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 10px;
  border: 1.5px solid #b2dfdb;
  border-radius: 6px;
  font-size: 1em;
  background: #f9fdfc;
  box-sizing: border-box;
  transition: border 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #26a69a;
  outline: none;
  background: #e0f2f1;
}

.status-select {
  width: auto;
  min-width: 140px;
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
}

.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 24px;
}

#ai-status {
  color: #1a6d5a;
  font-size: 0.95em;
}

.submit-btn,
.ai-btn,
.preview-btn {
  background: linear-gradient(90deg, #26a69a 0%, #1de9b6 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 1em;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover,
.ai-btn:hover,
.preview-btn:hover {
  background: linear-gradient(90deg, #1de9b6 0%, #26a69a 100%);
}

.preview-btn {
  background: #607d8b;
}

.preview-btn:hover {
  background: #546e7a;
}

#preview-modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#preview-content {
  background: #fff;
  border-radius: 10px;
  padding: 32px;
  max-width: 680px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
}

#preview-content h3 {
  color: #1a6d5a;
  margin-top: 0;
}

#preview-ja,
#preview-en {
  border: 1px solid #eee;
  padding: 12px;
  margin-bottom: 16px;
}

#close-preview {
  float: right;
  cursor: pointer;
  color: #26a69a;
  font-size: 1.5em;
}

@media (max-width: 700px) {
  .form-container {
    margin: 16px;
    padding: 18px 14px;
  }

  .meta-row {
    grid-template-columns: 1fr;
  }

  .import-row {
    flex-direction: column;
  }

  #preview-content {
    padding: 16px;
  }
}
