
body {
    margin: 0;
    background-color: #1a1a1a;
    color: #eff2f6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body.light-theme { background-color: #ffffff; color: #1a1a1a; }

.fq {
    --fq-panel: #202020;
    --fq-panel-2: #262626;
    --fq-border: #2e2e2e;
    --fq-text: #eff2f6;
    --fq-muted: #8a8f98;
    --fq-soft: #a8adb5;
    --fq-green: #3fb950;
    --fq-green-bg: rgba(63, 185, 80, .14);
    --fq-red: #f85149;
    --fq-red-bg: rgba(248, 81, 73, .14);
    --fq-btn-bg: #ffffff;
    --fq-btn-fg: #1a1a1a;
    --fq-btn-hover: #e0e0e0;
    --fq-link: #8ab4f8;
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 20px 80px;
    box-sizing: border-box;
    color: var(--fq-text);
}
body.light-theme .fq {
    --fq-panel: #fafafa;
    --fq-panel-2: #f3f3f3;
    --fq-border: #e6e6e6;
    --fq-text: #1a1a1a;
    --fq-muted: #777;
    --fq-soft: #555;
    --fq-green: #1a7f37;
    --fq-green-bg: rgba(26, 127, 55, .12);
    --fq-red: #cf222e;
    --fq-red-bg: rgba(207, 34, 46, .1);
    --fq-btn-bg: #1a1a1a;
    --fq-btn-fg: #ffffff;
    --fq-btn-hover: #333333;
    --fq-link: #0b57d0;
}
.fq *, .fq *::before, .fq *::after { box-sizing: border-box; }
.fq a:not(.fq-btn) { color: inherit; }


.fq-crumbs { font-size: 13px; color: var(--fq-muted); margin-bottom: 14px; }
.fq-crumbs a { color: var(--fq-muted); text-decoration: none; }
.fq-crumbs a:hover { color: var(--fq-text); }
.fq-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.fq-title { margin: 0 0 6px; font-size: 32px; font-weight: 700; letter-spacing: -.8px; line-height: 1.15; overflow-wrap: anywhere; }
.fq-lead { margin: 0; font-size: 14px; line-height: 1.6; color: var(--fq-muted); max-width: 560px; }

.fq-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--fq-btn-bg); color: var(--fq-btn-fg);
    border: 1px solid transparent; border-radius: 6px;
    padding: 9px 16px; font-size: 14px; font-weight: 500; font-family: inherit;
    cursor: pointer; text-decoration: none; transition: background .15s ease, opacity .15s ease;
}
.fq-btn:hover { background: var(--fq-btn-hover); }
.fq-btn:disabled, .fq-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.fq-btn--ghost { background: transparent; color: var(--fq-text); border-color: var(--fq-border); }
.fq-btn--ghost:hover { background: var(--fq-panel-2); }
.fq-btn--small { padding: 6px 11px; font-size: 13px; }
.fq-btn--green { background: var(--fq-green); color: #fff; }
.fq-btn--green:hover { background: var(--fq-green); opacity: .88; }

.fq-input, .fq-textarea {
    width: 100%; background: var(--fq-panel); color: var(--fq-text);
    border: 1px solid var(--fq-border); border-radius: 6px;
    padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none;
    transition: border-color .15s ease;
}
.fq-input:focus, .fq-textarea:focus { border-color: var(--fq-muted); }
.fq-textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
.fq-input:disabled, .fq-textarea:disabled { opacity: .5; cursor: not-allowed; }


.fq-tag {
    display: inline-flex; align-items: center; gap: 5px; vertical-align: middle;
    padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.fq-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fq-tag--solved { color: var(--fq-green); background: var(--fq-green-bg); }
.fq-tag--open   { color: var(--fq-red);   background: var(--fq-red-bg); }
.fq-tag--author { color: var(--fq-soft); background: var(--fq-panel-2); border: 1px solid var(--fq-border); }
.fq-tag--author::before { display: none; }


.fq-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.fq-tabs { display: flex; gap: 4px; background: var(--fq-panel); border: 1px solid var(--fq-border); border-radius: 8px; padding: 3px; }
.fq-tab {
    background: none; border: 0; color: var(--fq-muted); font: inherit; font-size: 13px; font-weight: 500;
    padding: 6px 12px; border-radius: 6px; cursor: pointer;
}
.fq-tab:hover { color: var(--fq-text); }
.fq-tab.is-active { background: var(--fq-panel-2); color: var(--fq-text); }
.fq-search { flex: 1 1 220px; max-width: 320px; }


.fq-list { border: 1px solid var(--fq-border); border-radius: 10px; background: var(--fq-panel); overflow: hidden; }
.fq-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--fq-border); }
.fq-row:last-child { border-bottom: 0; }
.fq-row:hover { background: var(--fq-panel-2); }
.fq-row-main { flex: 1; min-width: 0; }
.fq-row-title { margin: 0 0 4px; font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.fq-row-title a { text-decoration: none; margin-right: 8px; }
.fq-row-title a:hover { text-decoration: underline; }
.fq-row-meta { font-size: 12.5px; color: var(--fq-muted); display: flex; gap: 6px; flex-wrap: wrap; }
.fq-row-meta a { text-decoration: none; }
.fq-row-meta a:hover { color: var(--fq-text); text-decoration: underline; }
.fq-row-stat { text-align: center; min-width: 54px; font-size: 12px; color: var(--fq-muted); }
.fq-row-stat b { display: block; font-size: 17px; color: var(--fq-text); font-weight: 600; }

.fq-avatar {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
    background: var(--fq-panel-2); border: 1px solid var(--fq-border);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600; color: var(--fq-soft); text-transform: uppercase; user-select: none;
}

.fq-state { padding: 46px 20px; text-align: center; color: var(--fq-muted); font-size: 14px; }
.fq-state h3 { margin: 0 0 6px; color: var(--fq-text); font-size: 17px; }
.fq-pager { display: flex; justify-content: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }


.fq-notice {
    border: 1px solid var(--fq-border); background: var(--fq-panel); border-radius: 8px;
    padding: 12px 14px; font-size: 13.5px; line-height: 1.55; color: var(--fq-soft); margin-bottom: 16px;
}
.fq-notice--warn { border-color: var(--fq-red); background: var(--fq-red-bg); color: var(--fq-text); }
.fq-notice--ok { border-color: var(--fq-green); background: var(--fq-green-bg); color: var(--fq-text); }
.fq-notice a { color: var(--fq-link); }


.fq-form { display: flex; flex-direction: column; gap: 20px; }
.fq-field label, .fq-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; }
.fq-hint { font-size: 12.5px; color: var(--fq-muted); margin-top: 6px; line-height: 1.5; }
.fq-counter { float: right; font-weight: 400; color: var(--fq-muted); font-size: 12px; }
.fq-link-row { display: flex; gap: 8px; margin-bottom: 8px; }
.fq-link-row .fq-input { flex: 1; }
.fq-error { color: var(--fq-red); font-size: 13px; min-height: 18px; }
.fq-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.fq-card { border: 1px solid var(--fq-border); background: var(--fq-panel); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.fq-post-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.fq-post-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.25; overflow-wrap: anywhere; }
.fq-meta-grid { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--fq-muted); margin: 10px 0 14px; }
.fq-meta-grid b { color: var(--fq-text); font-weight: 600; }
.fq-meta-grid a { color: var(--fq-text); }
.fq-body { font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.fq-toolbar-post { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--fq-border); }

.fq-link {
    color: var(--fq-link); text-decoration: underline; text-underline-offset: 2px;
    cursor: pointer; overflow-wrap: anywhere;
}
.fq-link:hover { opacity: .85; }
.fq-link:focus-visible { outline: 2px solid var(--fq-link); outline-offset: 2px; border-radius: 2px; }


.fq-media { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.fq-media-item { border: 1px solid var(--fq-border); border-radius: 8px; background: var(--fq-panel-2); overflow: hidden; }
.fq-media-item img, .fq-media-item video { display: block; max-width: 100%; max-height: 520px; margin: 0 auto; background: #000; }
.fq-media-item iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.fq-media-cap { padding: 8px 12px; font-size: 12.5px; color: var(--fq-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--fq-border); }
.fq-media-item--link { padding: 10px 12px; font-size: 14px; border-top: 0; }


.fq-timeline { list-style: none; margin: 0; padding: 0; }
.fq-timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13.5px; line-height: 1.5; }
.fq-timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--fq-muted); }
.fq-timeline li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--fq-border); }
.fq-timeline li:last-child { padding-bottom: 0; }
.fq-timeline li:last-child::after { display: none; }
.fq-timeline li.ev-solved::before { background: var(--fq-green); }
.fq-timeline li.ev-reopened::before { background: var(--fq-red); }
.fq-timeline time { display: block; color: var(--fq-muted); font-size: 12px; }
.fq-section-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; }


.fq-chat { border: 1px solid var(--fq-border); border-radius: 10px; background: var(--fq-panel); overflow: hidden; }
.fq-chat-head { padding: 12px 16px; border-bottom: 1px solid var(--fq-border); font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.fq-chat-head span { color: var(--fq-muted); font-weight: 400; }
.fq-msgs { max-height: 560px; overflow-y: auto; padding: 6px 0; }
.fq-msg { display: flex; gap: 12px; padding: 10px 16px; position: relative; }
.fq-msg:hover { background: var(--fq-panel-2); }
.fq-msg.is-new { animation: fq-flash 1.6s ease-out; }
@keyframes fq-flash { from { background: var(--fq-green-bg); } to { background: transparent; } }
.fq-msg-body { flex: 1; min-width: 0; }
.fq-msg-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-bottom: 3px; }
.fq-msg-top a { font-weight: 600; text-decoration: none; }
.fq-msg-top a:hover { text-decoration: underline; }
.fq-msg-top time { color: var(--fq-muted); font-size: 12px; }
.fq-msg-text { font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.fq-msg-more {
    position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--fq-muted);
    font-size: 18px; line-height: 1; padding: 2px 8px; border-radius: 4px; cursor: pointer; opacity: 0;
}
.fq-msg:hover .fq-msg-more, .fq-msg-more:focus-visible { opacity: 1; }
.fq-msg-more:hover { background: var(--fq-border); color: var(--fq-text); }
@media (hover: none) { .fq-msg-more { opacity: .8; } }
.fq-empty-chat { padding: 34px 16px; text-align: center; color: var(--fq-muted); font-size: 14px; }

.fq-composer { border-top: 1px solid var(--fq-border); padding: 14px 16px; }
.fq-composer .fq-textarea { min-height: 78px; }
.fq-composer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.fq-composer .fq-hint { margin: 0; }
.fq-locked { border-top: 1px solid var(--fq-border); padding: 16px; text-align: center; font-size: 14px; color: var(--fq-soft); line-height: 1.55; }
.fq-locked a { color: var(--fq-link); }


.fq-ctx {
    position: fixed; z-index: 10000; min-width: 220px; padding: 5px;
    background: #262626; color: #eff2f6; border: 1px solid #3a3a3a; border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
body.light-theme .fq-ctx { background: #fff; color: #1a1a1a; border-color: #e0e0e0; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.fq-ctx button {
    display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit;
    font: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 5px; cursor: pointer;
}
.fq-ctx button:hover, .fq-ctx button:focus-visible { background: rgba(127, 127, 127, .18); outline: none; }
.fq-ctx button.danger { color: #f85149; }
.fq-ctx hr { border: 0; border-top: 1px solid rgba(127, 127, 127, .25); margin: 4px 0; }

@media (max-width: 600px) {
    .fq { padding: 20px 14px 60px; }
    .fq-title { font-size: 26px; }
    .fq-post-title { font-size: 21px; }
    .fq-card { padding: 14px; }
    .fq-row { padding: 12px; gap: 10px; }
    .fq-row .fq-avatar { display: none; }
    .fq-search { max-width: none; flex-basis: 100%; }
    .fq-msg { padding: 10px 12px; }
}


.fq-body .fq-media-item, .fq-msg-text .fq-media-item { margin: 10px 0; white-space: normal; max-width: 640px; }


.fq [hidden] { display: none !important; }
