/* ============================================================
   Diagsolve — Analysis Page Shared CSS
   v2: 視覚的区切り・可読性改善
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #080d1a;
  --bg2:     #0d1221;
  --bg3:     #111827;
  --border:  rgba(255,255,255,0.10);
  --border2: rgba(255,255,255,0.06);
  --text:    #f1f5f9;
  --muted:   #94a3b8;
  --dim:     #64748b;
  --acc:     #3b82f6;
  --acc-dark:#071318;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

/* ── Nav ── */
.nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  padding: 0 10%;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.0rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  padding-right: 20px;
  border-right: 1px solid var(--border);
  margin-right: 4px;
}
.nav-platform {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--acc);
  background: none;
  border: none;
  padding: 0 16px;
}
.nav-links {
  display: flex;
  margin-left: auto;
  border-left: 1px solid var(--border);
}
.nav-links a {
  color: var(--dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 18px;
  height: 56px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--muted); background: rgba(255,255,255,0.02); }
.nav-links a.cur  { color: var(--acc); }
.nav-links ~ .nav-user,
.nav-links ~ .nav-logout,
.nav-links ~ a.nav-logout { margin-left: 16px; }
.nav-back {
  color: var(--dim);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0 18px;
  height: 56px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.nav-back:hover { color: var(--muted); }
.nav-user { display:flex; align-items:center; gap:0; margin-left:auto; }
.nav-user-name { font-size:0.85rem; padding:0 16px; border-left:1px solid var(--border); height:56px; display:flex; align-items:center; }
.nav-logout { color:var(--dim); text-decoration:none; font-size:0.82rem; font-weight:600; padding:0 16px; height:56px; display:flex; align-items:center; border-left:1px solid var(--border); transition:color 0.15s; background:none; border-top:0; border-bottom:0; border-right:0; cursor:pointer; font-family:inherit; }
.nav-logout:hover { color:var(--muted); }

/* ── Page header ── */
.page-header {
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
}
.page-header-inner {
  padding: 40px 10% 0;
}
.page-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--acc);
  margin-bottom: 16px;
}
.page-title {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.0;
  color: var(--text);
  margin-bottom: 12px;
}
.page-title-accent {
  color: var(--acc);
}
.page-desc {
  font-size: 1.0rem;
  color: var(--muted);
  line-height: 1.8;
}
.page-stats {
  display: flex;
  gap: 0;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}
.page-stat {
  padding: 18px 0;
  padding-right: 36px;
  margin-right: 36px;
  border-right: 1px solid var(--border);
}
.page-stat:last-child { border-right: none; }
.stat-n {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.stat-l {
  font-size: 0.72rem;
  color: var(--dim);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Form ── */
.main {
  padding: 0 10% 80px;
}

.form-section {
  border-top: 2px solid var(--border);
  padding: 28px 0 24px;
}
.form-eyebrow {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 16px;
  display: block;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.field-select {
  position: relative;
}
.field-select::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  font-size: 0.8rem;
  pointer-events: none;
}
select {
  width: 100%;
  appearance: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 36px 14px 16px;
  font-size: 1.0rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  border-radius: 4px;
}
select:focus { border-color: var(--acc); }

/* サンプルリンク */
.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}
.sample {
  background: none;
  border: none;
  border-bottom: 1px dashed rgba(255,255,255,0.15);
  color: var(--muted);
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s, border-color 0.15s;
}
.sample:hover { color: var(--acc); border-bottom-color: var(--acc); }

/* Terminal textarea */
.terminal {
  border: 1px solid var(--border);
  background: #0c1018;
  overflow: hidden;
  border-radius: 6px;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.terminal-label {
  margin-left: 8px;
  font-size: 0.75rem;
  color: var(--dim);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  letter-spacing: 0.08em;
}
.terminal-label-right {
  margin-left: auto;
}
textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #9da5b4;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.88rem;
  line-height: 1.8;
  padding: 18px 20px;
  resize: vertical;
  min-height: 300px;
  display: block;
  caret-color: var(--acc);
}
textarea::placeholder { color: var(--dim); }

/* メモ */
.memo-area {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  outline: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.7;
  padding: 12px 14px;
  resize: vertical;
  min-height: 70px;
  display: block;
  transition: border-color 0.15s;
  border-radius: 4px;
}
.memo-area:focus { border-color: var(--acc); }
.memo-area::placeholder { color: var(--dim); }

/* 文字数 */
.char-count {
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--dim);
  text-align: right;
  margin-top: 6px;
}

/* Submit */
.submit-section {
  border-top: 2px solid var(--border);
  padding-top: 28px;
}
.btn-submit {
  width: 100%;
  background: var(--acc);
  border: 1px solid var(--acc);
  color: #fff;
  font-family: inherit;
  font-size: 1.0rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 18px;
  cursor: pointer;
  transition: filter 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
}
.btn-submit:hover { filter: brightness(1.12); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }

/* ── Nav history/login buttons (platform accent) ── */
.form-inline {
  display: inline;
}
.nav-history {
  color: var(--acc);
  border-color: rgba(59,130,246,0.3);
}
.nav-login-platform {
  margin-left: auto;
  color: var(--acc);
  border-color: rgba(59,130,246,0.4);
}

@media (max-width: 900px) {
  .nav-links { flex-wrap: wrap; }
  .nav-links a { font-size: 0.72rem; padding: 0 10px; height: 40px; }
  .nav-inner { flex-wrap: wrap; padding: 8px 10%; height: auto; min-height: 56px; }
}
@media (max-width: 600px) {
  .row2 { grid-template-columns: 1fr; }
  .page-title { font-size: 1.8rem; }
  .nav-platform { display: none; }
  .nav-links { display: none; }
  .main { padding: 0 5% 60px; }
  .page-header-inner { padding: 24px 5% 0; }
  .nav-inner { padding: 0 5%; }
}
