/* ========== 诗词解释工具容器 ========== */
.poetry-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 620px;
    background: #fdf8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(139, 90, 43, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e8d5b7;
}

/* 全屏模式 */
.poetry-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    border: none;
}

/* ========== 顶部工具栏 ========== */
.poetry-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    background: linear-gradient(135deg, #8b5e3c 0%, #c9956c 50%, #8b5e3c 100%);
    color: white;
    flex-wrap: nowrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.35);
    flex-shrink: 0;
    min-height: 36px;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-title-group {
    flex: 1;
    justify-content: center;
}

.toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #8b5e3c;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255,255,255,0.6);
}

/* ========== 主内容区域 ========== */
.poetry-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fdf8f0;
}

/* ========== 左侧历史面板 ========== */
.poetry-history-panel {
    width: 210px;
    min-width: 160px;
    background: #fff;
    border-right: 1px solid #e8d5b7;
    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, #fdf0e0, #f5e6cc);
    border-bottom: 1px solid #e8d5b7;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #6b4226;
}

.history-clear-btn {
    background: #fff0e8;
    border: 1px solid #f0c8a0;
    color: #c0552a;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #ffe0cc;
    border-color: #e09060;
}

.history-search {
    padding: 7px 10px;
    border-bottom: 1px solid #e8d5b7;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #f8ece0, #f2e2cc);
}

.history-search input {
    width: 100%;
    padding: 4px 10px 4px 26px;
    border: 1px solid #d9c4a8;
    border-radius: 12px;
    font-size: 11px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fdf8f3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c9956c' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='17' y1='17' x2='22' y2='22'/%3E%3C/svg%3E") no-repeat 8px center;
    color: #4a3020;
}

.history-search input::placeholder {
    color: #c0a480;
    font-size: 11px;
}

.history-search input:focus {
    border-color: #c9956c;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(201, 149, 108, 0.18);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    background: #fff;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: #f8f0e8;
}

.history-list::-webkit-scrollbar-thumb {
    background: #d9c4a8;
    border-radius: 2px;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    color: #b09070;
    text-align: center;
    gap: 6px;
}

.history-empty span {
    font-size: 13px;
}

.history-empty small {
    font-size: 11px;
    color: #c8a878;
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 12px;
    margin: 3px 8px;
    background: #fdf8f0;
    border: 1px solid #e8d5b7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: fadeInHistory 0.2s ease;
}

@keyframes fadeInHistory {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

.history-item:hover {
    background: #faeedd;
    border-color: #c9956c;
    transform: translateX(2px);
    box-shadow: inset 3px 0 0 rgba(201, 149, 108, 0.55);
}

.history-item.active {
    background: #fde8c8;
    border-color: #c9956c;
    box-shadow: inset 3px 0 0 #c9956c, 0 1px 6px rgba(201, 149, 108, 0.2);
}

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #5a3520;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
}

.history-item-meta {
    font-size: 11px;
    color: #9a7060;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-time {
    font-size: 10px;
    color: #b09080;
    margin-top: 2px;
}

.history-item-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    background: transparent;
    color: #cc7755;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    opacity: 0;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ffe0cc;
    color: #c0401a;
}

.history-footer {
    padding: 6px 12px;
    border-top: 1px solid #e8d5b7;
    background: #fdf0e0;
    flex-shrink: 0;
}

.history-count {
    font-size: 11px;
    color: #9a7060;
}

/* ========== 中间输入面板 ========== */
.poetry-input-panel {
    width: 340px;
    min-width: 280px;
    background: #fff;
    border-right: 1px solid #e8d5b7;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.panel-header {
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fdf0e0, #f5e6cc);
    border-bottom: 1px solid #e8d5b7;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #6b4226;
}

.input-section {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-section::-webkit-scrollbar {
    width: 4px;
}

.input-section::-webkit-scrollbar-thumb {
    background: #d9c4a8;
    border-radius: 2px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.input-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b4226;
    letter-spacing: 0.2px;
}

.required-mark {
    color: #c0401a;
    margin-left: 2px;
}

.poetry-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9c4a8;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'STSong', 'SimSun', 'KaiTi', serif;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #3a2010;
    background: #fffef9;
    min-height: 180px;
}

.poetry-textarea:focus {
    border-color: #c9956c;
    box-shadow: 0 0 0 3px rgba(201, 149, 108, 0.12);
    background: #fff;
}

.poetry-textarea::placeholder {
    color: #c0a880;
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 12px;
    line-height: 1.7;
}

.char-count {
    text-align: right;
    font-size: 11px;
    color: #b09070;
    margin-top: -4px;
    transition: color 0.2s;
}

.char-count.char-count-info { color: #c9956c; }
.char-count.char-count-warn { color: #c0401a; font-weight: 600; }

/* 元信息行 */
.meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-field {
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-input {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid #d9c4a8;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #3a2010;
    background: #fffef9;
}

.meta-input:focus {
    border-color: #c9956c;
    box-shadow: 0 0 0 2px rgba(201, 149, 108, 0.12);
}

/* 解析选项 */
.options-section {
    background: #fdf8f0;
    border: 1px solid #e8d5b7;
    border-radius: 7px;
    padding: 10px 12px;
}

/* 选项标题行 */
.options-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.options-title {
    font-size: 12px;
    font-weight: 600;
    color: #6b4226;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s;
    user-select: none;
}

.option-checkbox:hover {
    background: #faeedd;
}

.option-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #c9956c;
    flex-shrink: 0;
}

.checkbox-label {
    font-size: 12px;
    color: #5a3520;
    white-space: nowrap;
}

.options-quick-btns {
    display: flex;
    gap: 4px;
}

.quick-select-btn {
    padding: 2px 7px;
    background: #fff;
    border: 1px solid #d9c4a8;
    color: #8b5e3c;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.6;
}

.quick-select-btn:hover {
    background: #faeedd;
    border-color: #c9956c;
}

/* 操作按鈕 */
.action-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    padding-top: 4px;
}

.explain-btn {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8b5e3c 0%, #c9956c 100%);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(139, 90, 43, 0.3);
}

.explain-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7a5235 0%, #b8845b 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(139, 90, 43, 0.4);
}

.explain-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(139, 90, 43, 0.3);
}

.explain-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    animation: btnLoadingPulse 1.8s ease-in-out infinite;
}

@keyframes btnLoadingPulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 0.9; }
}

.btn-icon {
    font-size: 16px;
}

.cancel-btn {
    padding: 10px 16px;
    background: #f0e4d8;
    color: #8b5e3c;
    border: 1px solid #d9c4a8;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.cancel-btn:hover {
    background: #e8d8c8;
    border-color: #c9956c;
}

/* ========== 右侧结果面板 ========== */
.poetry-result-panel {
    flex: 1;
    background: #fffef9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

.result-panel-header {
    justify-content: space-between;
}

.result-actions {
    display: flex;
    gap: 6px;
}

.result-action-btn {
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #d9c4a8;
    color: #8b5e3c;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-action-btn:hover {
    background: #faeedd;
    border-color: #c9956c;
}

/* 占位符 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
    animation: gentle-sway 3s ease-in-out infinite;
}

@keyframes gentle-sway {
    0%, 100% { transform: rotate(-4deg) translateY(0px); opacity: 0.38; }
    25%  { transform: rotate(1deg)  translateY(-6px); opacity: 0.46; }
    50%  { transform: rotate(4deg)  translateY(-10px); opacity: 0.50; }
    75%  { transform: rotate(-1deg) translateY(-5px); opacity: 0.44; }
}

.placeholder-title {
    font-size: 18px;
    font-weight: 600;
    color: #8b6040;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 13px;
    color: #a08060;
    line-height: 1.7;
    max-width: 340px;
    margin: 0 0 20px 0;
}

.placeholder-tips {
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-align: left;
    background: #fdf0e0;
    border: 1px solid #e8d5b7;
    border-radius: 8px;
    padding: 14px 18px;
    max-width: 360px;
    width: 100%;
}

/* 占位符快速入口区 */
.placeholder-quick-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.placeholder-btn {
    padding: 10px 22px;
    background: linear-gradient(135deg, #8b5e3c 0%, #c9956c 100%);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    box-shadow: 0 3px 10px rgba(139, 90, 43, 0.25);
}

.placeholder-btn:hover {
    background: linear-gradient(135deg, #7a5235 0%, #b8845b 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(139, 90, 43, 0.35);
}

.placeholder-shortcut {
    font-size: 11px;
    color: #b09070;
}

.tip-item {
    font-size: 12px;
    color: #8b6040;
    line-height: 1.5;
}

/* 加载动画 */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-animation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.ink-drop {
    width: 11px;
    height: 15px;
    background: radial-gradient(ellipse at 45% 35%, #e8b080 0%, #c9956c 55%, #a07040 100%);
    border-radius: 50% 50% 48% 48% / 38% 38% 62% 62%;
    animation: inkBounce 1.2s ease-in-out infinite;
    box-shadow: 0 3px 6px rgba(201, 149, 108, 0.45);
}

.ink-drop:nth-child(1) { animation-delay: 0s; }
.ink-drop:nth-child(2) { animation-delay: 0.2s; }
.ink-drop:nth-child(3) { animation-delay: 0.4s; }

@keyframes inkBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

.loading-text {
    font-size: 15px;
    color: #6b4226;
    font-weight: 500;
    margin: 0 0 6px 0;
}

.loading-sub {
    font-size: 12px;
    color: #a08060;
    margin: 0;
    transition: opacity 0.25s ease;
    min-height: 1.4em;
}

/* 错误提示容器 */
.result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
    gap: 14px;
}

.result-error-icon {
    font-size: 48px;
    opacity: 0.7;
}

.result-error-msg {
    font-size: 14px;
    color: #c0401a;
    line-height: 1.6;
    max-width: 340px;
}

.result-error-retry {
    padding: 8px 20px;
    background: #fff;
    border: 1px solid #c9956c;
    color: #8b5e3c;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.result-error-retry:hover {
    background: #faeedd;
    border-color: #a07040;
}

/* 结果内容 */
.result-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-content::-webkit-scrollbar {
    width: 5px;
}

.result-content::-webkit-scrollbar-track {
    background: #fdf8f0;
}

.result-content::-webkit-scrollbar-thumb {
    background: #d9c4a8;
    border-radius: 3px;
}

/* 结果分区 */
.result-section {
    background: #fff;
    border: 1px solid #e8d5b7;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(139, 90, 43, 0.06), inset 3px 0 0 #e4cda8;
    animation: sectionFadeIn 0.3s ease;
}

/* 折叠状态 */
.result-section.collapsed > :not(.result-section-header) {
    display: none !important;
}

/* 折叠后去掉 header 下边框，避免与容器底边重叠 */
.result-section.collapsed .result-section-header {
    border-bottom: none;
}

.result-section.collapsed .section-collapse-icon {
    transform: rotate(-90deg);
}

@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(to right, #fdf0e0, #f9ece0);
    border-bottom: 1px solid #e8d5b7;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.result-section-header:hover {
    background: linear-gradient(to right, #faeedd, #f5e3d0);
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-collapse-icon {
    font-size: 12px;
    color: #b09070;
    transition: transform 0.2s ease;
    line-height: 1;
}

.section-copy-btn {
    padding: 2px 6px;
    background: transparent;
    border: 1px solid transparent;
    color: #b09070;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
    opacity: 0;
}

.result-section-header:hover .section-copy-btn {
    opacity: 1;
}

.section-copy-btn:hover {
    background: #faeedd;
    border-color: #d9c4a8;
    color: #8b5e3c;
}

/* section-icon 和 section-title 保持在 section-header-left 内 */
.section-icon {
    font-size: 15px;
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: #6b4226;
    letter-spacing: 0.3px;
}

.section-body {
    padding: 12px 14px;
    font-size: 13px;
    color: #3a2010;
    line-height: 1.8;
}

.section-body p {
    margin: 0 0 8px 0;
}

.section-body p:last-child {
    margin-bottom: 0;
}

/* 基本信息网格 */
.basic-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding: 12px 14px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #fdf8f0;
    border: 1px solid #e8d5b7;
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.15s;
}

.info-item:hover {
    background: #faeedd;
    border-color: #c9956c;
}

.info-label {
    font-size: 11px;
    color: #a08060;
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: #5a3520;
    font-weight: 600;
}

/* 诗词原文展示 */
.poetry-original {
    padding: 16px 20px;
    text-align: center;
}

.poetry-original-text {
    font-family: 'STSong', 'SimSun', 'KaiTi', '楷体', serif;
    font-size: 18px;
    line-height: 2.2;
    color: #3a2010;
    letter-spacing: 1px;
    white-space: pre-line;
    border-left: 3px solid #c9956c;
    padding-left: 20px;
    text-align: left;
    display: inline-block;
    min-width: 200px;
}

/* 译文特殊样式 */
.translation-body {
    background: #fdf8f0;
    border-radius: 0 0 7px 7px;
    font-style: italic;
    color: #4a3020;
    line-height: 2;
    font-size: 14px;
}

/* 主旨思想特殊样式 */
.theme-body {
    background: linear-gradient(135deg, #fdf0e0, #f5e6cc);
    border-radius: 0 0 7px 7px;
    font-size: 14px;
    font-weight: 500;
    color: #5a3520;
    text-align: center;
    padding: 14px 20px;
    letter-spacing: 0.5px;
}

/* 原始文本样式 */
.raw-text-body {
    white-space: pre-wrap;
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 13px;
    line-height: 1.8;
    color: #3a2010;
}

/* ========== 模态框 ========== */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10010;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(139, 90, 43, 0.25);
    width: 660px;
    max-width: 95vw;
    max-height: 80vh;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e8d5b7;
}

/* 模态框内容容器：确保 modal-body 可独立滚动 */
.modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal.active {
    display: flex !important;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(90, 53, 32, 0.35);
    z-index: 10009;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: block;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(to right, #fdf0e0, #f5e6cc);
    border-bottom: 1px solid #e8d5b7;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #6b4226;
}

.modal-close {
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid #d9c4a8;
    color: #8b5e3c;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
    padding: 0;
}

.modal-close:hover {
    background: #ffe0cc;
    border-color: #c9956c;
    color: #6b3010;
}

.modal-body {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* 示例分类 */
.example-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.example-category-title {
    font-size: 13px;
    font-weight: 700;
    color: #8b5e3c;
    margin: 0 0 8px 0;
    padding-bottom: 5px;
    border-bottom: 1px dashed #e8d5b7;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.example-card {
    background: #fdf8f0;
    border: 1px solid #e8d5b7;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.example-card:hover {
    background: #faeedd;
    border-color: #c9956c;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(201, 149, 108, 0.2);
}

.example-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #5a3520;
}

.example-card-author {
    font-size: 12px;
    color: #9a7060;
}

.example-card-preview {
    font-size: 12px;
    color: #7a5040;
    font-family: 'STSong', 'SimSun', serif;
    margin-top: 4px;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    border-left: 2px solid #c9956c;
    padding-left: 8px;
    white-space: pre-line;
}

/* ========== 响应式布局 ========== */
@media (max-width: 900px) {
    .poetry-history-panel {
        display: none;
    }
    .poetry-input-panel {
        width: 320px;
    }
}

@media (max-width: 680px) {
    .poetry-main-content {
        flex-direction: column;
    }

    .poetry-input-panel {
        width: 100%;
        min-width: unset;
        height: auto;
        max-height: 55vh;
        border-right: none;
        border-bottom: 1px solid #e8d5b7;
    }

    .poetry-result-panel {
        min-width: unset;
        height: 45vh;
    }

    .poetry-container {
        height: auto;
        min-height: unset;
    }

    .toolbar-title-group {
        display: none;
    }

    .options-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .poetry-toolbar {
        padding: 7px 10px;
        gap: 5px;
    }

    .toolbar-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .meta-row {
        flex-direction: column;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .basic-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .example-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========== 打印样式 ========== */
@media print {
    .poetry-toolbar,
    .poetry-history-panel,
    .poetry-input-panel {
        display: none !important;
    }

    .poetry-result-panel {
        width: 100%;
    }

    .result-content {
        overflow: visible;
    }
}

/* ========== 字词解释标签样式 ========== */
.word-tag {
    display: inline-block;
    background: #faeedd;
    border: 1px solid #d9c4a8;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 13px;
    font-weight: 600;
    color: #5a3520;
    margin-right: 4px;
}

.word-explanation-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px dashed #e8d5b7;
}

.word-explanation-item:last-child {
    border-bottom: none;
}

.word-explanation-text {
    color: #4a3020;
    flex: 1;
    font-size: 13px;
    line-height: 1.7;
}

/* 逐句解析样式 */
.line-parse-item {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #e8d5b7;
}

.line-parse-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.line-parse-original {
    font-family: 'STSong', 'SimSun', serif;
    font-size: 16px;
    color: #5a3520;
    margin-bottom: 6px;
    padding: 6px 12px;
    background: #fdf0e0;
    border-left: 3px solid #c9956c;
    border-radius: 0 4px 4px 0;
}

.line-parse-explanation {
    font-size: 13px;
    color: #4a3020;
    line-height: 1.7;
    padding-left: 4px;
}
