/* ========== 心得体会工具 - 主容器 ========== */
.pi-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: linear-gradient(135deg, #fdf8f0 0%, #f5e6cf 50%, #ede0ce 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(139, 90, 20, 0.12);
    transition: all 0.3s ease;
    position: relative;
}

/* 全屏模式 */
.pi-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.pi-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #4a2c0a 0%, #8b5a14 50%, #c68a2e 100%);
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(74, 44, 10, 0.3);
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-icon {
    font-size: 20px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.toolbar-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========== 按钮样式 ========== */
.pi-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pi-btn-ghost {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.pi-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.pi-btn-primary {
    background: #fff;
    color: #7a4a0e;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.pi-btn-primary:hover:not(:disabled) {
    background: #fff8ee;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.pi-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pi-btn-fullscreen {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pi-btn-fullscreen:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== 主内容区 ========== */
.pi-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== 历史记录栏 ========== */
.pi-history-col {
    width: 190px;
    min-width: 170px;
    flex-shrink: 0;
    overflow: hidden;
    border-right: 1px solid rgba(139, 90, 20, 0.1);
    background: rgba(255, 248, 235, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
}

.pi-history-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(139, 90, 20, 0.08);
}

.history-title {
    font-size: 12px;
    font-weight: 600;
    color: #7a4a0e;
}

.history-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #b08050;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #ffe0c0;
    color: #c04000;
}

.history-search-wrap {
    padding: 6px 8px;
}

.history-search-input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #e0c89a;
    border-radius: 20px;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s;
    color: #5a3a10;
}

.history-search-input:focus {
    border-color: #c68a2e;
    box-shadow: 0 0 0 2px rgba(198, 138, 46, 0.15);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px 6px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: #d4a876; border-radius: 4px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #c68a2e; }

.history-empty {
    text-align: center;
    color: #c0a070;
    font-size: 12px;
    padding: 14px 8px;
    font-style: italic;
}

.history-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 8px 8px 10px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #e8d5b0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    gap: 6px;
}

.history-item:hover {
    background: rgba(255, 245, 220, 0.95);
    border-color: #c68a2e;
    transform: translateX(2px);
}

.history-item.active {
    background: rgba(255, 240, 200, 0.9);
    border-color: #c68a2e;
    box-shadow: inset 3px 0 0 #c68a2e, 0 1px 5px rgba(198, 138, 46, 0.18);
}

.history-item-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.history-item-body {
    flex: 1;
    min-width: 0;
    padding-right: 16px;
}

.history-item-topic {
    font-size: 12px;
    font-weight: 600;
    color: #5a3a10;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.history-item-meta {
    font-size: 10px;
    color: #a07840;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-del {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #c0a070;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 3px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.2s;
    line-height: 1;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    background: #ffe0c0;
    color: #c04000;
}

/* ========== 左侧输入面板 ========== */
.pi-left {
    display: flex;
    flex-direction: column;
    width: 285px;
    min-width: 260px;
    flex-shrink: 0;
    overflow: hidden;
    border-right: 1px solid rgba(139, 90, 20, 0.1);
    background: rgba(255, 250, 240, 0.75);
    backdrop-filter: blur(8px);
}

.pi-input-panel {
    flex: 1;
    overflow-y: auto;
    background: transparent;
}

.pi-input-panel::-webkit-scrollbar { width: 4px; }
.pi-input-panel::-webkit-scrollbar-track { background: transparent; }
.pi-input-panel::-webkit-scrollbar-thumb { background: #d4a876; border-radius: 4px; }
.pi-input-panel::-webkit-scrollbar-thumb:hover { background: #c68a2e; }

.input-section {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group.half {
    flex: 1;
    min-width: 0;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-label {
    font-size: 12px;
    font-weight: 600;
    color: #5a3a10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.label-icon { font-size: 13px; }
.required { color: #c04000; font-size: 12px; }
.optional { color: #a07840; font-size: 11px; font-weight: 400; }

/* 快速主题标签 */
.quick-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin-top: 2px;
}

.quick-label {
    font-size: 11px;
    color: #a07840;
}

.quick-tag {
    padding: 3px 9px;
    background: rgba(198, 138, 46, 0.1);
    border: 1px solid rgba(198, 138, 46, 0.3);
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    color: #7a4a0e;
    transition: all 0.2s;
}

.quick-tag:hover {
    background: rgba(198, 138, 46, 0.22);
    border-color: #c68a2e;
    transform: translateY(-1px);
}

.pi-input,
.pi-select,
.pi-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #dcc898;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.88);
    transition: all 0.2s;
    box-sizing: border-box;
    color: #3a2408;
    font-family: inherit;
}

.pi-input:focus,
.pi-select:focus,
.pi-textarea:focus {
    border-color: #c68a2e;
    box-shadow: 0 0 0 2px rgba(198, 138, 46, 0.18);
    background: #fff;
}

.pi-input::placeholder, .pi-textarea::placeholder {
    color: #c0a878;
    font-size: 12px;
}

.pi-select {
    cursor: pointer;
    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 fill='%23c68a2e' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    background-color: rgba(255, 255, 255, 0.88);
}

.pi-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

/* 篇幅选择 */
.word-count-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wc-tab {
    flex: 1;
    min-width: 46px;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #dcc898;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #7a4a0e;
    transition: all 0.2s;
    text-align: center;
}

.wc-tab:hover {
    background: rgba(198, 138, 46, 0.12);
    border-color: #c68a2e;
}

.wc-tab.active {
    background: #c68a2e;
    border-color: #c68a2e;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(198, 138, 46, 0.35);
}

/* 字数计数 */
.char-count {
    text-align: right;
    font-size: 11px;
    color: #b09060;
    margin-top: -2px;
}

/* 面板内生成按钮 */
.pi-btn-generate-inner {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #8b5a14, #c68a2e);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 3px 12px rgba(139, 90, 20, 0.3);
    letter-spacing: 0.5px;
}

.pi-btn-generate-inner:hover {
    background: linear-gradient(135deg, #7a4a0e, #b87a20);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(139, 90, 20, 0.4);
}

.pi-btn-generate-inner:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.shortcut-hint {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.75;
    background: rgba(255,255,255,0.2);
    padding: 1px 6px;
    border-radius: 4px;
}

/* ========== 右侧结果面板 ========== */
.pi-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 252, 244, 0.8);
    backdrop-filter: blur(8px);
    position: relative;
}

/* 结果头部 */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(198, 138, 46, 0.15);
    background: linear-gradient(to right, rgba(255, 245, 220, 0.9), rgba(255, 252, 244, 0.9));
    flex-shrink: 0;
    gap: 10px;
    flex-wrap: wrap;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.result-topic {
    font-size: 14px;
    font-weight: 700;
    color: #5a3a10;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.result-badge {
    font-size: 11px;
    color: #8b5a14;
    background: rgba(198, 138, 46, 0.12);
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(198, 138, 46, 0.25);
    white-space: nowrap;
}

.result-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.result-regen-btn {
    padding: 5px 12px;
    background: rgba(198, 138, 46, 0.1);
    color: #7a4a0e;
    border: 1px solid rgba(198, 138, 46, 0.3);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-regen-btn:hover {
    background: rgba(198, 138, 46, 0.2);
    transform: translateY(-1px);
}

.result-copy-btn {
    padding: 5px 14px;
    background: linear-gradient(135deg, #8b5a14, #c68a2e);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-copy-btn:hover {
    background: linear-gradient(135deg, #7a4a0e, #b87a20);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(139, 90, 20, 0.3);
}

/* ========== 占位提示 ========== */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 280px;
    padding: 40px 30px;
    text-align: center;
}

.placeholder-quill {
    font-size: 64px;
    margin-bottom: 16px;
    animation: floatQuill 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(139, 90, 20, 0.2));
}

@keyframes floatQuill {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.placeholder-title {
    font-size: 20px;
    font-weight: 700;
    color: #7a4a0e;
    margin-bottom: 8px;
    font-family: 'STKaiti', 'KaiTi', Georgia, serif;
}

.placeholder-desc {
    font-size: 13px;
    color: #a07840;
    max-width: 340px;
    line-height: 1.7;
    margin-bottom: 28px;
}

.placeholder-features {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(198, 138, 46, 0.2);
    border-radius: 12px;
    font-size: 12px;
    color: #7a4a0e;
    min-width: 76px;
    transition: all 0.2s;
}

.feature-item:hover {
    background: rgba(255, 248, 225, 0.9);
    border-color: #c68a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 138, 46, 0.15);
}

.feature-icon { font-size: 24px; }

/* ========== 加载状态 ========== */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 280px;
    padding: 40px;
    text-align: center;
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.loading-pen {
    font-size: 38px;
    animation: writePen 1.5s ease-in-out infinite;
}

@keyframes writePen {
    0%, 100% { transform: translateX(-8px) rotate(-10deg); }
    50%       { transform: translateX(8px) rotate(10deg); }
}

.loading-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 140px;
}

.loading-line {
    height: 4px;
    background: linear-gradient(to right, #c68a2e, rgba(198, 138, 46, 0.2));
    border-radius: 4px;
    animation: growLine 1.8s ease-in-out infinite;
    transform-origin: left;
}

.loading-line.short { animation-delay: 0.3s; width: 70%; }
.loading-line.medium { animation-delay: 0.6s; width: 85%; }
.loading-line:nth-child(3) { animation-delay: 0.15s; }

@keyframes growLine {
    0%, 100% { opacity: 0.4; transform: scaleX(0.6); }
    50%       { opacity: 1; transform: scaleX(1); }
}

.loading-text {
    font-size: 14px;
    color: #7a4a0e;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-tips {
    font-size: 12px;
    color: #a07840;
    max-width: 280px;
    line-height: 1.6;
}

/* ========== 结果内容 ========== */
.result-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

.result-content::-webkit-scrollbar { width: 6px; }
.result-content::-webkit-scrollbar-track { background: rgba(255, 245, 220, 0.3); }
.result-content::-webkit-scrollbar-thumb { background: #d4a876; border-radius: 6px; }
.result-content::-webkit-scrollbar-thumb:hover { background: #c68a2e; }

body.dark .result-content::-webkit-scrollbar-track { background: rgba(10, 6, 2, 0.5); }

/* ========== Markdown 渲染 - 心得体会文章风格 ========== */
.result-markdown {
    line-height: 1.9;
    color: #3a2408;
    font-size: 14.5px;
    word-break: break-word;
    font-family: 'STSong', 'SimSun', Georgia, serif;
}

.result-markdown h1 {
    font-size: 22px;
    color: #5a3a10;
    border-bottom: 2px solid rgba(198, 138, 46, 0.4);
    padding-bottom: 10px;
    margin: 0 0 20px;
    font-family: 'STKaiti', 'KaiTi', Georgia, serif;
    text-align: center;
    letter-spacing: 2px;
}

.result-markdown h2 {
    font-size: 17px;
    color: #7a4a0e;
    margin: 22px 0 12px;
    padding: 8px 14px;
    background: linear-gradient(to right, rgba(198, 138, 46, 0.12), transparent);
    border-left: 4px solid #c68a2e;
    border-radius: 0 6px 6px 0;
    font-family: 'STKaiti', 'KaiTi', Georgia, serif;
}

.result-markdown h3 {
    font-size: 15px;
    color: #8b5a14;
    margin: 16px 0 8px;
    font-weight: 700;
}

.result-markdown p {
    margin: 10px 0;
    color: #3a2408;
    text-indent: 2em;
}

.result-markdown blockquote {
    border-left: 4px solid #c68a2e;
    padding: 10px 18px;
    margin: 14px 0;
    background: rgba(198, 138, 46, 0.06);
    border-radius: 0 10px 10px 0;
    color: #6a4010;
    font-style: italic;
    font-size: 14px;
    position: relative;
}

.result-markdown blockquote::before {
    content: '\201C';
    font-size: 36px;
    color: rgba(198, 138, 46, 0.25);
    position: absolute;
    top: -4px;
    left: 6px;
    font-family: Georgia, serif;
    line-height: 1;
}

.result-markdown strong {
    color: #7a4a0e;
    font-weight: 700;
}

.result-markdown em {
    color: #8b6030;
    font-style: italic;
}

.result-markdown ul, .result-markdown ol {
    margin: 8px 0;
    padding-left: 24px;
}

.result-markdown li {
    margin: 6px 0;
    color: #4a2e0a;
    text-indent: 0;
}

.result-markdown ul li::marker { color: #c68a2e; font-weight: 600; }
.result-markdown ol li::marker { color: #c68a2e; font-weight: 600; }

.result-markdown hr {
    border: none;
    border-top: 1px dashed rgba(198, 138, 46, 0.35);
    margin: 20px 0;
}

.result-markdown code {
    background: rgba(198, 138, 46, 0.1);
    color: #7a4a0e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Consolas', monospace;
}

.result-markdown a {
    color: #b06020;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.result-markdown a:hover {
    color: #7a3a08;
}

/* ========== 错误状态 ========== */
.result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 280px;
    padding: 40px;
    text-align: center;
    gap: 14px;
}

.error-icon { font-size: 48px; }
.error-text {
    font-size: 14px;
    color: #c04000;
    max-width: 300px;
    line-height: 1.6;
}

/* ========== 示例模态框 ========== */
.pi-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.pi-modal.show { display: flex; }

.pi-modal-content {
    background: #fffdf5;
    border-radius: 12px;
    max-width: 580px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(74, 44, 10, 0.2);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pi-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #4a2c0a, #8b5a14);
    color: white;
    flex-shrink: 0;
}

.pi-modal-header h3 { margin: 0; font-size: 15px; }

.pi-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}

.pi-modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.pi-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pi-modal-body::-webkit-scrollbar { width: 5px; }
.pi-modal-body::-webkit-scrollbar-track { background: transparent; }
.pi-modal-body::-webkit-scrollbar-thumb { background: #d4a876; border-radius: 5px; }
.pi-modal-body::-webkit-scrollbar-thumb:hover { background: #c68a2e; }

/* 示例卡片 */
.example-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 250, 235, 0.7);
    border: 1px solid #e8d5a8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    background: rgba(255, 245, 210, 0.95);
    border-color: #c68a2e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(198, 138, 46, 0.15);
}

.example-card-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }

.example-card-body { flex: 1; min-width: 0; }

.example-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #5a3a10;
    margin-bottom: 4px;
}

.example-card-desc {
    font-size: 12px;
    color: #8b6030;
    line-height: 1.5;
}

.example-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.example-tag {
    padding: 2px 8px;
    background: rgba(198, 138, 46, 0.1);
    border-radius: 10px;
    font-size: 11px;
    color: #7a4a0e;
    border: 1px solid rgba(198, 138, 46, 0.2);
}

/* ========== Toast 通知 ========== */
.pi-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    z-index: 999999;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.pi-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pi-toast.success { background: linear-gradient(135deg, #8b5a14, #c68a2e); }
.pi-toast.error   { background: linear-gradient(135deg, #c04000, #e06020); }
.pi-toast.info    { background: linear-gradient(135deg, #4a6080, #6a88a8); }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .pi-history-col { width: 150px; min-width: 130px; }
    .pi-left { width: 240px; min-width: 220px; }
}

@media (max-width: 700px) {
    .pi-main { flex-direction: column; }
    .pi-history-col { width: 100%; height: 120px; border-right: none; border-bottom: 1px solid rgba(139, 90, 20, 0.1); flex-shrink: 0; }
    .pi-history-panel { flex-direction: row; }
    .history-list { flex-direction: row; padding: 4px 8px; display: flex; overflow-x: auto; overflow-y: hidden; }
    .history-item { margin-bottom: 0; margin-right: 6px; min-width: 130px; }
    .pi-left { width: 100%; min-width: unset; border-right: none; border-bottom: 1px solid rgba(139, 90, 20, 0.1); }
    .pi-input-panel { max-height: 300px; }
}

@media print {
    .pi-toolbar, .pi-history-col, .pi-left { display: none !important; }
    #resultPlaceholder, #resultLoading { display: none !important; }
    .pi-container { box-shadow: none; background: #fff; }
    .result-panel { background: #fff; }
    .result-content { overflow: visible; }
}

/* ========== 暗黑模式 - 以 body.dark 为前缀 ========== */
body.dark .pi-container {
    background: linear-gradient(135deg, #1a1208 0%, #241808 50%, #1e1408 100%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

body.dark .pi-toolbar {
    background: linear-gradient(135deg, #0f0a04 0%, #2a1a08 50%, #4a2c0a 100%);
}

body.dark .pi-btn-primary {
    background: rgba(198, 138, 46, 0.85);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .pi-btn-primary:hover:not(:disabled) {
    background: rgba(220, 155, 50, 0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

body.dark .pi-history-col {
    background: rgba(30, 18, 6, 0.85);
    border-right-color: rgba(198, 138, 46, 0.12);
}

body.dark .pi-history-panel { background: transparent; }

body.dark .history-header { border-bottom-color: rgba(198, 138, 46, 0.1); }
body.dark .history-title { color: #d4a060; }
body.dark .history-clear-btn { color: #8a6030; }
body.dark .history-clear-btn:hover { background: rgba(192, 64, 0, 0.25); color: #e06030; }

body.dark .history-search-input {
    background: rgba(40, 24, 8, 0.9);
    border-color: rgba(198, 138, 46, 0.25);
    color: #d4b878;
}

body.dark .history-search-input:focus {
    border-color: #c68a2e;
    box-shadow: 0 0 0 2px rgba(198, 138, 46, 0.2);
}

body.dark .history-empty { color: #7a5a2a; }

body.dark .history-item {
    background: rgba(40, 24, 8, 0.7);
    border-color: rgba(198, 138, 46, 0.2);
}

body.dark .history-item:hover {
    background: rgba(60, 36, 10, 0.9);
    border-color: rgba(198, 138, 46, 0.5);
}

body.dark .history-item.active {
    background: rgba(70, 42, 12, 0.9);
    border-color: #c68a2e;
    box-shadow: inset 3px 0 0 #c68a2e, 0 1px 5px rgba(0, 0, 0, 0.35);
}

body.dark .history-item-topic { color: #e0c090; }
body.dark .history-item-meta  { color: #9a7040; }
body.dark .history-item-del   { color: #7a5a2a; }
body.dark .history-item-del:hover { background: rgba(192, 64, 0, 0.25); color: #e06030; }

body.dark .pi-left {
    background: rgba(28, 16, 4, 0.8);
    border-right-color: rgba(198, 138, 46, 0.12);
}

body.dark .input-label { color: #c4a060; }
body.dark .required { color: #e06030; }
body.dark .optional { color: #8a6030; }
body.dark .quick-label { color: #8a6030; }

body.dark .quick-tag {
    background: rgba(198, 138, 46, 0.12);
    border-color: rgba(198, 138, 46, 0.25);
    color: #d4a060;
}

body.dark .quick-tag:hover {
    background: rgba(198, 138, 46, 0.25);
    border-color: #c68a2e;
}

body.dark .pi-input,
body.dark .pi-select,
body.dark .pi-textarea {
    background: rgba(30, 18, 6, 0.85);
    border-color: rgba(198, 138, 46, 0.3);
    color: #e0c890;
}

body.dark .pi-input:focus,
body.dark .pi-select:focus,
body.dark .pi-textarea:focus {
    border-color: #c68a2e;
    box-shadow: 0 0 0 2px rgba(198, 138, 46, 0.2);
    background: rgba(40, 24, 8, 0.95);
}

body.dark .pi-input::placeholder,
body.dark .pi-textarea::placeholder { color: #6a4a20; }

body.dark .pi-select {
    background-color: rgba(30, 18, 6, 0.85);
    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 fill='%23c68a2e' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
}

body.dark .wc-tab {
    background: rgba(30, 18, 6, 0.7);
    border-color: rgba(198, 138, 46, 0.25);
    color: #c4a060;
}

body.dark .wc-tab:hover {
    background: rgba(60, 36, 10, 0.8);
    border-color: #c68a2e;
}

body.dark .wc-tab.active {
    background: #8b5a14;
    border-color: #8b5a14;
    color: #fff;
}

body.dark .char-count { color: #8a6a30; }

body.dark .pi-btn-generate-inner {
    background: linear-gradient(135deg, #5a3a0e, #8b5a14);
}

body.dark .pi-btn-generate-inner:hover {
    background: linear-gradient(135deg, #7a4a0e, #b87a20);
}

body.dark .result-panel {
    background: rgba(20, 12, 4, 0.85);
}

body.dark .result-header {
    background: linear-gradient(to right, rgba(40, 24, 8, 0.9), rgba(20, 12, 4, 0.9));
    border-bottom-color: rgba(198, 138, 46, 0.15);
}

body.dark .result-topic { color: #e0b870; }
body.dark .result-badge { color: #b08040; background: rgba(198, 138, 46, 0.12); border-color: rgba(198, 138, 46, 0.2); }

body.dark .result-regen-btn {
    background: rgba(198, 138, 46, 0.12);
    color: #d4a060;
    border-color: rgba(198, 138, 46, 0.25);
}

body.dark .result-regen-btn:hover { background: rgba(198, 138, 46, 0.25); }

body.dark .result-copy-btn {
    background: linear-gradient(135deg, #5a3a0e, #8b5a14);
}

body.dark .result-copy-btn:hover {
    background: linear-gradient(135deg, #7a4a0e, #b87a20);
}

body.dark .placeholder-title { color: #d4a060; }
body.dark .placeholder-desc  { color: #8a6030; }
body.dark .placeholder-quill { filter: drop-shadow(0 4px 12px rgba(198, 138, 46, 0.35)); }

body.dark .feature-item {
    background: rgba(40, 24, 8, 0.6);
    border-color: rgba(198, 138, 46, 0.2);
    color: #c4a060;
}

body.dark .feature-item:hover {
    background: rgba(60, 36, 10, 0.8);
    border-color: #c68a2e;
}

body.dark .loading-text { color: #d4a060; }
body.dark .loading-tips  { color: #8a6030; }
body.dark .loading-line  { background: linear-gradient(to right, #8b5a14, rgba(139, 90, 20, 0.2)); }

body.dark .result-content::-webkit-scrollbar-thumb { background: #6a4010; }
body.dark .result-content::-webkit-scrollbar-thumb:hover { background: #8b5a14; }

body.dark .result-markdown          { color: #e0d0b0; }
body.dark .result-markdown h1       { color: #e0c080; border-bottom-color: rgba(198, 138, 46, 0.3); }
body.dark .result-markdown h2       { color: #d4a060; background: linear-gradient(to right, rgba(198, 138, 46, 0.1), transparent); border-left-color: #8b5a14; }
body.dark .result-markdown h3       { color: #c49050; }
body.dark .result-markdown p        { color: #d8c8a0; }
body.dark .result-markdown blockquote { background: rgba(139, 90, 20, 0.1); border-left-color: #8b5a14; color: #c0a070; }
body.dark .result-markdown blockquote::before { color: rgba(139, 90, 20, 0.3); }
body.dark .result-markdown strong   { color: #e0b060; }
body.dark .result-markdown em       { color: #c09050; }
body.dark .result-markdown li       { color: #d0b880; }
body.dark .result-markdown ul li::marker { color: #8b5a14; font-weight: 600; }
body.dark .result-markdown ol li::marker { color: #8b5a14; font-weight: 600; }
body.dark .result-markdown hr       { border-top-color: rgba(198, 138, 46, 0.2); }
body.dark .result-markdown code     { background: rgba(139, 90, 20, 0.15); color: #d4a060; }
body.dark .result-markdown a        { color: #d4a060; text-decoration-color: rgba(212, 160, 96, 0.6); }
body.dark .result-markdown a:hover  { color: #e8c070; }

body.dark .error-text { color: #e08050; }

body.dark .pi-modal-content { background: #1e1208; }
body.dark .pi-modal-header  { background: linear-gradient(135deg, #0f0a04, #2a1a08); }

body.dark .example-card {
    background: rgba(30, 18, 6, 0.8);
    border-color: rgba(198, 138, 46, 0.2);
}

body.dark .example-card:hover {
    background: rgba(50, 30, 8, 0.9);
    border-color: #c68a2e;
    box-shadow: 0 4px 14px rgba(198, 138, 46, 0.2);
}

body.dark .example-card-title { color: #e0b870; }
body.dark .example-card-desc  { color: #9a7040; }
body.dark .example-tag { background: rgba(139, 90, 20, 0.15); color: #c4a060; border-color: rgba(198, 138, 46, 0.2); }

body.dark .history-list::-webkit-scrollbar-thumb { background: #5a3a10; }
body.dark .history-list::-webkit-scrollbar-thumb:hover { background: #7a4a0e; }

body.dark .pi-input-panel::-webkit-scrollbar-thumb { background: #5a3a10; }
body.dark .pi-input-panel::-webkit-scrollbar-thumb:hover { background: #7a4a0e; }

body.dark .pi-modal-body::-webkit-scrollbar-thumb { background: #5a3a10; }
body.dark .pi-modal-body::-webkit-scrollbar-thumb:hover { background: #7a4a0e; }
