:root {
  --primary: #6c63ff;
  --primary-dark: #4b44cc;
  --primary-light: #a29bfe;
  --accent: #00cec9;
  --accent-warm: #fd9644;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #d63031;
  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --bg-base: #0f0f1a;
  --bg-surface: rgba(255, 255, 255, 0.06);
  --bg-card: rgba(255, 255, 255, 0.08);
  --bg-card-hover: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.12);
  --border-focus: var(--primary-light);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(108, 99, 255, 0.3);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-main: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== リセット ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== ベース ===== */
body {
  font-family: var(--font-main);
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 206, 201, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 90%, rgba(253, 150, 68, 0.08) 0%, transparent 50%);
  color: #e2e8f0;
  line-height: 1.7;
  min-height: 100vh;
}

/* ===== ヘッダー ===== */
header {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 1rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.header-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.25;
  animation: float 8s ease-in-out infinite;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: -80px;
  left: -60px;
  animation-delay: 0s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  background: var(--accent);
  top: 20px;
  right: 10%;
  animation-delay: -3s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  background: var(--accent-warm);
  bottom: -40px;
  left: 40%;
  animation-delay: -6s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.header-inner {
  position: relative;
  z-index: 1;
}

.logo-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 1.2rem;
  line-height: 1.6;
}

.header-tags {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.tag {
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.35);
  color: var(--primary-light);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
}

/* ===== メイン ===== */
main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

/* ===== セクション共通 ===== */
section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

section:hover {
  box-shadow: var(--shadow-md);
}

/* ===== 注意事項 ===== */
.notice {
  background: rgba(253, 203, 110, 0.07);
  border: 1px solid rgba(253, 203, 110, 0.3);
  font-size: 0.88rem;
}

.notice strong {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--warning);
  font-size: 0.9rem;
}

.notice ul {
  padding-left: 1.2rem;
  color: #cbd5e0;
}

.notice li {
  margin-bottom: 0.35rem;
}

.notice strong strong {
  color: #fff;
}

/* ===== 入力エリア ===== */
.input-area label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: #e2e8f0;
}

.input-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

#targetUrl {
  flex: 1;
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  font-family: var(--font-main);
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: #e2e8f0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#targetUrl::placeholder {
  color: var(--text-muted);
}

#targetUrl:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

#targetUrl.input-valid {
  border-color: rgba(0, 184, 148, 0.6);
}

#targetUrl.input-invalid {
  border-color: rgba(214, 48, 49, 0.6);
}

.input-hint {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  min-height: 1.1em;
  color: var(--text-muted);
}

.input-hint.hint-ok {
  color: var(--success);
}

.input-hint.hint-error {
  color: #ff7675;
}

/* ===== ボタン ===== */
button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  padding: 0.9rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s;
  box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
  white-space: nowrap;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.55);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  box-shadow: none;
  font-size: 0.9rem;
  padding: 0.65rem 1.2rem;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-small {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
}

/* ===== 履歴エリア ===== */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.history-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  flex-wrap: wrap;
}

.history-item-info {
  min-width: 0;
  flex: 1;
}

.history-item-url {
  font-size: 0.85rem;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ===== 進捗 ===== */
.progress-header {
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.progress-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.2rem;
}

.progress-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.progress ol {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.progress li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  transition: all 0.3s ease;
}

.step-label {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  min-width: 52px;
  text-align: center;
}

.step-text {
  flex: 1;
}

.progress li::after {
  content: "○";
  font-size: 1rem;
  margin-left: auto;
}

.progress li.done {
  color: #a8edcb;
  background: rgba(0, 184, 148, 0.08);
  border-color: rgba(0, 184, 148, 0.2);
}

.progress li.done .step-label {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.progress li.done::after {
  content: "✓";
  color: var(--success);
}

.progress li.active {
  color: #fff;
  background: rgba(108, 99, 255, 0.12);
  border-color: rgba(108, 99, 255, 0.35);
  box-shadow: var(--shadow-glow);
}

.progress li.active .step-label {
  background: rgba(108, 99, 255, 0.3);
  color: var(--primary-light);
}

.progress li.active::after {
  content: "●";
  color: var(--primary-light);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== 結果エリア ===== */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.result-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.result-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e2e8f0;
}

.cache-badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.35);
  color: var(--primary-light);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== レポートカード ===== */
#reportContent {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.6rem;
  transition: box-shadow 0.2s;
}

.report-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.report-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.report-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  flex: 1;
}

/* 優先度バッジ */
.priority-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.priority-badge.high {
  background: rgba(214, 48, 49, 0.2);
  border: 1px solid rgba(214, 48, 49, 0.5);
  color: #ff7675;
}

.priority-badge.medium {
  background: rgba(253, 150, 68, 0.15);
  border: 1px solid rgba(253, 150, 68, 0.4);
  color: var(--accent-warm);
}

.priority-badge.low {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: var(--text-muted);
}

/* カード種別カラー（左ボーダー） */
.report-card.card-profile  { border-left: 3px solid var(--primary-light); }
.report-card.card-analysis { border-left: 3px solid var(--accent); }
.report-card.card-hooks    { border-left: 3px solid var(--accent-warm); }
.report-card.card-caution  { border-left: 3px solid var(--warning); }

/* ===== レポート内テキスト ===== */
.report-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-light);
  margin: 1.1rem 0 0.45rem;
}

.report-card h3:first-child {
  margin-top: 0;
}

.report-card p,
.report-card li {
  font-size: 0.9rem;
  color: #cbd5e0;
  line-height: 1.75;
}

.report-card ul,
.report-card ol {
  padding-left: 1.3rem;
}

.report-card li {
  margin-bottom: 0.35rem;
}

.report-card strong {
  color: #f1f5f9;
  font-weight: 600;
}

/* ===== プロファイルグリッド ===== */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.profile-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.profile-item .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.profile-item .value {
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.5;
}

/* ===== テーブル（競合分析） ===== */
.report-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  margin-top: 0.5rem;
}

.report-card th {
  background: rgba(255, 255, 255, 0.06);
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.8rem;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.report-card td {
  padding: 0.55rem 0.75rem;
  color: #cbd5e0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.report-card tr:last-child td {
  border-bottom: none;
}

/* ===== 営業フックカード ===== */
.hook-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hook-item {
  background: rgba(253, 150, 68, 0.05);
  border: 1px solid rgba(253, 150, 68, 0.18);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
}

.hook-item .hook-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-warm);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hook-item .hook-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.3rem;
  font-size: 0.87rem;
  color: #cbd5e0;
  line-height: 1.6;
}

.hook-item .hook-row-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 70px;
  flex-shrink: 0;
}

/* ===== フィードバックボタン群 ===== */
.fb-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(253, 150, 68, 0.25);
}

.fb-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.fb-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: #cbd5e0;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, opacity 0.2s;
}

.fb-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: none;
}

.fb-btn.fb-up:hover:not(:disabled) {
  background: rgba(0, 184, 148, 0.18);
  border-color: rgba(0, 184, 148, 0.5);
  color: #a8edcb;
}

.fb-btn.fb-down:hover:not(:disabled) {
  background: rgba(214, 48, 49, 0.15);
  border-color: rgba(214, 48, 49, 0.45);
  color: #ff7675;
}

.fb-btn.fb-selected {
  background: rgba(108, 99, 255, 0.25);
  border-color: rgba(108, 99, 255, 0.55);
  color: var(--primary-light);
}

.fb-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.fb-thanks {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--success);
  margin-left: 0.2rem;
}

/* ===== エラー ===== */
.error {
  background: rgba(214, 48, 49, 0.1);
  border: 1px solid rgba(214, 48, 49, 0.35);
  border-radius: var(--radius-lg);
  color: #ff7675;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ===== 免責 ===== */
.disclaimer {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1.2rem;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ===== フッター ===== */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.footer-badge {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ===== レスポンシブ ===== */
@media (max-width: 640px) {
  header h1 { font-size: 1.6rem; }
  .input-row { flex-direction: column; }
  .result-header { flex-direction: column; align-items: flex-start; }
  .profile-grid { grid-template-columns: 1fr; }
  .header-tags { gap: 0.35rem; }
  .tag { font-size: 0.72rem; }
  section { padding: 1.3rem; border-radius: var(--radius-md); }
  .history-item { flex-direction: column; align-items: flex-start; }
  .fb-group { gap: 0.4rem; }
}

/* ===== 印刷用スタイル ===== */
@media print {
  body {
    background: #fff;
    color: #111;
  }
  header, .notice, .input-area, .history-section, .progress,
  .result-actions, footer, .error, .fb-group {
    display: none !important;
  }
  section {
    background: #fff;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
  }
  .report-card {
    background: #fff;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  .report-card p, .report-card li, .profile-item .value,
  .hook-item .hook-row {
    color: #222;
  }
}
