/* ========== 藏头诗 - 容器 ========== */
.poem-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #FDF6E3;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(139, 35, 53, 0.1);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.poem-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.poem-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #5C1A0F 0%, #8B2335 50%, #AA5B20 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(92, 26, 15, 0.5);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    margin-right: 4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
}

.toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    transition: all 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: rgba(255, 255, 255, 0.95);
    color: #8B2335;
    border-color: transparent;
    font-weight: 600;
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: #fff;
    color: #5C1A0F;
}

.toolbar-btn-cancel {
    background: rgba(200, 60, 30, 0.85);
    border-color: rgba(200, 60, 30, 0.5);
}

.toolbar-btn-cancel:hover {
    background: rgba(200, 60, 30, 1);
}

/* ========== 主内容区 ========== */
.poem-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #FDF6E3;
}

/* ========== 左栏：历史记录 ========== */
.poem-history-panel {
    width: 200px;
    background: #FBF3DE;
    border-right: 1px solid #D4C5A0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #FDF6E3, #F5E8C4);
    border-bottom: 1px solid #D4C5A0;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7A2433;
}

.history-count {
    font-size: 11px;
    color: #AA5B20;
    margin-left: 4px;
    font-weight: 400;
}

.history-clear-btn {
    background: #FFF0EC;
    border: 1px solid #F5C3B0;
    color: #C84B1A;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #FFE4DC;
    border-color: #C84B1A;
}

.history-search {
    padding: 8px 10px;
    border-bottom: 1px solid #D4C5A0;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #D4C5A0;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #FDF6E3;
    color: #3B1A10;
}

.history-search input:focus {
    border-color: #8B2335;
    box-shadow: 0 0 0 2px rgba(139, 35, 53, 0.12);
}

.history-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

.history-empty {
    text-align: center;
    color: #AA8868;
    font-size: 12px;
    padding: 24px 12px;
    line-height: 1.8;
}

.history-item {
    padding: 9px 10px;
    margin: 3px 0;
    background: #FDF6E3;
    border: 1px solid #D4C5A0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: fadeInItem 0.2s ease;
}

@keyframes fadeInItem {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.history-item:hover {
    background: #F5E8C4;
    border-color: #AA8868;
    transform: translateX(2px);
}

.history-item.active {
    background: #F0E0C8;
    border-color: #8B2335;
    box-shadow: 0 1px 4px rgba(139, 35, 53, 0.2);
}

.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #FFE8E0;
    color: #C84B1A;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #C84B1A;
    color: white;
}

.history-item-word {
    font-size: 15px;
    font-weight: 700;
    color: #5C1A0F;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    padding-right: 18px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 2px;
}

.history-item-meta {
    font-size: 11px;
    color: #8B5E3C;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.history-item-badge {
    background: #F0E0C8;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    color: #7A3020;
}

.history-item-time {
    font-size: 10px;
    color: #AA8868;
    margin-top: 3px;
}

/* ========== 中栏：创作输入 ========== */
.poem-input-panel {
    width: 340px;
    min-width: 280px;
    background: #ffffff;
    border-right: 1px solid #D4C5A0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #FDF6E3, #F5E8C4);
    border-bottom: 1px solid #D4C5A0;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7A2433;
}

.panel-tip {
    font-size: 11px;
    color: #AA8868;
}

.poem-input-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}

/* 表单组 */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.form-group-half {
    flex: 1;
    margin-bottom: 0;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #5C1A0F;
    margin-bottom: 7px;
}

.form-label-icon {
    font-size: 14px;
}

.form-required {
    color: #CC2200;
    font-size: 13px;
}

.form-optional {
    color: #AA8868;
    font-size: 11px;
    font-weight: 400;
}

/* 藏头词输入 */
.acrostic-input-wrapper {
    position: relative;
}

.poem-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #D4C5A0;
    border-radius: 7px;
    font-size: 14px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 2px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #FFFDF5;
    color: #2C1810;
}

.poem-input:focus {
    border-color: #8B2335;
    box-shadow: 0 0 0 3px rgba(139, 35, 53, 0.12);
    background: #fff;
}

.poem-input::placeholder {
    color: #C4A880;
    font-size: 12px;
    letter-spacing: 0;
    font-family: inherit;
}

/* shake 校验动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.poem-input.shake {
    animation: shake 0.4s ease;
    border-color: #CC2200 !important;
    box-shadow: 0 0 0 3px rgba(204, 34, 0, 0.15) !important;
}

/* 藏头词字符预览印章 */
.acrostic-preview {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    min-height: 0;
}

.acrostic-preview-char {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #CC2200;
    border-radius: 4px;
    color: #CC2200;
    font-size: 16px;
    font-weight: bold;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    background: #FFF5F5;
    /* 双框印章效果：内圈边框 + 软阴影 */
    box-shadow: inset 0 0 0 1px rgba(204, 34, 0, 0.25), 0 2px 6px rgba(204, 34, 0, 0.14);
    animation: sealAppear 0.2s ease;
    transition: all 0.2s;
}

.acrostic-preview-char:hover {
    background: #FFE8E8;
    transform: scale(1.08);
}

@keyframes sealAppear {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

.char-counter {
    text-align: right;
    font-size: 11px;
    color: #AA8868;
    margin-top: 4px;
}

.acrostic-hint {
    margin-left: 6px;
    font-size: 11px;
    color: #CC2200;
}

.poem-select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #D4C5A0;
    border-radius: 7px;
    font-size: 13px;
    outline: none;
    background: #FFFDF5;
    color: #2C1810;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B2335' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.poem-select:focus {
    border-color: #8B2335;
    box-shadow: 0 0 0 3px rgba(139, 35, 53, 0.12);
}

/* 字数选项（五言/七言） */
.chars-options {
    display: flex;
    gap: 10px;
}

.chars-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    border: 2px solid #D4C5A0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #FFFDF5;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
}

.chars-option:hover {
    border-color: #8B2335;
    background: #FFF0EC;
}

.chars-option.selected {
    border-color: #CC2200;
    background: #FFF5F5;
    box-shadow: 0 1px 6px rgba(204, 34, 0, 0.2);
}

.chars-num {
    font-size: 22px;
    font-weight: bold;
    color: #5C1A0F;
    line-height: 1;
}

.chars-option.selected .chars-num {
    color: #CC2200;
}

.chars-label {
    font-size: 12px;
    color: #8B5E3C;
    margin-top: 2px;
}

.chars-option.selected .chars-label {
    color: #CC2200;
}

/* 提示框 */
.poem-tips-box {
    background: linear-gradient(135deg, #FDF6E3, #F9EFD4);
    border: 1px solid #D4C5A0;
    border-left: 3px solid #CC2200;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    color: #5C3820;
    margin-top: 4px;
}

.poem-tips-box p {
    margin: 0 0 8px;
    font-weight: 600;
    color: #5C1A0F;
}

.poem-tips-box ul {
    margin: 0;
    padding-left: 16px;
    line-height: 2;
}

.poem-tips-box kbd {
    background: #F0E0C8;
    border: 1px solid #D4C5A0;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 11px;
    color: #7A3020;
    font-family: inherit;
}

.tip-red-char {
    color: #CC2200;
    font-weight: 600;
}

/* ========== 右栏：生成结果 ========== */
.poem-result-panel {
    flex: 1;
    min-width: 300px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.poem-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #FDF6E3, #F5E8C4);
    border-bottom: 1px solid #D4C5A0;
    flex-shrink: 0;
}

.poem-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7A2433;
}

.result-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 结果区「换一首」按钮 */
.result-rewrite-btn {
    padding: 4px 10px;
    background: #FFF5F5;
    border: 1px solid #F5C3B0;
    border-radius: 12px;
    color: #8B2335;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-rewrite-btn:hover {
    background: #FFE8E0;
    border-color: #8B2335;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(139, 35, 53, 0.15);
}

.result-meta-info {
    display: flex;
    gap: 6px;
    align-items: center;
}

.result-acrostic-badge {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 700;
    background: #FFF5F5;
    color: #CC2200;
    border: 1px solid #F5C3B0;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 2px;
}

.result-style-badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
    background: #F0E0C8;
    color: #7A3020;
}

.poem-result-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 占位提示 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #AA8868;
    min-height: 200px;
}

/* 仿印章效果的占位图标 */
.placeholder-seal {
    width: 90px;
    height: 90px;
    border: 3px solid #CC2200;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: #CC2200;
    margin: 0 auto 20px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    /* 衬纸背景，增强印章立体感 */
    background: rgba(255, 245, 245, 0.85);
    animation: sealPulse 3s ease-in-out infinite;
    position: relative;
}

.placeholder-seal::before,
.placeholder-seal::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(204, 34, 0, 0.4);
    border-radius: 4px;
}

.placeholder-seal::before {
    inset: 4px;
}

.placeholder-seal::after {
    inset: 7px;
    border-color: rgba(204, 34, 0, 0.2);
}

@keyframes sealPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(204, 34, 0, 0.25); }
    50%       { transform: scale(1.04); box-shadow: 0 0 0 10px rgba(204, 34, 0, 0); }
}

.placeholder-title {
    font-size: 17px;
    font-weight: 600;
    color: #7A3020;
    margin: 0 0 10px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 2px;
}

.placeholder-desc {
    font-size: 13px;
    color: #AA8868;
    margin: 3px 0;
}

/* 加载动画（墨滴） */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.ink-drops {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.ink-drops span {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, #8B2335, #CC2200);
    transform: rotate(-45deg);
    animation: inkDrop 1.4s ease-in-out infinite;
}

.ink-drops span:nth-child(1) { animation-delay: 0s; }
.ink-drops span:nth-child(2) { animation-delay: 0.18s; }
.ink-drops span:nth-child(3) { animation-delay: 0.36s; }
.ink-drops span:nth-child(4) { animation-delay: 0.54s; }
.ink-drops span:nth-child(5) { animation-delay: 0.72s; }

@keyframes inkDrop {
    0%, 100% { transform: rotate(-45deg) scale(0.7); opacity: 0.4; }
    50%       { transform: rotate(-45deg) scale(1.2); opacity: 1; }
}

.loading-text {
    font-size: 14px;
    color: #8B2335;
    font-weight: 500;
    margin: 0;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 1px;
}

/* 结果内容区 */
.result-content {
    flex: 1;
    min-height: 0;
    padding: 30px 24px;
    overflow-y: auto;
    line-height: 1.8;
    animation: resultFadeIn 0.4s ease;
    /* 宣纸暖色背景，与诗歌主题呼应 */
    background: #FDFBF5;
}

@keyframes resultFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== 诗歌 HTML 内容样式 ========== */
.result-content .poem-result {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
    /* 卷轴式卡片框架：衬纸感背景 + 淡金边框 + 软阴影 */
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(212, 197, 160, 0.4);
    border-radius: 6px;
    padding: 24px 20px 20px;
    box-shadow: 0 2px 12px rgba(139, 35, 53, 0.07);
}

.result-content .poem-title {
    font-size: 24px;
    font-weight: bold;
    color: #2C1810;
    text-align: center;
    margin-bottom: 28px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 4px;
    position: relative;
    padding-bottom: 16px;
}

.result-content .poem-title::before,
.result-content .poem-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 2px;
    border-radius: 2px;
}

.result-content .poem-title::before {
    width: 80px;
    background: linear-gradient(90deg, transparent, #CC2200, transparent);
}

.result-content .poem-title::after {
    width: 40px;
    bottom: -6px;
    background: rgba(204, 34, 0, 0.3);
}

.result-content .poem-lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.result-content .poem-line {
    display: flex;
    align-items: baseline;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 21px;
    color: #2C1810;
    line-height: 1.8;
    letter-spacing: 5px;
    transition: all 0.2s;
}

.result-content .poem-line:hover {
    transform: translateX(4px);
}

.result-content .acrostic-char {
    color: #CC2200;
    font-weight: bold;
    font-size: 23px;
    display: inline-block;
    position: relative;
    padding: 0 2px;
    text-shadow: 0 1px 4px rgba(204, 34, 0, 0.25);
    background: rgba(204, 34, 0, 0.06);
    border-radius: 3px;
    transition: all 0.2s;
}

.result-content .poem-line:hover .acrostic-char {
    color: #9B0D00;
    background: rgba(204, 34, 0, 0.12);
}

.result-content .line-rest {
    color: #2C1810;
}

.result-content .poem-note {
    font-size: 12px;
    color: #8B5E3C;
    font-style: italic;
    border-top: 1px dashed #D4C5A0;
    padding-top: 16px;
    margin-top: 8px;
    text-align: center;
    line-height: 1.8;
    letter-spacing: 0.5px;
}

/* 错误提示 */
.result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #8B2335;
    min-height: 200px;
    font-size: 14px;
    gap: 12px;
}

.result-error::before {
    content: '⚠️';
    font-size: 36px;
}

.result-error-retry {
    margin-top: 6px;
    padding: 8px 22px;
    background: linear-gradient(135deg, #8B2335, #AA5B20);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.result-error-retry:hover {
    background: linear-gradient(135deg, #5C1A0F, #8B2335);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 26, 15, 0.3);
}

/* ========== 示例模态框 ========== */
.poem-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(92, 26, 15, 0.4);
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    backdrop-filter: blur(2px);
}

.poem-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.poem-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    background: #FDF6E3;
    border-radius: 12px;
    z-index: 100002;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(92, 26, 15, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.poem-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.poem-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #5C1A0F, #8B2335);
    color: #fff;
    flex-shrink: 0;
}

.poem-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 1px;
}

.poem-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poem-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.poem-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #FDF6E3;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}

.example-card {
    padding: 14px 16px;
    background: #FBF3DE;
    border: 1.5px solid #D4C5A0;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    border-color: #8B2335;
    background: #F5E8C4;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(139, 35, 53, 0.15);
}

.example-card-label {
    font-size: 14px;
    font-weight: 700;
    color: #5C1A0F;
    margin-bottom: 6px;
}

.example-card-word {
    font-size: 20px;
    font-weight: bold;
    color: #CC2200;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.example-card-theme {
    font-size: 12px;
    color: #5C3820;
    margin-bottom: 8px;
    line-height: 1.5;
}

.example-card-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.example-card-tag {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 500;
}

.example-card-tag.style-tag {
    background: #F0E0C8;
    color: #7A3020;
}

.example-card-tag.chars-tag {
    background: #FFF5F5;
    color: #CC2200;
    border: 1px solid #F5C3B0;
}

.example-loading {
    text-align: center;
    padding: 32px;
    color: #AA8868;
    font-size: 13px;
}

/* ========== 自定义滚动条 ========== */
.history-list::-webkit-scrollbar,
.poem-input-body::-webkit-scrollbar,
.result-content::-webkit-scrollbar,
.poem-modal-body::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track,
.poem-input-body::-webkit-scrollbar-track,
.result-content::-webkit-scrollbar-track,
.poem-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb,
.poem-input-body::-webkit-scrollbar-thumb,
.result-content::-webkit-scrollbar-thumb,
.poem-modal-body::-webkit-scrollbar-thumb {
    background: #D4C5A0;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover,
.poem-input-body::-webkit-scrollbar-thumb:hover,
.result-content::-webkit-scrollbar-thumb:hover,
.poem-modal-body::-webkit-scrollbar-thumb:hover {
    background: #AA8868;
}

/* ========== 暗黑模式 ========== */
body.dark .poem-container {
    background: #140A04;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

body.dark .poem-main-content {
    background: #140A04;
}

body.dark .poem-history-panel {
    background: #1C0D06;
    border-color: #3D2010;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #201008, #1C0D06);
    border-color: #3D2010;
}

body.dark .history-panel-header h3 {
    color: #E8956A;
}

body.dark .history-count {
    color: #A05835;
}

body.dark .history-clear-btn {
    background: #2A1208;
    border-color: #5C2515;
    color: #E88060;
}

body.dark .history-clear-btn:hover {
    background: #3A1A0A;
    border-color: #E88060;
}

body.dark .history-search input {
    background: #1C0D06;
    border-color: #3D2010;
    color: #F0E0CC;
}

body.dark .history-search input:focus {
    border-color: #CC5040;
    box-shadow: 0 0 0 2px rgba(204, 80, 64, 0.2);
}

body.dark .history-search input::placeholder {
    color: #5A3828;
}

body.dark .history-list::-webkit-scrollbar-thumb {
    background: #3D2010;
}

body.dark .history-list::-webkit-scrollbar-thumb:hover {
    background: #5C3020;
}

body.dark .history-empty {
    color: #7A5040;
}

body.dark .history-item {
    background: #1C0D06;
    border-color: #3D2010;
}

body.dark .history-item:hover {
    background: #241408;
    border-color: #6A3020;
}

body.dark .history-item.active {
    background: #2A1208;
    border-color: #CC5040;
}

body.dark .history-item-word {
    color: #F0D0B0;
}

body.dark .history-item-badge {
    background: #2A1208;
    color: #E89868;
}

body.dark .history-item-delete {
    background: #3A1208;
    color: #E88060;
}

body.dark .history-item-delete:hover {
    background: #E88060;
    color: #fff;
}

body.dark .history-item-time {
    color: #7A5040;
}

body.dark .poem-input-panel {
    background: #1A0C06;
    border-color: #3D2010;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #201008, #1C0D06);
    border-color: #3D2010;
}

body.dark .panel-header h3 {
    color: #E8956A;
}

body.dark .panel-tip {
    color: #7A5040;
}

body.dark .poem-input-body::-webkit-scrollbar-thumb {
    background: #3D2010;
}

body.dark .poem-input-body::-webkit-scrollbar-thumb:hover {
    background: #5C3020;
}

body.dark .form-label {
    color: #F0D0B0;
}

body.dark .form-optional {
    color: #7A5040;
}

body.dark .poem-input {
    background: #1C0D06;
    border-color: #3D2010;
    color: #F0D0B0;
}

body.dark .poem-input:focus {
    border-color: #CC5040;
    box-shadow: 0 0 0 3px rgba(204, 80, 64, 0.2);
    background: #241408;
}

body.dark .poem-input::placeholder {
    color: #6A4030;
}

body.dark .poem-input.shake {
    border-color: #FF6040 !important;
    box-shadow: 0 0 0 3px rgba(255, 96, 64, 0.2) !important;
}

body.dark .acrostic-preview-char {
    background: #2A0C08;
    border-color: #CC4030;
    color: #FF7060;
    box-shadow: inset 0 0 0 1px rgba(204, 80, 64, 0.35), 0 2px 6px rgba(204, 64, 48, 0.2);
}

body.dark .acrostic-preview-char:hover {
    background: #3A1008;
}

body.dark .char-counter {
    color: #7A5040;
}

body.dark .acrostic-hint {
    color: #FF6040;
}

body.dark .poem-select {
    background-color: #1C0D06;
    border-color: #3D2010;
    color: #F0D0B0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23CC5040' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

body.dark .poem-select:focus {
    border-color: #CC5040;
    box-shadow: 0 0 0 3px rgba(204, 80, 64, 0.2);
}

body.dark .chars-option {
    background: #1C0D06;
    border-color: #3D2010;
}

body.dark .chars-option:hover {
    border-color: #CC5040;
    background: #2A1208;
}

body.dark .chars-option.selected {
    border-color: #FF5040;
    background: #2A1208;
    box-shadow: 0 1px 6px rgba(255, 80, 64, 0.2);
}

body.dark .chars-num {
    color: #F0D0B0;
}

body.dark .chars-option.selected .chars-num {
    color: #FF6050;
}

body.dark .chars-label {
    color: #8A6050;
}

body.dark .chars-option.selected .chars-label {
    color: #FF6050;
}

body.dark .poem-tips-box {
    background: linear-gradient(135deg, #1C0D06, #201008);
    border-color: #3D2010;
    border-left-color: #CC4030;
    color: #C0906A;
}

body.dark .poem-tips-box p {
    color: #E8A080;
}

body.dark .poem-tips-box kbd {
    background: #2A1208;
    border-color: #5C2515;
    color: #E8956A;
}

body.dark .tip-red-char {
    color: #FF7060;
}

body.dark .poem-result-panel {
    background: #1A0C06;
}

body.dark .poem-result-header {
    background: linear-gradient(to bottom, #201008, #1C0D06);
    border-color: #3D2010;
}

body.dark .poem-result-header h3 {
    color: #E8956A;
}

body.dark .result-rewrite-btn {
    background: #2A0C08;
    border-color: #5C2020;
    color: #E88060;
}

body.dark .result-rewrite-btn:hover {
    background: #3A1008;
    border-color: #E88060;
}

body.dark .result-acrostic-badge {
    background: #2A0C08;
    color: #FF7060;
    border-color: #5C2020;
}

body.dark .result-style-badge {
    background: #2A1208;
    color: #E8A080;
}

body.dark .result-content::-webkit-scrollbar-thumb {
    background: #3D2010;
}

body.dark .result-content::-webkit-scrollbar-thumb:hover {
    background: #5C3020;
}

/* 暗黑模式下显式设置结果区背景，避免 scroll 区域透明渲染瑕疵 */
body.dark .result-content {
    background: #1A0B05;
}

body.dark .result-placeholder {
    color: #6A4030;
}

body.dark .placeholder-seal {
    color: #FF5040;
    border-color: #FF5040;
    background: rgba(40, 8, 4, 0.8);
}

body.dark .placeholder-seal::before {
    border-color: rgba(255, 80, 64, 0.4);
}

body.dark .placeholder-seal::after {
    border-color: rgba(255, 80, 64, 0.2);
}

body.dark .placeholder-title {
    color: #E8956A;
}

body.dark .placeholder-desc {
    color: #7A5040;
}

body.dark .loading-text {
    color: #E8956A;
}

body.dark .ink-drops span {
    background: linear-gradient(135deg, #E04030, #FF7060);
}

body.dark .result-content .poem-result {
    color: #F0D0B0;
    background: rgba(28, 12, 6, 0.55);
    border-color: rgba(61, 32, 16, 0.5);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
}

body.dark .result-content .poem-title {
    color: #F0D0B0;
}

body.dark .result-content .poem-title::before {
    background: linear-gradient(90deg, transparent, #FF6050, transparent);
}

body.dark .result-content .poem-title::after {
    background: rgba(255, 96, 80, 0.3);
}

body.dark .result-content .poem-line {
    color: #F0D0B0;
}

body.dark .result-content .acrostic-char {
    color: #FF6050;
    text-shadow: 0 1px 4px rgba(255, 96, 80, 0.35);
    background: rgba(255, 96, 80, 0.1);
}

body.dark .result-content .poem-line:hover .acrostic-char {
    color: #FF8070;
    background: rgba(255, 96, 80, 0.18);
}

body.dark .result-content .line-rest {
    color: #F0D0B0;
}

body.dark .result-content .poem-note {
    color: #8A6050;
    border-color: #3D2010;
}

body.dark .result-error {
    color: #E88070;
}

body.dark .result-error-retry {
    background: linear-gradient(135deg, #6A2010, #9B3520);
}

body.dark .result-error-retry:hover {
    background: linear-gradient(135deg, #5C1A0F, #8B2335);
}

body.dark .poem-modal {
    background: #1C0D06;
}

body.dark .poem-modal-body {
    background: #1C0D06;
}

body.dark .poem-modal-body::-webkit-scrollbar-thumb {
    background: #3D2010;
}

body.dark .poem-modal-body::-webkit-scrollbar-thumb:hover {
    background: #5C3020;
}

body.dark .example-card {
    background: #201008;
    border-color: #3D2010;
}

body.dark .example-card:hover {
    border-color: #CC5040;
    background: #2A1208;
}

body.dark .example-card-label {
    color: #F0D0B0;
}

body.dark .example-card-word {
    color: #FF7060;
}

body.dark .example-card-theme {
    color: #C0906A;
}

body.dark .example-card-tag.style-tag {
    background: #2A1208;
    color: #E8A080;
}

body.dark .example-card-tag.chars-tag {
    background: #2A0C08;
    color: #FF7060;
    border-color: #5C2020;
}

body.dark .example-loading {
    color: #7A5040;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .poem-history-panel {
        display: none;
    }
    .poem-input-panel {
        width: 300px;
        min-width: 260px;
    }
}

@media (max-width: 640px) {
    .poem-container {
        height: auto;
        min-height: 100vh;
    }
    .poem-main-content {
        flex-direction: column;
    }
    .poem-input-panel {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #D4C5A0;
    }
    .poem-result-panel {
        min-width: unset;
    }
    .poem-toolbar {
        gap: 6px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-group-half {
        margin-bottom: 16px;
    }
}
