/* AIRPA design system — blue/cyan tech gradient, pure CSS, no dependencies */
:root {
  --ap-navy: #0b1220;
  --ap-navy-2: #101a30;
  --ap-blue: #2563eb;
  --ap-cyan: #06b6d4;
  --ap-sky: #38bdf8;
  --ap-grad: linear-gradient(120deg, #2563eb, #06b6d4);
  --ap-text: #1e293b;
  --ap-muted: #64748b;
  --ap-line: #e2e8f0;
  --ap-bg: #f8fafc;
  --ap-card: #ffffff;
  --ap-ok: #10b981;
  --ap-warn: #f59e0b;
  --ap-err: #ef4444;
  --ap-radius: 12px;
  --ap-shadow: 0 8px 30px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ap-text); background: var(--ap-bg); line-height: 1.65; }
a { color: var(--ap-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== buttons ===== */
.ap-btn { display: inline-block; padding: 11px 26px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .18s; text-decoration: none !important; }
.ap-btn.primary { background: var(--ap-grad); color: #fff; }
.ap-btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ap-btn.ghost { background: transparent; color: #dbeafe; border-color: rgba(148, 197, 255, .45); }
.ap-btn.ghost:hover { background: rgba(56, 189, 248, .12); }
.ap-btn.ghost-dark { background: transparent; color: var(--ap-blue); border-color: var(--ap-blue); }
.ap-btn.ghost-dark:hover { background: rgba(37, 99, 235, .08); }
.ap-btn.sm { padding: 6px 14px; font-size: 13px; }
.ap-btn.danger { background: var(--ap-err); color: #fff; }
.ap-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== site head / foot ===== */
.ap-sitehead { position: sticky; top: 0; z-index: 50; background: rgba(11, 18, 32, .88); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(148, 163, 184, .15); }
.ap-sitehead-in { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 14px 24px; }
.ap-logo { font-size: 21px; font-weight: 800; color: #fff; letter-spacing: .5px; }
.ap-logo em { font-style: normal; background: var(--ap-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ap-sitenav { display: flex; gap: 22px; }
.ap-sitenav a { color: #cbd5e1; font-size: 14px; }
.ap-sitenav a:hover { color: #fff; text-decoration: none; }
.ap-sitenav a.on { color: var(--ap-sky); font-weight: 600; }
.ap-sitehead .sp { flex: 1; }
.ap-userchip { color: #94a3b8; font-size: 13px; }
.ap-userchip b { color: #e2e8f0; }
.ap-burger { display: none; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.ap-sitefoot { background: var(--ap-navy); color: #7d8db1; text-align: center; padding: 26px 16px; font-size: 13px; }

/* ===== hero ===== */
.ap-hero { background: radial-gradient(1200px 500px at 75% -10%, rgba(6, 182, 212, .28), transparent), radial-gradient(900px 420px at 12% 10%, rgba(37, 99, 235, .32), transparent), var(--ap-navy); color: #fff; padding: 92px 24px 84px; position: relative; overflow: hidden; }
.ap-hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.06) 1px, transparent 1px); background-size: 44px 44px; pointer-events: none; }
.ap-hero-in { max-width: 1160px; margin: 0 auto; position: relative; z-index: 1; }
.ap-kick { display: inline-block; font-size: 12px; letter-spacing: 3px; font-weight: 700; color: var(--ap-sky); border: 1px solid rgba(56, 189, 248, .4); padding: 5px 14px; border-radius: 999px; margin-bottom: 22px; }
.ap-hero h1 { font-size: 46px; line-height: 1.25; font-weight: 800; max-width: 760px; }
.ap-hero h1 .grad { background: var(--ap-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ap-hero .sub { margin: 20px 0 30px; color: #b6c2d9; font-size: 17px; max-width: 700px; }
.ap-hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
.ap-hero .terms { margin-top: 30px; display: flex; gap: 26px; flex-wrap: wrap; color: #8fa3c4; font-size: 13px; }
.ap-hero .terms span b { color: var(--ap-sky); }

/* ===== sections ===== */
.ap-sec { max-width: 1160px; margin: 0 auto; padding: 76px 24px 10px; }
.ap-sec .kick2 { font-size: 12px; letter-spacing: 3px; font-weight: 700; color: var(--ap-blue); }
.ap-sec h2 { font-size: 30px; margin: 10px 0 14px; }
.ap-sec .lead { color: var(--ap-muted); max-width: 780px; margin-bottom: 34px; }

/* ===== capability cards ===== */
.ap-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.ap-card { background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: var(--ap-radius); padding: 26px 22px; box-shadow: var(--ap-shadow); transition: transform .18s, box-shadow .18s; }
.ap-card:hover { transform: translateY(-4px); box-shadow: 0 14px 38px rgba(15, 23, 42, .12); }
.ap-card .ico { width: 44px; height: 44px; border-radius: 10px; background: var(--ap-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; }
.ap-card h3 { font-size: 17px; margin-bottom: 8px; }
.ap-card p { color: var(--ap-muted); font-size: 14px; }
.ap-card .tag { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--ap-cyan); background: rgba(6, 182, 212, .08); border: 1px solid rgba(6, 182, 212, .25); padding: 2px 10px; border-radius: 999px; }

/* ===== workflow strip ===== */
.ap-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 8px 0 18px; }
.ap-flow .step { position: relative; background: var(--ap-navy-2); color: #cbd5e1; padding: 22px 20px 20px; border-right: 1px solid rgba(148,163,184,.15); }
.ap-flow .step:first-child { border-radius: var(--ap-radius) 0 0 var(--ap-radius); }
.ap-flow .step:last-child { border-radius: 0 var(--ap-radius) var(--ap-radius) 0; border-right: none; }
.ap-flow .step b { display: block; color: #fff; font-size: 15px; margin: 8px 0 6px; }
.ap-flow .step span { font-size: 13px; color: #8fa3c4; }
.ap-flow .step .no { font-size: 12px; color: var(--ap-sky); letter-spacing: 2px; font-weight: 700; }
.ap-flow .step::after { content: "→"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); color: var(--ap-sky); z-index: 2; font-weight: 700; }
.ap-flow .step:last-child::after { content: none; }
.ap-flow-note { color: var(--ap-muted); font-size: 13px; margin-bottom: 30px; }
.ap-flow-note b { color: var(--ap-warn); }

/* ===== scenario cards ===== */
.ap-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 34px; }
.ap-scene { background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: var(--ap-radius); padding: 24px; box-shadow: var(--ap-shadow); }
.ap-scene h3 { font-size: 16px; margin-bottom: 10px; }
.ap-scene ul { list-style: none; }
.ap-scene li { font-size: 14px; color: var(--ap-muted); padding: 4px 0 4px 18px; position: relative; }
.ap-scene li::before { content: "▸"; position: absolute; left: 0; color: var(--ap-cyan); }
.ap-stack { background: var(--ap-navy); color: #93b4e8; border-radius: var(--ap-radius); padding: 18px 26px; display: flex; gap: 30px; flex-wrap: wrap; font-size: 14px; margin-bottom: 40px; }
.ap-stack b { color: #fff; }

/* ===== CTA band ===== */
.ap-cta { background: var(--ap-grad); color: #fff; text-align: center; padding: 64px 24px; margin-top: 56px; }
.ap-cta h2 { font-size: 30px; margin-bottom: 12px; }
.ap-cta p { opacity: .92; margin-bottom: 26px; }
.ap-cta .ap-btn.white { background: #fff; color: var(--ap-blue); }

/* ===== forms (signup/login) ===== */
.ap-authwrap { max-width: 460px; margin: 60px auto 80px; padding: 0 20px; }
.ap-authcard { background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: 16px; box-shadow: var(--ap-shadow); padding: 38px 36px; }
.ap-authcard h1 { font-size: 24px; margin-bottom: 6px; }
.ap-authcard .sub { color: var(--ap-muted); font-size: 14px; margin-bottom: 26px; }
.ap-field { margin-bottom: 16px; }
.ap-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ap-field .req { color: var(--ap-err); }
.ap-field input, .ap-field select { width: 100%; padding: 10px 12px; border: 1px solid var(--ap-line); border-radius: 8px; font-size: 14px; background: #fff; }
.ap-field input:focus, .ap-field select:focus { outline: none; border-color: var(--ap-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.ap-field .err { display: none; color: var(--ap-err); font-size: 12px; margin-top: 5px; }
.ap-field.bad input { border-color: var(--ap-err); }
.ap-field.bad .err { display: block; }
.ap-formmsg { display: none; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.ap-formmsg.error { display: block; background: #fef2f2; color: var(--ap-err); border: 1px solid #fecaca; }
.ap-formmsg.ok { display: block; background: #ecfdf5; color: var(--ap-ok); border: 1px solid #a7f3d0; }
.ap-authfoot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--ap-muted); }

/* ===== console (app/admin) ===== */
.ap-console { max-width: 1160px; margin: 36px auto 80px; padding: 0 24px; }
.ap-console h1 { font-size: 24px; margin-bottom: 4px; }
.ap-console .sub { color: var(--ap-muted); font-size: 14px; margin-bottom: 24px; }
.ap-tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--ap-line); margin-bottom: 26px; flex-wrap: wrap; }
.ap-tabs button { background: none; border: none; padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--ap-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.ap-tabs button.on { color: var(--ap-blue); border-bottom-color: var(--ap-blue); }
.ap-statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px; }
.ap-stat { background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: var(--ap-radius); padding: 20px 22px; box-shadow: var(--ap-shadow); }
.ap-stat .num { font-size: 30px; font-weight: 800; color: var(--ap-blue); }
.ap-stat .lbl { color: var(--ap-muted); font-size: 13px; margin-top: 2px; }
.ap-panel { background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: var(--ap-radius); box-shadow: var(--ap-shadow); padding: 24px; margin-bottom: 24px; }
.ap-panel h2 { font-size: 17px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.ap-panel h2 .sp { flex: 1; }
.ap-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ap-table th { text-align: left; color: var(--ap-muted); font-size: 12px; letter-spacing: 1px; padding: 8px 10px; border-bottom: 2px solid var(--ap-line); }
.ap-table td { padding: 10px; border-bottom: 1px solid var(--ap-line); }
.ap-table tr:hover td { background: #f1f5f9; }
.ap-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ap-badge.not_connected { background: #f1f5f9; color: #64748b; }
.ap-badge.exploring { background: #fffbeb; color: #b45309; }
.ap-badge.ready { background: #ecfdf5; color: #047857; }
.ap-badge.broken { background: #fef2f2; color: #b91c1c; }
.ap-badge.role-super_admin { background: #eef2ff; color: #4338ca; }
.ap-badge.role-admin { background: #e0f2fe; color: #0369a1; }
.ap-badge.role-user { background: #f1f5f9; color: #475569; }
.ap-badge.active { background: #ecfdf5; color: #047857; }
.ap-badge.disabled { background: #fef2f2; color: #b91c1c; }
.ap-empty { color: var(--ap-muted); text-align: center; padding: 34px 0; font-size: 14px; }
.ap-inlineform { display: grid; grid-template-columns: 1.2fr 1.6fr .7fr .7fr auto; gap: 10px; align-items: end; }
.ap-inlineform .ap-field { margin: 0; }
.ap-modal-mask { position: fixed; inset: 0; background: rgba(11, 18, 32, .55); display: none; align-items: center; justify-content: center; z-index: 100; }
.ap-modal-mask.show { display: flex; }
.ap-modal { background: #fff; border-radius: 14px; width: 420px; max-width: 92vw; padding: 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.ap-modal h3 { margin-bottom: 18px; font-size: 17px; }
.ap-modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.ap-tip { font-size: 12px; color: var(--ap-muted); margin-top: 6px; }

/* ===== help ===== */
.ap-doc { max-width: 860px; margin: 40px auto 80px; padding: 0 24px; }
.ap-doc h1 { font-size: 26px; margin-bottom: 22px; }
.ap-doc h2 { font-size: 18px; margin: 26px 0 10px; }
.ap-doc p, .ap-doc li { color: #334155; font-size: 15px; }
.ap-doc ul { padding-left: 22px; margin: 8px 0; }
.ap-doc code { background: #eef2ff; color: #4338ca; padding: 1px 6px; border-radius: 4px; font-size: 13px; }

/* ===== responsive ===== */
@media (max-width: 900px) {
  .ap-grid4 { grid-template-columns: repeat(2, 1fr); }
  .ap-grid3 { grid-template-columns: 1fr; }
  .ap-flow { grid-template-columns: 1fr; }
  .ap-flow .step { border-right: none; border-bottom: 1px solid rgba(148,163,184,.15); border-radius: 0 !important; }
  .ap-flow .step::after { content: "↓"; right: 50%; top: auto; bottom: -12px; transform: translateX(50%); }
  .ap-statgrid { grid-template-columns: repeat(2, 1fr); }
  .ap-inlineform { grid-template-columns: 1fr; }
  .ap-hero h1 { font-size: 32px; }
  .ap-sitenav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--ap-navy); flex-direction: column; padding: 16px 24px; gap: 14px; border-bottom: 1px solid rgba(148,163,184,.2); }
  .ap-sitenav.open { display: flex; }
  .ap-burger { display: block; }
}
