/* =============================================
   论文大纲 - paper_outline.css
   主题色：学术蓝系（深海蓝 + 金色点缀）
   布局：三栏结构（历史 / 论文输入 / 大纲结果）
   CSS 命名空间前缀：po-
   ============================================= */

/* ========== 主容器 ========== */
.po-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f5ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.po-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.po-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 50%, #1e3a8a 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(29, 78, 216, 0.4);
    flex-shrink: 0;
}

.po-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.po-toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #1e40af;
    transition: all 0.2s;
    white-space: nowrap;
}

.po-toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.po-toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.po-toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 主操作按钮（生成大纲） */
.po-toolbar-btn-primary {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.45);
}

.po-toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.5);
    color: #fff;
}

/* 取消按钮 */
.po-toolbar-btn-cancel {
    background: rgba(255, 255, 255, 0.92);
    color: #ef4444;
    font-weight: 600;
}

.po-toolbar-btn-cancel:hover:not(:disabled) {
    background: #fff;
    color: #dc2626;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.2);
}

/* ========== 主内容区：三栏 ========== */
.po-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f5ff;
}

/* ========== 左栏：历史记录 ========== */
.po-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #bfdbfe;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.po-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #eff6ff 0%, #dbeafe 100%);
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
}

.po-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e3a8a;
}

.po-history-count {
    font-size: 11px;
    color: #3b82f6;
    font-weight: 400;
}

.po-history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.po-history-clear-btn:hover {
    background: #fde8e8;
}

.po-history-search {
    padding: 8px;
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
}

.po-history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #f8faff;
}

.po-history-search input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.po-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.po-history-list::-webkit-scrollbar { width: 4px; }
.po-history-list::-webkit-scrollbar-track { background: transparent; }
.po-history-list:hover::-webkit-scrollbar-track { background: #eff6ff; }
.po-history-list::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 2px; }
.po-history-list::-webkit-scrollbar-thumb:hover { background: #2563eb; }

.po-history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
}

.po-history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #f8faff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: poHiFadeIn 0.2s ease;
}

@keyframes poHiFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.po-history-item:hover {
    background: #eff6ff;
    border-color: #60a5fa;
    transform: translateX(2px);
}

.po-history-item.active {
    background: #dbeafe;
    border-color: #2563eb;
    box-shadow: inset 3px 0 0 #d97706;
}

.po-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e3a8a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 22px;
}

.po-history-item-meta {
    font-size: 11px;
    color: #3b82f6;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.po-history-item-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.po-history-item-del {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.po-history-item:hover .po-history-item-del {
    opacity: 1;
}

.po-history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

/* ========== 中栏：论文信息输入 ========== */
.po-input-panel {
    width: 340px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.po-panel-header {
    padding: 0 16px;
    min-height: 44px;
    background: linear-gradient(to bottom, #f8faff 0%, #eff6ff 100%);
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.po-panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e3a8a;
}

.po-panel-tip {
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
}

.po-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.po-input-body::-webkit-scrollbar { width: 4px; }
.po-input-body::-webkit-scrollbar-track { background: transparent; }
.po-input-body::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 2px; }
.po-input-body::-webkit-scrollbar-thumb:hover { background: #2563eb; }

/* 区块 */
.po-section {
    margin-bottom: 14px;
    background: #f8faff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px;
}

.po-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.po-form-row {
    display: flex;
    gap: 10px;
}

.po-form-group {
    margin-bottom: 10px;
}

.po-form-group:last-child {
    margin-bottom: 0;
}

.po-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #1e40af;
    margin-bottom: 4px;
}

.po-form-group-half {
    flex: 1;
    min-width: 0;
}

/* 非必填标记 */
.mm-optional {
    font-size: 0.85em;
    color: #6b4030;
    font-weight: 400;
}

.po-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: #1e293b;
}

.po-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.po-input-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.po-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.po-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.po-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    resize: vertical;
    background: #fff;
    color: #1e293b;
    font-family: inherit;
}

.po-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* 字符计数器 */
.po-char-counter {
    font-size: 11px;
    color: #9ca3af;
    text-align: right;
    margin-top: 3px;
}

/* 抖动动画 - 模块前缀隔离 */
@keyframes poShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.po-input.shake,
.po-select.shake,
.po-textarea.shake {
    animation: poShake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 右栏：大纲结果 ========== */
.po-result-panel {
    flex: 1;
    min-width: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.po-result-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.po-result-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1e3a8a;
    font-weight: 500;
}

.po-result-time {
    font-size: 11px;
    color: #9ca3af;
}

.po-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
}

.po-result-body::-webkit-scrollbar { width: 5px; }
.po-result-body::-webkit-scrollbar-track { background: #f8faff; }
.po-result-body::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 3px; }
.po-result-body::-webkit-scrollbar-thumb:hover { background: #2563eb; }

/* ========== 结果占位区域 ========== */
.po-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: 24px;
}

.po-placeholder-icon {
    font-size: 54px;
    margin-bottom: 16px;
    animation: poDocFloat 3.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(37, 99, 235, 0.2));
}

@keyframes poDocFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

/* 模拟论文线条 */
.po-placeholder-lines {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 180px;
    margin-bottom: 18px;
}

.po-placeholder-line {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #dbeafe 25%, #bfdbfe 50%, #dbeafe 75%);
    background-size: 200% 100%;
    animation: poLineShimmer 2s linear infinite;
}

.po-placeholder-line.po-line-long  { width: 100%; }
.po-placeholder-line.po-line-medium { width: 72%; }
.po-placeholder-line.po-line-short { width: 48%; }

@keyframes poLineShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.po-placeholder-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e3a8a;
    margin: 0 0 8px;
}

.po-placeholder-desc {
    font-size: 12px;
    color: #9ca3af;
    margin: 2px 0;
}

/* ========== 加载状态 ========== */
.po-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: 24px;
}

.po-loading-icon {
    font-size: 38px;
    margin-bottom: 14px;
    animation: poWriting 1.2s ease-in-out infinite alternate;
}

@keyframes poWriting {
    0%   { transform: rotate(-8deg) translateX(-3px); }
    100% { transform: rotate(8deg) translateX(3px); }
}

.po-loading-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.po-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    animation: poDotBounce 1.2s ease-in-out infinite;
}

.po-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.po-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes poDotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1.1); opacity: 1; }
}

/* 禁止对加载文案使用 CSS opacity 动画（避免与 jQuery fadeOut/fadeIn 冲突） */
.po-loading-text {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* ========== 结果内容区 ========== */
.po-result-content {
    font-size: 13.5px;
    line-height: 1.9;
    color: #1e293b;
    white-space: normal;
    word-break: break-word;
}

/* 淡入动画（由 JS 动态添加，禁止硬编码在基础类） */
.po-result-enter {
    animation: poResultFadeIn 0.35s ease-out forwards;
}

@keyframes poResultFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* AI 输出标签样式 - h2/h3/h4/h5/h6/ul/ol/li/p/a/blockquote 全覆盖 */
.po-result-content h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 16px 0 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid #bfdbfe;
}

.po-result-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1e40af;
    margin: 14px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #dbeafe;
}

.po-result-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: #1d4ed8;
    margin: 10px 0 4px;
}

.po-result-content h5 {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    margin: 8px 0 3px;
}

.po-result-content h6 {
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    margin: 6px 0 3px;
}

.po-result-content p {
    margin: 6px 0;
    color: #1e293b;
}

.po-result-content ul,
.po-result-content ol {
    padding-left: 22px;
    margin: 6px 0;
    color: #1e293b;
}

.po-result-content li {
    margin-bottom: 4px;
    color: #1e293b;
}

.po-result-content li::marker {
    color: #2563eb;
}

.po-result-content a {
    color: #2563eb;
    text-decoration: underline;
}

.po-result-content a:hover {
    color: #1d4ed8;
}

.po-result-content strong {
    font-weight: 600;
    color: #1e3a8a;
}

.po-result-content em {
    font-style: italic;
    color: #1e40af;
}

.po-result-content blockquote {
    border-left: 3px solid #2563eb;
    margin: 8px 0;
    padding: 6px 14px;
    background: #eff6ff;
    color: #1e3a8a;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

.po-result-content pre {
    background: #f0f4ff;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    padding: 10px 14px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 12px;
    font-family: 'Courier New', Courier, monospace;
}

.po-result-content code {
    background: #dbeafe;
    color: #1e3a8a;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
}

.po-result-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* 错误状态 */
.po-result-content.po-result-content--error {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    white-space: normal;
}

.po-result-error-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    background: #fff5f5;
    border-left: 4px solid #ef4444;
    border-radius: 0 6px 6px 0;
}

.po-result-error-icon {
    flex-shrink: 0;
    font-size: 22px;
    color: #ef4444;
    line-height: 1.3;
}

.po-result-error-body {
    flex: 1;
}

.po-result-error-title {
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    margin: 0 0 4px;
}

.po-result-error-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0 0 10px;
}

.po-result-error-retry-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.po-result-error-retry-btn:hover {
    background: #dc2626;
}

/* ========== 示例模态框 ========== */
@keyframes meOverlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes meModalSlideIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.po-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.42);
    z-index: 99998;
    backdrop-filter: blur(2px);
    animation: meOverlayFadeIn 0.25s ease forwards;
}

.po-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: meModalSlideIn 0.38s cubic-bezier(.34,1.4,.64,1) forwards;
}

.po-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(30, 64, 175, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.po-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #fff;
    flex-shrink: 0;
}

.po-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.po-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.po-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.po-modal-body {
    padding: 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
}

/* 示例卡片 */
.po-example-card {
    border: 1.5px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8faff;
}

.po-example-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
}

.po-example-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.po-example-card-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}

.po-example-card-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #1e3a8a;
    line-height: 1.4;
}

.po-example-card-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1e40af;
    flex-shrink: 0;
    white-space: nowrap;
}

.po-example-card-meta {
    font-size: 11px;
    color: #6b7280;
    margin: 0 0 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.po-example-card-meta span {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 1px 6px;
    border-radius: 8px;
}

.po-example-import-btn {
    width: 100%;
    padding: 6px 0;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.po-example-import-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

/* ========== Toast 通知 ========== */
.po-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    padding: 9px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: #1e40af;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
    z-index: 100000;
    white-space: nowrap;
    pointer-events: none;
}

/* ========== 暗黑模式 ========== */
body.dark .po-container {
    background: #0f172a;
}

body.dark .po-main-content {
    background: #0f172a;
}

body.dark .po-toolbar {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e2a5e 50%, #1a2050 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .po-toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #93c5fd;
}

body.dark .po-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
}

body.dark .po-toolbar-btn-primary {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
}

body.dark .po-toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

body.dark .po-toolbar-btn-cancel {
    background: rgba(255, 255, 255, 0.12);
    color: #f87171;
    font-weight: 600;
}

body.dark .po-toolbar-btn-cancel:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    color: #fca5a5;
}

body.dark .po-history-panel {
    background: #0d1733;
    border-right-color: #1e3a8a;
}

body.dark .po-history-header {
    background: linear-gradient(to bottom, #0d1a33 0%, #112050 100%);
    border-bottom-color: #1e3a8a;
}

body.dark .po-history-header h3 {
    color: #93c5fd;
}

body.dark .po-history-count {
    color: #60a5fa;
}

body.dark .po-history-clear-btn {
    background: #2d1a1a;
    color: #f87171;
}

body.dark .po-history-clear-btn:hover {
    background: #3d1f1f;
}

body.dark .po-history-search {
    border-bottom-color: #1e3a8a;
}

body.dark .po-history-search input {
    background: #0f1e38;
    border-color: #1e3a8a;
    color: #e2e8f0;
}

body.dark .po-history-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

body.dark .po-history-list:hover::-webkit-scrollbar-track {
    background: #0d1733;
}

body.dark .po-history-list::-webkit-scrollbar-thumb {
    background: #1e3a8a;
}

body.dark .po-history-list::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

body.dark .po-history-empty {
    color: #475569;
}

body.dark .po-history-item {
    background: #0d1a33;
    border-color: #1e3a8a;
}

body.dark .po-history-item:hover {
    background: #112050;
    border-color: #3b82f6;
}

body.dark .po-history-item.active {
    background: #1e2a5e;
    border-color: #3b82f6;
    box-shadow: inset 3px 0 0 #d97706;
}

body.dark .po-history-item-title {
    color: #bfdbfe;
}

body.dark .po-history-item-meta {
    color: #60a5fa;
}

body.dark .po-history-item-time {
    color: #4b5563;
}

body.dark .po-history-item-del {
    background: #2d1515;
    color: #f87171;
}

body.dark .po-history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

body.dark .po-input-panel {
    background: #0f172a;
    border-right-color: #1e3a8a;
}

body.dark .po-panel-header {
    background: linear-gradient(to bottom, #0f1e38 0%, #0d1733 100%);
    border-bottom-color: #1e3a8a;
}

body.dark .po-panel-header h3 {
    color: #93c5fd;
}

body.dark .po-panel-tip {
    color: #64748b;
}

body.dark .po-input-body::-webkit-scrollbar-thumb {
    background: #1e3a8a;
}

body.dark .po-input-body::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

body.dark .po-section {
    background: #0d1a33;
    border-color: #1e3a8a;
}

body.dark .po-section-title {
    color: #93c5fd;
}

body.dark .po-form-group label {
    color: #60a5fa;
}

body.dark .mm-optional {
    color: #b89a8c;
}

body.dark .po-input {
    background: #0f1e38;
    border-color: #1e3a8a;
    color: #e2e8f0;
}

body.dark .po-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

body.dark .po-input-hint {
    color: #64748b;
}

body.dark .po-select {
    background: #0f1e38;
    border-color: #1e3a8a;
    color: #e2e8f0;
}

body.dark .po-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

body.dark .po-textarea {
    background: #0f1e38;
    border-color: #1e3a8a;
    color: #e2e8f0;
}

body.dark .po-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

body.dark .po-char-counter {
    color: #4b5563;
}

body.dark .po-result-panel {
    background: #0f172a;
}

body.dark .po-result-body::-webkit-scrollbar-track {
    background: #0f172a;
}

body.dark .po-result-body::-webkit-scrollbar-thumb {
    background: #1e3a8a;
}

body.dark .po-result-body::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

body.dark .po-result-type {
    background: #1e2a5e;
    color: #93c5fd;
}

body.dark .po-result-time {
    color: #4b5563;
}

body.dark .po-placeholder-title {
    color: #93c5fd;
}

body.dark .po-placeholder-desc {
    color: #475569;
}

body.dark .po-placeholder-lines .po-placeholder-line {
    background: linear-gradient(90deg, #1e2a5e 25%, #1e3a8a 50%, #1e2a5e 75%);
    background-size: 200% 100%;
    animation: poLineShimmer 2s linear infinite;
}

body.dark .po-loading-dots span {
    background: #3b82f6;
}

body.dark .po-loading-text {
    color: #94a3b8;
}

body.dark .po-result-content {
    color: #e2e8f0;
}

body.dark .po-result-content h2 {
    color: #93c5fd;
    border-bottom-color: #1e3a8a;
}

body.dark .po-result-content h3 {
    color: #bfdbfe;
    border-bottom-color: #1e2a5e;
}

body.dark .po-result-content h4 {
    color: #93c5fd;
}

body.dark .po-result-content h5 {
    color: #60a5fa;
}

body.dark .po-result-content h6 {
    color: #3b82f6;
}

body.dark .po-result-content p {
    color: #cbd5e1;
}

body.dark .po-result-content ul,
body.dark .po-result-content ol {
    color: #cbd5e1;
}

body.dark .po-result-content li {
    color: #cbd5e1;
}

body.dark .po-result-content li::marker {
    color: #3b82f6;
}

body.dark .po-result-content a {
    color: #60a5fa;
}

body.dark .po-result-content a:hover {
    color: #93c5fd;
}

body.dark .po-result-content strong {
    color: #bfdbfe;
}

body.dark .po-result-content em {
    color: #93c5fd;
}

body.dark .po-result-content blockquote {
    border-left-color: #3b82f6;
    background: #0d1a33;
    color: #93c5fd;
}

body.dark .po-result-content pre {
    background: #0d1a33;
    border-color: #1e3a8a;
}

body.dark .po-result-content code {
    background: #1e2a5e;
    color: #93c5fd;
}

body.dark .po-modal-content {
    background: #0f172a;
}

body.dark .po-modal-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e2a5e 100%);
}

body.dark .po-modal-body {
    background: #0f172a;
    scrollbar-width: thin;
    scrollbar-color: #1e3a8a transparent;
}

body.dark .po-modal-body::-webkit-scrollbar { width: 5px; }
body.dark .po-modal-body::-webkit-scrollbar-track { background: #0f172a; }
body.dark .po-modal-body::-webkit-scrollbar-thumb { background: #1e3a8a; border-radius: 3px; }
body.dark .po-modal-body::-webkit-scrollbar-thumb:hover { background: #2563eb; }

body.dark .po-example-card {
    background: #0d1a33;
    border-color: #1e3a8a;
}

body.dark .po-example-card:hover {
    background: #112050;
    border-color: #3b82f6;
}

body.dark .po-example-card-title {
    color: #bfdbfe;
}

body.dark .po-example-card-badge {
    background: #1e2a5e;
    color: #93c5fd;
}

body.dark .po-example-card-meta span {
    background: #0d1a33;
    color: #60a5fa;
}

body.dark .po-example-card-meta {
    color: #4b5563;
}

body.dark .po-toast {
    background: #1e3a8a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark .po-result-error-block {
    background: #1a0f0f;
    border-left-color: #ef4444;
}

body.dark .po-result-error-title {
    color: #f87171;
}

body.dark .po-result-error-hint {
    color: #64748b;
}

body.dark .po-result-error-retry-btn {
    background: #dc2626;
}

body.dark .po-result-error-retry-btn:hover {
    background: #b91c1c;
}

/* ========== 暗黑模式：占位文字颜色（所有输入控件必须显式定义） ========== */
body.dark .po-input::placeholder {
    color: #4b5563;
}

body.dark .po-textarea::placeholder {
    color: #4b5563;
}

body.dark .po-history-search input::placeholder {
    color: #4b5563;
}

/* ========== 响应式适配 ========== */
@media (max-width: 900px) {
    .po-history-panel {
        width: 160px;
    }
    .po-input-panel {
        width: 280px;
    }
}

/* 窄屏布局：统一断点 ≤639px（禁止使用 680px 等非标值） */
@media (max-width: 639px) {
    .po-main-content {
        flex-direction: column;
    }
    .po-history-panel {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid #bfdbfe;
    }
    /* 断点内 body.dark 适配：border-bottom 颜色 */
    body.dark .po-history-panel {
        border-bottom-color: #1e3a8a;
    }
    .po-input-panel {
        width: 100%;
        flex-shrink: 0;
        min-height: 240px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    body.dark .po-input-panel {
        border-bottom-color: #1e3a8a;
    }
    .po-result-panel {
        min-height: 240px;
    }
    .po-container {
        height: auto;
        min-height: 100vh;
    }
}
