:root {
  --bg: #f3f5fb;
  --panel: #ffffff;
  --ink: #161b2e;
  --muted: #6b7488;
  --line: #e7eaf3;
  --brand: #5468ff;
  --brand-dark: #3b4fe0;
  --brand-2: #8a5bff;
  --accent: #ff5d8f;
  --good: #1faa6b;
  --mid: #e1a325;
  --bad: #e05a4f;
  --grad: linear-gradient(135deg, #5468ff 0%, #8a5bff 100%);
  --grad-ai: linear-gradient(120deg, #7b5cff 0%, #ff5d8f 100%);
  --shadow: 0 12px 34px rgba(28, 33, 71, 0.1);
  --shadow-sm: 0 2px 10px rgba(28, 33, 71, 0.06);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  background: var(--grad);
  color: #fff;
  padding: 56px 0 48px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 80% at 80% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(50% 70% at 0% 100%, rgba(255, 93, 143, 0.25), transparent 60%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
}
.logo {
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}
.tagline {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 14px;
  line-height: 1.6;
}
.tagline strong {
  background: rgba(255, 255, 255, 0.22);
  padding: 2px 9px;
  border-radius: 8px;
  white-space: nowrap;
}
.catch {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 18px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.trust {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 6px;
}
.trust span {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.sub {
  font-size: 12.5px;
  opacity: 0.85;
  margin: 14px 0 0;
}

/* ---- Panels ---- */
main {
  padding: 28px 20px 56px;
}
.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 22px;
}
.input-panel {
  margin-top: -36px;
  position: relative;
  z-index: 2;
}

/* ---- Input ---- */
.controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 700;
}
.field select,
.field input {
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(84, 104, 255, 0.14);
}

textarea {
  width: 100%;
  min-height: 240px;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
  font-family: inherit;
  color: var(--ink);
  background: #fcfdff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(84, 104, 255, 0.15);
  background: #fff;
}
textarea.shake {
  animation: shake 0.4s;
  border-color: var(--bad);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.charcount {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.buttons {
  display: flex;
  gap: 10px;
}
.btn {
  padding: 12px 22px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, filter 0.15s, background 0.15s;
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(84, 104, 255, 0.38);
}
.btn.primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 8px 22px rgba(84, 104, 255, 0.46);
}
.btn.ghost {
  background: #eef1fa;
  color: var(--brand-dark);
}
.btn.ghost:hover {
  background: #e3e8f8;
}
.btn.lg {
  padding: 15px 30px;
  font-size: 16px;
  border-radius: 14px;
}
.disclaimer {
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 0;
}

/* ---- Result ---- */
.hidden {
  display: none;
}
.result-panel {
  border: 1px solid var(--line);
}
.score-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.score-circle {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: radial-gradient(circle at center, #fff 60%, transparent 61%),
    conic-gradient(var(--brand) calc(var(--p, 0) * 1%), #eef1fa 0);
  filter: drop-shadow(0 6px 14px rgba(84, 104, 255, 0.18));
}
.score-circle span {
  font-size: 50px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.score-circle small {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}
.grade {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 19px;
  color: #fff;
  background: var(--muted);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}
.grade.good { background: var(--good); }
.grade.mid { background: var(--mid); }
.grade.bad { background: var(--bad); }
.score-text {
  max-width: 480px;
}
.result-label {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.result-label.good { color: var(--good); }
.result-label.mid { color: var(--mid); }
.result-label.bad { color: var(--bad); }
.summary {
  font-size: 15px;
  font-weight: 600;
  color: #36405a;
  margin: 0;
}
.section-title {
  font-size: 15px;
  font-weight: 800;
  margin: 26px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 3px;
  background: var(--grad);
}

.metrics {
  display: grid;
  gap: 12px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  background: #fcfdff;
}
.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.metric-label {
  font-weight: 700;
}
.metric-score {
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.metric-score.good { color: var(--good); }
.metric-score.mid { color: var(--mid); }
.metric-score.bad { color: var(--bad); }
.bar {
  height: 8px;
  background: #eef1fa;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 10px;
}
.bar span {
  display: block;
  height: 100%;
  background: var(--grad);
  border-radius: 5px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.metric-reason {
  font-size: 14px;
  margin: 0 0 6px;
  color: var(--ink);
}
.metric-fix {
  font-size: 14px;
  margin: 0;
  color: var(--brand-dark);
  background: #f1f4ff;
  padding: 9px 11px;
  border-radius: 9px;
}

/* ---- AI採点アップセル（目立たせる）---- */
.ai-upsell {
  margin-top: 26px;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f6f3ff 0%, #fff0f6 100%);
  border: 1.5px solid #ece6ff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ai-upsell::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 93, 143, 0.16), transparent 70%);
  pointer-events: none;
}
.ai-upsell-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--grad-ai);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.ai-upsell h3 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 6px;
}
.ai-upsell p.lead {
  font-size: 14px;
  color: #55607c;
  margin: 0 0 16px;
}
.btn.ai {
  background: var(--grad-ai);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 93, 143, 0.36);
  position: relative;
  overflow: hidden;
}
.btn.ai:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 28px rgba(255, 93, 143, 0.46);
}
.btn.ai::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: shimmer 3.2s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 60% { left: -120%; }
  100% { left: 140%; }
}
/* 結果の最上部に出すAI採点カード（点数の上）— グラデ塗りで目立たせる */
.ai-top-card {
  margin: 0 0 22px;
  padding: 20px 18px;
  border-radius: 18px;
  background: var(--grad-ai);
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 30px rgba(255, 93, 143, 0.32);
}
.ai-top-card-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 4px;
}
.ai-top-card-sub {
  font-size: 12.5px;
  margin: 0 0 14px;
  opacity: 0.92;
  line-height: 1.5;
}
.ai-top-btn {
  background: #fff;
  color: #e5447f;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}
.ai-top-btn:hover {
  filter: brightness(0.97);
}
.ai-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 12px 0 0;
}
.ai-result {
  margin-top: 8px;
}
.rewrite {
  margin-top: 16px;
}
.rewrite-title {
  font-size: 15px;
  margin: 0 0 8px;
}
.rewrite-body {
  background: #f1f4ff;
  border-left: 4px solid var(--brand);
  padding: 12px 14px;
  border-radius: 9px;
  margin: 0 0 8px;
  font-size: 15px;
}
.rewrite-note {
  font-size: 12px;
  color: var(--bad);
  margin: 0;
}

.share {
  margin-top: 24px;
  text-align: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- シェアカード ---- */
.card-area {
  margin-top: 18px;
  text-align: center;
}
.card-area canvas {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.card-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
}
.card-actions .btn {
  text-decoration: none;
  display: inline-block;
}

/* ---- About ---- */
.about h2 {
  font-size: 18px;
  margin-top: 0;
}
.about h3 {
  font-size: 15px;
}
.about ul {
  padding-left: 20px;
}
.about li {
  margin-bottom: 6px;
}
.about .note {
  font-size: 13px;
  color: var(--muted);
}

/* ---- Footer ---- */
.footer {
  background: #161b2e;
  color: #c7cdda;
  padding: 28px 0;
  text-align: center;
  font-size: 14px;
}
.footer .tiny {
  font-size: 12px;
  opacity: 0.7;
  margin: 6px 0 0;
}
.footer-nav {
  display: flex;
  gap: 8px 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.footer-nav a {
  color: #aeb6c8;
  text-decoration: none;
  font-size: 13px;
}
.footer-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ---- 記事・規約などのドキュメントページ ---- */
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}
.doc .home-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--brand);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.doc .home-link:hover {
  text-decoration: underline;
}
.doc h1 {
  font-size: 28px;
  line-height: 1.4;
  margin: 0 0 8px;
}
.doc .lead {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 28px;
}
.doc h2 {
  font-size: 20px;
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.doc h3 {
  font-size: 16px;
  margin: 24px 0 8px;
}
.doc p,
.doc li {
  font-size: 15px;
  color: #2a3140;
}
.doc ul,
.doc ol {
  padding-left: 22px;
}
.doc li {
  margin-bottom: 8px;
}
.doc .example {
  background: #f1f4ff;
  border-left: 4px solid var(--brand);
  padding: 14px 16px;
  border-radius: 8px;
  margin: 12px 0;
}
.doc .ng {
  border-left-color: var(--bad);
  background: #fdf2f1;
}
.doc .cta-box {
  margin: 40px 0 0;
  padding: 22px;
  background: var(--grad);
  border-radius: 16px;
  text-align: center;
  color: #fff;
}
.doc .cta-box a {
  display: inline-block;
  margin-top: 12px;
  background: #fff;
  color: var(--brand-dark);
  padding: 11px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}
.doc table.simple {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 14px;
}
.doc table.simple th,
.doc table.simple td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}
.doc table.simple th {
  background: #f1f4ff;
}

@media (max-width: 480px) {
  .score-head {
    flex-direction: column;
    text-align: center;
  }
  .logo { font-size: 30px; }
  .tagline { font-size: 17px; }
  .panel { padding: 20px; }
}
