');mask-image:url('data:image/svg+xml,')}.atk-icon-no:after,.atk-icon-close:after{-webkit-mask-image:url('data:image/svg+xml,');mask-image:url('data:image/svg+xml,')}.atk-error-layer{background-color:var(--at-color-bg-transl)}.atk-error-layer .atk-error-title{color:var(--at-color-red)}.atk-error-layer .atk-warn-title{color:var(--at-color-yellow)}.atk-error-layer .atk-error-title,.atk-error-layer .atk-warn-title{display:inline-block;padding:0 15px;margin-bottom:20px;font-size:20px;letter-spacing:-.5px}.atk-error-layer .atk-error-text{text-align:center;padding:0 20px}.atk-error-layer .atk-error-text *{color:var(--at-color-deep)}.atk-error-layer .atk-error-text a{color:var(--at-color-meta)}.atk-version-check-notice{background:var(--at-color-bg-grey);border-radius:6px;padding:10px 20px;margin-bottom:10px;font-size:14px}.atk-version-check-notice .atk-info{color:var(--at-color-meta)}.atk-version-check-notice .atk-ignore-btn{cursor:pointer;float:right}.atk-version-check-notice .atk-ignore-btn:hover{opacity:.8}.atk-layer-dialog-wrap{background-color:var(--at-color-bg-transl)}.atk-layer-dialog-wrap>.atk-layer-dialog{width:25%}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-content .atk-captcha-img{cursor:pointer;width:170px;height:auto;margin-right:10px;padding-right:10px;border-right:1px solid var(--at-color-border);vertical-align:bottom}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-content input{width:100%;line-height:34px;background-color:var(--at-color-bg);border:1px solid var(--at-color-border);border-radius:3px;outline:none;padding:0 6px;display:block;margin-top:10px;margin-bottom:5px;text-align:center}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions{display:flex;flex-direction:row}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button{flex:1;display:block;cursor:pointer;border:1px solid var(--at-color-main);background:transparent;color:var(--at-color-main);border-radius:3px;padding:0 15px;line-height:30px;outline:none}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button:active{color:#fff;background:var(--at-color-main)}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button:not(:last-child){margin-right:5px}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button.error{color:#fff;background:#ff5652;border-color:#ff5652}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap{position:fixed;z-index:999998;left:0;top:0;height:100vh;width:100vw}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap>iframe{width:100%;height:100%;border:0}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap .atk-close-btn{z-index:999999;position:fixed;top:20px;right:20px;display:flex;flex-direction:column;width:50px;height:50px;align-items:center;place-content:center;cursor:pointer;-webkit-user-select:none;user-select:none;margin-left:10px}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap .atk-close-btn:hover .atk-icon-close:after{background-color:#e81123e6}@media only screen and (max-width: 768px){.atk-layer-dialog-wrap>.atk-layer-dialog{width:90%!important}}.atk-notify{display:block;overflow:hidden;background-color:#2c2c2c;color:#fff;border-radius:3px;cursor:pointer;font-size:14px;padding:5px 15px}.atk-notify:not(:last-child){margin-bottom:3px}.atk-notify .atk-notify-content{color:#fff}.atk-layer-wrap .atk-layer-mask{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99998;background:#0000004d}.atk-layer-wrap .atk-layer-item{position:fixed;z-index:99999;top:0;right:0;width:100%;height:100%}.atk-common-action-btn.atk-btn-confirm,.atk-common-action-btn.atk-btn-warn{color:var(--at-color-yellow)!important}.atk-common-action-btn.atk-btn-error{color:var(--at-color-red)!important}.atk-common-action-btn.atk-btn-success{color:var(--at-color-green)!important}img[atk-emoticon]{max-height:60px;display:initial}.atk-slim-scrollbar::-webkit-scrollbar,.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar{width:4px;height:4px;background:transparent}.atk-slim-scrollbar::-webkit-scrollbar-thumb,.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb,.atk-slim-scrollbar::-webkit-scrollbar-thumb:window-inactive{background:#5656564d}.atk-slim-scrollbar::-webkit-scrollbar-thumb:vertical:hover,.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb:vertical:hover{background:#414a52c4}.atk-slim-scrollbar::-webkit-scrollbar-thumb:vertical:active,.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb:vertical:active{background:#292f35c4}.atk-editor-plug-emoticons{height:100%;width:100%}.atk-editor-plug-emoticons>.atk-grp-wrap{overflow-y:scroll;overflow-x:hidden;height:100%;width:100%}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp{display:flex;flex-wrap:wrap;flex-direction:row;padding:5px 10px 35px}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp[data-type=image]>.atk-item{height:63px;width:63px}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp>.atk-item{display:flex;align-items:center;justify-content:center;padding:5px;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:3px;font-size:15px;min-width:35px;margin:2px}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp>.atk-item>img{max-height:100%;width:auto}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp>.atk-item:hover{background:var(--at-color-bg-grey)}.atk-editor-plug-emoticons>.atk-grp-switcher{position:absolute;bottom:0;left:0;width:100%;background:var(--at-color-bg-transl);height:30px;border-top:1px solid var(--at-color-border);border-bottom:1px solid var(--at-color-border)}.atk-editor-plug-emoticons>.atk-grp-switcher>span{-webkit-user-select:none;user-select:none;padding:0 10px;line-height:30px;float:left;display:block;cursor:pointer;font-size:14px}.atk-editor-plug-emoticons>.atk-grp-switcher>span:hover,.atk-editor-plug-emoticons>.atk-grp-switcher>span.active{background:var(--at-color-bg-grey)}.atk-slim-scrollbar::-webkit-scrollbar{width:4px;height:4px;background:transparent}.atk-slim-scrollbar::-webkit-scrollbar-thumb,.atk-slim-scrollbar::-webkit-scrollbar-thumb:window-inactive{background:#5656564d}.atk-slim-scrollbar::-webkit-scrollbar-thumb:vertical:hover{background:#414a52c4}.atk-slim-scrollbar::-webkit-scrollbar-thumb:vertical:active{background:#292f35c4}.atk-editor-plug-preview{overflow-y:scroll;overflow-x:hidden;height:100%;width:100%;padding:10px 15px}
code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:none;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#282a36}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#6272a4}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.property,.token.tag,.token.constant,.token.symbol,.token.deleted{color:#ff79c6}.token.boolean,.token.number{color:#bd93f9}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#50fa7b}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.function,.token.class-name{color:#f1fa8c}.token.keyword{color:#8be9fd}.token.regex,.token.important{color:#ffb86c}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-font-weight:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-gray-200:oklch(92.8% .006 264.531);--color-gray-500:oklch(55.1% .027 264.364);--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-bold:700;--radius-sm:.25rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-blue:#3273dc}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.static{position:static}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);margin-top:1.2em;margin-bottom:1.2em;font-size:1.25em;line-height:1.6}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:decimal}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:disc}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.25em;font-weight:600}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;font-style:italic;font-weight:500}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:0;margin-bottom:.888889em;font-size:2.25em;font-weight:800;line-height:1.11111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:900}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:2em;margin-bottom:1em;font-size:1.5em;font-weight:700;line-height:1.33333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:800}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.6em;margin-bottom:.6em;font-size:1.25em;font-weight:600;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.5em;margin-bottom:.5em;font-weight:600;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em;display:block}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows)/10%),0 3px rgb(var(--tw-prose-kbd-shadows)/10%);padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;border-radius:.3125rem;padding-inline-start:.375em;font-family:inherit;font-size:.875em;font-weight:500}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);padding-top:.857143em;padding-inline-end:1.14286em;padding-bottom:.857143em;border-radius:.375rem;margin-top:1.71429em;margin-bottom:1.71429em;padding-inline-start:1.14286em;font-size:.875em;font-weight:400;line-height:1.71429;overflow-x:auto}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;background-color:#0000;border-width:0;border-radius:0;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){table-layout:auto;width:100%;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.71429}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);vertical-align:bottom;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em;font-weight:600}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);margin-top:.857143em;font-size:.875em;line-height:1.42857}.prose{--tw-prose-body:oklch(37.3% .034 259.733);--tw-prose-headings:oklch(21% .034 264.665);--tw-prose-lead:oklch(44.6% .03 256.802);--tw-prose-links:oklch(21% .034 264.665);--tw-prose-bold:oklch(21% .034 264.665);--tw-prose-counters:oklch(55.1% .027 264.364);--tw-prose-bullets:oklch(87.2% .01 258.338);--tw-prose-hr:oklch(92.8% .006 264.531);--tw-prose-quotes:oklch(21% .034 264.665);--tw-prose-quote-borders:oklch(92.8% .006 264.531);--tw-prose-captions:oklch(55.1% .027 264.364);--tw-prose-kbd:oklch(21% .034 264.665);--tw-prose-kbd-shadows:NaN NaN NaN;--tw-prose-code:oklch(21% .034 264.665);--tw-prose-pre-code:oklch(92.8% .006 264.531);--tw-prose-pre-bg:oklch(27.8% .033 256.848);--tw-prose-th-borders:oklch(87.2% .01 258.338);--tw-prose-td-borders:oklch(92.8% .006 264.531);--tw-prose-invert-body:oklch(87.2% .01 258.338);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.7% .022 261.325);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.7% .022 261.325);--tw-prose-invert-bullets:oklch(44.6% .03 256.802);--tw-prose-invert-hr:oklch(37.3% .034 259.733);--tw-prose-invert-quotes:oklch(96.7% .003 264.542);--tw-prose-invert-quote-borders:oklch(37.3% .034 259.733);--tw-prose-invert-captions:oklch(70.7% .022 261.325);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:255 255 255;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(87.2% .01 258.338);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .03 256.802);--tw-prose-invert-td-borders:oklch(37.3% .034 259.733);font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.571429em;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.h-\[36px\]{height:36px}.h-full{height:100%}.w-24{width:calc(var(--spacing)*24)}.w-auto{width:auto}.w-full{width:100%}.max-w-none{max-width:none}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-8{padding-block:calc(var(--spacing)*8)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.text-blue{color:var(--color-blue)}.text-gray-500{color:var(--color-gray-500)}.italic{font-style:italic}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (min-width:48rem){.md\:flex{display:flex}.md\:w-28{width:calc(var(--spacing)*28)}.md\:w-\[750px\]{width:750px}.md\:flex-row{flex-direction:row}.md\:items-end{align-items:flex-end}.md\:px-0{padding-inline:calc(var(--spacing)*0)}}.prose-code\:rounded-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){border-radius:var(--radius-sm)}.prose-code\:bg-gray-200 :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:var(--color-gray-200)}.prose-code\:px-1 :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline:calc(var(--spacing)*1)}.prose-code\:font-mono :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-family:var(--font-mono)}.prose-code\:font-medium :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.prose-code\:before\:content-none :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose-code\:after\:content-none :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:var(--tw-content);--tw-content:none;content:none}}html{scrollbar-gutter:stable}@supports not (scrollbar-gutter:stable){html{overflow-y:scroll}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}
React前置技能之链表
前言
本来我是想好好研究一下 React 的渲染机制的,结果发现 React 的核心数据结构是链表,而了解了链表就很容易理解 React 的各种问题为什么会发生。
什么是链表
链表是一种数据结构,由一连串相连的数据节点构成,每一个节点都包含自身的数据和指向下一个节点的指针。
链表必须按顺序访问,因为只有上一个节点才知道当前节点的位置。
链表 - 维基百科
链表 - OIWiki
代码演示
直接描述有些抽象,我们可以来看看代码。
先定义节点类。
export class ListNode<T> {
data: T
next: ListNode<T> | null = null
prev: ListNode<T> | null = null
constructor(data: T) {
this.data = data
}
}
再定义链表类。
import { ListNode } from './ListNode'
export class LinkedList<T> {
private head: ListNode<T> | null = null
private tail: ListNode<T> | null = null
private size: number = 0
prepend(data: T): void {
const newNode = new ListNode(data)
if (!this.head) {
this.head = this.tail = newNode
return
}
newNode.next = this.head
this.head.prev = newNode
this.head = newNode
this.size++
}
append(data: T): void {
const newNode = new ListNode(data)
if (!this.tail) {
this.head = this.tail = newNode
return
}
this.tail.next = newNode
newNode.prev = this.tail
this.tail = newNode
this.size++
}
remove(data: T): boolean {
let current = this.head
while (current) {
if (current.data === data) {
if (current.prev) {
current.prev.next = current.next
} else {
this.head = current.next
}
if (current.next) {
current.next.prev = current.prev
} else {
this.tail = current.prev
}
this.size--
return true
}
current = current.next
}
return false
}
getSize(): number {
return this.size
}
}
分析
从代码逻辑中我们可以看到,链表的插入和删除的逻辑,复杂度是非常低的。
链表插入和删除数据的复杂度是 O(1)
,也就是不管数据有多少,逻辑操作只需要一次。
比如你的代码现在可以读取链表的第 114514 个节点,这时你想在这个节点后面添加一个新的节点,只要把 114514 节点的 next
赋值给新的节点的 next
,然后再把新的节点赋值给 114514 节点的 next
,最后给链表的 size+1
就行了。
这个操作就像是把一串首尾相接的圆环,在其中某两个圆环的位置,断开这两个圆环,再把新的圆环和这两个圆环首尾相接。
删除也是同理,只要读取到对应的元素,就能获取到上一个节点和下一个节点(需要双向链表),就可以直接把上一个节点的 next
指向下一个节点,把下一个节点的 prev
指向下一个节点就行了。
这个操作就像是把一串首尾相接的圆环,在其中某个圆环的位置,断开这个圆环的两段,再把两段的圆环收尾两个圆环首尾相接。
所以链表只要可以获取到当前要插入和删除的节点,就能拿到前后元素的指针,从而拿到前后元素。从而只要一步就能完成操作,所以复杂度是 O(1)
。
作为对比,数组的插入和删除的复杂度是 O(n)
,因为数组插入或删除数据后,为了保证数据的连贯性,需要移动其他元素的位置,数据越多移动的次数越多,所以是 O(n)
。
但是恰好相反的是,链表随机访问的复杂度是 O(n)
,也就是随着数据达到 n 个,逻辑操作需要 n 次。
因为链表是不能跳跃访问的,当你想要读取到第 114514 个节点的数据的时候,你只能从头部节点正向查找或者尾部节点反向查找。
作为对比,数组的随机访问的复杂度则是 O(1)
,因为数组会存储所有数据的索引,当你想要读取第 114514 个数据的时候,数据可以根据索引直接获取到对应的数据。
链表的适用场景
链表因为插入复杂删除复杂度低,并且天然具有连贯性,所以非常适合用来做任务调度,队列逻辑,以及一些链式结构的数据。
比如我想做一个连续调用接口的逻辑,我就可以把调用接口的时间放在链表的节点里,接口调用完成,就删掉对应的节点,还可以在运行过程中去添加或者删除还未调用接口的节点。
而如果用数组就会比较麻烦,你要把所有接口调用逻辑放进数组,然后在外面跑一个循环遍历数组,用来调用数组中的逻辑,而这时你想要取消某个未调用的接口就会非常麻烦了。你需要记录逻辑调用状态,知道自己逻辑走到哪一步了,然后再跳出循环,创建一个取消某个调用的新的数组,然后再去循环数组,然后跳过已经调用过的逻辑……
结语
总而言之,链表是一种也许会让你在某些时刻简化复杂逻辑的一种数据结构,在适当的时候使用就会有奇效。
# 数据结构 # 链表
评论