/* =============================================
   猜歌词 - guess_lyrics.css
   音乐主题：暖琥珀金 #f59e0b / #d97706
   三栏布局：历史 | 设置 | 游戏
   ============================================= */

/* ========== 主容器 ========== */
.gl-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fffbf0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.gl-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;
}

/* ========== 顶部工具栏 ========== */
.gl-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 40px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.40);
    flex-shrink: 0;
}

.gl-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.gl-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.8px;
    margin-right: 4px;
}

.gl-toolbar .toolbar-btn {
    padding: 4px 11px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #92400e;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.5;
}

.gl-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.gl-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.gl-toolbar .toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 主操作按钮 */
.gl-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    color: #92400e;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.4);
}

.gl-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: #fff;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.6);
}

/* 生成中 shimmer 动画 */
.gl-toolbar .toolbar-btn-primary.gl-btn-loading {
    background: linear-gradient(90deg, #fed7aa 0%, #fef3c7 35%, #fed7aa 65%, #fbbf24 100%);
    background-size: 200% 100%;
    animation: glBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
}

/* 暗黑模式shimmer动画独立隔离，防止被 body.dark .toolbar-btn-primary 覆盖 */
body.dark .gl-toolbar .toolbar-btn-primary.gl-btn-loading {
    background: linear-gradient(90deg, #78350f 0%, #b45309 35%, #78350f 65%, #92400e 100%);
    background-size: 200% 100%;
    animation: glBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
}

@keyframes glBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== 三栏主内容 ========== */
.gl-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fffbf0;
}

/* ========== 左栏：历史记录 ========== */
.gl-history-panel {
    width: 190px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gl-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #fffbf0 0%, #fef9ee 100%);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.gl-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #78350f;
}

.gl-history-count {
    font-size: 11px;
    color: #b45309;
    font-weight: 400;
}

.gl-history-clear-btn {
    background: #fff7ed;
    border: none;
    color: #b45309;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}
.gl-history-clear-btn:hover { background: #fde68a; }

.gl-history-search {
    padding: 7px;
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.gl-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #4a3728;
    background: #fffbf0;
}

.gl-history-search input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
}

.gl-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.gl-history-empty {
    text-align: center;
    color: #b45309;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.8;
    opacity: 0.7;
}

.gl-history-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: #fffbf0;
    border: 1px solid #fde68a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    gap: 6px;
}

.gl-history-item:hover {
    background: #fef9c3;
    border-color: #f59e0b;
    transform: translateX(2px);
}

.gl-history-item.active {
    background: #fef3c7;
    border-color: #f59e0b;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.25);
}

.gl-history-item-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.gl-history-item-main {
    flex: 1;
    min-width: 0;
}

.gl-history-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gl-history-item-meta {
    font-size: 11px;
    color: #b45309;
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 2px;
}

.gl-history-item-type {
    background: #fde68a;
    color: #92400e;
    border-radius: 3px;
    padding: 0 4px;
    font-size: 10px;
}

.gl-history-item-del {
    width: 18px;
    height: 18px;
    background: #fff0ee;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.gl-history-item:hover .gl-history-item-del { opacity: 1; }
.gl-history-item-del:hover { background: #ef4444; color: white; }

/* 历史列表滚动条 */
.gl-history-list::-webkit-scrollbar { width: 4px; }
.gl-history-list::-webkit-scrollbar-track { background: transparent; }
.gl-history-list::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 2px; }
.gl-history-list::-webkit-scrollbar-thumb:hover { background: #f59e0b; }

/* ========== 中栏：游戏设置 ========== */
.gl-settings-panel {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gl-panel-header {
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fffbf0 0%, #fef9ee 100%);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.gl-panel-header h3 {
    margin: 0 0 3px 0;
    font-size: 13px;
    font-weight: 600;
    color: #78350f;
}

.gl-panel-tip {
    font-size: 11px;
    color: #b45309;
}

.gl-settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.gl-settings-body::-webkit-scrollbar { width: 4px; }
.gl-settings-body::-webkit-scrollbar-track { background: transparent; }
.gl-settings-body::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 2px; }

.gl-settings-group {
    margin-bottom: 14px;
}

.gl-settings-label {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.gl-optional-tag {
    font-weight: 400;
    font-size: 10px;
    background: #fde68a;
    color: #92400e;
    padding: 0 5px;
    border-radius: 4px;
}

/* 设置选项（模式/难度） */
.gl-settings-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gl-settings-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid #fde68a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
    background: #fffbf0;
    user-select: none;
    font-size: 12px;
    font-weight: 500;
    color: #78350f;
}

.gl-settings-option:hover {
    border-color: #f59e0b;
    background: #fef9c3;
}

.gl-settings-option.selected {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.25);
}

.gl-option-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.gl-option-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.gl-option-name {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
}

.gl-option-desc {
    font-size: 10px;
    color: #b45309;
}

/* 风格选项（横向多行） */
.gl-genre-options {
    flex-direction: row;
    flex-wrap: wrap;
}

.gl-genre-options .gl-settings-option {
    padding: 5px 9px;
    flex: none;
    font-size: 11px;
}

/* 艺人输入框 */
.gl-settings-input {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #fde68a;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #4a3728;
    background: #fffbf0;
}

.gl-settings-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
    background: #fff;
}

.gl-settings-input::placeholder { color: #d97706; opacity: 0.6; }

/* 使用说明 */
.gl-tips-box {
    background: #fffbf0;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 11px;
    color: #78350f;
    line-height: 1.7;
    margin-top: 4px;
}

.gl-tips-box p {
    font-weight: 600;
    margin-bottom: 5px;
    color: #92400e;
}

.gl-tips-box ul {
    padding-left: 16px;
    margin: 0;
}

.gl-tips-box li {
    margin-bottom: 3px;
}

.gl-tips-box li::marker {
    color: var(--caq-primary, #f59e0b);
}

.gl-answer-block li::marker {
    color: #15803d;
}

/* ========== 右栏：游戏区域 ========== */
.gl-game-panel {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.gl-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(to bottom, #fffbf0 0%, #fef9ee 100%);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.gl-game-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #78350f;
}

.gl-game-meta {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ========== 占位 / 加载 / 错误 状态 ========== */
#glResultError {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gl-placeholder,
.gl-loading,
.gl-result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.gl-placeholder {
    padding: 40px 20px;
}

.gl-placeholder-notes {
    font-size: 36px;
    letter-spacing: 8px;
    animation: glNotePulse 2s ease-in-out infinite;
    margin-bottom: 18px;
}

@keyframes glNotePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.95); }
}

.gl-placeholder-title {
    font-size: 18px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 10px;
}

.gl-placeholder-desc {
    font-size: 13px;
    color: #b45309;
    margin-bottom: 4px;
}

.gl-placeholder-sub {
    margin-top: 16px;
    font-size: 13px;
    color: #d97706;
    background: #fef9c3;
    padding: 6px 18px;
    border-radius: 20px;
    border: 1px solid #fde68a;
}

/* 加载动画 */
.gl-loading {
    padding: 40px 20px;
}

.gl-loading-notes {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.gl-loading-notes span {
    font-size: 28px;
    animation: glLoadNote 1.2s ease-in-out infinite;
}

.gl-loading-notes span:nth-child(1) { animation-delay: 0s; }
.gl-loading-notes span:nth-child(2) { animation-delay: 0.3s; }
.gl-loading-notes span:nth-child(3) { animation-delay: 0.6s; }

@keyframes glLoadNote {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50%       { opacity: 1;   transform: translateY(-8px); }
}

.gl-loading-text {
    font-size: 14px;
    color: #92400e;
    font-weight: 500;
}

/* 错误区域 */
.gl-result-error {
    text-align: center;
    padding: 32px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 4px solid #ef4444;
    margin: 12px;
    border-radius: 6px;
    background: #fff5f5;
}

.gl-error-icon {
    font-size: 36px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.gl-error-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.gl-error-msg {
    font-size: 14px;
    color: #dc2626;
    font-weight: 500;
    margin: 0;
}

.gl-error-tip {
    font-size: 12px;
    color: #b45309;
    margin: 0;
}

/* 错误区一键重试按钮 */
.gl-retry-btn {
    margin-top: 12px;
    padding: 7px 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.gl-retry-btn:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.gl-retry-btn:active { transform: translateY(0); }

/* ========== 游戏内容区 ========== */
.gl-game-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.gl-game-body::-webkit-scrollbar { width: 5px; }
.gl-game-body::-webkit-scrollbar-track { background: transparent; }
.gl-game-body::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 3px; }
.gl-game-body::-webkit-scrollbar-thumb:hover { background: #f59e0b; }

.gl-game-content {
    padding: 20px 24px;
    flex: 1;
}

/* ========== 游戏挑战 HTML 样式（AI 生成内容） ========== */
.gl-game {
    max-width: 680px;
}

/* 挑战头部 */
.gl-challenge-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 8px;
}

.gl-challenge-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gl-challenge-icon { font-size: 20px; }

.gl-challenge-title {
    font-size: 16px;
    font-weight: 700;
    color: #78350f;
}

.gl-badge-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* 游戏徽标 */
.gl-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.gl-badge-fill    { background: #e0f2fe; color: #0369a1; }
.gl-badge-guess   { background: #f0fdf4; color: #166534; }
.gl-badge-easy    { background: #dcfce7; color: #15803d; }
.gl-badge-medium  { background: #fff7ed; color: #c2410c; }
.gl-badge-hard    { background: #fef2f2; color: #b91c1c; }

/* 歌词区块 */
.gl-lyrics-block {
    background: linear-gradient(135deg, #fffbf0 0%, #fefce8 100%);
    border: 1.5px solid #fde68a;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

/* 装饰音符 */
.gl-lyrics-block::before {
    content: "🎵";
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    opacity: 0.15;
}

.gl-lyrics-line {
    font-size: 17px;
    line-height: 2;
    color: #3d1a08;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif;
    letter-spacing: 0.5px;
}

/* 填词输入框 */
.gl-fill-input {
    display: inline-block;
    width: 80px;
    padding: 2px 6px;
    border: none;
    border-bottom: 2px solid #f59e0b;
    background: transparent;
    font-size: 17px;
    font-family: inherit;
    color: #92400e;
    outline: none;
    text-align: center;
    transition: all 0.2s;
    vertical-align: baseline;
    border-radius: 0;
    min-width: 40px;
}

.gl-fill-input:focus {
    border-bottom-color: #d97706;
    background: rgba(254, 243, 199, 0.5);
    border-radius: 4px 4px 0 0;
}

/* 答题结果状态 */
.gl-fill-input.gl-correct {
    color: #15803d;
    border-bottom-color: #22c55e;
    background: rgba(220, 252, 231, 0.5);
    border-radius: 4px;
}

.gl-fill-input.gl-wrong {
    color: #dc2626;
    border-bottom-color: #ef4444;
    background: rgba(254, 226, 226, 0.5);
    border-radius: 4px;
}

.gl-correct-hint {
    font-size: 12px;
    color: #15803d;
    background: #dcfce7;
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
}

/* 提示区 */
.gl-hint-block {
    font-size: 13px;
    color: #92400e;
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* 猜歌名答题区 */
.gl-guess-input-area {
    background: #fffbf0;
    border: 1.5px solid #fde68a;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.gl-guess-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.gl-guess-input-row:last-child { margin-bottom: 0; }

.gl-guess-input-row label {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
    white-space: nowrap;
    min-width: 50px;
}

.gl-guess-input {
    flex: 1;
    padding: 7px 10px;
    border: 1.5px solid #fcd34d;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
    color: #3d1a08;
}

.gl-guess-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

/* 猜歌名模式答题结果状态 */
.gl-guess-input.gl-guess-correct {
    border-color: #22c55e;
    color: #15803d;
    background: rgba(220, 252, 231, 0.45);
}

.gl-guess-input.gl-guess-wrong {
    border-color: #ef4444;
    color: #dc2626;
    background: rgba(254, 226, 226, 0.45);
}

/* 查看答案按钮 */
.gl-check-btn {
    display: block;
    width: 100%;
    padding: 11px 0;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.5px;
    margin-top: 8px;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

.gl-check-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 5px 16px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.gl-check-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* 得分展示 */
.gl-score {
    text-align: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
    border: 1.5px solid #fde68a;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 10px;
    animation: glScorePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes glScorePop {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* 答案揭晓区 */
.gl-answer-block {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1.5px solid #86efac;
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 14px;
    animation: glAnswerSlide 0.35s ease-out;
}

@keyframes glAnswerSlide {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gl-answer-song {
    font-size: 17px;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 6px;
}

.gl-answer-year {
    font-size: 13px;
    color: #166534;
    margin-bottom: 8px;
}

.gl-answer-bg {
    font-size: 13px;
    color: #166534;
    line-height: 1.7;
    padding-top: 8px;
    border-top: 1px solid #86efac;
}

.gl-full-lyrics-label {
    font-size: 12px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 6px;
    padding-top: 8px;
    border-top: 1px solid #86efac;
}

.gl-full-lyrics {
    font-size: 15px;
    line-height: 1.9;
    color: #14532d;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif;
}

.gl-full-line {
    display: block;
    line-height: 2;
}

/* ========== 工具栏及游戏区徽标 ========== */
.gl-mode-badge,
.gl-diff-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
}

/* 游戏头部「换一题」快捷按钮 */
.gl-refresh-btn {
    padding: 3px 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.5;
}

.gl-refresh-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.gl-refresh-btn:active { transform: translateY(0); }

/* ========== 模态框 ========== */
.gl-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.gl-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 10px;
    width: 680px;
    max-width: 96vw;
    max-height: 80vh;
    z-index: 100001;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: glModalIn 0.22s ease-out;
}

@keyframes glModalIn {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.gl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    flex-shrink: 0;
}

.gl-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.gl-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gl-modal-close:hover { background: rgba(255,255,255,0.35); }

.gl-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.gl-example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gl-example-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fffbf0;
    border: 1.5px solid #fde68a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s;
}

.gl-example-card:hover {
    background: #fef9c3;
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.18);
}

.gl-example-icon { font-size: 22px; flex-shrink: 0; }

.gl-example-info { flex: 1; min-width: 0; }

.gl-example-name {
    font-size: 13px;
    font-weight: 700;
    color: #78350f;
    margin-bottom: 2px;
}

.gl-example-mode-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    margin-right: 4px;
    background: #fde68a;
    color: #92400e;
}

.gl-example-desc {
    font-size: 11px;
    color: #b45309;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 响应式布局 ========== */
@media (max-width: 899px) {
    .gl-history-panel { display: none; }
    .gl-settings-panel { width: 230px; }
}

@media (max-width: 639px) {
    .gl-main-content { flex-direction: column; }
    .gl-settings-panel {
        width: 100%;
        flex-shrink: 0;
        max-height: 260px;
        border-right: none;
        border-bottom: 1px solid #fde68a;
    }
    body.dark .gl-settings-panel {
        border-bottom-color: #44320a;
    }
    .gl-game-panel { flex: 1; min-height: 0; }
    .gl-example-grid { grid-template-columns: 1fr; }
}

/* ========== 打印样式 ========== */
@media print {
    .gl-toolbar,
    .gl-history-panel,
    .gl-settings-panel { display: none !important; }
    .gl-container { height: auto !important; position: static !important; }
    .gl-game-panel { flex: 1; overflow: visible !important; }
    .gl-game-body { overflow: visible !important; }
    .gl-answer-block { display: block !important; }
}

/* ========== 抖动动画（输入验证） ========== */
@keyframes glShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.shake {
    animation: glShake 0.4s ease;
    border-color: #ef4444 !important;
}

/* ========== 暗黑模式 ========== */
body.dark .gl-container {
    background: #1c1008;
}

body.dark .gl-main-content {
    background: #1c1008;
}

body.dark .gl-toolbar {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.5);
}

body.dark .gl-toolbar .toolbar-btn {
    background: rgba(30, 16, 4, 0.7);
    color: #fde68a;
}

body.dark .gl-toolbar .toolbar-btn:hover:not(:disabled) {
    background: rgba(30, 16, 4, 0.9);
    color: #fbbf24;
}

body.dark .gl-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    color: #fef9c3;
}

body.dark .gl-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
}

body.dark .gl-toolbar .toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

body.dark .gl-history-panel {
    background: #1c1a14;
    border-color: #44320a;
}

body.dark .gl-history-header {
    background: linear-gradient(to bottom, #1c1008 0%, #1c1a14 100%);
    border-color: #44320a;
}

body.dark .gl-history-header h3 { color: #fde68a; }
body.dark .gl-history-count { color: #b45309; }

body.dark .gl-history-clear-btn {
    background: #2a1a06;
    color: #fbbf24;
}
body.dark .gl-history-clear-btn:hover { background: #3d2a0a; }

body.dark .gl-history-search { border-color: #44320a; }

body.dark .gl-history-search input {
    background: #1c1008;
    border-color: #44320a;
    color: #fde68a;
}

body.dark .gl-history-search input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

body.dark .gl-history-list::-webkit-scrollbar-thumb { background: #44320a; }
body.dark .gl-history-list::-webkit-scrollbar-thumb:hover { background: #78350f; }

body.dark .gl-history-empty { color: #b45309; }

body.dark .gl-history-item {
    background: #221504;
    border-color: #44320a;
    color: #fde68a;
}

body.dark .gl-history-item:hover {
    background: #2e1d07;
    border-color: #f59e0b;
}

body.dark .gl-history-item.active {
    background: #3d2a0a;
    border-color: #f59e0b;
}

body.dark .gl-history-item-name { color: #fde68a; }
body.dark .gl-history-item-meta { color: #b45309; }

body.dark .gl-history-item-type {
    background: #44320a;
    color: #fde68a;
}

body.dark .gl-history-item-del {
    background: #3d1006;
    color: #f87171;
}

body.dark .gl-history-item:hover .gl-history-item-del { opacity: 1; }
body.dark .gl-history-item-del:hover { background: #ef4444; color: #fff; }

body.dark .gl-settings-panel {
    background: #1c1a14;
    border-color: #44320a;
}

body.dark .gl-panel-header {
    background: linear-gradient(to bottom, #1c1008 0%, #1c1a14 100%);
    border-color: #44320a;
}

body.dark .gl-panel-header h3 { color: #fde68a; }
body.dark .gl-panel-tip { color: #b45309; }
body.dark .gl-settings-body::-webkit-scrollbar-thumb { background: #44320a; }
body.dark .gl-settings-label { color: #fde68a; }

body.dark .gl-optional-tag {
    background: #44320a;
    color: #fde68a;
}

body.dark .gl-settings-option {
    background: #221504;
    border-color: #44320a;
    color: #fde68a;
}

body.dark .gl-settings-option:hover {
    background: #2e1d07;
    border-color: #f59e0b;
}

body.dark .gl-settings-option.selected {
    background: linear-gradient(135deg, #44320a 0%, #3d2a0a 100%);
    border-color: #f59e0b;
}

body.dark .gl-option-name { color: #fde68a; }
body.dark .gl-option-desc { color: #b45309; }

body.dark .gl-settings-input {
    background: #1c1008;
    border-color: #44320a;
    color: #fde68a;
}

body.dark .gl-settings-input:focus {
    border-color: #f59e0b;
    background: #221504;
}

body.dark .gl-settings-input::placeholder { color: #b45309; opacity: 0.7; }

body.dark .gl-tips-box {
    background: #221504;
    border-color: #44320a;
    color: #fde68a;
}

body.dark .gl-tips-box p { color: #fbbf24; }

body.dark .gl-tips-box li::marker {
    color: var(--caq-primary, #f59e0b);
}

body.dark .gl-answer-block li::marker {
    color: #4ade80;
}

body.dark .gl-game-panel { background: #1c1a14; }

body.dark .gl-game-header {
    background: linear-gradient(to bottom, #1c1008 0%, #1c1a14 100%);
    border-color: #44320a;
}

body.dark .gl-game-header h3 { color: #fde68a; }

body.dark .gl-mode-badge,
body.dark .gl-diff-badge {
    background: #44320a;
    color: #fde68a;
}

body.dark .gl-game-body::-webkit-scrollbar-thumb { background: #44320a; }
body.dark .gl-game-body::-webkit-scrollbar-thumb:hover { background: #78350f; }

body.dark .gl-placeholder-title { color: #fde68a; }
body.dark .gl-placeholder-desc  { color: #b45309; }
body.dark .gl-placeholder-sub   { background: #221504; border-color: #44320a; color: #fbbf24; }
body.dark .gl-loading-text      { color: #fde68a; }

body.dark .gl-result-error .gl-error-msg { color: #f87171; }
body.dark .gl-result-error .gl-error-tip { color: #b45309; }

body.dark .gl-result-error {
    background: #2d0a0a;
    border-left-color: #ef4444;
}

body.dark .gl-retry-btn {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.4);
}

body.dark .gl-retry-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* 暗黑-游戏内容 */
body.dark .gl-lyrics-block {
    background: linear-gradient(135deg, #221504 0%, #2a1a06 100%);
    border-color: #44320a;
}

body.dark .gl-lyrics-line { color: #fde68a; }

body.dark .gl-fill-input {
    border-bottom-color: #f59e0b;
    color: #fde68a;
}

body.dark .gl-fill-input:focus {
    background: rgba(245, 158, 11, 0.12);
}

body.dark .gl-fill-input.gl-correct {
    color: #4ade80;
    border-bottom-color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

body.dark .gl-fill-input.gl-wrong {
    color: #f87171;
    border-bottom-color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

body.dark .gl-correct-hint {
    background: #14532d;
    color: #4ade80;
}

body.dark .gl-hint-block {
    background: #221504;
    border-color: #44320a;
    color: #fde68a;
}

body.dark .gl-guess-input-area {
    background: #221504;
    border-color: #44320a;
}

body.dark .gl-guess-input-row label { color: #fde68a; }

body.dark .gl-guess-input {
    background: #1c1008;
    border-color: #44320a;
    color: #fde68a;
}

body.dark .gl-guess-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

body.dark .gl-guess-input.gl-guess-correct {
    border-color: #22c55e;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
}

body.dark .gl-guess-input.gl-guess-wrong {
    border-color: #ef4444;
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
}

body.dark .gl-check-btn {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
    box-shadow: 0 3px 10px rgba(180, 83, 9, 0.4);
}

body.dark .gl-check-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

body.dark .gl-score {
    background: linear-gradient(135deg, #2a1a06 0%, #3d2a0a 100%);
    border-color: #44320a;
    color: #fde68a;
}

body.dark .gl-answer-block {
    background: linear-gradient(135deg, #052e16 0%, #14532d 100%);
    border-color: #166534;
}

body.dark .gl-answer-song { color: #4ade80; }
body.dark .gl-answer-year { color: #86efac; }
body.dark .gl-answer-bg   { color: #86efac; border-color: #166534; }
body.dark .gl-full-lyrics-label { color: #4ade80; border-color: #166534; }
body.dark .gl-full-lyrics { color: #bbf7d0; }

body.dark .gl-challenge-title { color: #fde68a; }

/* 暗黑模式-游戏内容徽标 */
body.dark .gl-badge-fill    { background: #0c2a3d; color: #38bdf8; }
body.dark .gl-badge-guess   { background: #052e16; color: #4ade80; }
body.dark .gl-badge-easy    { background: #052e16; color: #4ade80; }
body.dark .gl-badge-medium  { background: #431407; color: #fb923c; }
body.dark .gl-badge-hard    { background: #450a0a; color: #f87171; }

/* 暗黑模式-换一题按钮 */
body.dark .gl-refresh-btn {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
}
body.dark .gl-refresh-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* 暗黑-模态框 */
body.dark .gl-modal {
    background: #1c1a14;
}

body.dark .gl-modal-body {
    background: #1c1a14;
}

body.dark .gl-modal-header {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
}

body.dark .gl-example-card {
    background: #221504;
    border-color: #44320a;
}

body.dark .gl-example-card:hover {
    background: #2e1d07;
    border-color: #f59e0b;
}

body.dark .gl-example-name { color: #fde68a; }

body.dark .gl-example-mode-badge {
    background: #44320a;
    color: #fde68a;
}

body.dark .gl-example-desc { color: #b45309; }

/* 暗黑模式滚动条 */
body.dark .gl-settings-body::-webkit-scrollbar-thumb { background: #44320a; }
body.dark .gl-settings-body::-webkit-scrollbar-thumb:hover { background: #78350f; }
