/* 証券収益ダッシュボードの紹介・解説・規約ページ (dashboard/pages.py が作る HTML) の見た目。
   pages.py の CSS の代わりに dashboard/__init__.py が差し込む。クラス名は pages.py のものに合わせる */
:root {
  --bg: #070b12; --surface: rgba(255,255,255,.035); --surface-solid: #0e1521; --surface-2: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16);
  --ink: #eef3f9; --ink-2: #a3b0c2; --muted: #6f7e93;
  --cyan: #38e1ff; --mint: #3ef0a6; --violet: #8b7bff; --amber: #ffc25c;
  --accent: #3ef0a6; --gain: #38c6ff; --loss: #ff5f6d; --div: #3ef0a6;
  --grad: linear-gradient(120deg, #3ef0a6 0%, #38c6ff 100%);
  --font: "Inter", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.85;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* 背景 */
.doc-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.doc-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; opacity: .5;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 25%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 25%, transparent 72%);
}
.doc-bg i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .38; animation: drift 18s ease-in-out infinite alternate; }
.doc-bg i:nth-child(1) { width: 520px; height: 520px; background: #00b884; top: -200px; left: -140px; }
.doc-bg i:nth-child(2) { width: 460px; height: 460px; background: #1a6bff; top: -160px; right: -160px; animation-delay: -7s; }
@keyframes drift { to { transform: translate3d(60px, 40px, 0) scale(1.1); } }

/* レイアウト */
.wrap { max-width: 820px; margin: 0 auto; padding: 72px 24px 110px; }
.wrap.wide { max-width: 1160px; }
main a { color: var(--mint); text-underline-offset: 3px; }
main a:hover { color: #7ff7c6; }

/* 見出し・本文 */
h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.3; margin: 0 0 18px; font-weight: 900; letter-spacing: -.005em; text-wrap: balance; }
h2 {
  font-size: clamp(20px, 2.4vw, 26px); line-height: 1.4; margin: 64px 0 18px; padding: 0 0 0 16px; font-weight: 800;
  border: 0; position: relative;
}
h2::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px; background: var(--grad); }
h3 { font-size: 17px; margin: 32px 0 8px; font-weight: 700; }
p { margin: 0 0 16px; }
.lead { color: var(--ink-2); font-size: clamp(15px, 1.6vw, 17px); margin: 0 0 32px; }
.meta { color: var(--muted); font-size: 13px; }
.meta a { color: var(--ink-2); text-decoration: none; }
.meta a:hover { color: var(--ink); }
main > .meta:first-child { margin-bottom: 18px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
ol, ul { padding-left: 1.4em; margin: 0 0 20px; }
li { margin: 6px 0; }
li::marker { color: var(--mint); }
main > ol { counter-reset: st; list-style: none; padding: 0; display: grid; gap: 10px; }
main > ol > li { counter-increment: st; position: relative; margin: 0; padding: 16px 18px 16px 62px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
main > ol > li::before {
  content: counter(st, decimal-leading-zero); position: absolute; left: 18px; top: 15px;
  font-family: var(--mono); font-size: 15px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* 表 */
.tbl { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: transparent; border: 0; }
th, td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; white-space: nowrap; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }

/* 注意・ボタン */
.note {
  background: linear-gradient(90deg, rgba(255,194,92,.12), rgba(255,194,92,.03)); color: #ffd99a;
  border: 1px solid rgba(255,194,92,.3); border-radius: 14px; padding: 14px 18px; font-size: 14px; margin: 32px 0;
}
.cta {
  display: inline-flex; align-items: center; gap: 8px; background: var(--grad); color: #04140d !important; text-decoration: none;
  font-weight: 800; border-radius: 10px; padding: 13px 24px; margin: 8px 0; box-shadow: 0 8px 30px -8px rgba(62,240,166,.55);
  transition: transform .2s, box-shadow .2s;
}
.cta::after { content: "→"; transition: transform .2s; }
.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 36px -8px rgba(62,240,166,.7); }
.cta:hover::after { transform: translateX(3px); }
.doc-guide main > p:last-child { margin-top: 56px; padding: 28px; border: 1px solid var(--line-2); border-radius: 20px; text-align: center;
  background: radial-gradient(ellipse at 20% 0%, rgba(62,240,166,.14), transparent 60%), radial-gradient(ellipse at 80% 100%, rgba(56,198,255,.12), transparent 60%), var(--surface-solid); }

/* 証券会社カード (guide.html) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding: 0; margin: 0 0 20px; list-style: none; }
.cards li { margin: 0; }
.cards a {
  display: block; height: 100%; padding: 20px 20px 18px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; position: relative; overflow: hidden;
  transition: border-color .25s, transform .25s, background .25s;
}
.cards a::after { content: "→"; position: absolute; right: 18px; top: 18px; color: var(--muted); transition: transform .25s, color .25s; }
.cards a:hover { border-color: rgba(62,240,166,.5); background: rgba(62,240,166,.05); transform: translateY(-3px); color: var(--ink); }
.cards a:hover::after { color: var(--mint); transform: translateX(3px); }
.cards b { display: block; font-size: 16px; margin: 0 0 6px; }
.cards span { display: block; color: var(--ink-2); font-size: 13px; line-height: 1.7; }

/* ================= 紹介ページ (index.html) ================= */
.doc-top .hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; margin: 16px 0 96px; }
.doc-top .hero > * { min-width: 0; }
.doc-top .hero::before { content: "02 / PROFIT DASHBOARD"; grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; letter-spacing: .18em; color: var(--mint); margin-bottom: -40px; }
.doc-top .hero h1 { font-size: clamp(30px, 3.8vw, 46px); line-height: 1.2; margin: 0 0 22px; }
.doc-top .hero h1 { background: linear-gradient(180deg, #fff 30%, #b9c7d9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc-top .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.doc-top .actions .cta { margin: 0; }
.btn2 {
  display: inline-flex; align-items: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink) !important;
  text-decoration: none; font-weight: 700; border-radius: 10px; padding: 12px 20px; transition: border-color .2s, transform .2s;
}
.btn2:hover { border-color: rgba(255,255,255,.32); transform: translateY(-2px); }
.badges { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; list-style: none; color: var(--ink-2); font-size: 13px; }
.badges li { margin: 0; }
.badges li::before { content: "✓"; color: var(--mint); font-weight: 700; margin-right: 6px; }

.doc-top .mock {
  position: relative; border: 1px solid var(--line-2); border-radius: 18px; padding: 18px; background: rgba(5,8,14,.8);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(62,240,166,.08), 0 0 60px -20px rgba(62,240,166,.35);
}
.doc-top .mock .bar { display: flex; gap: 6px; margin-bottom: 14px; }
.doc-top .mock .bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a3342; }
.doc-top .mock .k { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.doc-top .mock .k div { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.doc-top .mock .k small { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-top .mock .k b { display: block; font-family: var(--mono); font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-top .mock .k b.pos { color: var(--mint); }
.doc-top .mock svg { display: block; width: 100%; height: auto; }
.doc-top .mock .g { fill: var(--gain); } .doc-top .mock .l { fill: var(--loss); } .doc-top .mock .d { fill: var(--div); } .doc-top .mock .z { stroke: var(--line-2); }
.doc-top .mock .cap { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11.5px; margin-top: 8px; flex-wrap: wrap; }
.doc-top .mock .cap span i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin: 0 4px 0 8px; }

section.blk { margin: 0 0 96px; }
section.blk > h2 { font-size: clamp(24px, 3.4vw, 38px); margin: 0 0 10px; padding: 0; font-weight: 900; }
section.blk > h2::before { display: none; }
section.blk > .lead { margin-bottom: 32px; }
.brokers { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.brokers li { margin: 0; }
.brokers a {
  display: block; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 9px 20px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; transition: border-color .2s, background .2s, transform .2s;
}
.brokers a:hover { border-color: rgba(62,240,166,.6); background: rgba(62,240,166,.08); color: var(--ink); transform: translateY(-2px); }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; padding: 0; margin: 0; list-style: none; }
.feats li { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color .25s, background .25s; }
.feats li:hover { border-color: var(--line-2); background: rgba(255,255,255,.055); }
.feats h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; gap: 12px; }
.feats h3 span { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(62,240,166,.1); color: var(--mint); font-family: var(--mono); font-size: 13px; font-weight: 500; }
.feats p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.75; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { margin: 0; padding: 24px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); counter-increment: s; }
.steps li::before { content: "0" counter(s); display: block; font-family: var(--mono); font-size: 28px; line-height: 1; margin-bottom: 14px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.steps b { display: block; font-size: 16px; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.75; }
.safe {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px; border: 1px solid rgba(62,240,166,.3); border-radius: 22px; padding: 36px;
  background: linear-gradient(120deg, rgba(62,240,166,.09), rgba(56,198,255,.03) 60%, transparent);
}
.safe h2 { font-size: clamp(22px, 3vw, 32px); margin: 0 0 12px; padding: 0; font-weight: 900; }
.safe h2::before { display: none; }
.safe p { color: var(--ink-2); margin: 0; }
.safe ul { margin: 0; padding-left: 1.2em; }
.safe li { color: var(--ink-2); font-size: 14px; }
.end {
  text-align: center; border: 1px solid var(--line-2); border-radius: 28px; padding: 64px 24px; margin-bottom: 0;
  background: radial-gradient(ellipse at 20% 0%, rgba(62,240,166,.16), transparent 55%), radial-gradient(ellipse at 80% 100%, rgba(56,198,255,.14), transparent 55%), var(--surface-solid);
}
.end h2 { font-size: clamp(26px, 4vw, 42px); margin: 0 0 12px; padding: 0; font-weight: 900; }
.end h2::before { display: none; }
.end p { color: var(--ink-2); margin: 0 0 26px; }

/* 規約ページ: 条文を読みやすく */
.doc-legal main > h2 { font-size: 18px; margin-top: 44px; }
.doc-legal main { counter-reset: none; }

@media (max-width: 860px) {
  .wrap { padding: 48px 16px 80px; }
  .doc-top .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; margin-bottom: 72px; }
  .doc-top .hero::before { margin-bottom: -20px; }
  .steps, .safe { grid-template-columns: 1fr; }
  .safe { padding: 26px 22px; gap: 20px; }
  section.blk { margin-bottom: 72px; }
  main > ol > li { padding-left: 54px; }
}
@media (max-width: 480px) {
  .doc-top .mock { padding: 14px; }
  .doc-top .mock .k b { font-size: 13px; }
  th, td { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
