:root {
    --brand: #6d55fe;
    --brand-hover: #5d48e8;
    --text: #1d1d1f;
    --secondary: #6e6e73;
    --border: #e5e5e5;
    --fill: #eef1f5;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
}

html {
    background: #f6f7f9;
}

body {
    min-width: 320px;
    color: var(--text);
    background:
        radial-gradient(circle at 6% 0, rgba(109, 85, 254, .08), transparent 30rem),
        radial-gradient(circle at 94% 3%, rgba(55, 145, 255, .07), transparent 28rem),
        #f6f7f9;
    background-repeat: no-repeat;
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(109, 85, 254, .2);
    outline-offset: 2px;
}

.grid-container {
    width: min(1300px, calc(100% - 64px));
    max-width: none;
    margin-inline: auto;
}

main .grid-container,
footer .grid-container {
    width: calc(100% - 64px);
    max-width: 1300px;
}

.grid-container::before,
.grid-container::after {
    content: none;
    display: none;
}

/* 标题 */
.workspace {
    padding-top: 32px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 48px;
    margin-bottom: 32px;
}

.hero-copy {
    max-width: 900px;
}

.hero-kicker {
    display: block;
    margin-bottom: 9px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .08em;
}

.hero h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 650;
    line-height: 1.18;
    letter-spacing: -.035em;
}

.hero p {
    margin: 8px 0 0;
    color: var(--secondary);
    font-size: 14px;
    line-height: 1.75;
}

.hero-shortcuts {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding-bottom: 7px;
    color: #6e6e73;
    white-space: nowrap;
}

.hero-shortcuts span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
}

.hero-shortcuts i {
    color: #c7c7cc;
    font-style: normal;
}

.hero-shortcuts kbd {
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--brand);
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

/* 无外层卡片的编辑工作区 */
.editor-shell {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.control-panel {
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 0;
    background: rgba(238, 240, 244, .82);
}

.controller {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.control-label {
    color: #424245;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0;
}

.options input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
}

.options input[type="checkbox"] + label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 0;
    color: var(--secondary);
    background: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 20px;
    transition: color .15s ease;
}

.options input[type="checkbox"] + label::before {
    content: "";
    width: 18px;
    height: 18px;
    display: block;
    border: 1px solid #b9bbc1;
    border-radius: 0;
    background: #fff;
    transition: border-color .15s ease, background .15s ease;
}

.options input[type="checkbox"] + label::after,
.options input[type="checkbox"]:checked + label::after,
.options input[type="checkbox"]:not(:checked) + label::after {
    content: "";
    position: absolute;
    top: 7px;
    left: 5px;
    width: 8px;
    height: 5px;
    border: solid #fff;
    border-width: 0 0 2px 2px;
    opacity: 0;
    font-size: 0;
    transform: rotate(-45deg);
}

.options input[type="checkbox"]:checked + label {
    color: #424245;
    background: none;
}

.options input[type="checkbox"]:checked + label::before {
    border-color: var(--brand);
    background: var(--brand);
}

.options input[type="checkbox"]:checked + label::after {
    opacity: 1;
}

.options input[type="checkbox"]:focus-visible + label::before {
    outline: 3px solid rgba(109, 85, 254, .18);
    outline-offset: 2px;
}

.options label:hover {
    color: var(--text);
}

.format-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    min-width: 118px;
    padding: 0 18px;
    border: 0;
    border-radius: 0;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s ease;
}

.format-button svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.format-button:hover {
    background: var(--brand-hover);
}

.editor-card {
    padding: 0;
}

#demoInput {
    position: fixed;
    top: -100px;
    left: -100px;
    width: 1px;
    height: 1px;
    border: 0;
    opacity: 0;
}

/* CKEditor：系统工具栏感，取消按钮卡片 */
.cke_chrome {
    overflow: hidden !important;
    border: 1px solid var(--border) !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
}

.cke_top {
    padding: 9px 10px 4px !important;
    border: 0 !important;
    background: var(--fill) !important;
}

.cke_toolbar {
    margin-right: 4px !important;
}

.cke_toolgroup,
.cke_combo_button {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.cke_toolgroup {
    padding-right: 1px !important;
}

.cke_toolgroup a.cke_button:last-child::after,
.cke_combo::after {
    display: none !important;
}

.cke_button:hover,
.cke_button:focus,
.cke_button_on,
.cke_combo_button:hover,
.cke_combo_button:focus {
    border-color: transparent !important;
    border-radius: 0 !important;
    background: rgba(0, 0, 0, .055) !important;
    box-shadow: none !important;
}

.cke_contents {
    min-height: 510px;
    background: #fff;
}

.cke_bottom {
    min-height: 32px;
    display: flex !important;
    align-items: center;
    box-sizing: border-box !important;
    padding: 5px 10px !important;
    border: 0 !important;
    background: #fafafa !important;
}

.cke_notifications_area {
    display: none !important;
}

.cke_path {
    display: inline-block !important;
    order: 1;
    margin: 0 auto 0 0 !important;
    color: #86868b !important;
    line-height: 20px !important;
}

.cke_resizer {
    order: 2;
    margin-left: auto !important;
}

.cke_path_item,
.cke_path_empty {
    display: inline-flex !important;
    align-items: center;
    min-height: 20px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    color: #6e6e73 !important;
    font-size: 11px !important;
}

/* 轻量文本操作 */
.utility-bar {
    min-height: 62px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
}

.utility-label {
    color: #51545b;
    font-size: 12px;
    font-weight: 600;
}

.suspension {
    display: flex;
    gap: 8px;
    padding: 0;
}

.suspension button {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 112px;
    padding: 0 14px;
    border: 1px solid #d7dae0;
    border-radius: 0;
    color: #3f4249;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.suspension button > span {
    min-width: 24px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.suspension button:hover {
    border-color: #aaa0f7;
    color: var(--brand-hover);
    background: #f8f7ff;
}

/* 操作指南 */
.usage-guide {
    margin-top: 52px;
    padding-bottom: 36px;
}

.guide-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.guide-heading h2 {
    margin: 0;
    font-size: 23px;
    font-weight: 650;
    letter-spacing: -.025em;
}

.guide-heading p {
    margin: 0;
    color: var(--secondary);
    font-size: 13px;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 42px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-steps li {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 13px;
}

.step-number {
    padding-top: 2px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

.guide-steps h3 {
    margin: 0 0 6px;
    color: #333336;
    font-size: 14px;
    font-weight: 600;
}

.guide-steps p {
    margin: 0;
    color: var(--secondary);
    font-size: 12px;
    line-height: 1.7;
}

.footer-a {
    width: 100%;
    padding: 16px 0 20px;
    border: 0;
    color: #a1a1a6;
    background: #f6f7f9;
    font-size: 11px;
    text-align: center;
}

.footer-a .grid-container,
.footer-a p {
    margin: 0 auto;
}

.footer-a a {
    color: #86868b;
}

@media (max-width: 760px) {
    .grid-container {
        width: min(100% - 28px, 1300px);
    }

    main .grid-container,
    footer .grid-container {
        width: calc(100% - 28px);
    }

    .workspace {
        padding-top: 28px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 24px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 13px;
    }

    .hero-shortcuts {
        justify-content: start;
        flex-wrap: wrap;
        gap: 7px;
        padding-bottom: 0;
    }

    .editor-shell {
        width: 100%;
    }

    .control-panel,
    .editor-card {
        padding-right: 14px;
        padding-left: 14px;
    }

    .control-panel {
        margin-bottom: 10px;
        padding-top: 14px;
        padding-right: 14px;
        padding-bottom: 18px;
        padding-left: 14px;
    }

    .controller {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px 16px;
    }

    .format-button {
        width: 100%;
    }

    .cke_top {
        height: 50px !important;
        min-height: 0 !important;
        box-sizing: border-box !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 8px 7px 4px !important;
        white-space: nowrap;
        scrollbar-color: #c7c7cc transparent;
        scrollbar-width: thin;
    }

    .cke_top .cke_toolbox {
        display: block !important;
        height: 32px !important;
        line-height: 0 !important;
    }

    .cke_toolbar {
        float: none !important;
        display: inline-block !important;
        margin-right: 2px !important;
        vertical-align: top !important;
        white-space: normal;
    }

    .cke_toolbar_break {
        display: none !important;
    }

    .cke_top::-webkit-scrollbar {
        height: 3px;
    }

    .cke_top::-webkit-scrollbar-thumb {
        border-radius: 0;
        background: #c7c7cc;
    }

    .cke_contents {
        min-height: 410px;
    }

    .utility-bar {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-top: 6px;
    }

    .suspension {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .suspension button {
        min-width: 0;
        padding-inline: 4px;
        font-size: 11px;
    }

    .usage-guide {
        margin-top: 42px;
        padding-bottom: 28px;
    }

    .guide-heading {
        display: block;
        margin-bottom: 22px;
    }

    .guide-heading h2 {
        font-size: 21px;
    }

    .guide-heading p {
        margin-top: 5px;
    }

    .guide-steps {
        grid-template-columns: 1fr;
        gap: 20px;
    }

}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
    }
}
