/* ====================================================
   成语接龙 - 样式表
   主题色：中国红 + 金色，传统文化风格
   ==================================================== */

/* ========== 主容器 ========== */
.is-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fdf6ec;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(160, 40, 30, 0.12);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.is-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.is-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #c0392b 0%, #8b1a1a 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(160, 40, 30, 0.4);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffe8c8;
    letter-spacing: 1px;
    margin-right: 6px;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: rgba(255, 215, 0, 0.25);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffe066;
    font-weight: 600;
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.4);
    border-color: #ffd700;
    color: #fff;
}

.toolbar-btn-suggest {
    background: rgba(39, 174, 96, 0.2);
    border-color: rgba(39, 174, 96, 0.4);
    color: #a8ffc7;
}

.toolbar-btn-suggest:hover:not(:disabled) {
    background: rgba(39, 174, 96, 0.35);
    border-color: rgba(39, 174, 96, 0.7);
    color: #fff;
}

/* ========== 主内容区 ========== */
.is-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fdf6ec;
}

/* ========== 左栏：历史记录 ========== */
.is-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #f0d9c0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fffaf5 0%, #fff3e6 100%);
    border-bottom: 1px solid #f0d9c0;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #8b3a1a;
}

.history-count {
    font-size: 11px;
    color: #c0392b;
    margin-left: 4px;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #c0392b;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 3px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.history-empty {
    text-align: center;
    color: #c8a880;
    font-size: 12px;
    padding: 24px 8px;
}

.history-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #fff9f2;
    border: 1px solid #f0d9c0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.history-item:hover {
    background: #fff3e2;
    border-color: #c0392b;
    transform: translateX(2px);
}

.history-item.active {
    background: #fff3e2;
    border-color: #c0392b;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.history-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b2010;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #b07850;
}

.history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #e74c3c;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    background: #e74c3c;
    color: #fff;
}

/* ========== 中栏：游戏区 ========== */
.is-game-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #f0d9c0;
    background: #fdf6ec;
    min-width: 0;
}

/* 欢迎引导页 */
.game-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-icon {
    font-size: 56px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: #8b1a1a;
    margin: 0 0 8px;
    letter-spacing: 2px;
}

.welcome-desc {
    font-size: 14px;
    color: #a06040;
    margin: 0 0 20px;
    text-align: center;
    max-width: 380px;
    line-height: 1.7;
}

.welcome-rules {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
    max-width: 360px;
    width: 100%;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #7a4030;
    background: #fff8f0;
    border: 1px solid #f0d9c0;
    border-left: 3px solid #c0392b;
    border-radius: 6px;
    padding: 8px 14px;
}

.rule-num {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #c0392b, #8b1a1a);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.welcome-start {
    width: 100%;
    max-width: 400px;
}

.start-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.start-idiom-input {
    flex: 1;
    padding: 11px 14px;
    border: 2px solid #f0d9c0;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    background: #fff;
    color: #5a2010;
    font-family: inherit;
    letter-spacing: 2px;
    text-align: center;
    transition: all 0.2s;
}

.start-idiom-input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.start-idiom-input::placeholder {
    color: #c8a880;
    letter-spacing: 0;
    font-size: 13px;
}

.start-btn {
    padding: 11px 20px;
    background: linear-gradient(135deg, #c0392b, #8b1a1a);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.start-btn:hover {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

.start-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Shake 抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%,  60% { transform: translateX(-6px); }
    40%,  80% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.4s ease;
}

.start-error-tip {
    font-size: 12px;
    color: #c0392b;
    text-align: center;
    margin: 0 0 4px;
    font-weight: 500;
}

.start-tip {
    font-size: 12px;
    color: #b07850;
    text-align: center;
    margin: 0;
}

/* ========== 游戏进行中 ========== */
.game-playing {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 接龙链展示区 */
.chain-display-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 14px 16px 0;
}

.chain-label {
    font-size: 12px;
    font-weight: 600;
    color: #8b3a1a;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.chain-display {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 接龙卡片 */
.idiom-card {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #f0d9c0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(160, 50, 30, 0.08);
    animation: cardIn 0.3s ease;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.idiom-card:hover {
    border-color: #c0392b;
    box-shadow: 0 2px 10px rgba(192, 57, 43, 0.18);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.card-index {
    width: 28px;
    height: 100%;
    background: linear-gradient(to bottom, #c0392b, #8b1a1a);
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 12px 0;
}

.card-chars {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 4px;
    flex: 1;
}

.char-cell {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #5a2010;
    border-radius: 4px;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    transition: all 0.2s;
    position: relative;
}

.char-cell.char-first {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 2px solid #e67e22;
    color: #c0392b;
}

.char-cell.char-last {
    background: linear-gradient(135deg, #fde8e8, #fcb8b8);
    border: 2px solid #c0392b;
    color: #8b1a1a;
}

.card-meaning-wrap {
    padding: 10px 14px 10px 0;
    flex: 1;
    min-width: 0;
}

.card-meaning-text {
    font-size: 12px;
    color: #9a6040;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 接龙箭头（卡片间） */
.chain-arrow {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 0 0 36px;
    flex-shrink: 0;
}

.arrow-line {
    width: 2px;
    height: 16px;
    background: linear-gradient(to bottom, #c0392b, #e67e22);
    border-radius: 2px;
}

.arrow-tip {
    font-size: 14px;
    color: #c0392b;
}

/* ========== 要求首字提示条 ========== */
.required-char-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fff0e8, #ffe4d0);
    border-top: 1px solid #f0c8a0;
    border-bottom: 1px solid #f0c8a0;
    flex-shrink: 0;
}

.required-char-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.req-label {
    font-size: 13px;
    color: #8b3a1a;
}

.req-char {
    font-size: 28px;
    font-weight: 700;
    color: #c0392b;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    background: #fff;
    border: 2px solid #c0392b;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.2);
    animation: pulseChar 2s ease-in-out infinite;
}

@keyframes pulseChar {
    0%, 100% { box-shadow: 0 2px 6px rgba(192, 57, 43, 0.2); }
    50% { box-shadow: 0 2px 12px rgba(192, 57, 43, 0.4); }
}

.game-stats-inline {
    display: flex;
    gap: 14px;
    align-items: center;
}

.stat-item {
    font-size: 13px;
    color: #8b3a1a;
}

.stat-item strong {
    color: #c0392b;
    font-weight: 700;
}

/* ========== 输入区 ========== */
.game-input-area {
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid #f0d9c0;
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    position: relative;
    border: 2px solid #f0c8a0;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
    background: #fff;
}

.input-wrapper:focus-within {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.char-hint-prefix {
    padding: 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: #c0392b;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    background: #fff3e0;
    height: 44px;
    display: flex;
    align-items: center;
    border-right: 1px solid #f0c8a0;
    min-width: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.char-hint-prefix:empty {
    display: none;
}

.idiom-input {
    flex: 1;
    height: 44px;
    padding: 0 12px;
    border: none;
    outline: none;
    font-size: 18px;
    color: #5a2010;
    background: transparent;
    letter-spacing: 3px;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    font-weight: 600;
}

.idiom-input::placeholder {
    color: #c8a880;
    letter-spacing: 0;
    font-size: 13px;
    font-family: inherit;
    font-weight: 400;
}

.char-counter {
    padding: 0 10px;
    font-size: 12px;
    color: #b07850;
    white-space: nowrap;
}

.char-counter.full {
    color: #27ae60;
    font-weight: 600;
}

/* 3 字预警色（即将输完） */
.char-counter.warming {
    color: #e67e22;
    font-weight: 600;
}

.input-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.action-btn {
    padding: 9px 16px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-validate {
    background: linear-gradient(135deg, #c0392b, #8b1a1a);
    color: #fff;
}

.action-validate:hover:not(:disabled) {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(192, 57, 43, 0.3);
}

.action-validate:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.action-ai {
    background: linear-gradient(135deg, #27ae60, #1a6b40);
    color: #fff;
}

.action-ai:hover:not(:disabled) {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

.action-ai:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 验证中提示 */
.validating-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #fff8f0;
    border-top: 1px solid #f0d9c0;
    font-size: 13px;
    color: #8b3a1a;
    flex-shrink: 0;
}

.validating-dots {
    display: flex;
    gap: 4px;
}

.validating-dots span {
    width: 6px;
    height: 6px;
    background: #c0392b;
    border-radius: 50%;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.validating-dots span:nth-child(2) { animation-delay: 0.2s; }
.validating-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.6; }
    40% { transform: scale(1); opacity: 1; }
}

/* 验证结果提示 */
.validate-result {
    padding: 10px 16px;
    font-size: 13px;
    line-height: 1.6;
    flex-shrink: 0;
    border-top: 1px solid #f0d9c0;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.validate-result.success {
    background: #f0fff5;
    color: #1a6b40;
    border-left: 4px solid #27ae60;
}

.validate-result.error {
    background: #fff5f5;
    color: #8b1a1a;
    border-left: 4px solid #c0392b;
}

/* 验证重试 & AI建议重试 按鈕 */
.validate-retry-btn,
.suggest-retry-btn {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    color: inherit;
    vertical-align: middle;
    transition: opacity 0.2s;
}

.validate-retry-btn:hover,
.suggest-retry-btn:hover {
    opacity: 0.7;
}

/* AI建议失败提示 */
.suggest-error {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    font-size: 13px;
    color: #9a6040;
}

/* ========== 游戏结束 ========== */
.game-ended {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    overflow-y: auto;
    animation: fadeInUp 0.4s ease;
}

.ended-header {
    text-align: center;
    margin-bottom: 20px;
}

.ended-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.ended-title {
    font-size: 20px;
    font-weight: 700;
    color: #8b1a1a;
    margin: 0;
    letter-spacing: 1px;
}

.ended-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #f0d9c0;
    border-radius: 8px;
    padding: 14px 20px;
    text-align: center;
    min-width: 90px;
    box-shadow: 0 1px 4px rgba(160, 50, 30, 0.08);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #c0392b;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: #9a6040;
    margin-top: 4px;
}

.ended-chain-title {
    font-size: 13px;
    font-weight: 600;
    color: #8b3a1a;
    margin-bottom: 10px;
    align-self: flex-start;
    width: 100%;
}

.ended-chain-display {
    width: 100%;
    background: #fff;
    border: 1px solid #f0d9c0;
    border-radius: 8px;
    padding: 14px;
    font-size: 13px;
    color: #5a2010;
    line-height: 2;
    margin-bottom: 20px;
    word-break: break-all;
}

.ended-chain-display .ended-chain-idiom {
    display: inline-block;
    background: linear-gradient(135deg, #fff8f0, #fff3e0);
    border: 1px solid #f0c8a0;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 3px 2px;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    font-weight: 700;
    color: #6b2010;
    font-size: 14px;
    vertical-align: middle;
    transition: background 0.2s;
}

.ended-chain-display .ended-arrow {
    color: #c0392b;
    font-size: 14px;
    margin: 0 2px;
    vertical-align: middle;
    font-weight: 700;
}

.ended-actions {
    display: flex;
    gap: 12px;
}

.ended-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #c0392b;
    color: #c0392b;
    background: #fff;
}

.ended-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(192, 57, 43, 0.2);
}

.ended-btn-primary {
    background: linear-gradient(135deg, #c0392b, #8b1a1a);
    color: #fff;
    border-color: transparent;
}

.ended-btn-primary:hover {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.35);
}

/* ========== 右栏：信息面板 ========== */
.is-info-panel {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 初始占位 */
.info-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
}

.placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.placeholder-title {
    font-size: 14px;
    font-weight: 600;
    color: #8b3a1a;
    margin: 0 0 8px;
}

.placeholder-desc {
    font-size: 12px;
    color: #a07050;
    line-height: 1.7;
    margin: 0;
}

/* 成语详情 */
.idiom-detail {
    border-bottom: 1px solid #f0d9c0;
    flex-shrink: 0;
}

.detail-header {
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fffaf5, #fff3e6);
    border-bottom: 1px solid #f0d9c0;
}

.detail-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #8b3a1a;
}

.detail-body {
    padding: 14px 16px;
}

.detail-idiom-name {
    font-size: 22px;
    font-weight: 700;
    color: #c0392b;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.detail-meaning {
    font-size: 13px;
    color: #5a3020;
    line-height: 1.7;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: #fff9f2;
    border-radius: 4px;
    border-left: 3px solid #e67e22;
}

.detail-origin {
    font-size: 12px;
    color: #9a6040;
    line-height: 1.6;
    font-style: italic;
}

/* AI建议区 */
.ai-suggest-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.suggest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fffaf5, #fff3e6);
    border-bottom: 1px solid #f0d9c0;
    flex-shrink: 0;
}

.suggest-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #8b3a1a;
}

.suggest-for {
    font-size: 12px;
    color: #a07050;
}

.suggest-for strong {
    color: #c0392b;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    font-size: 14px;
}

.suggest-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    font-size: 13px;
    color: #8b3a1a;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: #c0392b;
    border-radius: 50%;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

.suggest-list {
    overflow-y: auto;
    padding: 10px;
    flex: 1;
}

.suggest-item {
    background: #fff9f2;
    border: 1px solid #f0d9c0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.suggest-item:hover {
    background: #fff3e2;
    border-color: #c0392b;
    transform: translateX(2px);
}

.suggest-item-idiom {
    font-size: 18px;
    font-weight: 700;
    color: #8b1a1a;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.suggest-item-idiom .first-char {
    color: #c0392b;
    border-bottom: 2px solid #c0392b;
}

.suggest-item-meaning {
    font-size: 12px;
    color: #9a6040;
    line-height: 1.5;
    margin-bottom: 6px;
}

.suggest-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggest-difficulty {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.suggest-difficulty.easy {
    background: #e8f5e9;
    color: #2e7d32;
}

.suggest-difficulty.medium {
    background: #fff3e0;
    color: #e65100;
}

.suggest-difficulty.hard {
    background: #fde8e8;
    color: #c0392b;
}

.suggest-next-char {
    font-size: 11px;
    color: #9a6040;
}

.suggest-use-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #c0392b, #8b1a1a);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.suggest-item:hover .suggest-use-btn {
    opacity: 1;
}

.suggest-use-btn:hover {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.suggest-tip {
    padding: 10px 16px;
    margin: 0 10px 10px;
    background: #fff9f2;
    border: 1px solid #f0d9c0;
    border-radius: 6px;
    font-size: 12px;
    color: #9a6040;
    line-height: 1.6;
}

/* ========== 模态框 ========== */
.is-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(80, 20, 10, 0.4);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.is-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    z-index: 100001;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(120, 30, 20, 0.2);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -55%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.is-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #c0392b, #8b1a1a);
    color: #fff;
    flex-shrink: 0;
}

.is-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffe8c8;
}

.is-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.is-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.is-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.example-category {
    margin-bottom: 20px;
}

.example-category-title {
    font-size: 12px;
    font-weight: 600;
    color: #8b3a1a;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0d9c0;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.example-card {
    background: #fff9f2;
    border: 1px solid #f0d9c0;
    border-radius: 8px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.example-card:hover {
    background: #fff3e2;
    border-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(192, 57, 43, 0.15);
}

.example-card-idiom {
    font-size: 16px;
    font-weight: 700;
    color: #8b1a1a;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.example-card-desc {
    font-size: 11px;
    color: #9a6040;
    line-height: 1.4;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .is-history-panel {
        display: none;
    }

    .is-info-panel {
        width: 200px;
    }
}

@media (max-width: 680px) {
    .is-info-panel {
        display: none;
    }

    .is-toolbar {
        gap: 4px;
    }

    .toolbar-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
}

/* ========== 滚动条美化 ========== */
.chain-display::-webkit-scrollbar,
.suggest-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar,
.is-modal-body::-webkit-scrollbar,
.game-ended::-webkit-scrollbar {
    width: 5px;
}

.chain-display::-webkit-scrollbar-track,
.suggest-list::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track,
.is-modal-body::-webkit-scrollbar-track,
.game-ended::-webkit-scrollbar-track {
    background: transparent;
}

.chain-display::-webkit-scrollbar-thumb,
.suggest-list::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb,
.is-modal-body::-webkit-scrollbar-thumb,
.game-ended::-webkit-scrollbar-thumb {
    background: #f0c8a0;
    border-radius: 3px;
}

.chain-display::-webkit-scrollbar-thumb:hover,
.suggest-list::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

/* ========================================================
   暗黑模式 (body.dark 前缀)
   ======================================================== */

body.dark .is-container {
    background: #1a0f0a;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

body.dark .is-toolbar {
    background: linear-gradient(135deg, #5a1010 0%, #2a0808 100%);
}

body.dark .is-main-content {
    background: #1a0f0a;
}

/* 左栏暗黑 */
body.dark .is-history-panel {
    background: #0f0808;
    border-right-color: #3a2020;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1e1010, #160c0c);
    border-bottom-color: #3a2020;
}

body.dark .history-panel-header h3 {
    color: #e8a880;
}

body.dark .history-count {
    color: #e05050;
}

body.dark .history-clear-btn {
    background: #2a1010;
    color: #e05050;
}

body.dark .history-clear-btn:hover {
    background: #3a1010;
}

body.dark .history-empty {
    color: #6a4030;
}

body.dark .history-item {
    background: #1e1010;
    border-color: #3a2020;
}

body.dark .history-item:hover {
    background: #2a1410;
    border-color: #c0392b;
}

body.dark .history-item.active {
    background: #2a1410;
    border-color: #c0392b;
    box-shadow: inset 3px 0 0 #3b82f6;
}

body.dark .history-item-title {
    color: #e8a880;
}

body.dark .history-item-meta {
    color: #7a5040;
}

body.dark .history-item-del {
    background: #3a1010;
    color: #e05050;
}

/* 中栏暗黑 */
body.dark .is-game-panel {
    background: #1a0f0a;
    border-right-color: #3a2020;
}

body.dark .welcome-title {
    color: #e8a880;
}

body.dark .welcome-desc {
    color: #9a6040;
}

body.dark .rule-item {
    background: #1e1010;
    border-color: #3a2020;
    border-left-color: #c0392b;
    color: #c89060;
}

body.dark .start-idiom-input {
    background: #1e1010;
    border-color: #3a2020;
    color: #e8c8a0;
}

body.dark .start-idiom-input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.2);
}

body.dark .start-idiom-input::placeholder {
    color: #6a4030;
}

body.dark .start-error-tip {
    color: #f08080;
}

body.dark .chain-display-wrap {
    /* inherits from game panel */
}

body.dark .chain-label {
    color: #e8a880;
}

body.dark .idiom-card {
    background: #1e1010;
    border-color: #3a2020;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

body.dark .idiom-card:hover {
    border-color: #c0392b;
    box-shadow: 0 2px 10px rgba(192, 57, 43, 0.25);
}

body.dark .char-cell {
    color: #e8c8a0;
}

body.dark .char-cell.char-first {
    background: linear-gradient(135deg, #2a1810, #3a2010);
    border-color: #c0392b;
    color: #f08060;
}

body.dark .char-cell.char-last {
    background: linear-gradient(135deg, #2a1010, #3a1010);
    border-color: #8b1a1a;
    color: #f08080;
}

body.dark .card-meaning-text {
    color: #7a5040;
}

body.dark .required-char-bar {
    background: linear-gradient(135deg, #1e1010, #2a1410);
    border-top-color: #3a2020;
    border-bottom-color: #3a2020;
}

body.dark .req-label {
    color: #c89060;
}

body.dark .stat-item {
    color: #c89060;
}

body.dark .stat-item strong {
    color: #e05050;
}

body.dark .game-input-area {
    background: #0f0808;
    border-top-color: #3a2020;
}

body.dark .input-wrapper {
    border-color: #3a2020;
    background: #1e1010;
}

body.dark .input-wrapper:focus-within {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

body.dark .char-hint-prefix {
    background: #2a1810;
    border-right-color: #3a2020;
}

body.dark .idiom-input {
    color: #e8c8a0;
}

body.dark .idiom-input::placeholder {
    color: #6a4030;
}

body.dark .char-counter {
    color: #7a5040;
}

body.dark .validating-tip {
    background: #1e1010;
    border-top-color: #3a2020;
    color: #c89060;
}

body.dark .validate-result.success {
    background: #0a1e0f;
    color: #60d080;
}

body.dark .validate-result.error {
    background: #1e0808;
    color: #f08080;
}

body.dark .game-ended {
    /* inherits */
}

body.dark .ended-title {
    color: #e8a880;
}

body.dark .stat-card {
    background: #1e1010;
    border-color: #3a2020;
}

body.dark .stat-value {
    color: #e05050;
}

body.dark .stat-label {
    color: #7a5040;
}

body.dark .ended-chain-title {
    color: #e8a880;
}

body.dark .ended-chain-display {
    background: #1e1010;
    border-color: #3a2020;
    color: #c89060;
}

body.dark .ended-chain-display .ended-chain-idiom {
    background: linear-gradient(135deg, #2a1810, #1e1010);
    border-color: #3a2020;
    color: #e8c8a0;
}

/* 右栏暗黑 */
body.dark .is-info-panel {
    background: #0f0808;
}

body.dark .placeholder-title {
    color: #e8a880;
}

body.dark .placeholder-desc {
    color: #7a5040;
}

body.dark .detail-header {
    background: linear-gradient(to bottom, #1e1010, #160c0c);
    border-bottom-color: #3a2020;
}

body.dark .detail-header h4 {
    color: #e8a880;
}

body.dark .idiom-detail {
    border-bottom-color: #3a2020;
}

body.dark .detail-idiom-name {
    color: #e05050;
}

body.dark .detail-meaning {
    background: #1e1010;
    border-left-color: #c0392b;
    color: #c8a080;
}

body.dark .detail-origin {
    color: #7a5040;
}

body.dark .suggest-header {
    background: linear-gradient(to bottom, #1e1010, #160c0c);
    border-bottom-color: #3a2020;
}

body.dark .suggest-header h4 {
    color: #e8a880;
}

body.dark .suggest-for {
    color: #7a5040;
}

body.dark .suggest-loading {
    color: #c89060;
}

body.dark .suggest-item {
    background: #1e1010;
    border-color: #3a2020;
}

body.dark .suggest-item:hover {
    background: #2a1410;
    border-color: #c0392b;
}

body.dark .suggest-item-idiom {
    color: #e8c8a0;
}

body.dark .suggest-item-idiom .first-char {
    color: #f08060;
    border-bottom-color: #c0392b;
}

body.dark .suggest-item-meaning {
    color: #7a5040;
}

body.dark .suggest-next-char {
    color: #7a5040;
}

body.dark .suggest-tip {
    background: #1e1010;
    border-color: #3a2020;
    color: #7a5040;
}

body.dark .suggest-error {
    color: #7a5040;
}

body.dark .suggest-list::-webkit-scrollbar-thumb {
    background: #5a2020;
}

body.dark .suggest-list::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

/* 模态框暗黑 */
body.dark .is-modal-overlay {
    background: rgba(20, 0, 0, 0.7);
}

body.dark .is-modal {
    background: #1e1010;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

body.dark .example-category-title {
    color: #e8a880;
    border-bottom-color: #3a2020;
}

body.dark .example-card {
    background: #2a1410;
    border-color: #3a2020;
}

body.dark .example-card:hover {
    background: #3a1c10;
    border-color: #c0392b;
}

body.dark .example-card-idiom {
    color: #e8c8a0;
}

body.dark .example-card-desc {
    color: #7a5040;
}

body.dark .history-list::-webkit-scrollbar-thumb {
    background: #5a2020;
}

body.dark .history-list::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}
