/* =============================================
   飞花令 - flying_flower_order.css
   三栏布局：历史 | 设置 | 结果
   主色调：墨绿(jade) + 古铜(bronze) + 羊皮纸(parchment)
   ============================================= */

/* ========== 主容器 ========== */
.ffl-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8f5ee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.ffl-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.ffl-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 36px;
    background: linear-gradient(135deg, #1a5c3a 0%, #2d6a4f 60%, #3a7a5c 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(26, 92, 58, 0.4);
    flex-shrink: 0;
}

.ffl-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.ffl-toolbar .toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.90);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #1a5c3a;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.ffl-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.ffl-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.ffl-toolbar .toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 主操作按钮 */
.ffl-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #b7791f 0%, #9a6419 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(183, 121, 31, 0.45);
}

.ffl-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #d4a94a 0%, #b7791f 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(183, 121, 31, 0.55);
}

/* 生成按钮 loading shimmer 流光动画 */
.ffl-toolbar .toolbar-btn-primary.ffl-btn-loading {
    background: linear-gradient(90deg, #b7791f 0%, #e8c470 35%, #b7791f 65%, #9a6419 100%);
    background-size: 200% 100%;
    animation: fflBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
    box-shadow: 0 2px 10px rgba(183, 121, 31, 0.5);
}

@keyframes fflBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ffl-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

/* ========== 主内容：三栏 ========== */
.ffl-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8f5ee;
}

/* ========== 左栏：历史记录 ========== */
.ffl-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #d4c5a9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #fdfaf5 0%, #f5ede0 100%);
    border-bottom: 1px solid #d4c5a9;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #3d2b0e;
}

.history-count {
    font-size: 11px;
    color: #a08060;
    font-weight: 400;
}

.history-clear-btn {
    background: #fef0e0;
    border: none;
    color: #b7791f;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover { background: #fde8c8; }

.history-search {
    padding: 7px;
    border-bottom: 1px solid #d4c5a9;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #cdbfa0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #3d2b0e;
    background: #fdfaf5;
}

.history-search input:focus {
    border-color: #2d6a4f;
    box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    scrollbar-width: thin;
    scrollbar-color: #c8b898 transparent;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: #c8b898; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #f97316; }

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 3px;
    border: 1px solid transparent;
}

.history-item-main { flex: 1; min-width: 0; }

.history-item:hover {
    background: #f0f7f2;
    border-color: #b8d8c8;
}

.history-item.active {
    background: #ddeee6;
    border-color: #7cbfa0;
}

.history-item-char {
    font-size: 20px;
    font-weight: 900;
    color: #1a5c3a;
    margin-bottom: 2px;
    font-family: "SimSun", "宋体", serif;
    letter-spacing: 1px;
}

.history-item-meta {
    font-size: 10px;
    color: #a08060;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-mode {
    background: #e0f0e8;
    color: #2d6a4f;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
}

.history-item-del {
    background: none;
    border: none;
    color: #c8b080;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0;
}

.history-item:hover .history-item-del { opacity: 1; }
.history-item:hover .history-item-del:hover {
    color: #b7791f;
    background: #fde8c8;
}

.history-empty {
    text-align: center;
    color: #b8a080;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.7;
}

/* ========== 中栏：输入面板 ========== */
.ffl-input-panel {
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #d4c5a9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 20px 10px;
    border-bottom: 1px solid #d4c5a9;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fdfaf5 0%, #f5ede0 100%);
}

.panel-header h3 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: #3d2b0e;
}

.panel-tip {
    font-size: 11px;
    color: #a08060;
    display: block;
}

.ffl-input-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #c8b898 transparent;
}

.ffl-input-body::-webkit-scrollbar { width: 4px; }
.ffl-input-body::-webkit-scrollbar-track { background: transparent; }
.ffl-input-body::-webkit-scrollbar-thumb { background: #c8b898; border-radius: 2px; }
.ffl-input-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

.ffl-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b4c2a;
    margin-bottom: 7px;
}

/* 飞花字输入框 */
.ffl-char-section { margin-bottom: 16px; }

.ffl-char-box {
    position: relative;
    display: flex;
    align-items: center;
}

.ffl-char-input {
    flex: 1;
    padding: 9px 36px 9px 14px;
    border: 2px solid #cdbfa0;
    border-radius: 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1a3d0a;
    background: #fdfaf5;
    outline: none;
    transition: all 0.2s;
    font-family: "SimSun", "宋体", "Noto Serif CJK SC", serif;
    letter-spacing: 4px;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
}

.ffl-char-input:focus {
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
    background: #fff;
}

.ffl-char-input::placeholder {
    font-size: 14px;
    color: #b8a080;
    letter-spacing: 0;
    font-family: inherit;
    font-weight: 400;
}

.ffl-char-counter {
    position: absolute;
    right: 10px;
    font-size: 10px;
    color: #b8a080;
    pointer-events: none;
}

/* 模式选择 */
.ffl-mode-group { margin-bottom: 16px; }

.ffl-mode-options {
    display: flex;
    gap: 8px;
}

.ffl-mode-option {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    border: 1.5px solid #cdbfa0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
    user-select: none;
    background: #fdfaf5;
}

.ffl-mode-option:hover {
    border-color: #2d6a4f;
    background: #f0f7f2;
}

.ffl-mode-option.selected {
    border-color: #2d6a4f;
    background: linear-gradient(135deg, #1a5c3a 0%, #2d6a4f 100%);
    box-shadow: 0 2px 6px rgba(45, 106, 79, 0.3);
}

.ffl-mode-icon {
    font-size: 18px;
    display: block;
    margin-bottom: 3px;
}

.ffl-mode-name {
    font-size: 12px;
    font-weight: 600;
    color: #3d2b0e;
    display: block;
    margin-bottom: 2px;
}

.ffl-mode-option.selected .ffl-mode-name,
.ffl-mode-option.selected .ffl-mode-desc {
    color: #fff;
}

.ffl-mode-desc {
    font-size: 10px;
    color: #a08060;
    display: block;
}

/* 快捷飞花字 */
.ffl-quick-chars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.ffl-quick-char {
    padding: 5px 12px;
    background: #f0f7f2;
    border: 1px solid #9ed0b8;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    color: #1a5c3a;
    cursor: pointer;
    transition: all 0.18s;
    font-family: "SimSun", "宋体", serif;
}

.ffl-quick-char:hover {
    background: #2d6a4f;
    border-color: #2d6a4f;
    color: #fff;
    transform: scale(1.08);
}

/* 对战出句区域 */
.ffl-verse-area {
    margin-bottom: 16px;
    background: linear-gradient(135deg, #f5ede0 0%, #fdf8f0 100%);
    border: 1px solid #cdbfa0;
    border-radius: 8px;
    padding: 12px;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ffl-verse-input {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #cdbfa0;
    border-radius: 6px;
    font-size: 14px;
    color: #2d1b0e;
    background: #fff;
    outline: none;
    resize: none;
    font-family: "SimSun", "宋体", serif;
    line-height: 1.7;
    transition: all 0.2s;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.ffl-verse-input:focus {
    border-color: #b7791f;
    box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.12);
}

.ffl-verse-input::-webkit-scrollbar { width: 4px; }
.ffl-verse-input::-webkit-scrollbar-thumb { background: #c8b898; border-radius: 2px; }
.ffl-verse-input::-webkit-scrollbar-thumb:hover { background: #f97316; }
.ffl-verse-input { scrollbar-width: thin; scrollbar-color: #c8b898 transparent; }

.ffl-verse-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ffl-verse-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #b7791f 0%, #9a6419 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(183, 121, 31, 0.35);
    white-space: nowrap;
}

.ffl-verse-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d4a94a 0%, #b7791f 100%);
    box-shadow: 0 3px 8px rgba(183, 121, 31, 0.45);
    transform: translateY(-1px);
}

.ffl-verse-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ffl-verse-btn.ffl-verse-btn-loading {
    background: linear-gradient(90deg, #b7791f 0%, #e8c470 40%, #b7791f 70%, #9a6419 100%);
    background-size: 200% 100%;
    animation: fflBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
}

.ffl-verse-shortcut {
    font-size: 10px;
    color: #b8a080;
}

/* 使用提示 */
.ffl-tips-box {
    background: linear-gradient(135deg, #f8f0e0 0%, #fdf5e8 100%);
    border: 1px solid #e0cfa0;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #7a5020;
    line-height: 1.7;
}

.ffl-tips-box p { margin: 0 0 4px; font-weight: 600; }
.ffl-tips-box ul { margin: 0; padding-left: 16px; }
.ffl-tips-box ul li { margin-bottom: 2px; }
.ffl-tips-box ul li::marker { color: #b7791f; }

/* ========== 右栏：结果面板 ========== */
.ffl-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fdfaf5;
    min-width: 0;
}

.ffl-result-header {
    padding: 10px 16px;
    border-bottom: 1px solid #d4c5a9;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fdfaf5 0%, #f5ede0 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ffl-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #3d2b0e;
}

.result-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    min-width: 0;
    flex-shrink: 1;
    transition: opacity 0.3s ease-in-out;
}

.result-meta-char {
    font-size: 18px;
    font-weight: 900;
    color: #1a5c3a;
    font-family: "SimSun", "宋体", serif;
}

.result-mode-badge {
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.result-mode-badge.mode-appreciate {
    background: #d4e8d8;
    color: #1a5c3a;
}

.result-mode-badge.mode-battle {
    background: #fde8c8;
    color: #9a6419;
}

.result-meta-time {
    font-size: 10px;
    color: #b8a080;
    white-space: nowrap;
}

.ffl-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #c8b898 transparent;
}

.ffl-result-body::-webkit-scrollbar { width: 5px; }
.ffl-result-body::-webkit-scrollbar-track { background: transparent; }
.ffl-result-body::-webkit-scrollbar-thumb { background: #c8b898; border-radius: 3px; }
.ffl-result-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

/* 占位提示 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #b8a080;
    text-align: center;
    padding: 40px;
    min-height: 180px;
}

.placeholder-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.7; }
.placeholder-title { font-size: 16px; font-weight: 600; color: #a08060; margin: 0 0 8px; }
.placeholder-desc { font-size: 13px; color: #b8a080; margin: 3px 0; line-height: 1.6; }

/* 加载中 */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 180px;
}

.loading-petals {
    display: flex;
    gap: 8px;
}

.loading-petals span {
    font-size: 18px;
    animation: petalFloat 1.2s ease-in-out infinite;
    display: inline-block;
}

.loading-petals span:nth-child(2) { animation-delay: 0.2s; }
.loading-petals span:nth-child(3) { animation-delay: 0.4s; }

@keyframes petalFloat {
    0%, 80%, 100% { transform: translateY(0) scale(0.8); opacity: 0.5; }
    40% { transform: translateY(-8px) scale(1.1); opacity: 1; }
}

.loading-text {
    font-size: 13px;
    color: #a08060;
    margin: 0;
}

/* ========== 欣赏模式结果内容 ========== */
.result-content {
    animation: fadeInUp 0.35s ease;
    min-height: 0;
    word-break: break-word;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* AI 生成的欣赏内容根容器 */
.result-content .ffl-result {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* 意象点评区 */
.result-content .ffl-summary {
    background: linear-gradient(135deg, #1a5c3a 0%, #2d6a4f 100%);
    padding: 16px 20px;
    color: rgba(255,255,255,0.95);
}

.result-content .ffl-summary p {
    margin: 0;
    font-size: 13px;
    line-height: 1.85;
    font-style: italic;
}

/* 诗词列表 */
.result-content .ffl-verses {
    padding: 8px 0;
}

.result-content .ffl-verse-item {
    padding: 14px 20px;
    border-bottom: 1px solid #f0e8d8;
    transition: background 0.15s;
}

.result-content .ffl-verse-item:last-child { border-bottom: none; }
.result-content .ffl-verse-item:hover { background: #faf5ec; }

.result-content .ffl-verse-text {
    font-size: 17px;
    font-weight: 600;
    color: #2d1b0e;
    margin-bottom: 8px;
    line-height: 1.6;
    font-family: "SimSun", "宋体", "Noto Serif CJK SC", serif;
    letter-spacing: 1px;
}

.result-content .ffl-verse-text mark {
    background: linear-gradient(135deg, #f5c518 0%, #e8a800 100%);
    color: #3d1a00;
    border-radius: 3px;
    padding: 0 3px;
    font-weight: 900;
}

.result-content .ffl-verse-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.result-content .ffl-author {
    font-size: 12px;
    font-weight: 600;
    color: #1a5c3a;
    background: #e0f0e8;
    padding: 1px 8px;
    border-radius: 10px;
}

.result-content .ffl-source {
    font-size: 12px;
    color: #6b4c2a;
    font-style: italic;
}

.result-content .ffl-dynasty {
    font-size: 11px;
    color: #a08060;
    background: #f5ede0;
    padding: 1px 6px;
    border-radius: 8px;
}

/* 通用 AI 输出标签样式 */
.result-content h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1a5c3a;
    margin: 14px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0d5c0;
}

.result-content h3, .result-content h4 {
    color: #1a5c3a;
    margin: 10px 0 5px;
}

.result-content hr {
    border: none;
    border-top: 1px solid #e0d5c0;
    margin: 12px 0;
}

.result-content blockquote {
    margin: 10px 0;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f5ede0 0%, #fdf5e8 100%);
    border-left: 3px solid #b7791f;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #6b4c2a;
    font-style: italic;
    line-height: 1.8;
}

.result-content ul, .result-content ol {
    padding-left: 18px;
    font-size: 13px;
    color: #3d2b0e;
    line-height: 1.8;
}

.result-content ul li::marker, .result-content ol li::marker {
    color: #b7791f;
}

.result-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 8px 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.result-content table th {
    background: linear-gradient(135deg, #1a5c3a 0%, #2d6a4f 100%);
    color: #fff;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
}

.result-content table td {
    padding: 7px 12px;
    color: #3d2b0e;
    border-bottom: 1px solid #f0e8d8;
    line-height: 1.6;
}

.result-content table tr:nth-child(even) td { background: #faf5ec; }
.result-content table tr:hover td { background: #f0f7f2; }

.result-content strong { color: #1a5c3a; font-weight: 700; }
.result-content em { color: #6b4c2a; font-style: italic; }

/* ========== 对战模式棋盘 ========== */
.ffl-battle-board {
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: fadeInUp 0.35s ease;
    min-height: 0;
    flex-shrink: 0;
}

.battle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #1a5c3a 0%, #2d6a4f 100%);
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.battle-char-badge {
    font-size: 20px;
    font-weight: 900;
    color: #f5c518;
    font-family: "SimSun", "宋体", serif;
    letter-spacing: 2px;
    background: rgba(255,255,255,0.12);
    padding: 2px 10px;
    border-radius: 6px;
}

.battle-score {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.battle-rounds {
    background: #fff;
    border: 1px solid #d4c5a9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 80px;
}

/* 单轮对战 */
.battle-round {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeInUp 0.25s ease;
}

/* AI 出句 */
.battle-ai-card {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 90%;
}

.battle-ai-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a5c3a 0%, #52b788 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(45,106,79,0.3);
}

.battle-ai-bubble {
    flex: 1;
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ee 100%);
    border: 1px solid #b8d8c8;
    border-radius: 0 8px 8px 8px;
    padding: 10px 14px;
}

/* 用户出句 */
.battle-user-card {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 90%;
    align-self: flex-end;
    flex-direction: row-reverse;
}

.battle-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b7791f 0%, #d4a94a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(183,121,31,0.3);
}

.battle-user-bubble {
    flex: 1;
    background: linear-gradient(135deg, #fef8ec 0%, #fdf0d8 100%);
    border: 1px solid #d4a94a;
    border-radius: 8px 0 8px 8px;
    padding: 10px 14px;
}

.battle-verse-text {
    font-size: 15px;
    font-weight: 600;
    color: #2d1b0e;
    font-family: "SimSun", "宋体", serif;
    letter-spacing: 1px;
    line-height: 1.6;
    margin-bottom: 4px;
    word-break: break-word;
}

.battle-verse-meta {
    font-size: 11px;
    color: #a08060;
    line-height: 1.5;
}

/* 验证失败提示 */
.battle-invalid-card {
    background: #fef5f5;
    border: 1px solid #f5c0c0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #c0392b;
    align-self: flex-end;
    max-width: 90%;
    word-break: break-word;
}

/* 轮次小结 */
.battle-round-summary {
    text-align: center;
    font-size: 11px;
    color: #a08060;
    background: #f5ede0;
    padding: 3px 10px;
    border-radius: 10px;
    align-self: center;
    font-style: italic;
}

/* AI 思考中气泡 */
.battle-thinking-bubble {
    font-size: 13px;
    color: #6b8c75;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px !important;
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ee 100%) !important;
    border: 1px dashed #9ed0b8 !important;
}

.thinking-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 4px;
}

.thinking-dots span {
    width: 5px;
    height: 5px;
    background: #52b788;
    border-radius: 50%;
    display: inline-block;
    animation: thinkingBounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* 错误提示 */
.result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.result-error .error-icon { font-size: 36px; margin-bottom: 10px; }
.result-error .error-msg { font-size: 14px; color: #b7791f; margin: 0 0 6px; font-weight: 600; }
.result-error .error-tip { font-size: 12px; color: #a08060; margin: 0 0 12px; }
.result-error .error-retry-btn {
    padding: 6px 16px;
    background: linear-gradient(135deg, #2d6a4f 0%, #1a5c3a 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.result-error .error-retry-btn:hover {
    background: linear-gradient(135deg, #52b788 0%, #2d6a4f 100%);
    transform: translateY(-1px);
}

/* ========== 示例导入模态框 ========== */
.ffl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 10000;
    display: none;
}

.ffl-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
    width: 540px;
    max-width: 95vw;
    max-height: 90vh;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ffl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a5c3a 0%, #2d6a4f 100%);
    color: #fff;
    flex-shrink: 0;
}

.ffl-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.ffl-modal-close {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.ffl-modal-close:hover { background: rgba(255,255,255,0.35); }

.ffl-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #c8b898 transparent;
}

.ffl-modal-body::-webkit-scrollbar { width: 4px; }
.ffl-modal-body::-webkit-scrollbar-thumb { background: #c8b898; border-radius: 2px; }
.ffl-modal-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

.example-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.example-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }

.example-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid #d4c5a9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s;
    background: #fdfaf5;
}

.example-card:hover {
    border-color: #2d6a4f;
    background: #f0f7f2;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(45, 106, 79, 0.12);
}

.example-char {
    font-size: 28px;
    font-weight: 900;
    color: #1a5c3a;
    font-family: "SimSun", "宋体", serif;
    line-height: 1;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.example-info { flex: 1; min-width: 0; }

.example-desc {
    font-size: 12px;
    color: #6b4c2a;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========== 输入框 shake 动画 ========== */
@keyframes fflShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.ffl-char-input.shake { animation: fflShake 0.4s ease; }
.ffl-verse-input.shake { animation: fflShake 0.4s ease; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .ffl-history-panel { width: 160px; }
    .ffl-input-panel { width: 250px; }
}

@media (max-width: 720px) {
    .ffl-main-content { flex-direction: column; overflow-y: auto; }
    .ffl-history-panel { width: 100%; min-height: 160px; border-right: none; border-bottom: 1px solid #d4c5a9; }
    .ffl-input-panel { width: 100%; border-right: none; border-bottom: 1px solid #d4c5a9; }
    .ffl-result-panel { min-height: 300px; }
}

/* ========== 打印适配 ========== */
@media print {
    .ffl-toolbar, .ffl-history-panel, .ffl-input-panel, .ffl-modal-overlay, .ffl-modal { display: none !important; }
    .ffl-result-panel { flex: 1; overflow: visible; }
    .ffl-result-body { overflow: visible; }
}
