/* Prompt Generator 系列 · 五便签学习指引 */
body.pg-guide-open {
    overflow: hidden;
}

body.pg-guide-open .qaw-fab,
body.pg-guide-open .qaw-panel {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

[data-pg-guide-trigger] {
    min-height: 44px;
}

[data-pg-guide-trigger]:focus-visible,
.pg-guide-close:focus-visible,
.pg-guide-tab:focus-visible,
.pg-guide-pane:focus-visible {
    outline: 3px solid var(--accent-color, #f6b73c);
    outline-offset: 3px;
}

.pg-guide-root {
    position: fixed;
    inset: 0;
    z-index: 100000;
    visibility: hidden;
    pointer-events: none;
}

.pg-guide-root.show {
    visibility: visible;
    pointer-events: auto;
}

.pg-guide-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .74);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity .24s ease;
}

.pg-guide-root.show .pg-guide-overlay {
    opacity: 1;
}

.pg-guide-dialog {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(620px, calc(100vw - 24px));
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
    border-left: 1px solid #3b3b3b;
    background: #101010;
    color: #e8e8e8;
    box-shadow: -18px 0 58px rgba(0, 0, 0, .52);
    transform: translateX(104%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.pg-guide-root.show .pg-guide-dialog {
    transform: translateX(0);
}

.pg-guide-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 14px;
    align-items: start;
    padding: 20px 20px 17px 24px;
    border-bottom: 1px solid #383327;
    background: linear-gradient(135deg, #2a2415 0%, #171717 62%, #121b20 100%);
}

.pg-guide-kicker {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 6px;
    color: #c9b77e;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.pg-guide-kicker span {
    display: inline-grid;
    min-height: 23px;
    place-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--accent-color, #f6b73c);
    color: var(--accent-contrast, #111);
    letter-spacing: .04em;
}

.pg-guide-head h2 {
    margin: 0;
    color: #fff;
    font-size: 1.42rem;
    line-height: 1.22;
}

.pg-guide-head p:last-child {
    max-width: 500px;
    margin: 7px 0 0;
    color: #a9a9a9;
    font-size: .78rem;
    line-height: 1.65;
}

.pg-guide-close {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid #3c3c3c;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    color: #aaa;
    font-size: 1.18rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.pg-guide-close:hover {
    background: #262626;
    color: #fff;
    transform: rotate(4deg);
}

.pg-guide-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 12px 14px 14px;
    border-bottom: 1px solid #303030;
    background: #151515;
}

.pg-guide-tab {
    --pg-note: #fff0aa;
    min-width: 0;
    min-height: 62px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 7px 3px;
    border: 2px solid transparent;
    border-radius: 5px 5px 10px 5px;
    background: var(--pg-note);
    color: #211e16;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .32);
    transform: rotate(-.7deg);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.pg-guide-tab:nth-child(2) { --pg-note: #d9f1e8; transform: rotate(.7deg); }
.pg-guide-tab:nth-child(3) { --pg-note: #e7e1fa; transform: rotate(-.45deg); }
.pg-guide-tab:nth-child(4) { --pg-note: #dcecf7; transform: rotate(.6deg); }
.pg-guide-tab:nth-child(5) { --pg-note: #f8dfe6; transform: rotate(-.55deg); }

.pg-guide-tab > span {
    font: 900 .62rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    opacity: .58;
}

.pg-guide-tab > b {
    font-size: .72rem;
    line-height: 1.25;
}

.pg-guide-tab-short {
    display: none;
}

.pg-guide-tab:hover {
    transform: translateY(-2px) rotate(0);
    box-shadow: 0 7px 14px rgba(0, 0, 0, .38);
}

.pg-guide-tab.is-active {
    border-color: var(--accent-color, #f6b73c);
    transform: translateY(2px) rotate(0);
    box-shadow: 0 3px 0 rgba(255, 255, 255, .16), 0 8px 16px rgba(0, 0, 0, .38);
}

.pg-guide-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 22px max(30px, env(safe-area-inset-bottom));
    background:
        repeating-linear-gradient(0deg, transparent 0 27px, rgba(255, 255, 255, .018) 27px 28px),
        #0c0c0c;
    scrollbar-width: thin;
    scrollbar-color: #505050 transparent;
}

.pg-guide-body::-webkit-scrollbar { width: 6px; }
.pg-guide-body::-webkit-scrollbar-thumb { border-radius: 9px; background: #505050; }
.pg-guide-pane[hidden] { display: none !important; }

.pg-guide-pane {
    animation: pgGuidePaneIn .18s ease-out;
}

@keyframes pgGuidePaneIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
}

.pg-guide-pane-head {
    margin-bottom: 14px;
}

.pg-guide-pane-head > p {
    margin: 0 0 5px;
    color: var(--accent-color, #f6b73c);
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.pg-guide-pane-head h3 {
    margin: 0;
    color: #fff;
    font-size: 1.12rem;
    line-height: 1.35;
}

.pg-guide-pane-head > span {
    display: block;
    margin-top: 6px;
    color: #999;
    font-size: .76rem;
    line-height: 1.7;
}

.pg-guide-formula {
    margin: 0 0 12px;
    padding: 11px 12px;
    border: 1px dashed #5a5141;
    border-radius: 10px;
    background: #18150e;
    color: #f2d680;
    font-size: .75rem;
    font-weight: 850;
    line-height: 1.65;
    text-align: center;
}

.pg-guide-formula i {
    padding: 0 4px;
    color: var(--accent-color, #f6b73c);
    font-style: normal;
}

.pg-guide-card-grid,
.pg-guide-concept-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.pg-guide-card,
.pg-guide-concept-grid article,
.pg-guide-step,
.pg-guide-dimension,
.pg-guide-prompt-layer {
    min-width: 0;
    border: 1px solid #303030;
    border-radius: 11px;
    background: #151515;
    box-shadow: 0 4px 13px rgba(0, 0, 0, .16);
}

.pg-guide-card,
.pg-guide-concept-grid article {
    padding: 12px;
}

.pg-guide-card:nth-child(1) { border-top: 3px solid #d99b25; }
.pg-guide-card:nth-child(2) { border-top: 3px solid #2ba57d; }
.pg-guide-card:nth-child(3) { border-top: 3px solid #8365d4; }
.pg-guide-card:nth-child(4) { border-top: 3px solid #4d8ec3; }

.pg-guide-card b,
.pg-guide-concept-grid b,
.pg-guide-dimension b,
.pg-guide-prompt-layer b {
    display: block;
    margin-bottom: 5px;
    color: #f1f1f1;
    font-size: .78rem;
}

.pg-guide-card p,
.pg-guide-concept-grid p,
.pg-guide-dimension p,
.pg-guide-prompt-layer p {
    margin: 0;
    color: #a7a7a7;
    font-size: .72rem;
    line-height: 1.68;
}

.pg-guide-concept-grid article:nth-child(1) { border-left: 3px solid #d99b25; }
.pg-guide-concept-grid article:nth-child(2) { border-left: 3px solid #2ba57d; }
.pg-guide-concept-grid article:nth-child(3) { border-left: 3px solid #8365d4; }
.pg-guide-concept-grid article:nth-child(4) { border-left: 3px solid #4d8ec3; }
.pg-guide-concept-grid article:nth-child(5) { border-left: 3px solid #a85f78; }
.pg-guide-concept-grid article:nth-child(6) { border-left: 3px solid #a9863a; }

.pg-guide-callout {
    margin-top: 12px;
    padding: 11px 13px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    border: 1px solid #3d3d3d;
    border-left: 4px solid var(--accent-color, #f6b73c);
    border-radius: 10px;
    background: #171717;
    font-size: .72rem;
    line-height: 1.7;
}

.pg-guide-callout b { color: #f1f1f1; white-space: nowrap; }
.pg-guide-callout span { color: #aaa; }
.pg-guide-callout.is-amber { border-color: #6f592b; background: #211b0e; }
.pg-guide-callout.is-green { border-color: #295d4b; background: #102019; }
.pg-guide-callout.is-violet { border-color: #4c3c74; background: #171328; }
.pg-guide-callout.is-blue { border-color: #31566f; background: #101c24; }

.pg-guide-step-list,
.pg-guide-dimension-list,
.pg-guide-prompt-stack {
    display: grid;
    gap: 9px;
}

.pg-guide-step {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
}

.pg-guide-step > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #d58f20;
    color: #fff;
    font: 900 .68rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.pg-guide-step:nth-child(2) > span { background: #169873; }
.pg-guide-step:nth-child(3) > span { background: #7251d2; }
.pg-guide-step:nth-child(4) > span { background: #317eb7; }
.pg-guide-step:nth-child(5) > span { background: #a65370; }
.pg-guide-step h4 { margin: 0 0 4px; color: #f3f3f3; font-size: .8rem; }
.pg-guide-step p { margin: 0; color: #aaa; font-size: .72rem; line-height: 1.68; }

.pg-guide-dimension {
    padding: 12px;
    border-left: 4px solid #d99b25;
}

.pg-guide-dimension:nth-child(2) { border-left-color: #2ba57d; }
.pg-guide-dimension:nth-child(3) { border-left-color: #8365d4; }
.pg-guide-dimension em {
    display: block;
    margin-top: 6px;
    color: #d5d5d5;
    font-size: .7rem;
    font-style: normal;
    line-height: 1.6;
}

.pg-guide-evidence-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.pg-guide-evidence-grid article {
    padding: 10px 11px;
    border: 1px solid #323232;
    border-radius: 9px;
    background: #131313;
}

.pg-guide-evidence-grid b { display: block; margin-bottom: 4px; color: #eee; font-size: .73rem; }
.pg-guide-evidence-grid p { margin: 0; color: #999; font-size: .69rem; line-height: 1.62; }

.pg-guide-prompt-layer {
    padding: 11px 12px;
    border-left: 5px solid #4e4e4e;
}

.pg-guide-prompt-layer.is-source { border-left-color: #d99b25; background: #1d190f; }
.pg-guide-prompt-layer.is-landing { border-left-color: #2ba57d; background: #101c17; }
.pg-guide-prompt-layer.is-variable { border-left-color: #8365d4; background: #171326; }
.pg-guide-prompt-layer.is-output { border-left-color: #4d8ec3; background: #101921; }
.pg-guide-prompt-layer > span { display: block; margin-bottom: 4px; color: #858585; font-size: .62rem; font-weight: 900; letter-spacing: .08em; }
.pg-guide-prompt-layer.is-variable > span { color: #b8a1f2; }

.pg-guide-example {
    margin-top: 11px;
    padding: 12px 13px;
    border: 1px solid #3d5d52;
    border-radius: 10px;
    background: #101b17;
}

.pg-guide-example b { display: block; margin-bottom: 6px; color: #71c6a9; font-size: .72rem; }
.pg-guide-example p { margin: 0; color: #c2cbc7; font-size: .72rem; line-height: 1.75; }

.pg-guide-rules {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 5px;
}

.pg-guide-rules li {
    position: relative;
    padding: 8px 9px 8px 26px;
    border-bottom: 1px dashed #333;
    color: #aaa;
    font-size: .71rem;
    line-height: 1.65;
}

.pg-guide-rules li::before {
    content: '✓';
    position: absolute;
    left: 6px;
    top: 8px;
    color: var(--accent-color, #f6b73c);
    font-weight: 900;
}

.pg-guide-rules b { color: #eee; }

@media (max-width: 560px) {
    .pg-guide-dialog { width: 100vw; }
    .pg-guide-head {
        padding: max(14px, env(safe-area-inset-top)) max(13px, env(safe-area-inset-right)) 13px max(16px, env(safe-area-inset-left));
        gap: 10px;
    }
    .pg-guide-head h2 { font-size: 1.22rem; }
    .pg-guide-head p:last-child { font-size: .72rem; line-height: 1.55; }
    .pg-guide-tabs { gap: 4px; padding: 8px 8px 10px; }
    .pg-guide-tab { min-height: 55px; padding: 5px 2px; }
    .pg-guide-tab > b { font-size: .67rem; }
    .pg-guide-body {
        padding: 16px max(13px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-left));
    }
    .pg-guide-pane-head h3 { font-size: 1.04rem; }
    .pg-guide-callout { grid-template-columns: 1fr; gap: 2px; }
    .pg-guide-callout b { white-space: normal; }
}

@media (max-width: 440px) {
    .pg-guide-tab-full { display: none; }
    .pg-guide-tab-short { display: block; }
    .pg-guide-tab > span { font-size: .55rem; }
    .pg-guide-tab > b { font-size: .64rem; }
    .pg-guide-card-grid,
    .pg-guide-concept-grid,
    .pg-guide-evidence-grid { grid-template-columns: 1fr; }
    .pg-guide-step { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 11px; }
    .pg-guide-step > span { width: 32px; height: 32px; }
}

@media (max-width: 350px) {
    .pg-guide-tabs { gap: 3px; padding-left: 5px; padding-right: 5px; }
    .pg-guide-tab { min-height: 52px; }
    .pg-guide-tab > b { font-size: .59rem; }
    .pg-guide-body { padding-left: 10px; padding-right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .pg-guide-overlay,
    .pg-guide-dialog,
    .pg-guide-tab,
    .pg-guide-close { transition: none !important; }
    .pg-guide-pane { animation: none; }
}
