/* ================================
 * NicheWorks 共通レイアウト
 * ================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --border: #e5e7eb;
  --border-soft: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --accent: #111111;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.05);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

header {
  padding: 24px 16px 12px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

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

/* ---------------------------
 * 使い方リンク（広告直下）
 * --------------------------- */
.usage-link {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.usage-link a {
  color: var(--muted);
  text-decoration: underline;
}

/* ---------------------------
 * 広告プレースホルダ
 * --------------------------- */
.ad-area {
  margin: 12px 0;
}
.ad-placeholder {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------------------------
 * main
 * --------------------------- */
main {
  max-width: 600px;
  padding: 0 16px 32px;
  margin: 0 auto;
}

.label {
  font-size: 14px;
  color: var(--text);
}

textarea {
  width: 100%;
  min-height: 140px;
  padding: 12px;
  margin: 6px 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: monospace;
  background: var(--bg-soft);
}

button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
button:hover {
  opacity: 0.9;
}

/* ---------------------------
 * プログレスバー
 * --------------------------- */
.progress-wrap {
  width: 100%;
  margin-top: 16px;
  background: var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  height: 10px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s linear;
}
.hidden {
  display: none !important;
}

/* ---------------------------
 * 成功・失敗件数
 * --------------------------- */
.count-area {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text);
  display: flex;
  gap: 12px;
}

/* ---------------------------
 * 結果テーブル
 * --------------------------- */
#results table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 14px;
}

#results th, #results td {
  border: 1px solid var(--border);
  padding: 8px;
  word-break: break-all;
}

#results th {
  background: var(--bg-soft);
}

/* ステータス色 */
.status-success {
  color: green;
  font-weight: 600;
}
.status-no-title {
  color: #999;
  font-weight: 600;
}
.status-http-error {
  color: #cc0000;
  font-weight: 600;
}
.status-network-error {
  color: #b30000;
  font-weight: 600;
}

/* ---------------------------
 * CSV/TSV/Reset ボタン
 * --------------------------- */
.export-area {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.export-area button {
  flex: 1;
  padding: 10px;
  background: var(--bg-soft);
  color: var(--accent);
  border: 1px solid var(--border);
  font-size: 14px;
  border-radius: var(--radius);
}
.export-area button:hover {
  background: #eee;
}

/* Resetボタン（赤系ではなくNicheWorks仕様で控えめ） */
.reset-btn {
  background: #fff0f0;
  border-color: #ffcccc;
  color: #b30000;
}
.reset-btn:hover {
  background: #ffe5e5;
}

/* ================================
 * NicheWorks – Internal Links Block
 * ================================ */

.nw-links {
  margin: 32px 0 16px;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.nw-links a {
  color: #666;
  text-decoration: none;
  padding: 0 4px;
}

.nw-links a:hover {
  text-decoration: underline;
  opacity: 0.8;
}


/* ---------------------------
 * footer
 * --------------------------- */
footer {
  margin-top: 40px;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
