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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: #F8FAFC;
  color: #1E293B;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 48px;
  width: 100%;
}

a {
  color: #2563EB;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* ===== ヘッダー ===== */
.site-header {
  background: #1E3A5F;
  color: #fff;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  color: #93C5FD;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.header-logo:hover {
  color: #BFDBFE;
  text-decoration: none;
}

.header-service {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

/* ===== ヒーロー ===== */
.hero {
  text-align: center;
  padding: 40px 16px 24px;
}

.hero h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: #1E3A5F;
  margin-bottom: 8px;
}

.hero-sub {
  color: #475569;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.privacy-badge {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: #1E40AF;
  text-align: left;
  max-width: 600px;
}

.privacy-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== アップロードエリア ===== */
.upload-area {
  padding: 8px 0 24px;
}

.drop-zone {
  border: 2.5px dashed #CBD5E1;
  border-radius: 12px;
  background: #fff;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone.drag-over {
  border-color: #2563EB;
  background: #EFF6FF;
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.drop-main {
  font-size: 1.05rem;
  color: #334155;
  margin-bottom: 6px;
}

.drop-or {
  color: #94A3B8;
  margin-bottom: 12px;
}

.btn-file-select {
  display: inline-block;
  background: #2563EB;
  color: #fff;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-file-select:hover {
  background: #1D4ED8;
}

.drop-hint {
  color: #94A3B8;
  font-size: 0.82rem;
  margin-top: 14px;
}

/* ===== 解析中 ===== */
.loading-area {
  text-align: center;
  padding: 64px 16px;
  color: #475569;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #E2E8F0;
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== エラー ===== */
.error-area {
  padding: 16px 0 24px;
}

.error-card {
  background: #fff;
  border: 1.5px solid #FECACA;
  border-radius: 12px;
  padding: 28px 32px;
}

.error-title {
  font-size: 1.15rem;
  color: #DC2626;
  margin-bottom: 12px;
}

.error-message {
  background: #FEF2F2;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #7F1D1D;
  margin-bottom: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.error-guide {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 20px;
}

/* ===== レポートエリア ===== */
.report-area {
  padding: 8px 0 24px;
}

.report-header {
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.report-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.report-title-row h2 {
  font-size: 1.15rem;
  color: #1E3A5F;
}

.report-filename {
  font-size: 0.85rem;
  color: #64748B;
  font-weight: 500;
}

.report-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.report-version {
  font-size: 0.85rem;
  color: #64748B;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-section {
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1E3A5F;
  margin-bottom: 16px;
}

/* ===== メトリクスグリッド ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.metric-card {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1E3A5F;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.75rem;
  color: #64748B;
  margin-top: 4px;
}

/* ===== 懸念リスト ===== */
.findings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1.5px solid transparent;
}

.finding-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.finding-label {
  flex: 1;
  color: #334155;
}

.finding-count {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* 緊急（セキュリティ） */
.finding-urgent {
  background: #FEF2F2;
  border-color: #FECACA;
}

.finding-urgent .finding-count {
  color: #DC2626;
}

/* 検出あり（警告） */
.finding-warning {
  background: #FFFBEB;
  border-color: #FDE68A;
}

.finding-warning .finding-count {
  color: #B45309;
}

/* 問題なし */
.finding-ok {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

.finding-ok .finding-count {
  color: #64748B;
}

/* ===== 総評 ===== */
.summary-text {
  color: #334155;
  font-size: 0.95rem;
}

/* ===== CTA ===== */
.cta-section {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: 12px;
  padding: 24px 28px;
  text-align: center;
  margin-bottom: 16px;
}

.cta-section h3 {
  font-size: 1.05rem;
  color: #1E3A5F;
  margin-bottom: 8px;
}

.cta-section p {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 18px;
}

/* ===== プライバシーフッター（レポート内） ===== */
.privacy-footer {
  font-size: 0.78rem;
  color: #94A3B8;
  text-align: center;
  padding: 8px 0;
}

/* ===== ボタン ===== */
.btn-primary {
  display: inline-block;
  background: #2563EB;
  color: #fff;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #1D4ED8;
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  display: inline-block;
  background: #fff;
  color: #475569;
  border: 1.5px solid #CBD5E1;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
  border-color: #94A3B8;
  color: #334155;
}

/* ===== フッター ===== */
.site-footer {
  background: #F1F5F9;
  border-top: 1px solid #E2E8F0;
  padding: 16px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: #64748B;
}

.site-footer a {
  color: #475569;
}

/* ===== レスポンシブ ===== */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.3rem;
  }

  .drop-zone {
    padding: 32px 16px;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .report-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-actions {
    width: 100%;
  }

  .report-actions .btn-secondary {
    flex: 1;
    text-align: center;
  }
}
