* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}
.topbar {
  background: linear-gradient(135deg, #2148b5, #3d68e7);
  color: #fff;
  padding: 20px 24px;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.topbar h1 { margin: 0 0 4px; font-size: 28px; }
.sub { margin: 0; opacity: .92; }
.page { padding: 20px; max-width: 1600px; margin: 0 auto; }
.card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15,23,42,.08);
  padding: 18px;
  margin-bottom: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}
label { display: block; font-size: 14px; font-weight: 700; }
input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid #cfd6e4;
  border-radius: 12px;
  font-size: 14px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
button, .linkbtn {
  border: 0;
  background: #2148b5;
  color: #fff;
  padding: 11px 15px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}
button[disabled] { opacity: .45; cursor: not-allowed; }
.linkbtn { background: #4f46e5; }
.status {
  margin-top: 12px;
  background: #eef3ff;
  border-left: 5px solid #2148b5;
  padding: 12px;
  border-radius: 10px;
  white-space: pre-wrap;
}
.workspace {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 18px;
}
.left-panel, .right-panel { min-height: 560px; }
.tree-box {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  min-height: 480px;
  max-height: 700px;
  overflow: auto;
  background: #fafbff;
}
.detail-box, .analysis-box {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  min-height: 240px;
  background: #fafbff;
}
.small { font-size: 12px; color: #6b7280; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.tree-list { list-style: none; padding-left: 14px; margin: 0; }
.root-tree { padding-left: 0; }
.tree-node { margin: 6px 0; }
.tree-details > summary {
  list-style: none;
}
.tree-details > summary::-webkit-details-marker { display: none; }
.tree-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 7px 10px;
  border-radius: 10px;
  font-weight: 700;
  color: #334155;
}
.tree-summary:hover { background: #eef4ff; }
.tree-summary::before {
  content: "▸";
  font-size: 11px;
  color: #64748b;
}
.tree-details[open] > .tree-summary::before { content: "▾"; }
.folder-label { flex: 1; }
.folder-count {
  min-width: 24px;
  text-align: center;
  font-size: 11px;
  background: #e2e8f0;
  color: #475569;
  border-radius: 999px;
  padding: 2px 8px;
}
.tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid #e6eaf2;
  background: #fff;
  transition: .15s ease;
}
.tree-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15,23,42,.08);
}
.tree-item.active {
  outline: 2px solid #2563eb;
  background: #eff6ff;
}
.tree-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tree-page-label {
  font-weight: 800;
  color: #0f172a;
  word-break: break-word;
}
.tree-page-title {
  font-size: 12px;
  color: #64748b;
  word-break: break-word;
}
.tree-badges {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.mini-badge, .badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge {
  background: #e9efff;
  color: #2148b5;
  margin: 0 6px 6px 0;
}
.importance-top { background: #dbeafe; color: #1d4ed8; }
.importance-service { background: #ede9fe; color: #6d28d9; }
.importance-contact { background: #dcfce7; color: #15803d; }
.importance-company { background: #fef3c7; color: #b45309; }
.importance-blog { background: #fee2e2; color: #b91c1c; }
.importance-normal { background: #e5e7eb; color: #4b5563; }
.health-good { background: #dcfce7; color: #166534; }
.health-mid { background: #fef3c7; color: #92400e; }
.health-weak { background: #fee2e2; color: #b91c1c; }
.tree-item.importance-top { border-left: 5px solid #2563eb; }
.tree-item.importance-service { border-left: 5px solid #7c3aed; }
.tree-item.importance-contact { border-left: 5px solid #16a34a; }
.tree-item.importance-company { border-left: 5px solid #d97706; }
.tree-item.importance-blog { border-left: 5px solid #dc2626; }
.tree-item.importance-normal { border-left: 5px solid #94a3b8; }
.tree-item.health-weak { background: linear-gradient(90deg, #fff 0%, #fff1f2 100%); }
.tree-item.health-good { background: linear-gradient(90deg, #fff 0%, #f0fdf4 100%); }
.codebox, pre.content {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.kv { margin-bottom: 12px; }
.kv strong { display: block; margin-bottom: 5px; color: #374151; }
.section-title {
  font-size: 16px;
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e5e7eb;
}
.analysis-box h3 { margin-bottom: 8px; }
@media (max-width: 1024px) {
  .workspace { grid-template-columns: 1fr; }
  .form-grid, .grid2 { grid-template-columns: 1fr; }
}
.topnav-links{display:flex;flex-wrap:wrap;gap:14px;margin-bottom:10px}
.topnav-links a{color:#dbeafe;text-decoration:none;font-weight:700}
.topnav-links a:hover{text-decoration:underline}
