:root {
    --faq-primary: #5b4cf0;
    --faq-primary-dark: #4438ca;
    --faq-accent: #8b5cf6;
    --faq-pink: #ec4899;
    --faq-text: #17203b;
    --faq-muted: #69758f;
    --faq-border: rgba(91, 76, 240, 0.14);
    --faq-surface: rgba(255, 255, 255, 0.92);
    --faq-shadow: 0 20px 55px -32px rgba(56, 40, 145, 0.48);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--faq-text);
    background:
        radial-gradient(circle at 8% 8%, rgba(99, 102, 241, 0.16), transparent 27rem),
        radial-gradient(circle at 94% 18%, rgba(236, 72, 153, 0.11), transparent 25rem),
        linear-gradient(145deg, #f6f7ff 0%, #f7f2ff 52%, #fff7fb 100%);
    font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
}

button, input { font: inherit; }

a { color: inherit; }

.faq-ambient {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(25px);
    pointer-events: none;
}

.faq-ambient-one { width: 18rem; height: 18rem; left: -8rem; top: 24rem; background: rgba(129, 140, 248, 0.12); }
.faq-ambient-two { width: 22rem; height: 22rem; right: -10rem; top: 42rem; background: rgba(244, 114, 182, 0.1); }

.faq-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    color: #fff;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.97), rgba(139, 92, 246, 0.97) 68%, rgba(192, 61, 152, 0.96));
    box-shadow: 0 12px 32px -22px rgba(49, 36, 132, 0.78);
    backdrop-filter: blur(16px);
}

.faq-topbar-inner {
    width: min(1160px, calc(100% - 2rem));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.faq-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.faq-brand-icon {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.15);
}

.faq-brand strong, .faq-brand small { display: block; }
.faq-brand strong { font-size: 1.05rem; line-height: 1.3; }
.faq-brand small { margin-top: 0.12rem; color: rgba(255, 255, 255, 0.76); font-size: 0.74rem; }

.faq-topbar-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.faq-topbar-actions .book-switcher__trigger { min-height: 44px; }

.faq-home,
.faq-topbar-actions .feedback-entry.faq-feedback {
    min-height: 44px;
    padding: 0.58rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--faq-primary-dark);
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.86rem !important;
    line-height: 1.4;
    white-space: nowrap;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.faq-home:hover { transform: translateY(-1px); background: #fff; }

.faq-topbar-actions .feedback-entry.faq-feedback {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.12);
}

.faq-topbar-actions .faq-feedback:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.22);
}

.faq-topbar-actions a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

.faq-main {
    width: min(1080px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.faq-hero {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    padding: clamp(2rem, 6vw, 4rem);
    border-radius: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
    color: #fff;
    background: linear-gradient(125deg, #5548ed 0%, #7c3aed 57%, #c13d98 100%);
    box-shadow: 0 30px 70px -38px rgba(70, 48, 185, 0.7);
}

.faq-hero::before, .faq-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
    pointer-events: none;
}

.faq-hero::before { width: 23rem; height: 23rem; right: -8rem; top: -13rem; }
.faq-hero::after { width: 14rem; height: 14rem; left: 42%; bottom: -10rem; }

.faq-hero-copy, .faq-search { position: relative; z-index: 1; }

.faq-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.faq-hero h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: 1.1; letter-spacing: 0.04em; }
.faq-hero p { max-width: 34rem; margin: 1rem 0 0; color: rgba(255, 255, 255, 0.8); font-size: 1rem; }

.faq-search label { display: block; margin: 0 0 0.65rem; font-size: 0.85rem; font-weight: 700; }

.faq-search-box {
    min-height: 58px;
    padding: 0 0.55rem 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

.faq-search-box:focus-within { border-color: rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.11); }

.faq-search-box input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
    font-size: 0.92rem;
}

.faq-search-box input::placeholder { color: rgba(255, 255, 255, 0.64); }
.faq-search-box input::-webkit-search-cancel-button { display: none; }

.faq-search-box button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.faq-session-note {
    margin: 1.4rem 0;
    padding: 1.15rem 1.25rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 0.95rem;
    background: rgba(236, 253, 245, 0.84);
    box-shadow: 0 12px 32px -28px rgba(5, 150, 105, 0.7);
}

.faq-session-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #047857;
    background: rgba(16, 185, 129, 0.13);
}

.faq-session-note strong { color: #065f46; font-size: 0.96rem; }
.faq-session-note p { margin: 0.16rem 0 0; color: #52736c; font-size: 0.85rem; }

.faq-filters {
    margin: 1.7rem 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.faq-filter {
    min-height: 42px;
    padding: 0.55rem 0.92rem;
    border: 1px solid var(--faq-border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--faq-muted);
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.faq-filter:hover { transform: translateY(-1px); color: var(--faq-primary); }
.faq-filter.is-active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--faq-primary), var(--faq-accent)); box-shadow: 0 12px 22px -16px rgba(79, 70, 229, 0.8); }

.faq-result-meta {
    min-height: 28px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--faq-muted);
    font-size: 0.8rem;
}

.faq-result-meta button { border: 0; color: var(--faq-primary); background: none; font-weight: 700; cursor: pointer; }

.faq-groups { display: grid; gap: 1.2rem; }

.faq-group {
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--faq-border);
    border-radius: 24px;
    background: var(--faq-surface);
    box-shadow: var(--faq-shadow);
    backdrop-filter: blur(12px);
}

.faq-group-heading {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.faq-group-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.faq-group-icon.materials { color: #4f46e5; background: #eef2ff; }
.faq-group-icon.method { color: #047857; background: #ecfdf5; }
.faq-group-icon.spelling { color: #b45309; background: #fffbeb; }
.faq-group-icon.pronunciation { color: #be185d; background: #fdf2f8; }
.faq-group-icon.access { color: #0e7490; background: #ecfeff; }

.faq-group-heading h2 { margin: 0; color: var(--faq-text); font-size: 1.12rem; line-height: 1.35; }
.faq-group-heading p { margin: 0.15rem 0 0; color: var(--faq-muted); font-size: 0.8rem; }

.faq-list { display: grid; gap: 0.65rem; }

.faq-item {
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, 0.14);
    border-radius: 15px;
    background: rgba(248, 250, 252, 0.76);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.faq-item:hover, .faq-item[open] { border-color: rgba(91, 76, 240, 0.24); background: #fff; }
.faq-item[open] { box-shadow: 0 14px 28px -26px rgba(59, 45, 155, 0.6); }

.faq-item summary {
    min-height: 56px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #26314f;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-question-copy {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    gap: 0.72rem;
}

.faq-question-number {
    width: 34px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5a50d5;
    background: #ececff;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.04em;
}

.faq-question-text {
    min-width: 0;
    padding-top: 0.12rem;
}

.faq-summary-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.faq-copy-link {
    min-height: 30px;
    padding: 0.3rem 0.52rem;
    border: 1px solid rgba(99, 102, 241, 0.14);
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    color: #6b65c8;
    background: rgba(238, 242, 255, 0.72);
    font-size: 0.66rem;
    font-weight: 750;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.faq-copy-link:hover {
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.32);
    background: #eef2ff;
}

.faq-copy-link.is-copied {
    color: #047857;
    border-color: rgba(16, 185, 129, 0.28);
    background: #ecfdf5;
}

.faq-chevron {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--faq-primary);
    background: rgba(99, 102, 241, 0.08);
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-chevron { transform: rotate(180deg); }

.faq-item:target {
    scroll-margin-top: 96px;
    border-color: rgba(91, 76, 240, 0.52);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 18px 34px -28px rgba(59, 45, 155, 0.72);
}

.faq-search-highlight {
    margin: 0 0.04em;
    padding: 0.04em 0.18em;
    border-radius: 0.28em;
    color: #4c1d95;
    background: linear-gradient(135deg, #fef08a, #fde68a);
    box-shadow: inset 0 -1px 0 rgba(217, 119, 6, 0.16);
    font-weight: 850;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.faq-answer { padding: 0 1rem 1rem; color: #64708a; font-size: 0.88rem; }
.faq-answer::before { content: ""; display: block; height: 1px; margin: 0 0 0.85rem; background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), transparent); }
.faq-answer p { margin: 0; white-space: pre-line; }
.faq-answer p + p { margin-top: 0.85rem; }
.faq-answer a { color: var(--faq-primary); font-weight: 650; overflow-wrap: anywhere; }

.faq-answer-image {
    max-width: 720px;
    margin: 1rem auto 0;
    padding: 0.55rem;
    border: 1px solid rgba(91, 76, 240, 0.12);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 34px -30px rgba(45, 37, 126, 0.72);
}

.faq-answer-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 11px;
}

.faq-empty {
    padding: 3rem 1rem;
    border: 1px dashed rgba(99, 102, 241, 0.24);
    border-radius: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.68);
}

.faq-empty > span { width: 58px; height: 58px; margin: 0 auto; border-radius: 18px; display: flex; align-items: center; justify-content: center; color: var(--faq-primary); background: #eef2ff; font-size: 1.3rem; }
.faq-empty h2 { margin: 1rem 0 0; font-size: 1.15rem; }
.faq-empty p { margin: 0.3rem 0 1rem; color: var(--faq-muted); font-size: 0.87rem; }
.faq-empty button { min-height: 42px; padding: 0.55rem 1rem; border: 0; border-radius: 999px; color: #fff; background: var(--faq-primary); font-weight: 700; cursor: pointer; }

.faq-systems { margin-top: 3rem; }
.faq-section-title { margin-bottom: 1rem; text-align: center; }
.faq-section-title span { color: var(--faq-primary); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.18em; }
.faq-section-title h2 { margin: 0.25rem 0 0; font-size: clamp(1.35rem, 4vw, 1.8rem); }

.faq-system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }

.faq-system-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--faq-border);
    border-radius: 18px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--faq-shadow);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faq-system-card:hover { transform: translateY(-3px); box-shadow: 0 24px 42px -30px rgba(63, 47, 169, 0.65); }

.faq-system-icon { width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; }
.faq-system-card.spell .faq-system-icon { color: #4f46e5; background: #eef2ff; }
.faq-system-card.trans .faq-system-icon { color: #be185d; background: #fdf2f8; }
.faq-system-card.sentence .faq-system-icon { color: #0e7490; background: #ecfeff; }
.faq-system-card.speed .faq-system-icon { color: #b15b0e; background: #fff0df; }
.faq-system-card strong, .faq-system-card small { display: block; }
.faq-system-card strong { overflow: hidden; color: #26314f; font-size: 0.92rem; text-overflow: ellipsis; white-space: nowrap; }
.faq-system-card small { margin-top: 0.12rem; color: var(--faq-muted); font-size: 0.74rem; }
.faq-system-card > .fa-arrow-right { color: #9ca3af; font-size: 0.8rem; }

.faq-footer { padding: 1.4rem 1rem 2rem; color: #8b93a8; text-align: center; font-size: 0.75rem; }

[hidden] { display: none !important; }

@media (max-width: 820px) {
    .faq-hero { grid-template-columns: 1fr; min-height: 0; }
    .faq-search { max-width: 620px; }
    .faq-system-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .faq-topbar-actions .book-switcher { position: static; }
    .faq-topbar-actions .book-switcher__menu { position: absolute; top: calc(100% + 0.7rem); right: 0; max-height: calc(100dvh - 160px); overflow-y: auto; }
    .faq-home { width: 44px; padding: 0; justify-content: center; }
    .faq-home span { display: none; }
    .faq-topbar-actions .book-switcher__trigger { width: 44px; }
}

@media (max-width: 700px) {
    .faq-topbar-inner { flex-wrap: wrap; padding: 0.75rem 0; }
    .faq-brand { flex-basis: 100%; }
    .faq-topbar-actions { width: 100%; margin-left: 0; justify-content: flex-end; }
}

@media (max-width: 560px) {
    .faq-topbar-inner { width: calc(100% - 1.25rem); min-height: 68px; }
    .faq-brand small { display: none; }
    .faq-brand strong { font-size: 0.92rem; }
    .faq-brand-icon { width: 40px; height: 40px; }
    .faq-main { width: calc(100% - 1rem); padding-top: 0.75rem; }
    .faq-hero { padding: 1.55rem 1.15rem; border-radius: 21px; gap: 1.5rem; }
    .faq-hero h1 { font-size: 2.35rem; }
    .faq-hero p { font-size: 0.88rem; }
    .faq-search-box { min-height: 54px; }
    .faq-session-note { align-items: flex-start; padding: 1rem; }
    .faq-filters { flex-wrap: nowrap; margin-left: -0.5rem; margin-right: -0.5rem; padding: 0 0.5rem 0.4rem; overflow-x: auto; scrollbar-width: none; }
    .faq-filters::-webkit-scrollbar { display: none; }
    .faq-filter { flex: 0 0 auto; }
    .faq-group { border-radius: 19px; }
    .faq-item summary { padding: 0.8rem 0.85rem; font-size: 0.87rem; }
    .faq-question-copy { grid-template-columns: 30px minmax(0, 1fr); gap: 0.55rem; }
    .faq-question-number { width: 30px; height: 26px; }
    .faq-copy-link { width: 30px; padding: 0; }
    .faq-copy-link span { display: none; }
    .faq-answer { padding: 0 0.85rem 0.9rem; font-size: 0.84rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}
