:root {
  --bg: #f5f7fb;
  --bg-soft: #ffffff;
  --primary: #1652f0;
  --primary-soft: #e5edff;
  --text-main: #1f2933;
  --text-muted: #7b8794;
  --border-soft: #e4e7eb;
  --danger: #e02424;
  --success: #1ca36a;
  --pending: #f97316;
}

/* ====== GLOBAL ====== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: inherit;
}

main {
  max-width: 1280px;
  margin: 0 auto;
}

/* ====== BUTTONS ====== */
.btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-outline {
  background: #fff;
  border-color: var(--border-soft);
  color: var(--text-main);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

/* 小さいボタン（Adminなど） */
.btn-xs {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border-soft);
  background: #fff;
  cursor: pointer;
}

.btn-xs-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ====== USER HEADER (フロント側) ====== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
}

.site-header .logo-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
}

.site-nav {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

.site-nav .nav-link {
  color: var(--text-muted);
}

.site-nav .nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* ====== CARD ====== */
.card {
  background: var(--bg-soft);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  padding: 12px 14px;
  font-size: 12px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
}

.card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ====== FOOTER ====== */
.site-footer {
  padding: 16px 20px 24px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ====== ADMIN共通（ヘッダー・サイドバー） ====== */
.admin-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 60px;
  z-index: 30;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-logo-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.admin-logo-text {
  font-weight: 700;
  font-size: 16px;
}

.admin-logo-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 200px;
  background: #0f172a;
  color: #e5e7eb;
  padding-top: 52px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #020617;
  z-index: 20;
}

.sidebar-title {
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 12px;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link-admin {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #9ca3af;
  cursor: pointer;
}

.nav-link-admin:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #e5e7eb;
}

.nav-link-admin.active {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid rgba(129, 140, 248, 0.5);
}

.nav-icon {
  width: 14px;
  text-align: center;
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 14px 12px;
  font-size: 11px;
  color: #6b7280;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
}

.admin-main {
  margin-left: 200px;
  padding-top: 52px;
}

.admin-main-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 18px 24px;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.page-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* small badges */
.badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
}

.badge-status-active {
  background: #dcfce7;
  color: var(--success);
}

.badge-status-pending {
  background: #ffedd5;
  color: var(--pending);
}

.badge-status-suspended {
  background: #fee2e2;
  color: var(--danger);
}

.badge-group {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-kyc {
  background: #e5e7eb;
  color: var(--text-main);
}
/* ===== EXCHANGE PAGE LAYOUT ===== */
.exchange-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 14px 40px;
  display: grid;
  grid-template-columns: 0.9fr 1.4fr 0.7fr;
  gap: 10px;
}

@media (max-width: 1100px) {
  .exchange-grid {
    grid-template-columns: 1fr;
  }
}

/* MARKET LIST */
.market-item {
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  margin-bottom: 6px;
  background: #fff;
}
.market-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-soft);
}
.market-symbol {
  font-weight: 600;
  font-size: 13px;
}
.market-name {
  color: var(--text-muted);
  font-size: 11px;
}

/* CHART */
.chart-area {
  background: #fff;
  border: 1px solid var(--border-soft);
  height: 520px;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.chart-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  background: #fff;
}
.chart-main-symbol {
  font-size: 15px;
  font-weight: 700;
}
.chart-sub-symbol {
  font-size: 11px;
  color: var(--text-muted);
}

/* ORDERBOOK */
.orderbook-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}
.sell {
  color: var(--danger);
}
.buy {
  color: var(--success);
}

/* ORDER PANEL */
.order-panel select,
.order-panel input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  margin-bottom: 6px;
}
.order-btn-buy {
  background: var(--success);
  color: white;
  border: none;
  padding: 7px;
  border-radius: 6px;
  margin-bottom: 4px;
  cursor: pointer;
}
.order-btn-sell {
  background: var(--danger);
  color: white;
  border: none;
  padding: 7px;
  border-radius: 6px;
  margin-bottom: 4px;
  cursor: pointer;
}
.order-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* TRADES */
.trade-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}
.recent-trades {
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
}
/* ===== SYSTEM TRADE PAGE ===== */

.system-page {
  padding: 20px 24px 32px;
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(0,1fr);
  gap: 16px;
}
@media (max-width:960px){
  .system-page { grid-template-columns:1fr; }
}

.switch-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.switch {
  width:34px;
  height:18px;
  border-radius:999px;
  background:#d1d5db;
  position:relative;
  cursor:pointer;
}
.switch-knob {
  width:16px;
  height:16px;
  border-radius:999px;
  background:#fff;
  position:absolute;
  top:1px;
  left:1px;
  transition:all 0.15s ease;
  box-shadow:0 1px 2px rgba(0,0,0,0.15);
}
.switch.on {
  background:var(--primary);
}
.switch.on .switch-knob {
  left:17px;
}

.strategy-card {
  border-radius:10px;
  border:1px solid var(--border-soft);
  padding:10px;
  background:#f9fafb;
  cursor:pointer;
}
.strategy-card.active {
  border-color:var(--primary);
  background:#eef3ff;
}

.system-log {
  max-height:260px;
  overflow:auto;
  border-radius:6px;
  border:1px solid var(--border-soft);
  padding:6px 8px;
  background:#f9fafb;
  font-family:"SF Mono", Menlo, Consolas, monospace;
  font-size:10px;
  color:#4b5563;
}
.system-log-line {
  margin-bottom:2px;
}

.pill-row {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:4px;
}
/* ===== INDEX PAGE ===== */

.index-main {
  padding: 32px 20px 40px;
  max-width: 1120px;
  margin: 0 auto;
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
  gap: 26px;
  align-items: center;
  margin-bottom: 32px;
}
@media(max-width:900px){
  .hero { grid-template-columns:1fr; }
}

.hero-eyebrow {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:3px 10px;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:11px;
  margin-bottom:10px;
}
.hero-title {
  font-size:clamp(26px,4vw,32px);
  font-weight:700;
  margin-bottom:10px;
}
.hero-title span { color:var(--primary); }
.hero-sub {
  font-size:13px;
  color:var(--text-muted);
  line-height:1.6;
  margin-bottom:18px;
}
.hero-actions {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:10px;
}
.hero-meta {
  font-size:11px;
  color:var(--text-muted);
}

/* HERO CARD */
.hero-card {
  background:rgba(255,255,255,0.96);
  border-radius:14px;
  border:1px solid var(--border-soft);
  box-shadow:0 8px 24px rgba(15,23,42,0.1);
  padding:16px;
  font-size:11px;
}
.hero-card-title {
  font-size:13px;
  font-weight:600;
}
.chip {
  border-radius:999px;
  padding:2px 8px;
  font-size:10px;
  background:var(--primary-soft);
  color:var(--primary);
}

/* Market Mini Table */
.market-mini {
  width:100%;
  border-collapse:collapse;
  font-size:11px;
  margin-top:4px;
}
.market-mini th,
.market-mini td {
  padding:4px 4px;
  white-space:nowrap;
  text-align:right;
}
.market-mini th:first-child,
.market-mini td:first-child {
  text-align:left;
}
.price-up { color:#16a34a; }
.price-down { color:#dc2626; }

/* SECTIONS */
.section { margin-bottom:28px; }
.section-title { font-size:16px; font-weight:600; margin-bottom:10px; }
.section-sub { font-size:12px; color:var(--text-muted); margin-bottom:14px; }

/* Features */
.features {
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:12px;
}
@media(max-width:900px){
  .features { grid-template-columns:1fr; }
}
.feature-card {
  background:#fff;
  border-radius:12px;
  border:1px solid var(--border-soft);
  padding:12px;
  font-size:12px;
}
.feature-title { font-size:13px; font-weight:600; margin-bottom:4px; }

/* Steps */
.steps {
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
  font-size:12px;
}
@media(max-width:900px){
  .steps { grid-template-columns:1fr; }
}
.step-card {
  background:#fff;
  border-radius:12px;
  border:1px solid var(--border-soft);
  padding:10px;
}
.step-label {
  font-size:11px;
  color:var(--primary);
  font-weight:600;
  margin-bottom:2px;
}
.step-title {
  font-size:13px;
  font-weight:600;
  margin-bottom:4px;
}

/* Coins */
.coins-grid {
  display:grid;
  grid-template-columns:repeat(5, minmax(0,1fr));
  gap:8px;
  font-size:11px;
}
@media(max-width:900px){
  .coins-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.coin-pill {
  background:#fff;
  border-radius:999px;
  border:1px solid var(--border-soft);
  padding:6px 8px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.coin-pill .symbol { font-weight:600; font-size:11px; }
.coin-pill .name { color:var(--text-muted); font-size:10px; }

/* Campaign Banner */
.campaign-banner {
  background:linear-gradient(135deg, #1652f0, #1d8ff0);
  border-radius:14px;
  color:#fff;
  padding:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  font-size:12px;
}
@media(max-width:780px){
  .campaign-banner { flex-direction:column; align-items:flex-start; }
}
.campaign-chip {
  font-size:11px;
  border-radius:999px;
  padding:2px 8px;
  background:rgba(255,255,255,0.18);
  display:inline-block;
  margin-bottom:4px;
}
.campaign-btn {
  border-radius:999px;
  padding:7px 14px;
  border:none;
  background:#ffffff;
  color:#1652f0;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap;
}
/* ===== CAMPAIGN PAGE ===== */

.campaign-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}

/* hero の背景をキャンペーン用に少し変える */
.campaign-hero {
  background: linear-gradient(135deg, #1652f0, #1d8ff0);
  border-radius: 16px;
  color: #fff;
  padding: 18px 18px 16px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(0,1fr);
  gap: 16px;
  align-items: center;
}
@media (max-width:780px){
  .campaign-hero { grid-template-columns:1fr; }
}
.hero-right {
  background: rgba(15,23,42,0.24);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
}
.hero-right h3 {
  font-size: 13px;
  margin-bottom: 4px;
}
.hero-list {
  list-style: none;
  margin-top: 4px;
  padding-left: 0;
}
.hero-list li::before {
  content: "• ";
}

/* FAQ / buttons */
.btn-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge-outline {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--primary-soft);
  color: var(--primary);
  padding: 2px 8px;
  font-size: 11px;
  margin-bottom: 4px;
}
.faq-item {
  margin-bottom: 8px;
  font-size: 12px;
}
.faq-q {
  font-weight: 600;
  margin-bottom: 2px;
}
.faq-a {
  color: var(--text-muted);
}

