/* =============================================
   猜灯谜工具 - guess_lantern_riddle.css
   三栏布局：历史 | 配置 | 灯谜结果
   主题色：中国红 #c62828 / 金色 #f9a825
   ============================================= */

/* ========== 主容器 ========== */
.glr-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fff8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(198, 40, 40, 0.18);
    transition: all 0.3s ease;
}

.glr-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;
}

body.glr-fullscreen-active { overflow: hidden; }

/* ========== 顶部工具栏 ========== */
.glr-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 38px;
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(109, 10, 10, 0.45);
    flex-shrink: 0;
    position: relative;
}

/* 灯笼装饰条 */
.glr-toolbar::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f9a825, #c62828, #f9a825, #c62828, #f9a825);
    background-size: 80px 100%;
}

.glr-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.glr-toolbar .toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.88);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #b71c1c;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.glr-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.glr-toolbar .toolbar-btn:active:not(:disabled) { transform: translateY(0); }

.glr-toolbar .toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.glr-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #f9a825 0%, #e65100 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(249, 168, 37, 0.5);
}

.glr-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #fbc02d 0%, #f57c00 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(249, 168, 37, 0.6);
}

.glr-toolbar .toolbar-btn-primary.glr-btn-loading {
    background: linear-gradient(90deg, #c62828 0%, #f9a825 35%, #c62828 65%, #6d0a0a 100%);
    background-size: 200% 100%;
    animation: glrBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
}

@keyframes glrBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes glrResultFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.glr-result-enter { animation: glrResultFadeIn 0.35s ease-out forwards; }

.glr-toolbar .toolbar-btn-cancel {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.glr-toolbar .toolbar-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
}

.glr-toolbar .toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ========== 主内容三栏 ========== */
.glr-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fff8f0;
    margin-top: 3px; /* 给装饰条留空 */
}

/* ========== 左栏：历史记录 ========== */
.glr-history-panel {
    width: 188px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #ffccbc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.glr-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #fff8f0 0%, #fff3e0 100%);
    border-bottom: 1px solid #ffccbc;
    flex-shrink: 0;
}

.glr-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #c62828;
}

.glr-history-count {
    font-size: 11px;
    color: #e57373;
    font-weight: 400;
}

.glr-clear-btn {
    background: #fff0f0;
    border: none;
    color: #c62828;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.glr-clear-btn:hover { background: #fce4e1; }
.glr-clear-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.glr-history-search {
    padding: 7px;
    border-bottom: 1px solid #ffccbc;
    flex-shrink: 0;
}

.glr-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #ef9a9a;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #5d0a0a;
    background: #fff8f0;
}

.glr-history-search input:focus {
    border-color: #c62828;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.1);
}

.glr-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.glr-history-list::-webkit-scrollbar { width: 4px; }
.glr-history-list::-webkit-scrollbar-track { background: transparent; }
.glr-history-list::-webkit-scrollbar-thumb { background: #ef9a9a; border-radius: 2px; }
.glr-history-list::-webkit-scrollbar-thumb:hover { background: #c62828; }

.glr-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;
}

.glr-history-item-main { flex: 1; min-width: 0; }

.glr-history-item:hover {
    background: #fff8f0;
    border-color: #ffccbc;
}

.glr-history-item.active {
    background: #fce4e1;
    border-color: #ef9a9a;
    box-shadow: 0 1px 5px rgba(198, 40, 40, 0.12);
}

.glr-history-item-theme {
    font-size: 12px;
    font-weight: 600;
    color: #b71c1c;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.glr-history-item-meta {
    font-size: 10px;
    color: #e57373;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3px;
}

.glr-history-item-badge {
    background: #fff8f0;
    color: #c62828;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.glr-history-item-del {
    background: none;
    border: none;
    color: #ef9a9a;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s;
    flex-shrink: 0;
    opacity: 0;
    margin-top: 1px;
    line-height: 1;
}

.glr-history-item:hover .glr-history-item-del { opacity: 1; }
.glr-history-item:hover .glr-history-item-del:hover { color: #c62828; background: #fce4e1; }

.glr-history-empty {
    text-align: center;
    color: #ef9a9a;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.7;
}

/* ========== 中栏：参数配置 ========== */
.glr-input-panel {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #ffccbc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.glr-panel-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #ffccbc;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fff8f0 0%, #fff3e0 100%);
}

.glr-panel-header h3 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: #c62828;
}

.glr-panel-tip {
    font-size: 11px;
    color: #e57373;
    display: block;
}

.glr-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.glr-input-body::-webkit-scrollbar { width: 4px; }
.glr-input-body::-webkit-scrollbar-track { background: transparent; }
.glr-input-body::-webkit-scrollbar-thumb { background: #ef9a9a; border-radius: 2px; }
.glr-input-body::-webkit-scrollbar-thumb:hover { background: #c62828; }

.glr-field-group { margin-bottom: 16px; }

.glr-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #5d0a0a;
    margin-bottom: 7px;
}

.glr-input-wrap { position: relative; }

.glr-input {
    width: 100%;
    padding: 9px 30px 9px 12px;
    border: 1.5px solid #ef9a9a;
    border-radius: 6px;
    font-size: 13px;
    color: #5d0a0a;
    background: #fff8f0;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.glr-input:focus {
    border-color: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
    background: #fff;
}

.glr-input::placeholder { color: #ef9a9a; font-size: 12px; }

.glr-input:disabled {
    background: #f5ece8;
    color: #ef9a9a;
    -webkit-text-fill-color: #ef9a9a;
    cursor: not-allowed;
    border-color: #ffccbc;
}

@keyframes glrShake {
    0%, 100% { transform: translateX(0); }
    20%, 60%  { transform: translateX(-4px); }
    40%, 80%  { transform: translateX(4px); }
}

.glr-input.shake {
    animation: glrShake 0.4s ease;
    border-color: #c62828 !important;
}

.glr-clear-input-btn {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ef9a9a;
    font-size: 16px;
    line-height: 1;
    width: 20px;
    height: 20px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.glr-clear-input-btn:hover {
    color: #c62828;
    background: rgba(198, 40, 40, 0.1);
}

.glr-char-count {
    text-align: right;
    font-size: 11px;
    color: #ef9a9a;
    margin-top: 4px;
    transition: color 0.2s;
    user-select: none;
}
.glr-char-count.warn { color: #e57373; font-weight: 600; }
.glr-char-count.over { color: #c62828; font-weight: 700; }

/* 热门主题标签 */
.glr-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.glr-tag-item {
    padding: 4px 10px;
    border: 1.5px solid #ffccbc;
    border-radius: 14px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: #c62828;
    transition: all 0.18s;
    user-select: none;
    background: #fff8f0;
}

.glr-tag-item:hover {
    border-color: #c62828;
    background: #fce4e1;
}

.glr-tag-item.selected {
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    border-color: #c62828;
    color: #fff;
    box-shadow: 0 2px 6px rgba(198, 40, 40, 0.35);
}

/* 谜语类型 */
.glr-type-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.glr-type-item {
    flex: 0 0 auto;
    padding: 7px 12px;
    text-align: center;
    border: 1.5px solid #ffccbc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #5d0a0a;
    transition: all 0.18s;
    user-select: none;
    background: #fff8f0;
}

.glr-type-item:hover {
    border-color: #c62828;
    color: #c62828;
    background: #fce4e1;
}

.glr-type-item.selected {
    border-color: #c62828;
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(198, 40, 40, 0.35);
}

.glr-type-icon {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}

/* 数量选择 */
.glr-count-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.glr-count-item {
    padding: 5px 14px;
    border: 1.5px solid #ef9a9a;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #c62828;
    transition: all 0.18s;
    user-select: none;
    background: #fff8f0;
}

.glr-count-item:hover {
    border-color: #c62828;
    background: #fce4e1;
}

.glr-count-item.selected {
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    border-color: #c62828;
    color: #fff;
    box-shadow: 0 2px 6px rgba(198, 40, 40, 0.35);
}

/* 生成按钮 */
.glr-generate-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.4);
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.glr-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d32f2f 0%, #8d1515 100%);
    box-shadow: 0 4px 14px rgba(198, 40, 40, 0.5);
    transform: translateY(-1px);
}

.glr-generate-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.glr-generate-btn.glr-inline-loading {
    background: linear-gradient(90deg, #c62828 0%, #f9a825 35%, #c62828 65%, #6d0a0a 100%);
    background-size: 200% 100%;
    animation: glrBtnShimmer 1.4s ease-in-out infinite;
    opacity: 1;
    cursor: not-allowed;
    transform: none;
}

/* 使用提示 */
.glr-tips-box {
    background: linear-gradient(135deg, #fff8f0 0%, #fce4e1 100%);
    border: 1px solid #ffccbc;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #c62828;
    line-height: 1.7;
}

.glr-tips-box p  { margin: 0 0 4px; font-weight: 600; }
.glr-tips-box ul { margin: 0; padding-left: 16px; }
.glr-tips-box li { margin-bottom: 2px; }
.glr-tips-box ul li::marker { color: #f9a825; font-weight: 600; }

/* 加载中禁用选项区域 */
.glr-disabled-section {
    pointer-events: none;
    opacity: 0.45;
    transition: opacity 0.2s;
    user-select: none;
}

/* ========== 右栏：灯谜结果 ========== */
.glr-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff8f0;
    min-width: 0;
}

.glr-result-header {
    padding: 10px 16px;
    border-bottom: 1px solid #ffccbc;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fff8f0 0%, #fff3e0 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.glr-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #c62828;
}

.glr-result-header-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.glr-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    flex-wrap: wrap;
}

.glr-regen-btn {
    padding: 3px 10px;
    background: linear-gradient(135deg, #fff3e0 0%, #fce4e1 100%);
    border: 1px solid #ef9a9a;
    border-radius: 12px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #c62828;
    transition: all 0.2s;
    white-space: nowrap;
}

.glr-regen-btn:hover {
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    color: #fff;
    border-color: #c62828;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.3);
}

.glr-result-theme {
    font-size: 12px;
    font-weight: 700;
    color: #b71c1c;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.glr-result-type-badge {
    background: #fff8f0;
    color: #c62828;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid #ffccbc;
}

.glr-result-count-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.glr-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
}

.glr-result-body::-webkit-scrollbar { width: 4px; }
.glr-result-body::-webkit-scrollbar-track { background: transparent; }
.glr-result-body::-webkit-scrollbar-thumb { background: #ef9a9a; border-radius: 3px; }
.glr-result-body::-webkit-scrollbar-thumb:hover { background: #c62828; }

/* ========== 占位符 ========== */
.glr-result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ef9a9a;
    text-align: center;
    padding: 40px;
    min-height: 200px;
}

.glr-placeholder-icon {
    font-size: 72px;
    margin-bottom: 16px;
    opacity: 0.85;
    animation: glrFloat 3s ease-in-out infinite;
}

@keyframes glrFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%       { transform: translateY(-10px) rotate(3deg); }
}

.glr-placeholder-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px;
    background: linear-gradient(135deg, #c62828 30%, #f9a825 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glr-placeholder-desc {
    font-size: 13px;
    color: #ef9a9a;
    margin: 3px 0;
    line-height: 1.6;
}

.glr-placeholder-shortcut {
    font-size: 12px;
    color: #e57373;
    margin: 10px 0 0;
}

.glr-placeholder-shortcut kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #fff8f0;
    border: 1px solid #ef9a9a;
    border-radius: 3px;
    font-size: 11px;
    color: #c62828;
    font-family: inherit;
    line-height: 1.5;
}

/* ========== 加载中 ========== */
.glr-result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 200px;
}

.glr-loading-lantern {
    font-size: 56px;
    animation: glrLanternSwing 1.8s ease-in-out infinite;
}

@keyframes glrLanternSwing {
    0%, 100% { transform: rotate(-10deg); }
    50%       { transform: rotate(10deg); }
}

.glr-loading-dots { display: flex; gap: 8px; }

.glr-loading-dots span {
    width: 9px;
    height: 9px;
    background: #c62828;
    border-radius: 50%;
    animation: glrDotBounce 1.2s ease-in-out infinite;
}

.glr-loading-dots span:nth-child(2) { animation-delay: 0.2s; background: #e57373; }
.glr-loading-dots span:nth-child(3) { animation-delay: 0.4s; background: #f9a825; }

@keyframes glrDotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1.15); opacity: 1; }
}

.glr-loading-text {
    font-size: 13px;
    color: #c62828;
    margin: 0;
}

/* ========== 结果内容 ========== */
.glr-result-content { min-height: 0; word-break: break-word; }

.glr-result-content .glr-result-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

/* 卡片入场动画 */
@keyframes glrCardIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 灯谜卡片 */
.glr-result-content .glr-riddle-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(198, 40, 40, 0.1);
    overflow: hidden;
    border-left: 5px solid #c62828;
    transition: box-shadow 0.22s, transform 0.22s, border-left-color 0.3s;
    cursor: pointer;
    position: relative;
    animation: glrCardIn 0.35s ease both;
    user-select: none;
}

/* 卡片顶部金色装饰线 */
.glr-result-content .glr-riddle-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(249, 168, 37, 0.45) 50%, transparent 100%);
    pointer-events: none;
}

/* 彩虹边框色序 */
.glr-result-content .glr-riddle-card:nth-child(6n+1) { border-left-color: #c62828; }
.glr-result-content .glr-riddle-card:nth-child(6n+2) { border-left-color: #f9a825; }
.glr-result-content .glr-riddle-card:nth-child(6n+3) { border-left-color: #1565c0; }
.glr-result-content .glr-riddle-card:nth-child(6n+4) { border-left-color: #2e7d32; }
.glr-result-content .glr-riddle-card:nth-child(6n+5) { border-left-color: #6a1b9a; }
.glr-result-content .glr-riddle-card:nth-child(6n+0) { border-left-color: #00695c; }

/* 入场延迟 */
.glr-result-content .glr-riddle-card:nth-child(1)  { animation-delay: 0.02s; }
.glr-result-content .glr-riddle-card:nth-child(2)  { animation-delay: 0.07s; }
.glr-result-content .glr-riddle-card:nth-child(3)  { animation-delay: 0.12s; }
.glr-result-content .glr-riddle-card:nth-child(4)  { animation-delay: 0.17s; }
.glr-result-content .glr-riddle-card:nth-child(5)  { animation-delay: 0.22s; }
.glr-result-content .glr-riddle-card:nth-child(6)  { animation-delay: 0.27s; }
.glr-result-content .glr-riddle-card:nth-child(7)  { animation-delay: 0.31s; }
.glr-result-content .glr-riddle-card:nth-child(8)  { animation-delay: 0.35s; }
.glr-result-content .glr-riddle-card:nth-child(9)  { animation-delay: 0.39s; }
.glr-result-content .glr-riddle-card:nth-child(10) { animation-delay: 0.43s; }
.glr-result-content .glr-riddle-card:nth-child(n+11) { animation-delay: 0.46s; }

.glr-result-content .glr-riddle-card:hover {
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.2);
    transform: translateY(-2px);
}

/* 谜面区 */
.glr-result-content .glr-riddle-q {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px 8px;
    background: #fff;
}

/* 题号徽章 */
.glr-result-content .glr-q-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    padding: 0 4px;
}

/* 彩虹题号色序 */
.glr-result-content .glr-riddle-card:nth-child(6n+2) .glr-q-num { background: linear-gradient(135deg, #f9a825, #e65100); }
.glr-result-content .glr-riddle-card:nth-child(6n+3) .glr-q-num { background: linear-gradient(135deg, #1565c0, #0d47a1); }
.glr-result-content .glr-riddle-card:nth-child(6n+4) .glr-q-num { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.glr-result-content .glr-riddle-card:nth-child(6n+5) .glr-q-num { background: linear-gradient(135deg, #6a1b9a, #4a148c); }
.glr-result-content .glr-riddle-card:nth-child(6n+0) .glr-q-num { background: linear-gradient(135deg, #00695c, #004d40); }

/* 谜面文字 */
.glr-result-content .glr-q-text {
    font-size: 14px;
    font-weight: 600;
    color: #3e0a00;
    line-height: 1.7;
    word-break: break-word;
    flex: 1;
    font-family: "SimSun", "宋体", serif;
    letter-spacing: 0.3px;
}

/* 点击提示行 */
.glr-riddle-hint {
    font-size: 11px;
    color: #ef9a9a;
    text-align: center;
    padding: 4px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: color 0.2s;
}

.glr-riddle-card.revealed .glr-riddle-hint { color: #43a047; }

.glr-hint-icon {
    font-size: 14px;
    transition: transform 0.3s;
}

.glr-riddle-card.revealed .glr-hint-icon {
    transform: rotate(180deg);
}

/* 谜底区 */
.glr-result-content .glr-riddle-a {
    display: none;
    padding: 12px 16px 10px;
    background: linear-gradient(135deg, #fff8e1 0%, #fffde7 100%);
    border-top: 1px dashed #f9cc50;
    animation: glrAnswerReveal 0.32s ease both;
}

/* 卡片底部操作栏 */
.glr-result-content .glr-card-footer {
    display: none;
    padding: 6px 16px 10px;
    background: linear-gradient(135deg, #fff8e1 0%, #fffde7 100%);
    justify-content: flex-end;
}

.glr-riddle-card.revealed .glr-card-footer { display: flex; }

.glr-card-copy-btn {
    padding: 3px 10px;
    background: rgba(198, 40, 40, 0.08);
    border: 1px solid #ef9a9a;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: #c62828;
    transition: all 0.18s;
    white-space: nowrap;
    line-height: 1.5;
}

.glr-card-copy-btn:hover {
    background: #c62828;
    color: #fff;
    border-color: #c62828;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(198, 40, 40, 0.25);
}

@keyframes glrAnswerReveal {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.glr-riddle-card.revealed .glr-riddle-a { display: block; }

.glr-result-content .glr-a-label {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    margin-bottom: 7px;
    letter-spacing: 0.5px;
}

.glr-result-content .glr-a-text {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #b71c1c;
    margin-bottom: 6px;
    line-height: 1.4;
    word-break: break-word;
    font-family: "KaiTi", "楷体", "SimKai", serif;
    letter-spacing: 2px;
}

.glr-result-content .glr-a-tip {
    display: block;
    font-size: 12px;
    color: #e65100;
    line-height: 1.6;
    word-break: break-word;
    font-style: italic;
}

/* 揭晓状态卡片 */
.glr-riddle-card.revealed {
    box-shadow: 0 4px 16px rgba(198, 40, 40, 0.2);
    border-left-color: #f9a825 !important;
}

/* ========== 解析错误 ========== */
.glr-parse-error {
    padding: 16px;
    color: #c62828;
    font-size: 13px;
    background: #fce4e1;
    border-radius: 6px;
    border: 1px solid #ef9a9a;
}

/* ========== 错误区域 ========== */
.glr-result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    color: #c62828;
    min-height: 200px;
}

.glr-result-error .error-icon { font-size: 42px; margin-bottom: 12px; }

.glr-result-error .error-msg {
    font-size: 14px;
    font-weight: 600;
    color: #c62828;
    margin: 0 0 8px;
}

.glr-result-error .error-tip {
    font-size: 12px;
    color: #ef9a9a;
    margin: 0 0 16px;
}

.glr-result-error .error-retry-btn {
    padding: 7px 22px;
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.glr-result-error .error-retry-btn:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #8d1515 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.35);
}

/* ========== Toast ========== */
.glr-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(80, 10, 10, 0.88);
    color: #fff;
    padding: 9px 22px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 10100;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.glr-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 模态框 ========== */
.glr-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10050;
    backdrop-filter: blur(2px);
}

.glr-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, 90vw);
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(198, 40, 40, 0.22);
    z-index: 10060;
    flex-direction: column;
    overflow: hidden;
}

.glr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    color: #fff;
    flex-shrink: 0;
}

.glr-modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; }

.glr-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.glr-modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.glr-modal-body {
    overflow-y: auto;
    padding: 16px;
    flex: 1;
}

.glr-modal-body::-webkit-scrollbar { width: 4px; }
.glr-modal-body::-webkit-scrollbar-track { background: transparent; }
.glr-modal-body::-webkit-scrollbar-thumb { background: #ef9a9a; border-radius: 2px; }
.glr-modal-body::-webkit-scrollbar-thumb:hover { background: #c62828; }

.glr-example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.glr-example-card {
    padding: 14px;
    border: 1.5px solid #ffccbc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff8f0;
}

.glr-example-card:hover {
    border-color: #c62828;
    background: #fce4e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.18);
}

.glr-example-icon { font-size: 24px; margin-bottom: 6px; }

.glr-example-theme {
    font-size: 13px;
    font-weight: 700;
    color: #b71c1c;
    margin-bottom: 4px;
    word-break: break-word;
}

.glr-example-badge {
    display: inline-block;
    background: #fff8f0;
    color: #c62828;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 5px;
    border: 1px solid #ffccbc;
}

.glr-example-desc {
    font-size: 11px;
    color: #e57373;
    line-height: 1.5;
    word-break: break-word;
}

.glr-example-loading,
.glr-example-load-err {
    text-align: center;
    padding: 32px;
    color: #ef9a9a;
    font-size: 13px;
}

.glr-example-load-err .error-retry-btn {
    padding: 7px 22px;
    background: linear-gradient(135deg, #c62828 0%, #6d0a0a 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 8px;
    display: inline-block;
}

.glr-example-load-err .error-retry-btn:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #8d1515 100%);
    transform: translateY(-1px);
}

/* ========== 暗黑模式 ========== */
body.dark .glr-container { background: #1a0a0a; box-shadow: 0 2px 12px rgba(0,0,0,0.5); }
body.dark .glr-main-content { background: #1a0a0a; }
body.dark .glr-toolbar { background: linear-gradient(135deg, #8d1515 0%, #4a0000 100%); }

/* 历史面板暗黑 */
body.dark .glr-history-panel { background: #1e0e0e; border-right-color: #3a1010; }
body.dark .glr-history-header { background: linear-gradient(to bottom, #260a0a 0%, #1e0e0e 100%); border-bottom-color: #3a1010; }
body.dark .glr-history-header h3 { color: #ef9a9a; }
body.dark .glr-history-count { color: #c62828; }
body.dark .glr-history-search { border-bottom-color: #3a1010; }
body.dark .glr-history-search input { background: #260a0a; border-color: #5a1a1a; color: #ffcdd2; }
body.dark .glr-history-search input:focus { border-color: #c62828; box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.15); }
body.dark .glr-history-item:hover { background: #260a0a; border-color: #3a1010; }
body.dark .glr-history-item.active { background: #3a1010; border-color: #c62828; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3); }
body.dark .glr-history-item-theme { color: #e57373; }
body.dark .glr-history-item-meta { color: #c62828; }
body.dark .glr-history-item-badge { background: #3a1010; color: #ef9a9a; }
body.dark .glr-history-empty { color: #5a1a1a; }
body.dark .glr-clear-btn { background: #3a1010; color: #ef9a9a; }
body.dark .glr-clear-btn:hover { background: #4a1515; }
body.dark .glr-history-item:hover .glr-history-item-del { color: #c62828; }
body.dark .glr-history-item:hover .glr-history-item-del:hover { color: #ff6b6b; background: #3a1010; }
body.dark .glr-history-list::-webkit-scrollbar-thumb { background: #5a1a1a; }
body.dark .glr-history-list::-webkit-scrollbar-thumb:hover { background: #8d1515; }

/* 中栏暗黑 */
body.dark .glr-input-panel { background: #1e0e0e; border-right-color: #3a1010; }
body.dark .glr-panel-header { background: linear-gradient(to bottom, #260a0a 0%, #1e0e0e 100%); border-bottom-color: #3a1010; }
body.dark .glr-panel-header h3 { color: #ef9a9a; }
body.dark .glr-panel-tip { color: #c62828; }
body.dark .glr-label { color: #ffcdd2; }
body.dark .glr-input { background: #260a0a; border-color: #5a1a1a; color: #ffcdd2; }
body.dark .glr-input:disabled { background: #1a0a0a; -webkit-text-fill-color: #5a1a1a; border-color: #3a1010; }
body.dark .glr-input:focus { border-color: #c62828; box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15); background: #2e0e0e; }
body.dark .glr-input::placeholder { color: #5a1a1a; }
body.dark .glr-char-count { color: #5a1a1a; }
body.dark .glr-char-count.warn { color: #c62828; }
body.dark .glr-char-count.over { color: #ff5252; font-weight: 700; }
body.dark .glr-tag-item { background: #260a0a; border-color: #3a1010; color: #e57373; }
body.dark .glr-tag-item:hover { background: #3a1010; border-color: #c62828; }
body.dark .glr-tag-item.selected { background: linear-gradient(135deg, #8d1515 0%, #4a0000 100%); }
body.dark .glr-type-item { background: #260a0a; border-color: #3a1010; color: #ffcdd2; }
body.dark .glr-type-item:hover { background: #3a1010; color: #ef9a9a; }
body.dark .glr-type-item.selected { background: linear-gradient(135deg, #8d1515 0%, #4a0000 100%); color: #fff; }
body.dark .glr-count-item { background: #260a0a; border-color: #5a1a1a; color: #ef9a9a; }
body.dark .glr-count-item:hover { background: #3a1010; }
body.dark .glr-count-item.selected { background: linear-gradient(135deg, #8d1515 0%, #4a0000 100%); }
body.dark .glr-generate-btn { background: linear-gradient(135deg, #8d1515 0%, #4a0000 100%); }
body.dark .glr-disabled-section { opacity: 0.25; }
body.dark .glr-generate-btn:hover:not(:disabled) { background: linear-gradient(135deg, #b71c1c 0%, #6d0a0a 100%); }
body.dark .glr-generate-btn.glr-inline-loading {
    background: linear-gradient(90deg, #8d1515 0%, #c62828 35%, #8d1515 65%, #4a0000 100%);
    background-size: 200% 100%;
}
body.dark .glr-tips-box { background: linear-gradient(135deg, #260a0a 0%, #1e0e0e 100%); border-color: #3a1010; color: #e57373; }
body.dark .glr-input-body::-webkit-scrollbar-thumb { background: #5a1a1a; }
body.dark .glr-input-body::-webkit-scrollbar-thumb:hover { background: #8d1515; }

/* 结果区暗黑 */
body.dark .glr-result-panel { background: #1a0a0a; }
body.dark .glr-result-header { background: linear-gradient(to bottom, #260a0a 0%, #1e0e0e 100%); border-bottom-color: #3a1010; }
body.dark .glr-result-header h3 { color: #ef9a9a; }
body.dark .glr-regen-btn { background: linear-gradient(135deg, #3a1010 0%, #260a0a 100%); border-color: #5a1a1a; color: #ef9a9a; }
body.dark .glr-regen-btn:hover { background: linear-gradient(135deg, #8d1515 0%, #4a0000 100%); color: #fff; border-color: #8d1515; }
body.dark .glr-result-theme { color: #e57373; }
body.dark .glr-result-type-badge { background: #3a1010; color: #ef9a9a; border-color: #5a1a1a; }
body.dark .glr-result-count-badge { background: #1b3a1e; color: #66bb6a; }
body.dark .glr-placeholder-title {
    background: linear-gradient(135deg, #ef9a9a 30%, #f9a825 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.dark .glr-placeholder-desc { color: #5a1a1a; }
body.dark .glr-placeholder-shortcut { color: #4a1010; }
body.dark .glr-placeholder-shortcut kbd { background: #260a0a; border-color: #5a1a1a; color: #ef9a9a; }
body.dark .glr-loading-dots span { background: #c62828; }
body.dark .glr-loading-dots span:nth-child(2) { background: #e57373; }
body.dark .glr-loading-dots span:nth-child(3) { background: #f9a825; }
body.dark .glr-loading-text { color: #c62828; }
body.dark .glr-result-body::-webkit-scrollbar-thumb { background: #5a1a1a; }
body.dark .glr-result-body::-webkit-scrollbar-thumb:hover { background: #8d1515; }

/* 卡片暗黑 */
body.dark .glr-result-content .glr-riddle-card { background: #260a0a; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
body.dark .glr-result-content .glr-riddle-card::after { background: linear-gradient(90deg, transparent 0%, rgba(249, 168, 37, 0.2) 50%, transparent 100%); }
body.dark .glr-result-content .glr-riddle-q { background: #260a0a; }
body.dark .glr-result-content .glr-q-text { color: #ffcdd2; }
body.dark .glr-riddle-hint { color: #5a1a1a; }
body.dark .glr-riddle-card.revealed .glr-riddle-hint { color: #66bb6a; }
body.dark .glr-result-content .glr-riddle-a { background: linear-gradient(135deg, #2a1a00 0%, #1e1400 100%); border-top-color: #5a3a00; }
body.dark .glr-result-content .glr-card-footer { background: linear-gradient(135deg, #2a1a00 0%, #1e1400 100%); }
body.dark .glr-card-copy-btn { background: rgba(198, 40, 40, 0.12); border-color: #8d1515; color: #ef9a9a; }
body.dark .glr-card-copy-btn:hover { background: #8d1515; color: #fff; border-color: #8d1515; }
body.dark .glr-result-content .glr-a-label { background: linear-gradient(135deg, #8d1515 0%, #4a0000 100%); }
body.dark .glr-result-content .glr-a-text { color: #f9a825; }
body.dark .glr-result-content .glr-a-tip { color: #e57373; }
body.dark .glr-riddle-card.revealed { box-shadow: 0 4px 16px rgba(249, 168, 37, 0.2); border-left-color: #f9a825 !important; }
body.dark .glr-parse-error { background: #3a1010; border-color: #8d1515; color: #ef9a9a; }

/* 错误区域暗黑 */
body.dark .glr-result-error { color: #c62828; }
body.dark .glr-result-error .error-msg { color: #e57373; }
body.dark .glr-result-error .error-tip { color: #5a1a1a; }

/* Toast 暗黑 */
body.dark .glr-toast { background: rgba(80, 10, 10, 0.92); }

/* 模态框暗黑 */
body.dark .glr-modal { background: #1e0e0e; }
body.dark .glr-modal-header { background: linear-gradient(135deg, #8d1515 0%, #4a0000 100%); }
body.dark .glr-example-card { background: #260a0a; border-color: #3a1010; }
body.dark .glr-example-card:hover { border-color: #c62828; background: #3a1010; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
body.dark .glr-example-theme { color: #e57373; }
body.dark .glr-example-badge { background: #3a1010; color: #ef9a9a; border-color: #5a1a1a; }
body.dark .glr-example-desc { color: #c62828; }
body.dark .glr-example-loading, body.dark .glr-example-load-err { color: #5a1a1a; }
body.dark .glr-modal-body::-webkit-scrollbar-thumb { background: #5a1a1a; }
body.dark .glr-modal-body::-webkit-scrollbar-thumb:hover { background: #8d1515; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .glr-main-content { flex-direction: column; }
    .glr-history-panel { width: 100%; height: 160px; border-right: none; border-bottom: 1px solid #ffccbc; flex-direction: row; flex-shrink: 0; }
    .glr-history-list { flex-direction: row; display: flex; gap: 5px; overflow-x: auto; overflow-y: hidden; padding: 5px; }
    .glr-history-item { min-width: 140px; max-width: 180px; flex-direction: column; }
    .glr-history-search { display: none; }
    .glr-input-panel { width: 100%; border-right: none; border-bottom: 1px solid #ffccbc; max-height: 260px; flex-shrink: 0; }
    .glr-input-body { padding: 10px; }
}

@media (max-width: 600px) {
    .glr-toolbar { flex-direction: column; align-items: flex-start; }
    .glr-result-content .glr-result-list { grid-template-columns: 1fr; }
    .glr-example-grid { grid-template-columns: 1fr; }
    .glr-history-panel { height: 130px; }
    .glr-input-panel { max-height: 220px; }
}
