/* ============================================================
   ドメイン管理  IT系エッジデザイン
   ダーク基調・ネオンアクセント・モノスペース・シャープな角
   ============================================================ */
:root {
  --bg: #070b14;
  --bg2: #0c1322;
  --panel: #101a2b;
  --surface: #0f1a2e;
  --text: #dbe6f5;
  --muted: #7d8aa3;
  --border: #22334d;
  --primary: #22d3ee;      /* シアン */
  --primary-2: #a78bfa;    /* バイオレット */
  --danger: #fb7185;
  --danger-dark: #e11d48;
  --ok: #34d399;
  --radius: 8px;
  --glow: 0 0 16px rgba(34,211,238,.30);
  --grad: linear-gradient(135deg, #22d3ee, #818cf8);
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  --star: #38bdf8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background:
    linear-gradient(rgba(34,211,238,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,.05) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(129,140,248,.18), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(34,211,238,.14), transparent 40%),
    linear-gradient(160deg, var(--bg), var(--bg2));
  background-size: 46px 46px, 46px 46px, auto, auto, auto;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", Arial, "Hiragino Sans", Meiryo, sans-serif;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: #7ee7ff; }

/* ---- トップバー ---- */
.topbar {
  background: rgba(7,11,20,.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(34,211,238,.15);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1060px; margin: 0 auto; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; min-height: 56px;
}
.brand {
  color: #fff; font-weight: 700; font-size: 1.02rem; letter-spacing: .02em;
  font-family: var(--mono); display: inline-flex; align-items: center; gap: 10px;
}
.brand::before { content: ">_"; color: var(--primary); font-weight: 700; }
.brand .mascot {
  width: 30px; height: 30px; border-radius: 6px; object-fit: cover;
  border: 1px solid rgba(34,211,238,.4); background:#0a0e17;
}
.brand:hover { text-decoration: none; color: #fff; opacity: .95; }

.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.nav a {
  color: var(--muted); font-size: .84rem; font-weight: 600;
  font-family: var(--mono); padding: 5px 10px; border-radius: 6px; transition: .15s;
}
.nav a:hover { text-decoration: none; color: var(--primary); background: rgba(34,211,238,.10); }
.nav-logout { margin: 0; }
.theme-toggle {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3);
  color: #fff; width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
  font-size: 16px; line-height: 1; font-family: var(--mono); transition: .15s;
}
.theme-toggle:hover { background: rgba(255,255,255,.25); }
.linklike {
  background: rgba(34,211,238,.08); border: 1px solid var(--border);
  color: var(--primary); font-size: .8rem; font-weight: 600; cursor: pointer;
  padding: 5px 12px; border-radius: 6px; font-family: var(--mono); transition: .15s;
}
.linklike:hover { background: rgba(34,211,238,.18); color: #7ee7ff; }

/* ---- コンテナ ---- */
.container { max-width: 1060px; margin: 0 auto; padding: 26px 18px 70px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-header h1 {
  font-size: 1.35rem; margin: 0; font-family: var(--mono); font-weight: 700;
  color: #fff; letter-spacing: .01em;
}
.page-header h1::before { content: "// "; color: var(--primary); }

/* ---- ボタン ---- */
.btn {
  display: inline-block; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 9px 16px;
  font-size: .86rem; font-weight: 600; font-family: var(--mono); cursor: pointer;
  transition: .15s; text-align: center;
}
.btn:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.btn-primary {
  background: var(--grad); border: none; color: #061018;
  box-shadow: var(--glow); font-weight: 700;
}
.btn-primary:hover { color: #061018; filter: brightness(1.1); }
.btn-danger { background: rgba(251,113,133,.14); border: 1px solid rgba(251,113,133,.5); color: #fda4af; }
.btn-danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: .76rem; }
.btn-block { display: block; width: 100%; }

/* ---- フラッシュ ---- */
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: .9rem; font-family: var(--mono); }
.flash::before { content: "> "; }
.flash-ok   { background: rgba(52,211,153,.10); border: 1px solid rgba(52,211,153,.4); color: #6ee7b7; }
.flash-error{ background: rgba(251,113,133,.10); border: 1px solid rgba(251,113,133,.4); color: #fda4af; }

/* ---- チップ（絞り込み） ---- */
.chip-row {
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px; font-size: .8rem;
}
.chip-label { font-weight: 600; color: var(--muted); padding-top: 5px; font-family: var(--mono); }
.chip {
  display: inline-block; background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 11px; color: var(--muted); font-family: var(--mono); font-size: .76rem;
}
.chip:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.chip-active { background: var(--grad); border-color: transparent; color: #061018; font-weight: 700; }

.filter-banner {
  background: rgba(129,140,248,.10); border: 1px solid rgba(167,139,250,.4);
  color: #b6b9ff; padding: 8px 14px; border-radius: 6px; margin: 8px 0 16px;
  font-size: .84rem; font-family: var(--mono);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ---- 検索ボックス ---- */
.search-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-input {
  flex: 1; min-width: 200px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--mono); font-size: .9rem; color: var(--text); background: var(--panel);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }

/* ---- 一覧の状態トグル ---- */
.state-cell { white-space: nowrap; }
.state-toggle { margin: 0; }
.st-select {
  padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--mono); font-size: .76rem; color: var(--text); background: var(--panel); cursor: pointer;
}
.st-select:hover { border-color: var(--primary); }

/* ---- テーブル ---- */
.table-wrap {
  overflow-x: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.table { width: 100%; border-collapse: collapse; min-width: 680px; font-size: .88rem; }
.table th, .table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--border); }
.table thead th {
  background: #0d1830; font-size: .76rem; color: var(--primary); font-family: var(--mono);
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.table thead a { color: var(--primary); }
.table thead a:hover { color: #7ee7ff; }
.table tbody tr:hover { background: rgba(34,211,238,.05); }
.table tbody tr:last-child td { border-bottom: none; }
.th-actions { width: 150px; }
.domain-name { font-weight: 600; color: var(--primary); }
.domain-name a { color: var(--primary); }
.domain-name a:hover { color: #7ee7ff; }
.notes { color: var(--muted); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* ---- ステータス・状態 ---- */
.state { font-size: .76rem; padding: 2px 10px; border-radius: 4px; white-space: nowrap; font-weight: 600; font-family: var(--mono); }
.state-operating   { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.state-developing  { background: rgba(56,189,248,.12); color: #7dd3fc; border: 1px solid rgba(56,189,248,.3); }
.state-considering { background: rgba(251,191,36,.12); color: #fcd34d; border: 1px solid rgba(251,191,36,.3); }

.exp { font-size: .78rem; font-weight: 700; white-space: nowrap; font-family: var(--mono); }
.exp-danger { color: #fb7185; }
.exp-warn   { color: #fbbf24; }
.exp-notice { color: #60a5fa; }
.exp-normal { color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 44px 0; font-family: var(--mono); }
.empty::before { content: "// no_such_record "; color: var(--danger); }

/* ---- フォーム ---- */
.form, .bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.30);
}
.field { margin-bottom: 14px; flex: 1; min-width: 200px; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: 5px; color: var(--primary); font-family: var(--mono); }
.req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: .92rem; font-family: var(--mono); background: #0b1220; color: var(--text); transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34,211,238,.15);
}
.actions { display: flex; gap: 10px; margin-top: 6px; }

/* ログインページ */
.auth-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px;
}
.auth-box {
  background: rgba(15,26,46,.85); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5), var(--glow);
  padding: 30px; width: 100%; max-width: 430px; position: relative; backdrop-filter: blur(6px);
}
.auth-box::before {
  content: ">_ user.auth"; display: block; font-family: var(--mono);
  color: var(--primary); font-size: .72rem; letter-spacing: .05em; margin-bottom: 8px;
}
.auth-box h1 {
  font-size: 1.3rem; text-align: center; margin: 0 6px 6px; color: #fff; font-family: var(--mono);
}
.auth-box h1::after { content: "_"; color: var(--primary); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.auth-box h2 { font-size: .92rem; margin: 16px 0 8px; color: var(--primary); font-family: var(--mono); }
.auth-note { font-size: .84rem; color: var(--muted); margin-bottom: 8px; }

.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.hint { color: var(--muted); font-size: .82rem; font-family: var(--mono); }
h2 { font-size: .98rem; margin: 26px 0 8px; color: var(--primary); font-family: var(--mono); letter-spacing: .02em; }
h2::before { content: "## "; color: var(--primary-2); }

@media (max-width: 640px) {
  .container { padding: 16px 10px 50px; }
  .table { font-size: .8rem; }
  .form, .bar { padding: 14px; }
}

/* ============================================================
   モエイラスト（IT系ネオン枠で掲載）
   ============================================================ */
.auth-hero { text-align: center; margin: -6px 0 6px; }
.auth-hero img {
  width: 140px; height: 140px; max-width: 100%; border-radius: 10px;
  border: 1px solid rgba(34,211,238,.35); box-shadow: var(--glow);
  filter: saturate(1.05);
}
.welcome-hero {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: 0 8px 30px rgba(0,0,0,.3); margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.welcome-hero::after {
  content: "SYS // DOMAIN-MGR v2.0"; position: absolute; right: 12px; bottom: 6px;
  font-family: var(--mono); font-size: .6rem; color: rgba(34,211,238,.3);
}
.welcome-hero img {
  width: 74px; height: 74px; flex: none; border-radius: 6px;
  border: 1px solid rgba(34,211,238,.3);
}
.welcome-hero .text h2 { margin: 0 0 4px; color: #fff; font-size: 1rem; }
.welcome-hero .text h2::before { content: ""; }
.welcome-hero .text p { margin: 0; color: var(--muted); font-size: .84rem; font-family: var(--mono); }

/* ============================================================
   企画書・AI評価
   ============================================================ */
.plan-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: .86rem; }
.plan-body { white-space: pre-wrap; line-height: 1.7; color: var(--text); }
.badge {
  background: rgba(167,139,250,.10); color: #c4b5fd; border: 1px solid rgba(167,139,250,.35);
  padding: 2px 10px; border-radius: 4px; font-size: .76rem; font-family: var(--mono);
}
.eval-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 8px; }
.eval-header h2 { margin: 0; }
.eval-form { display: flex; gap: 8px; align-items: center; }
.eval-form select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: .86rem; font-family: var(--mono); background: #0b1220; color: var(--text);
}

.evaluations { display: grid; gap: 14px; }
.evaluation {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.3); padding: 16px;
}
.eval-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.eval-meta form { margin: 0; }
.eval-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--mono); }
.eval-model {
  background: var(--grad); color: #061018; font-size: .72rem;
  padding: 2px 10px; border-radius: 4px; font-weight: 700;
}
.eval-body { font-size: .92rem; }

.score-grid { display: grid; gap: 10px; margin-bottom: 12px; }
.score-row, .total-row {
  background: #0c1730; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px;
}
.score-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score-title { color: var(--text); font-size: .88rem; }
.score-val { color: var(--primary); white-space: nowrap; font-family: var(--mono); }
.score-stars { color: var(--star); font-size: .95rem; letter-spacing: 2px; margin-top: 2px; }
.score-comment { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.total-row { border-color: rgba(34,211,238,.4); background: rgba(34,211,238,.06); }
.score-summary { margin-top: 12px; line-height: 1.7; }
.score-reco {
  margin-top: 8px; background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.3);
  border-radius: 6px; padding: 10px 12px; font-size: .9rem; font-family: var(--mono);
}
.score-reco::before { content: "> "; color: var(--primary-2); }

/* ============================================================
   現在の状況（時系列ログ）
   ============================================================ */
.status-section { margin: 26px 0 6px; }
.status-form {
  display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px;
}
.status-form textarea {
  flex: 1; min-width: 220px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-family: var(--mono); font-size: .88rem; color: var(--text); background: #0b1220;
}
.status-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }

.status-list { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.status-item {
  position: relative; margin-bottom: 12px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.status-item::before {
  content: "❯"; position: absolute; left: -24px; top: 8px; color: var(--primary); font-family: var(--mono);
}
.status-date { display: inline-block; font-size: .72rem; color: var(--primary); font-weight: 600; margin-bottom: 4px; font-family: var(--mono); }
.status-body { font-size: .9rem; line-height: 1.7; white-space: pre-wrap; }
.status-del { position: absolute; top: 10px; right: 12px; margin: 0; }
.status-del .btn-sm { padding: 3px 10px; }

/* ============================================================
   フッター・一般サイトページ
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border); padding: 28px 16px 32px; text-align: center;
  margin-top: 24px; background: rgba(7,11,20,.6);
}
.sitemap {
  display: flex; justify-content: center; gap: 12px 48px; flex-wrap: wrap;
  align-items: center; margin-bottom: 18px;
}
.sitemap-col {
  display: flex; flex-direction: row; flex-wrap: wrap;
  align-items: center; gap: 0; justify-content: center;
}
.sitemap-title {
  margin: 0; font-size: .74rem; font-weight: 700; color: var(--primary);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em;
  margin-right: 12px;
}
.sitemap-col a {
  color: var(--muted); font-size: .84rem; padding: 0 12px;
  border-right: 1px dashed var(--border);
}
.sitemap-col a:first-of-type { border-left: none; }
.sitemap-col a:last-child { border-right: none; padding-right: 0; }
.sitemap-col a:hover { color: var(--primary); }
.footer-nav { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-nav a { color: var(--muted); font-family: var(--mono); font-size: .82rem; }
.footer-nav a:hover { color: var(--primary); }
.footer-copy { color: var(--muted); font-family: var(--mono); font-size: .78rem; margin: 0; }

.sections {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: 0 8px 30px rgba(0,0,0,.3); margin-bottom: 18px;
}
.sections h2 { margin: 18px 0 6px; }
.sections h2:first-child { margin-top: 0; }
.sections p, .sections li { color: var(--text); font-size: .9rem; line-height: 1.8; }
.sections ul { padding-left: 20px; margin: 6px 0; }
.contact-email { font-family: var(--mono); }

/* ログイン（独立）ページ用フッター */
.auth-page { flex-direction: column; }
.auth-foot {
  margin-top: 18px; text-align: center; color: var(--muted);
  font-family: var(--mono); font-size: .78rem;
}
.auth-foot a { color: var(--muted); margin: 0 8px; }
.auth-foot a:hover { color: var(--primary); }

/* ============================================================
   ログイン履歴
   ============================================================ */
.lg-result { font-size: .76rem; font-weight: 700; padding: 2px 10px; border-radius: 4px; font-family: var(--mono); }
.lg-ok   { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.4); }
.lg-fail { background: rgba(251,113,133,.12); color: #fda4af; border: 1px solid rgba(251,113,133,.4); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }

/* ============================================================
   ライトテーマ（data-theme="light"）
   ============================================================ */
[data-theme="light"] {
  --bg: #f5f7fb; --bg2: #e9eef7;
  --panel: #ffffff; --surface: #ffffff;
  --text: #1f2937; --muted: #6b7280; --border: #e2e8f0;
  --primary: #0ea5e9; --primary-2: #8b5cf6;
  --danger: #ef4444; --danger-dark: #dc2626; --ok: #10b981;
  --glow: 0 0 16px rgba(14,165,233,.16);
}
[data-theme="light"] body {
  background:
    linear-gradient(rgba(15,22,40,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,22,40,.04) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(139,92,246,.10), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(14,165,233,.10), transparent 40%),
    linear-gradient(160deg, var(--bg), var(--bg2));
  background-size: 46px 46px, 46px 46px, auto, auto, auto;
  background-attachment: fixed;
}
[data-theme="light"] .topbar {
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(14,165,233,.15);
}
[data-theme="light"] .brand, [data-theme="light"] .brand:hover { color: #0f1a2e; }
[data-theme="light"] .brand .mascot { background: #fff; border-color: var(--border); }
[data-theme="light"] .nav a { color: #475569; }
[data-theme="light"] .nav a:hover { color: var(--primary); background: rgba(14,165,233,.08); }
[data-theme="light"] .theme-toggle {
  background: rgba(15,23,42,.06); border-color: var(--border); color: #334155;
}
[data-theme="light"] .theme-toggle:hover { background: rgba(15,23,42,.12); }
[data-theme="light"] .linklike {
  background: rgba(14,165,233,.08); border-color: var(--border); color: var(--primary);
}
[data-theme="light"] .linklike:hover { background: rgba(14,165,233,.14); }
[data-theme="light"] .table thead th { background: #f1f5f9; }
[data-theme="light"] .table tbody tr:hover { background: #f8fafc; }
[data-theme="light"] .field input, [data-theme="light"] .field select,
[data-theme="light"] .field textarea { background: #fff; color: var(--text); }
[data-theme="light"] .score-row, [data-theme="light"] .total-row { background: #f8fafc; }
[data-theme="light"] .auth-box { background: rgba(255,255,255,.92); }
[data-theme="light"] .auth-box h1 { color: var(--text); }
[data-theme="light"] .auth-box h1::after { color: var(--primary); }
[data-theme="light"] .page-header h1 { color: var(--text); }
[data-theme="light"] .page-header h1::before { color: var(--primary); }
[data-theme="light"] .welcome-hero .text h2 { color: var(--text); }
[data-theme="light"] .site-footer { background: rgba(15,23,42,.03); }
[data-theme="light"] .welcome-hero, [data-theme="light"] .evaluation,
[data-theme="light"] .status-item, [data-theme="light"] .form, [data-theme="light"] .bar,
[data-theme="light"] .sections { box-shadow: 0 8px 30px rgba(15,23,42,.06); }
[data-theme="light"] .theme-label { color: var(--muted); }
