@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

*,*::before,*::after{box-sizing:border-box;}
html{scroll-behavior:smooth;scroll-padding-top:68px;}
html,body{margin:0;padding:0;height:100%;}
body{
  font-family:'Plus Jakarta Sans','Pretendard',-apple-system,BlinkMacSystemFont,sans-serif;
  background:#fff;color:#1e293b;-webkit-font-smoothing:antialiased;
}
a{color:#5b21b6;text-decoration:none;transition:color .12s;}
a:hover{color:#7c3aed;}
::selection{background:#ede9fe;}

/* ═══ SHELL ═══ */
.ds{display:grid;grid-template-columns:280px minmax(0,1fr) 208px;min-height:calc(100vh - 60px);margin-top:60px;}
@media(max-width:1200px){.ds{grid-template-columns:264px minmax(0,1fr);}.ds-toc{display:none;}}
@media(max-width:768px){.ds{grid-template-columns:1fr;}.ds-nav{display:none;}.ds-nav.open{display:block;position:fixed;inset:0;z-index:600;background:#fff;padding:60px 0 0;overflow-y:auto;}}

/* ═══ LEFT NAV ═══ */
.ds-nav{
  position:sticky;top:60px;height:calc(100vh - 60px);
  overflow-y:auto;overflow-x:hidden;
  border-right:1px solid #e5e7eb;
  background:#fafafa;
  padding-bottom:40px;
}
.ds-nav::-webkit-scrollbar{width:3px;}
.ds-nav::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px;}

.ns{padding:14px 16px 12px;}
.ns input{
  width:100%;padding:8px 12px 8px 34px;
  border:1px solid #e5e7eb;border-radius:8px;font-size:.82rem;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E") 11px center no-repeat;
  color:#1e293b;outline:none;transition:border-color .15s;
}
.ns input:focus{border-color:#a78bfa;box-shadow:0 0 0 3px rgba(139,92,246,.1);}
.ns input::placeholder{color:#9ca3af;}

/* Tree */
.nt,.nt-sub{list-style:none;margin:0;padding:0;}
.nt{padding:0 8px;}
.nt-sub{
  margin-left:8px;padding-left:12px;
  border-left:1.5px solid #e5e7eb;
}
.nn.closed>.nt-sub{display:none;}

.nn{position:relative;}
.nr{
  display:flex;align-items:center;gap:3px;
  padding:6px 8px;margin:1px 0;
  border-radius:6px;transition:background .08s;
  min-height:32px;
}
.nr:hover{background:#f3f4f6;}
.nr.act{background:#f3e8ff;}
.nr.act .nl{color:#7c3aed;font-weight:700;}
.nr.act .nd{background:#7c3aed;}

.nb{
  display:flex;align-items:center;justify-content:center;
  width:22px;height:22px;flex-shrink:0;
  background:none;border:none;color:#9ca3af;
  cursor:pointer;padding:0;border-radius:4px;
  transition:all .12s;
}
.nb:hover{color:#6b7280;background:#e5e7eb;}
.nb svg{transform:rotate(90deg);transition:transform .2s ease;}
.nn.closed>.nr .nb svg{transform:rotate(0deg);}

.nd{
  width:6px;height:6px;flex-shrink:0;
  border-radius:50%;background:#d1d5db;
  margin:0 8px;
}

.nl{
  font-size:14.5px;font-weight:500;
  color:#374151;text-decoration:none;
  line-height:1.4;padding:1px 0;
  flex:1;min-width:0;
}
.nl:hover{color:#111827;}

.nt-sub .nl{font-size:14px;color:#4b5563;}
.nt-sub .nt-sub .nl{font-size:13.5px;color:#6b7280;}

.nav-write{
  display:none;align-items:center;justify-content:center;
  width:20px;height:20px;flex-shrink:0;
  border:none;background:none;color:#a78bfa;
  cursor:pointer;border-radius:4px;font-size:14px;font-weight:700;
  margin-left:auto;
  transition:all .12s;
}
.nav-write:hover{background:#f3e8ff;color:#7c3aed;}
.nr:hover .nav-write{display:flex;}

.nav-home{
  display:flex;align-items:center;gap:8px;
  padding:12px 16px;margin:0 8px 8px;
  border-radius:8px;background:#f5f3ff;
  border:1px solid #ede9fe;
  font-size:14px;font-weight:700;
  color:#7c3aed;text-decoration:none;
  transition:all .12s;
}
.nav-home:hover{background:#ede9fe;border-color:#c4b5fd;}
.nav-home svg{flex-shrink:0;}

/* ═══ MAIN ═══ */
.ds-main{padding:36px 52px 80px;max-width:100%;min-width:0;}
@media(max-width:768px){.ds-main{padding:20px 16px 60px;}}

/* Index Hero */
.dx-hero{
  text-align:center;
  padding:40px 20px 44px;
  margin:-36px -52px 36px;
  background:linear-gradient(135deg,#faf5ff 0%,#ede9fe 30%,#dbeafe 70%,#f0f9ff 100%);
  border-bottom:1px solid #e5e7eb;
}
.dx-hero h1{font-size:2.2rem;font-weight:800;letter-spacing:-.03em;color:#0f172a;margin:0 0 8px;}
.dx-hero h1 span{
  background:linear-gradient(135deg,#7c3aed,#2563eb,#06b6d4);
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;
}
.dx-hero p{font-size:.98rem;color:#475569;margin:0 0 24px;}
.dx-search{position:relative;max-width:520px;margin:0 auto;}
.dx-search input{
  width:100%;padding:14px 20px 14px 48px;
  border:1.5px solid #c4b5fd;border-radius:14px;
  font-size:.95rem;background:rgba(255,255,255,.9);backdrop-filter:blur(8px);
  color:#1e293b;outline:none;
  transition:border-color .2s,box-shadow .2s;
  box-shadow:0 8px 24px rgba(124,58,237,.08);
}
.dx-search input:focus{border-color:#7c3aed;box-shadow:0 8px 24px rgba(124,58,237,.15);}
.dx-search input::placeholder{color:#9ca3af;}
.dx-search .si{position:absolute;left:18px;top:50%;transform:translateY(-50%);color:#a78bfa;font-size:1.1rem;pointer-events:none;}
.dx-search .sk{
  position:absolute;right:14px;top:50%;transform:translateY(-50%);
  padding:3px 8px;border-radius:6px;font-size:.7rem;font-weight:600;
  color:#a78bfa;background:rgba(167,139,250,.1);border:1px solid rgba(167,139,250,.2);
  font-family:'JetBrains Mono',monospace;
}

/* Sections */
.dx-section{margin-bottom:32px;}
.dx-label{
  font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:#7c3aed;margin-bottom:14px;
  display:flex;align-items:center;gap:10px;
}
.dx-label::after{content:'';flex:1;height:1px;background:linear-gradient(90deg,#c4b5fd,transparent);}

.dx-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;}
.dx-card{
  display:block;padding:18px 20px;
  border:1px solid #e5e7eb;border-radius:12px;
  background:#fff;transition:all .18s;
}
.dx-card:hover{border-color:#c4b5fd;box-shadow:0 8px 24px rgba(124,58,237,.06);transform:translateY(-2px);}
.dx-card .t{font-size:.92rem;font-weight:700;color:#0f172a;margin-bottom:5px;}
.dx-card .m{font-size:.74rem;color:#9ca3af;}

.dx-pills{display:flex;flex-wrap:wrap;gap:6px;}
.dx-pill{
  padding:5px 14px;border-radius:999px;
  font-size:.76rem;font-weight:600;
  background:#f5f3ff;color:#7c3aed;
  border:1px solid #ede9fe;transition:all .12s;
}
.dx-pill:hover{background:#ede9fe;border-color:#c4b5fd;}

/* Admin bar */
.da{display:flex;gap:8px;margin-bottom:24px;padding:14px 16px;border-radius:10px;background:#fefce8;border:1px solid #fde68a;}

/* Breadcrumb */
.db{display:flex;flex-wrap:wrap;gap:5px;font-size:.8rem;color:#9ca3af;margin-bottom:6px;}
.db a{color:#6b7280;}.db a:hover{color:#7c3aed;}
.db .s{color:#d1d5db;}

/* Doc header */
.dh{font-size:2rem;font-weight:800;letter-spacing:-.03em;color:#0f172a;margin:0 0 8px;line-height:1.25;}
.dm{
  display:flex;flex-wrap:wrap;gap:10px;align-items:center;
  font-size:.8rem;color:#9ca3af;
  padding-bottom:20px;margin-bottom:28px;
  border-bottom:1px solid #f1f5f9;
}
.dm .tg{padding:2px 10px;border-radius:999px;font-size:.72rem;font-weight:600;background:#f5f3ff;color:#7c3aed;}

/* ═══ ARTICLE ═══ */
.dd{font-size:.95rem;line-height:1.9;color:#334155;max-width:760px;}
.dd h1{font-size:1.6rem;font-weight:800;margin:36px 0 12px;color:#0f172a;}
.dd h2{font-size:1.32rem;font-weight:800;margin:32px 0 12px;color:#0f172a;padding-bottom:10px;border-bottom:1px solid #f1f5f9;}
.dd h3{font-size:1.12rem;font-weight:700;margin:24px 0 8px;color:#1e293b;}
.dd h4{font-size:1rem;font-weight:700;margin:20px 0 6px;color:#334155;}
.dd p{margin:0 0 16px;}
.dd img{max-width:100%;height:auto;border-radius:8px;border:1px solid #e5e7eb;margin:20px 0;}
.dd code{font-family:'JetBrains Mono',monospace;font-size:.84em;padding:2px 7px;border-radius:5px;background:#f5f3ff;color:#5b21b6;font-weight:500;}
.dd pre{background:#0f172a;color:#e2e8f0;padding:20px 24px;border-radius:10px;overflow-x:auto;font-size:.84rem;line-height:1.7;margin:20px 0;}
.dd pre code{background:none;color:inherit;padding:0;font-weight:400;font-size:inherit;}
.dd blockquote{margin:18px 0;padding:16px 20px;border-left:3px solid #7c3aed;background:#faf5ff;border-radius:0 8px 8px 0;color:#475569;}
.dd blockquote p{margin:0;}
.dd table{width:100%;border-collapse:collapse;margin:20px 0;font-size:.88rem;}
.dd th{padding:12px 16px;text-align:left;font-weight:700;font-size:.82rem;background:#faf5ff;border-bottom:2px solid #e5e7eb;color:#0f172a;}
.dd td{padding:12px 16px;border-bottom:1px solid #f1f5f9;}
.dd tr:hover td{background:#faf5ff;}
.dd ul,.dd ol{padding-left:24px;margin:12px 0 18px;}
.dd li{margin-bottom:8px;}
.dd li::marker{color:#a78bfa;}
.dd a{color:#7c3aed;font-weight:600;text-decoration:underline;text-decoration-color:#c4b5fd;text-underline-offset:3px;}
.dd a:hover{text-decoration-color:#7c3aed;}
.dd hr{border:none;height:1px;background:#e5e7eb;margin:32px 0;}

/* ═══ TOC RAIL ═══ */
.ds-toc{position:sticky;top:60px;height:calc(100vh - 60px);overflow-y:auto;padding:24px 16px 40px 0;border-left:1px solid #f1f5f9;}
.tl{font-size:.68rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:#9ca3af;margin-bottom:12px;padding-left:12px;}
.tc{list-style:none;padding:0;margin:0;}
.tc li{margin-bottom:1px;}
.tc a{display:block;padding:4px 12px;border-left:2px solid transparent;font-size:.78rem;font-weight:500;color:#9ca3af;transition:all .1s;border-radius:0 4px 4px 0;}
.tc a:hover{color:#6b7280;}
.tc a.on{color:#7c3aed;border-left-color:#7c3aed;font-weight:600;}
.tc .h3{padding-left:24px;font-size:.76rem;}
.ds-toc .rt{font-size:.8rem;color:#9ca3af;line-height:1.6;padding:0 12px;}

/* ═══ SEARCH RESULTS ═══ */
.sr{padding:16px 0;border-bottom:1px solid #f1f5f9;}
.sr:last-child{border-bottom:none;}
.sr .st{font-size:.95rem;font-weight:700;color:#0f172a;}.sr .st:hover{color:#7c3aed;}
.sr .sm{font-size:.74rem;color:#9ca3af;margin-top:4px;}
.se{text-align:center;padding:60px 20px;color:#9ca3af;}
.se .ic{font-size:2.4rem;margin-bottom:12px;}
.se .mg{font-size:.95rem;font-weight:600;color:#6b7280;}

/* ═══ TABLE (manage) ═══ */
.mt{width:100%;border-collapse:collapse;font-size:.85rem;}
.mt th{text-align:left;padding:12px 16px;font-weight:700;font-size:.74rem;letter-spacing:.04em;text-transform:uppercase;color:#6b7280;border-bottom:2px solid #e5e7eb;}
.mt td{padding:10px 16px;border-bottom:1px solid #f1f5f9;color:#334155;}
.mt tr:hover td{background:#faf5ff;}
.mt .ml{color:#7c3aed;font-weight:600;font-size:.82rem;}
.mt .arrow{
  display:inline-flex;align-items:center;justify-content:center;
  width:26px;height:26px;border-radius:6px;
  border:1px solid #e5e7eb;background:#fff;
  color:#6b7280;cursor:pointer;font-size:.8rem;
  transition:all .12s;text-decoration:none;
}
.mt .arrow:hover{background:#f5f3ff;border-color:#c4b5fd;color:#7c3aed;}

/* ═══ BUTTONS ═══ */
.bt{
  display:inline-flex;align-items:center;gap:5px;
  padding:8px 18px;border-radius:8px;font-size:.84rem;font-weight:700;
  text-decoration:none;border:1px solid #e5e7eb;background:#fff;color:#1e293b;
  cursor:pointer;transition:all .15s;
}
.bt:hover{background:#f9fafb;border-color:#d1d5db;}
.bt-p{background:linear-gradient(135deg,#7c3aed,#6d28d9);color:#fff;border:none;box-shadow:0 2px 8px rgba(124,58,237,.2);}
.bt-p:hover{box-shadow:0 4px 16px rgba(124,58,237,.3);}
.bt-d{background:#ef4444;color:#fff;border:none;}
.bt-s{padding:6px 12px;font-size:.78rem;}

/* ═══ FORM ═══ */
.fg{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:18px;}
.fg4{display:grid;grid-template-columns:1.2fr 1fr .8fr .8fr;gap:14px;margin-bottom:18px;}
@media(max-width:768px){.fg,.fg4{grid-template-columns:1fr;}}
.fl{font-size:.78rem;font-weight:600;color:#6b7280;display:block;margin-bottom:4px;}
.fi{width:100%;padding:9px 14px;border-radius:8px;border:1.5px solid #e5e7eb;background:#fff;color:#1e293b;font-size:.88rem;outline:none;transition:border-color .15s;}
.fi:focus{border-color:#a78bfa;box-shadow:0 0 0 3px rgba(139,92,246,.08);}
.fa{display:flex;gap:8px;justify-content:flex-end;margin-top:20px;}
.fe{margin-bottom:16px;padding:12px 16px;border-radius:8px;border:1px solid #fecaca;background:#fef2f2;font-size:.88rem;color:#dc2626;}

/* ═══ MOBILE ═══ */
.ds-mb{
  display:none;position:fixed;bottom:20px;left:20px;
  width:44px;height:44px;border-radius:10px;
  background:#0f172a;color:#fff;border:none;cursor:pointer;z-index:601;
  font-size:1.1rem;box-shadow:0 4px 16px rgba(0,0,0,.2);
  align-items:center;justify-content:center;
}
@media(max-width:768px){.ds-mb{display:flex;}}

/* ═══ QUILL ═══ */
.ql-toolbar.ql-snow{border:1.5px solid #e5e7eb !important;border-radius:10px 10px 0 0 !important;background:#fafafa !important;}
.ql-container.ql-snow{border:1.5px solid #e5e7eb !important;border-top:none !important;border-radius:0 0 10px 10px !important;background:#fff !important;min-height:420px;font-size:.92rem;color:#1e293b;}
.ql-editor{min-height:400px;line-height:1.8;font-family:'Plus Jakarta Sans','Pretendard',sans-serif;}
.ql-editor.ql-blank::before{color:#9ca3af !important;font-style:normal !important;}
