/* ============================================
   nanbonan.jp - メインスタイルシート
   ============================================ */

:root {
  --primary: #1A1A2E;
  --accent: #E8670A;
  --accent-light: #FF8C3A;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #1A1A2E;
  --text-muted: #64748B;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

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

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}

/* ===== ヘッダー ===== */
header {
  background: var(--primary);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--accent);
}

nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  margin-left: 24px;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover { color: #fff; }

/* ===== ヒーロー ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #16213E 60%, #0F3460 100%);
  color: #fff;
  padding: 60px 20px 80px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero h1 .highlight {
  color: var(--accent);
  display: inline-block;
}

.hero p {
  font-size: clamp(14px, 2vw, 17px);
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero-badge {
  display: inline-block;
  background: rgba(232,103,10,0.2);
  border: 1px solid var(--accent);
  color: var(--accent-light);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

/* ===== メインコンテンツ ===== */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ===== カード ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 32px;
}

.card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  background: var(--accent);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ===== タブ ===== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--bg);
  padding: 4px;
  border-radius: 10px;
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== フォーム ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.form-group .hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  font-size: 16px;
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,103,10,0.35);
}

/* ===== 結果パネル ===== */
.result-panel {
  display: none;
  margin-top: 24px;
  animation: slideUp 0.3s ease;
}

.result-panel.show { display: block; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-verdict {
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.result-verdict.buy {
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  border: 2px solid var(--success);
}

.result-verdict.watch {
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
  border: 2px solid var(--warning);
}

.result-verdict.pass {
  background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
  border: 2px solid var(--danger);
}

.verdict-icon {
  font-size: 48px;
  line-height: 1;
  flex-shrink: 0;
}

.verdict-text h3 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 4px;
}

.verdict-text.buy h3 { color: #065F46; }
.verdict-text.watch h3 { color: #92400E; }
.verdict-text.pass h3 { color: #991B1B; }

.verdict-text p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 数字グリッド ===== */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.result-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.result-item .label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.result-item .value {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
}

.result-item .value.positive { color: var(--success); }
.result-item .value.negative { color: var(--danger); }
.result-item .value.accent { color: var(--accent); }

/* ===== 内訳テーブル ===== */
.breakdown {
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.breakdown-row:last-child { border-bottom: none; }

.breakdown-row.total {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}

.breakdown-row .amt { font-weight: 700; }
.breakdown-row .amt.neg { color: var(--danger); }

/* ===== ツールカードグリッド ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.tool-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  border: 2px solid transparent;
  display: block;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.tool-card .tool-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.tool-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--primary);
}

.tool-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.tool-card .tag {
  display: inline-block;
  background: rgba(232,103,10,0.1);
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 12px;
}

/* ===== AdSense広告エリア ===== */
.ad-banner {
  background: var(--border);
  border-radius: 8px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  margin: 24px 0;
}

/* ===== フッター ===== */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 40px 20px;
  text-align: center;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ===== 記事ページ ===== */
.article-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.article-header {
  margin-bottom: 32px;
}

.article-header .category {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.article-header h1 {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 900;
  line-height: 1.4;
  color: var(--primary);
  margin-bottom: 12px;
}

.article-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.article-body h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin: 40px 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.article-body h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin: 28px 0 12px;
}

.article-body p {
  margin-bottom: 16px;
  line-height: 1.9;
  color: #374151;
}

.article-body ul, .article-body ol {
  margin: 12px 0 20px 20px;
}

.article-body li {
  margin-bottom: 8px;
  line-height: 1.8;
}

.info-box {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
}

.info-box .box-title {
  font-weight: 800;
  color: #1D4ED8;
  margin-bottom: 8px;
}

.table-wrap { overflow-x: auto; margin: 20px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

tr:nth-child(even) td { background: var(--bg); }

/* ===== BSRページ専用 ===== */
.bsr-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
}

/* ===== キーワードページ専用 ===== */
.keyword-results {
  display: none;
  margin-top: 20px;
}

.keyword-results.show { display: block; }

.keyword-list {
  list-style: none;
}

.keyword-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 6px;
}

.keyword-list li:hover { background: var(--bg); }

.keyword-list .kw-text {
  font-size: 14px;
  font-weight: 600;
}

.keyword-list .kw-copy {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  border: 1px solid var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== スライダー ===== */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.slider-val {
  font-weight: 800;
  color: var(--accent);
  min-width: 80px;
  text-align: right;
}

/* ===== レスポンシブ ===== */
@media (max-width: 600px) {
  .header-inner nav { display: none; }
  .card { padding: 20px; }
  .result-verdict { flex-direction: column; text-align: center; gap: 12px; }
  .verdict-icon { font-size: 36px; }
  .verdict-text h3 { font-size: 18px; }
}
