/* ===================================================================
   撩话大师 (Flirt Master) - 专属样式
   主题色：浪漫玫瑰 #f43f5e → 少女紫 #c084fc → 甜蜜粉 #fb7185
   =================================================================== */

/* ---- CSS 变量 ---- */
:root {
    --fm-primary:       #f43f5e;
    --fm-primary-dark:  #e11d48;
    --fm-secondary:     #c084fc;
    --fm-accent:        #fb7185;
    --fm-gold:          #f59e0b;
    --fm-bg:            #fff1f2;
    --fm-surface:       #ffffff;
    --fm-surface2:      #fff0f3;
    --fm-border:        #fecdd3;
    --fm-border2:       #fda4af;
    --fm-text:          #1f0a0e;
    --fm-text2:         #4c0519;
    --fm-text-muted:    #9f1239;
    --fm-toolbar-bg:    linear-gradient(100deg, #1f0a0e 0%, #4c0519 50%, #2d0a4e 100%);
    --fm-toolbar-text:  #fff1f2;
    --fm-shadow:        0 2px 12px rgba(244, 63, 94, .1);
    --fm-shadow-md:     0 4px 24px rgba(244, 63, 94, .15);
    --fm-radius:        10px;
    --fm-radius-sm:     6px;
    --fm-toolbar-h:     52px;
    --fm-history-w:     220px;
    --fm-input-w:       360px;
}

/* 暗黑模式变量 */
body.dark {
    --fm-bg:        #1a0a0d;
    --fm-surface:   #240a10;
    --fm-surface2:  #1e0a0d;
    --fm-border:    #4a1020;
    --fm-border2:   #6b1530;
    --fm-text:      #fef2f2;
    --fm-text2:     #fecdd3;
    --fm-text-muted:#fb7185;
    --fm-shadow:    0 2px 12px rgba(0,0,0,.45);
    --fm-shadow-md: 0 4px 24px rgba(0,0,0,.55);
}

/* ===== 主容器 ===== */
.fm-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 130px);
    min-height: 500px;
    background: var(--fm-bg);
    border: 1px solid var(--fm-border);
    border-radius: var(--fm-radius);
    overflow: hidden;
    box-shadow: var(--fm-shadow-md);
    transition: background .25s, border-color .25s;
}

.fm-container.fullscreen-mode {
    position: fixed;
    inset: 0;
    z-index: 9999;
    height: 100vh !important;
    border-radius: 0;
    border: none;
}

/* ===== 工具栏 ===== */
.fm-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: var(--fm-toolbar-h);
    background: var(--fm-toolbar-bg);
    color: var(--fm-toolbar-text);
    flex-shrink: 0;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

/* 工具栏心跳渐变装饰条 */
.fm-toolbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(to right,
    #f43f5e, #fb7185, #c084fc, #f43f5e,
    #e879f9, #fb7185, #f43f5e);
    background-size: 200% 100%;
    animation: fmBarShimmer 4s ease-in-out infinite;
}

@keyframes fmBarShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fda4af;
    letter-spacing: .3px;
    white-space: nowrap;
    margin-right: 4px;
    text-shadow: 0 0 12px rgba(244,63,94,.6);
}

.fm-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 5px;
    background: rgba(255,255,255,.08);
    color: #fecdd3;
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, border-color .18s, color .18s;
}
.fm-toolbar-btn:hover {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.35);
    color: #fff;
}
.fm-toolbar-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.fm-toolbar-btn-primary {
    background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(244,63,94,.45);
}
.fm-toolbar-btn-primary:hover {
    background: linear-gradient(135deg, #fb7185, #f43f5e) !important;
    box-shadow: 0 4px 14px rgba(244,63,94,.6);
}
.fm-toolbar-btn-primary.fm-btn-loading {
    background: linear-gradient(90deg, #881337, #e11d48, #881337, #be123c) !important;
    background-size: 300% 100% !important;
    animation: fmShimmer .8s infinite linear;
    box-shadow: none;
}
.fm-toolbar-btn-cancel {
    background: rgba(244,63,94,.18) !important;
    border-color: rgba(244,63,94,.35) !important;
    color: #fca5a5 !important;
}
.fm-toolbar-btn-cancel:hover {
    background: rgba(244,63,94,.32) !important;
}

@keyframes fmShimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

body.dark .fm-toolbar-btn-primary.fm-btn-loading {
    background: linear-gradient(90deg, #881337, #be123c, #881337, #9f1239) !important;
    background-size: 300% 100% !important;
    animation: fmShimmer .8s infinite linear;
}

/* ===== 主内容区 ===== */
.fm-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== 历史记录面板（左） ===== */
.fm-history-panel {
    width: var(--fm-history-w);
    min-width: 180px;
    display: flex;
    flex-direction: column;
    background: var(--fm-surface2);
    border-right: 1px solid var(--fm-border);
    transition: background .25s, border-color .25s;
    flex-shrink: 0;
}

.fm-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--fm-border);
    flex-shrink: 0;
}
.fm-history-header h3 {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fm-text2);
    white-space: nowrap;
}

.fm-history-count {
    font-size: 11px;
    color: var(--fm-text-muted);
    font-weight: 400;
    margin-left: 4px;
}

.fm-history-clear-btn {
    background: none;
    border: none;
    color: var(--fm-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .18s, background .18s;
    line-height: 1;
}
.fm-history-clear-btn:hover {
    color: #ef4444;
    background: rgba(239,68,68,.1);
}

.fm-history-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--fm-border);
    flex-shrink: 0;
}
.fm-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid var(--fm-border);
    border-radius: 5px;
    font-size: 12px;
    background: var(--fm-surface);
    color: var(--fm-text);
    outline: none;
    transition: border-color .18s;
    box-sizing: border-box;
}
.fm-history-search input:focus {
    border-color: var(--fm-primary);
}
body.dark .fm-history-search input {
    background: var(--fm-surface2);
}

.fm-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.fm-history-empty {
    text-align: center;
    color: var(--fm-text-muted);
    font-size: 12px;
    padding: 24px 8px;
    opacity: .7;
}

.fm-history-item {
    position: relative;
    padding: 10px 28px 10px 11px;
    border-radius: 7px;
    cursor: pointer;
    margin-bottom: 4px;
    border: 1px solid transparent;
    transition: background .18s, border-color .18s;
    background: var(--fm-surface);
}
.fm-history-item:hover {
    background: var(--fm-surface);
    border-color: var(--fm-border2);
}
.fm-history-item.active {
    background: rgba(244,63,94,.08);
    border-color: rgba(244,63,94,.35);
    box-shadow: inset 3px 0 0 #3b82f6;
}
body.dark .fm-history-item {
    background: rgba(255,255,255,.04);
}
body.dark .fm-history-item:hover {
    background: rgba(255,255,255,.08);
}
body.dark .fm-history-item.active {
    background: rgba(244,63,94,.12);
    box-shadow: inset 3px 0 0 #3b82f6;
}

.fm-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--fm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.fm-history-item-meta {
    font-size: 11px;
    color: var(--fm-text-muted);
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.fm-history-tag {
    background: rgba(244,63,94,.12);
    color: var(--fm-primary-dark);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 10.5px;
    font-weight: 500;
}
body.dark .fm-history-tag {
    background: rgba(244,63,94,.22);
    color: #fb7185;
}

.fm-history-del-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--fm-text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity .18s, color .18s, background .18s;
}
.fm-history-item:hover .fm-history-del-btn {
    opacity: 1;
}
.fm-history-del-btn:hover {
    color: #ef4444;
    background: rgba(239,68,68,.1);
}

/* ===== 输入面板（中） ===== */
.fm-input-panel {
    width: var(--fm-input-w);
    min-width: 280px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--fm-border);
    background: var(--fm-surface);
    transition: background .25s, border-color .25s;
    flex-shrink: 0;
}

.fm-panel-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--fm-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 44px;
}
.fm-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--fm-text);
    white-space: nowrap;
}
body.dark .fm-panel-header h3 {
    color: var(--fm-text);
}
.fm-panel-tip {
    font-size: 11px;
    color: var(--fm-text-muted);
    text-align: right;
}

.fm-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fm-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.fm-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--fm-text2);
    display: flex;
    align-items: center;
    gap: 4px;
}
.fm-required {
    color: #ef4444;
    font-size: 13px;
}
.fm-optional {
    font-size: 11px;
    color: var(--fm-text-muted);
    font-weight: 400;
}

.fm-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--fm-border);
    border-radius: 7px;
    font-size: 13px;
    color: var(--fm-text);
    background: var(--fm-surface);
    resize: vertical;
    outline: none;
    line-height: 1.6;
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
    font-family: inherit;
}
.fm-textarea:focus {
    border-color: var(--fm-primary);
    box-shadow: 0 0 0 3px rgba(244,63,94,.12);
}
body.dark .fm-textarea {
    background: var(--fm-surface2);
    border-color: var(--fm-border);
    color: var(--fm-text);
}

.fm-char-counter {
    font-size: 11px;
    color: var(--fm-text-muted);
    text-align: right;
    margin-top: -4px;
}
.fm-char-counter.warn { color: #f59e0b; }
.fm-char-counter.over { color: #ef4444; font-weight: 600; }

.fm-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--fm-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--fm-text);
    background: var(--fm-surface);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
}
.fm-input:focus {
    border-color: var(--fm-primary);
    box-shadow: 0 0 0 3px rgba(244,63,94,.12);
}
body.dark .fm-input {
    background: var(--fm-surface2);
    border-color: var(--fm-border);
    color: var(--fm-text);
}

/* ===== 场景类型网格 ===== */
.fm-scene-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.fm-scene-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border: 1.5px solid var(--fm-border);
    border-radius: 8px;
    background: var(--fm-surface);
    cursor: pointer;
    font-size: 11px;
    color: var(--fm-text2);
    transition: all .18s;
    white-space: nowrap;
}
.fm-scene-btn .scene-icon { font-size: 20px; line-height: 1; }
.fm-scene-btn .scene-label { font-size: 10.5px; font-weight: 600; }
.fm-scene-btn:hover {
    border-color: var(--fm-primary);
    background: rgba(244,63,94,.06);
    color: var(--fm-primary-dark);
}
.fm-scene-btn.selected {
    border-color: var(--fm-primary);
    background: rgba(244,63,94,.12);
    color: var(--fm-primary-dark);
    box-shadow: 0 0 0 2px rgba(244,63,94,.2);
}
body.dark .fm-scene-btn {
    background: var(--fm-surface2);
    border-color: var(--fm-border);
    color: var(--fm-text);
}
body.dark .fm-scene-btn:hover,
body.dark .fm-scene-btn.selected {
    border-color: #fb7185;
    background: rgba(244,63,94,.15);
    color: #fb7185;
}

/* ===== 撩话风格 ===== */
.fm-style-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fm-style-btn {
    padding: 5px 12px;
    border: 1.5px solid var(--fm-border);
    border-radius: 20px;
    background: var(--fm-surface);
    cursor: pointer;
    font-size: 12px;
    color: var(--fm-text2);
    white-space: nowrap;
    transition: all .18s;
    font-weight: 500;
}
.fm-style-btn:hover {
    border-color: var(--fm-secondary);
    background: rgba(192,132,252,.07);
    color: var(--fm-secondary);
}
.fm-style-btn.selected {
    border-color: var(--fm-secondary);
    background: rgba(192,132,252,.12);
    color: var(--fm-secondary);
    box-shadow: 0 0 0 2px rgba(192,132,252,.2);
}
body.dark .fm-style-btn {
    background: var(--fm-surface2);
    border-color: var(--fm-border);
    color: var(--fm-text);
}
body.dark .fm-style-btn:hover,
body.dark .fm-style-btn.selected {
    border-color: #d8b4fe;
    background: rgba(192,132,252,.18);
    color: #d8b4fe;
}

/* ===== 输出形式 ===== */
.fm-format-row {
    display: flex;
    gap: 6px;
}

.fm-format-btn {
    flex: 1;
    padding: 8px 6px;
    border: 1.5px solid var(--fm-border);
    border-radius: 8px;
    background: var(--fm-surface);
    cursor: pointer;
    font-size: 12px;
    color: var(--fm-text2);
    text-align: center;
    transition: all .18s;
}
.fm-format-btn .format-icon  { font-size: 16px; display: block; margin-bottom: 2px; }
.fm-format-btn .format-label { font-weight: 600; display: block; font-size: 11.5px; }
.fm-format-btn .format-desc  { font-size: 10px; color: var(--fm-text-muted); display: block; margin-top: 1px; }
.fm-format-btn:hover {
    border-color: var(--fm-gold);
    background: rgba(245,158,11,.07);
    color: #92400e;
}
.fm-format-btn.selected {
    border-color: var(--fm-gold);
    background: rgba(245,158,11,.12);
    color: #92400e;
    box-shadow: 0 0 0 2px rgba(245,158,11,.2);
}
body.dark .fm-format-btn {
    background: var(--fm-surface2);
    border-color: var(--fm-border);
    color: var(--fm-text);
}
body.dark .fm-format-btn:hover,
body.dark .fm-format-btn.selected {
    border-color: #fbbf24;
    background: rgba(245,158,11,.18);
    color: #fbbf24;
}
body.dark .fm-format-btn .format-desc {
    color: var(--fm-text-muted);
}

/* ===== 嵌入式操作按钮 ===== */
.fm-input-footer {
    padding: 10px 14px 12px;
    border-top: 1px solid var(--fm-border);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.fm-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .18s;
    margin-bottom: 14px;
}
.fm-inline-btn-primary {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    box-shadow: 0 2px 8px rgba(244,63,94,.4);
}
.fm-inline-btn-primary:hover {
    background: linear-gradient(135deg, #fb7185, #f43f5e);
    box-shadow: 0 4px 14px rgba(244,63,94,.55);
}
.fm-inline-btn-primary.fm-btn-loading {
    background: linear-gradient(90deg, #881337, #e11d48, #881337) !important;
    background-size: 300% 100% !important;
    animation: fmShimmer .8s infinite linear;
    box-shadow: none;
}
.fm-inline-btn-cancel {
    background: rgba(244,63,94,.1);
    color: var(--fm-primary-dark);
    border: 1px solid rgba(244,63,94,.3);
}
.fm-inline-btn-cancel:hover {
    background: rgba(244,63,94,.2);
}
body.dark .fm-inline-btn-cancel {
    color: #fb7185;
    background: rgba(244,63,94,.12);
    border-color: rgba(244,63,94,.25);
}

/* ===== 结果面板（右） ===== */
.fm-result-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--fm-surface);
    transition: background .25s;
    overflow: hidden;
}

.fm-result-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.fm-result-scene-tag {
    background: rgba(244,63,94,.15);
    color: var(--fm-primary-dark);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
}
.fm-result-style-tag {
    background: rgba(192,132,252,.12);
    color: var(--fm-secondary);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
}
body.dark .fm-result-scene-tag {
    background: rgba(244,63,94,.22);
    color: #fb7185;
}
body.dark .fm-result-style-tag {
    background: rgba(192,132,252,.22);
    color: #d8b4fe;
}

.fm-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

/* ===== 占位区 ===== */
.fm-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    padding: 20px;
}

.fm-placeholder-hearts {
    margin-bottom: 20px;
    position: relative;
    width: 80px;
    height: 70px;
}
.fm-heart {
    position: absolute;
    font-size: 28px;
    animation: fmHeartFloat 2.4s ease-in-out infinite alternate;
}
.fm-heart.h1 { left: 50%; transform: translateX(-50%); bottom: 0; animation-delay: 0s; }
.fm-heart.h2 { left: 15%; bottom: 10px; font-size: 18px; animation-delay: .4s; opacity: .75; }
.fm-heart.h3 { right: 15%; bottom: 16px; font-size: 14px; animation-delay: .8s; opacity: .55; }

@keyframes fmHeartFloat {
    0%   { transform: translateX(-50%) translateY(0) scale(1); }
    100% { transform: translateX(-50%) translateY(-10px) scale(1.08); }
}
.fm-heart.h2, .fm-heart.h3 {
    transform: none !important;
    animation: fmHeartFloatSide 2.4s ease-in-out infinite alternate;
}
@keyframes fmHeartFloatSide {
    0%   { transform: translateY(0) scale(1); }
    100% { transform: translateY(-8px) scale(1.05); }
}

.fm-placeholder-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--fm-text2);
    margin: 0 0 8px;
}
.fm-placeholder-desc {
    font-size: 13px;
    color: var(--fm-text-muted);
    margin: 0 0 4px;
    line-height: 1.6;
}

/* ===== 加载动画 ===== */
.fm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    gap: 16px;
}

.fm-loading-petals {
    display: flex;
    gap: 8px;
    height: 40px;
    align-items: center;
}
.petal {
    font-size: 20px;
    animation: fmPetalDrop 1.4s ease-in-out infinite;
}
.petal.p1 { animation-delay: 0s;   }
.petal.p2 { animation-delay: .2s;  }
.petal.p3 { animation-delay: .4s;  }
.petal.p4 { animation-delay: .6s;  }
.petal.p5 { animation-delay: .8s;  }

@keyframes fmPetalDrop {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: .8; }
    50%       { transform: translateY(-14px) rotate(12deg); opacity: 1; }
}

.fm-loading-dots {
    display: flex;
    gap: 6px;
}
.fm-loading-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--fm-primary);
    animation: fmDotBounce 1s ease-in-out infinite;
}
.fm-loading-dots span:nth-child(2) { animation-delay: .15s; background: var(--fm-secondary); }
.fm-loading-dots span:nth-child(3) { animation-delay: .3s;  background: var(--fm-gold); }

@keyframes fmDotBounce {
    0%, 100% { transform: translateY(0); opacity: .7; }
    50%       { transform: translateY(-10px); opacity: 1; }
}

.fm-loading-text {
    font-size: 13px;
    color: var(--fm-text-muted);
    margin: 0;
    animation: fmTextPulse 2s ease-in-out infinite;
}
@keyframes fmTextPulse {
    0%, 100% { opacity: .7; }
    50%       { opacity: 1; }
}

/* ===== 结果内容（AI输出样式） ===== */
.fm-result-content {
    line-height: 1.8;
    color: var(--fm-text);
}

.hfi-result-enter {
    animation: fmResultFadeIn 0.35s ease-out forwards;
}

@keyframes fmResultFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 核心撩话卡片 */
.fm-result-content .fm-main-line {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--fm-primary-dark);
    background: linear-gradient(135deg, rgba(244,63,94,.06), rgba(192,132,252,.06));
    border: 1.5px solid var(--fm-border2);
    border-left: 4px solid var(--fm-primary);
    padding: 16px 20px;
    margin: 0 0 16px;
    border-radius: 0 10px 10px 0;
    font-style: italic;
}
body.dark .fm-result-content .fm-main-line {
    background: rgba(244,63,94,.1);
    color: #fb7185;
}
body.dark .fm-result-content .fm-tip-card {
    background: linear-gradient(135deg, rgba(244,63,94,.1) 0%, rgba(192,132,252,.1) 100%);
    border-color: var(--fm-border2);
}

/* 撩话段落 */
.fm-result-content .fm-para {
    font-size: 14px;
    line-height: 1.9;
    color: var(--fm-text);
    margin: 0 0 12px;
}

/* 撩话列表 */
.fm-result-content .fm-lines {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fm-result-content .fm-lines li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.7;
    padding: 12px 16px;
    background: var(--fm-surface2);
    border-radius: 8px;
    border: 1px solid var(--fm-border);
    position: relative;
    transition: border-color .18s;
}
.fm-result-content .fm-lines li:hover {
    border-color: var(--fm-border2);
}
body.dark .fm-result-content .fm-lines li {
    background: rgba(255,255,255,.04);
    border-color: var(--fm-border);
}
.fm-result-content .fm-lines li::before {
    content: '💌';
    flex-shrink: 0;
    font-size: 15px;
    margin-top: 1px;
}

/* 撩话提示卡片 */
.fm-result-content .fm-tip-card {
    background: linear-gradient(135deg, rgba(244,63,94,.06) 0%, rgba(192,132,252,.06) 100%);
    border: 1.5px solid var(--fm-border2);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 0 0 14px;
    position: relative;
}
.fm-result-content .fm-tip-card::before {
    content: '💕';
    position: absolute;
    top: -10px;
    left: 14px;
    font-size: 22px;
    line-height: 1;
}
.fm-result-content .fm-tip-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--fm-primary-dark);
    margin: 0 0 6px;
    padding-top: 4px;
}
body.dark .fm-result-content .fm-tip-title {
    color: #fb7185;
}
.fm-result-content .fm-tip-text {
    font-size: 13px;
    color: var(--fm-text);
    line-height: 1.7;
    margin: 0;
}

/* 区块标题 */
.fc-section-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--fm-primary-dark);
    margin: 14px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.fc-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--fm-border2), transparent);
}
body.dark .fc-section-title {
    color: #fb7185;
}

/* Markdown 基础样式 */
.fm-result-content strong     { font-weight: 700; color: var(--fm-primary-dark); }
.fm-result-content em         { font-style: italic; color: var(--fm-text-muted); }
.fm-result-content blockquote { margin: 0; padding: 0; }
.fm-result-content h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--fm-text2);
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--fm-border2);
}
body.dark .fm-result-content h2 {
    color: var(--fm-text2);
    border-bottom-color: var(--fm-border);
}
.fm-result-content h3,
.fm-result-content h4,
.fm-result-content h5 {
    font-weight: 700;
    color: var(--fm-text2);
    margin: 12px 0 6px;
}
.fm-result-content pre {
    display: block;
    background: var(--fm-surface2);
    border-radius: 6px;
    padding: 10px 12px;
    font-family: monospace;
    font-size: 12.5px;
    overflow-x: auto;
    white-space: pre-wrap;
    margin: 8px 0;
}
.fm-result-content code {
    background: var(--fm-surface2);
    border-radius: 4px;
    padding: 2px 5px;
    font-family: monospace;
    font-size: 12.5px;
}
.fm-result-content li::marker {
    color: var(--fm-primary);
}
body.dark .fm-result-content strong { color: #fb7185; }
body.dark .fm-result-content em     { color: var(--fm-text-muted); }
body.dark .fm-result-content h2,
body.dark .fm-result-content h3,
body.dark .fm-result-content h4,
body.dark .fm-result-content h5 { color: var(--fm-text2); }
body.dark .fm-result-content pre,
body.dark .fm-result-content code { background: rgba(255,255,255,.07); }

/* 错误状态 */
.fm-result-content.fm-result-error {
    flex: 1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.fm-error-inner { text-align: center; padding: 20px; }
.fm-error-icon  { font-size: 36px; margin-bottom: 10px; }
.fm-error-msg   { font-size: 14px; color: #ef4444; font-weight: 600; margin: 0 0 6px; }
.fm-error-hint  { font-size: 12px; color: var(--fm-text-muted); margin: 0 0 14px; }
.fm-retry-btn {
    padding: 7px 18px;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .18s;
}
.fm-retry-btn:hover { background: linear-gradient(135deg, #fb7185, #f43f5e); }
body.dark .fm-error-msg  { color: #fca5a5; }
body.dark .fm-error-hint { color: var(--fm-text-muted); }

/* ===== 示例模态框 ===== */
.fm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 10000;
    backdrop-filter: blur(2px);
}
.fm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: min(900px, 94vw);
    max-height: 80vh;
    background: var(--fm-surface);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
}
body.dark .fm-modal { background: #1e0a10; }

.fm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--fm-border);
}
.fm-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--fm-text);
}
.fm-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--fm-text-muted);
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color .18s, background .18s;
}
.fm-modal-close:hover { color: var(--fm-primary); background: rgba(244,63,94,.08); }

.fm-modal-body {
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.fm-example-card {
    padding: 12px 14px;
    border: 1.5px solid var(--fm-border);
    border-radius: 9px;
    cursor: pointer;
    transition: all .18s;
    background: var(--fm-surface2);
}
.fm-example-card:hover {
    border-color: var(--fm-primary);
    background: rgba(244,63,94,.05);
    box-shadow: 0 2px 8px rgba(244,63,94,.12);
}
body.dark .fm-example-card {
    background: rgba(255,255,255,.04);
    border-color: var(--fm-border);
}
body.dark .fm-example-card:hover {
    border-color: #fb7185;
    background: rgba(244,63,94,.1);
}
.fm-example-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--fm-text);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.fm-example-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.fm-example-tag {
    background: rgba(244,63,94,.1);
    color: var(--fm-primary-dark);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 10.5px;
    font-weight: 600;
}
body.dark .fm-example-tag { background: rgba(244,63,94,.2); color: #fb7185; }
.fm-example-preview {
    font-size: 12px;
    color: var(--fm-text-muted);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 输入框占位文字颜色 ===== */
.fm-textarea::placeholder,
.fm-input::placeholder,
.fm-history-search input::placeholder {
    color: var(--fm-text-muted);
    opacity: .55;
}
body.dark .fm-textarea::placeholder,
body.dark .fm-input::placeholder,
body.dark .fm-history-search input::placeholder {
    color: #fb7185;
    opacity: .45;
}

/* ===== 滚动条美化 ===== */
.fm-history-list::-webkit-scrollbar,
.fm-input-body::-webkit-scrollbar,
.fm-result-body::-webkit-scrollbar,
.fm-modal-body::-webkit-scrollbar {
    width: 4px;
}
.fm-history-list::-webkit-scrollbar-track,
.fm-input-body::-webkit-scrollbar-track,
.fm-result-body::-webkit-scrollbar-track,
.fm-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.fm-history-list::-webkit-scrollbar-thumb,
.fm-input-body::-webkit-scrollbar-thumb,
.fm-result-body::-webkit-scrollbar-thumb,
.fm-modal-body::-webkit-scrollbar-thumb {
    background: #8a2be2;
    border-radius: 3px;
    transition: background .18s;
}
.fm-history-list::-webkit-scrollbar-thumb:hover,
.fm-input-body::-webkit-scrollbar-thumb:hover,
.fm-result-body::-webkit-scrollbar-thumb:hover,
.fm-modal-body::-webkit-scrollbar-thumb:hover {
    background: #7b1fa2;
}
body.dark .fm-history-list::-webkit-scrollbar-thumb,
body.dark .fm-input-body::-webkit-scrollbar-thumb,
body.dark .fm-result-body::-webkit-scrollbar-thumb,
body.dark .fm-modal-body::-webkit-scrollbar-thumb {
    background: #9d4edd;
}
body.dark .fm-history-list::-webkit-scrollbar-thumb:hover,
body.dark .fm-input-body::-webkit-scrollbar-thumb:hover,
body.dark .fm-result-body::-webkit-scrollbar-thumb:hover,
body.dark .fm-modal-body::-webkit-scrollbar-thumb:hover {
    background: #b36ee0;
}
body.dark .fm-history-list::-webkit-scrollbar-track,
body.dark .fm-input-body::-webkit-scrollbar-track,
body.dark .fm-result-body::-webkit-scrollbar-track,
body.dark .fm-modal-body::-webkit-scrollbar-track {
    background: rgba(255,255,255,.04);
}

/* ===== 场景shake抖动 ===== */
@keyframes fmShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}
.fm-scene-grid.shake {
    animation: fmShake .45s ease-in-out;
    outline: 2px solid var(--fm-primary);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ===== Toast 提示 ===== */
.fm-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(244,63,94,.92);
    color: #fff;
    padding: 9px 20px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 99999;
    box-shadow: 0 4px 16px rgba(244,63,94,.35);
    white-space: nowrap;
    pointer-events: none;
}
body.dark .fm-toast {
    background: rgba(244,63,94,.85);
    box-shadow: 0 4px 16px rgba(0,0,0,.45);
}

/* ===== 响应式适配 ===== */
@media (max-width: 900px) {
    :root {
        --fm-history-w: 0px;
        --fm-input-w: 300px;
    }
    .fm-history-panel { display: none; }
}

@media (max-width: 640px) {
    :root { --fm-input-w: 100%; }
    .fm-main-content { flex-direction: column; }
    .fm-input-panel {
        width: 100% !important;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--fm-border);
        max-height: 55vh;
    }
    .fm-result-panel { min-height: 300px; }
    .fm-scene-grid { grid-template-columns: repeat(4, 1fr); }
    .fm-modal-body { grid-template-columns: 1fr; }
}
