/* ========================================================
   专利撰写工具 - patent_writing.css
   色彩主题：深海蓝（#1e3a5f）× 琥珀金（#f59e0b），体现专利的严肃性与价值感
   CSS前缀：pw-   暗黑模式前缀：body.dark
   ======================================================== */

/* ========== 主容器 ========== */
.pw-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f4f8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(30, 58, 95, 0.08);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.pw-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.pw-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5986 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(30, 58, 95, 0.4);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.pw-toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: #e8f4ff;
    margin-right: 4px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.pw-toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #e8f4ff;
    transition: all 0.2s;
    white-space: nowrap;
}

.pw-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.pw-toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pw-toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pw-toolbar-btn-primary {
    background: #f59e0b;
    border-color: #d97706;
    color: #1a1a1a;
    font-weight: 600;
}

.pw-toolbar-btn-primary:hover:not(:disabled) {
    background: #d97706;
    border-color: #b45309;
    color: #111;
}

.pw-toolbar-btn-cancel {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(220, 38, 38, 0.9);
    color: white;
}

.pw-toolbar-btn-cancel:hover:not(:disabled) {
    background: #dc2626;
}

/* ========== 主内容区 ========== */
.pw-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f4f8;
}

/* ========== 左侧历史面板 ========== */
.pw-history-panel {
    width: 210px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.pw-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f7fa 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.pw-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e3a5f;
    background: none;
    border: none;
    padding: 0;
}

.pw-history-count {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
}

.pw-history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.pw-history-clear-btn:hover {
    background: #fde8e8;
}

.pw-history-search {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.pw-history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.pw-history-search input:focus {
    border-color: #2d5986;
    box-shadow: 0 0 0 2px rgba(45, 89, 134, 0.12);
}

.pw-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    background: #ffffff;
}

.pw-history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 24px 10px;
}

.pw-history-item {
    padding: 9px 11px;
    margin: 3px 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: pwFadeIn 0.2s ease;
}

@keyframes pwFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pw-history-item:hover {
    background: #eef2f7;
    border-color: #c7d7ec;
    transform: translateX(2px);
}

.pw-history-item.active {
    background: #dbeafe;
    border-color: #3b82f6;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.pw-history-item-title {
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 22px;
    margin-bottom: 3px;
}

.pw-history-item-meta {
    font-size: 11px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.pw-history-item-time {
    font-size: 10px;
    color: #94a3b8;
}

.pw-history-item-del {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pw-history-item:hover .pw-history-item-del {
    opacity: 1;
}

.pw-history-item-del:hover {
    background: #ef4444;
    color: white;
}

/* ========== 中栏：输入面板 ========== */
.pw-input-panel {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
}

.pw-panel-header {
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f7fa 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.pw-panel-header h3 {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e3a5f;
}

/* 结果面板头部：h3 左侧， meta 右侧横向排列 */
.pw-result-panel .pw-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 44px;
}

.pw-result-panel .pw-panel-header h3 {
    margin: 0;
}

.pw-result-panel .pw-panel-header .pw-result-meta {
    margin-top: 0;
}

.pw-panel-tip {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

.pw-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.pw-section {
    margin-bottom: 16px;
}

.pw-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #2d5986;
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 3px solid #2d5986;
    line-height: 1.4;
}

.pw-form-group {
    margin-bottom: 10px;
}

.pw-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 4px;
}

.pw-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.pw-form-group-half {
    flex: 1;
    min-width: 0;
}

.pw-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #1e293b;
    background: #fafafa;
}

.pw-input:focus {
    border-color: #2d5986;
    box-shadow: 0 0 0 2px rgba(45, 89, 134, 0.12);
    background: #fff;
}

.pw-input::placeholder {
    color: #94a3b8;
    font-size: 11px;
}

.pw-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    background: #fafafa;
    color: #1e293b;
    transition: all 0.2s;
    box-sizing: border-box;
    appearance: auto;
}

.pw-select:focus {
    border-color: #2d5986;
    box-shadow: 0 0 0 2px rgba(45, 89, 134, 0.12);
    background: #fff;
}

.pw-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #1e293b;
    background: #fafafa;
    line-height: 1.6;
    min-height: 80px;
}

.pw-textarea:focus {
    border-color: #2d5986;
    box-shadow: 0 0 0 2px rgba(45, 89, 134, 0.12);
    background: #fff;
}

.pw-textarea::placeholder {
    color: #94a3b8;
    font-size: 11px;
}

.pw-input-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.pw-char-counter {
    text-align: right;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
    transition: color 0.2s;
}

.pw-char-counter--warn {
    color: #e75480;
}

.pw-optional {
    font-weight: 400;
    color: #94a3b8;
    font-size: 11px;
    margin-left: 4px;
}

.pw-required {
    font-size: 11px;
    color: #ef4444;
    font-weight: 500;
    margin-left: 4px;
}

/* ========== 右栏：结果面板 ========== */
.pw-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
    min-width: 300px;
}

.pw-result-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.pw-result-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 500;
}

.pw-result-time {
    font-size: 11px;
    color: #94a3b8;
}

.pw-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 20px;
}

/* ========== 自定义滚动条 ========== */
.pw-result-body::-webkit-scrollbar,
.pw-history-list::-webkit-scrollbar,
.pw-input-body::-webkit-scrollbar {
    width: 5px;
}

.pw-result-body::-webkit-scrollbar-track,
.pw-history-list::-webkit-scrollbar-track,
.pw-input-body::-webkit-scrollbar-track {
    background: transparent;
}

.pw-result-body::-webkit-scrollbar-thumb,
.pw-history-list::-webkit-scrollbar-thumb,
.pw-input-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.pw-result-body::-webkit-scrollbar-thumb:hover,
.pw-history-list::-webkit-scrollbar-thumb:hover,
.pw-input-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.pw-result-body,
.pw-history-list,
.pw-input-body {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

/* 占位符 */
.pw-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    padding: 30px 20px;
    text-align: center;
}

.pw-placeholder-icon {
    font-size: 52px;
    margin-bottom: 18px;
    opacity: 0.4;
}

.pw-placeholder-lines {
    margin-bottom: 20px;
    width: 100%;
    max-width: 280px;
}

.pw-placeholder-line {
    height: 10px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: pwSkeletonShimmer 1.8s infinite;
    border-radius: 5px;
    margin-bottom: 8px;
}

@keyframes pwSkeletonShimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.pw-line-long   { width: 100%; }
.pw-line-medium { width: 72%; }
.pw-line-short  { width: 48%; }

.pw-placeholder-title {
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 8px 0;
}

.pw-placeholder-desc {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0;
}

/* 加载中 */
.pw-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    padding: 30px 20px;
}

.pw-loading-icon {
    font-size: 42px;
    margin-bottom: 16px;
    animation: pwSpin 2.4s linear infinite;
}

@keyframes pwSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pw-loading-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.pw-loading-dots span {
    width: 8px;
    height: 8px;
    background: #2d5986;
    border-radius: 50%;
    animation: pwDotBounce 1.2s infinite ease-in-out;
}

.pw-loading-dots span:nth-child(1) { animation-delay: 0s; }
.pw-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.pw-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pwDotBounce {
    0%, 60%, 100% { transform: scale(1); opacity: 0.7; }
    30%            { transform: scale(1.4); opacity: 1; }
}

.pw-loading-text {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    margin: 0;
}

/* 结果内容 */
.pw-result-content {
    font-size: 13px;
    line-height: 1.85;
    color: #1e293b;
    animation: pwResultEnter 0.3s ease-out;
}

@keyframes pwResultEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* AI 输出的 HTML 元素样式 */
.pw-result-content h2 {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 22px 0 10px;
    padding: 8px 14px;
    background: linear-gradient(to right, #dbeafe, #eff6ff);
    border-left: 4px solid #2d5986;
    border-radius: 0 6px 6px 0;
}

.pw-result-content h2:first-child {
    margin-top: 0;
}

.pw-result-content h3 {
    font-size: 13px;
    font-weight: 600;
    color: #2d5986;
    margin: 14px 0 6px;
    padding: 4px 0 4px 10px;
    border-left: 2px solid #93c5fd;
}

.pw-result-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin: 10px 0 4px;
}

.pw-result-content h5 {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin: 8px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pw-result-content a {
    color: #2d5986;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pw-result-content a:hover {
    color: #1e3a5f;
}

.pw-result-content p {
    margin: 6px 0;
    color: #334155;
    text-align: justify;
    text-indent: 0;
}

.pw-result-content ul,
.pw-result-content ol {
    margin: 6px 0 6px 22px;
    padding: 0;
}

.pw-result-content li {
    margin-bottom: 5px;
    color: #334155;
    line-height: 1.7;
}

.pw-result-content blockquote {
    border-left: 3px solid #f59e0b;
    margin: 10px 0;
    padding: 8px 14px;
    background: #fffbeb;
    color: #92400e;
    border-radius: 0 5px 5px 0;
    font-size: 12px;
}

.pw-result-content strong {
    color: #1e3a5f;
    font-weight: 600;
}

.pw-result-content code {
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    color: #2d5986;
}

/* 错误提示区块 */
.pw-result-error-block {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 18px;
    margin-top: 20px;
}

.pw-result-error-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.pw-result-error-body {
    flex: 1;
}

.pw-result-error-title {
    font-size: 14px;
    font-weight: 600;
    color: #c53030;
    margin: 0 0 6px 0;
}

.pw-result-error-hint {
    font-size: 12px;
    color: #718096;
    margin: 0 0 12px 0;
}

.pw-result-error-retry-btn {
    padding: 6px 16px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.pw-result-error-retry-btn:hover {
    background: #c53030;
}

/* ========== 模态框 ========== */
.pw-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.pw-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: 600px;
    max-width: calc(100vw - 32px);
    max-height: 82vh;
    background: white;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pwModalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pwModalIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.pw-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.pw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(to bottom, #fafafa, #f5f7fa);
    flex-shrink: 0;
}

.pw-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
}

.pw-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f4f8;
    color: #64748b;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.pw-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 示例卡片 */
.pw-example-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    transition: all 0.2s;
}

.pw-example-card:hover {
    border-color: #2d5986;
    background: #eff6ff;
    box-shadow: 0 3px 10px rgba(45, 89, 134, 0.1);
}

.pw-example-card-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.pw-example-card-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1.2;
}

.pw-example-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e3a5f;
    flex: 1;
    line-height: 1.4;
}

.pw-example-card-badge {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.pw-example-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pw-example-card-meta span {
    background: #f0f4f8;
    color: #475569;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

.pw-example-import-btn {
    padding: 5px 14px;
    background: #2d5986;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.pw-example-import-btn:hover {
    background: #1e3a5f;
}

/* ========== Toast 通知 ========== */
.pw-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200000;
    padding: 10px 24px;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    pointer-events: none;
}

/* 抖动动画 */
@keyframes pwShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.pw-shake {
    animation: pwShake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

/* ========== 响应式 ========== */
@media (max-width: 960px) {
    .pw-history-panel { display: none; }
    .pw-input-panel { width: 300px; }
}

@media (max-width: 660px) {
    .pw-input-panel { width: 100%; border-right: none; }
    .pw-result-panel { display: none; }
    .pw-main-content { flex-direction: column; }
}

/* ========================================================
   暗黑模式 (body.dark)
   ======================================================== */
body.dark .pw-container {
    background: #0f172a;
}

body.dark .pw-toolbar {
    background: linear-gradient(135deg, #0f2745 0%, #1e3a5f 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

body.dark .pw-toolbar-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: #cbd5e1;
}

body.dark .pw-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

body.dark .pw-toolbar-btn-primary {
    background: #d97706;
    border-color: #b45309;
    color: #fefce8;
}

body.dark .pw-toolbar-btn-primary:hover:not(:disabled) {
    background: #b45309;
    border-color: #92400e;
}

body.dark .pw-main-content {
    background: #0f172a;
}

body.dark .pw-history-panel,
body.dark .pw-input-panel,
body.dark .pw-result-panel {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .pw-history-header,
body.dark .pw-panel-header {
    background: linear-gradient(to bottom, #243147 0%, #1e293b 100%);
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .pw-history-header h3,
body.dark .pw-panel-header h3 {
    color: #93c5fd;
}

body.dark .pw-panel-tip {
    color: #94a3b8;
}

body.dark .pw-history-search {
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .pw-history-search input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .pw-history-search input::placeholder {
    color: #6e7681;
}

body.dark .pw-history-list {
    background: #1e293b;
}

body.dark .pw-history-item {
    background: #243147;
    border-color: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
}

body.dark .pw-history-item:hover {
    background: #2d3f56;
    border-color: #3b5a84;
}

body.dark .pw-history-item.active {
    background: #1e3a5f;
    border-color: #3b82f6;
    box-shadow: inset 3px 0 0 #3b82f6;
}

body.dark .pw-history-item-title {
    color: #e2e8f0;
}

body.dark .pw-history-item-meta {
    color: #94a3b8;
}

body.dark .pw-history-item-time {
    color: #64748b;
}

body.dark .pw-history-item-del {
    color: #6e7681;
    background: rgba(239, 68, 68, 0.15);
}

body.dark .pw-section-title {
    color: #93c5fd;
    border-left-color: #3b82f6;
}

body.dark .pw-input,
body.dark .pw-select,
body.dark .pw-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .pw-input:focus,
body.dark .pw-select:focus,
body.dark .pw-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: #0f172a;
}

body.dark .pw-input::placeholder,
body.dark .pw-textarea::placeholder {
    color: #6e7681;
}

body.dark .pw-form-group label {
    color: #94a3b8;
}

body.dark .pw-input-hint,
body.dark .pw-optional {
    color: #94a3b8;
}

body.dark .pw-char-counter {
    color: #64748b;
}

body.dark .pw-char-counter--warn {
    color: #f87171;
}

body.dark .pw-result-body {
    background: #1e293b;
}

body.dark .pw-placeholder-title {
    color: #64748b;
}

body.dark .pw-placeholder-desc {
    color: #64748b;
}

body.dark .pw-placeholder-line {
    background: linear-gradient(90deg, #243147 25%, #2d3f56 50%, #243147 75%);
    background-size: 200% 100%;
}

body.dark .pw-loading-text {
    color: #94a3b8;
}

body.dark .pw-loading-dots span {
    background: #3b82f6;
}

body.dark .pw-result-content {
    color: #e2e8f0;
}

body.dark .pw-result-content h2 {
    background: linear-gradient(to right, #1e3a5f, #1e293b);
    color: #93c5fd;
    border-left-color: #3b82f6;
}

body.dark .pw-result-content h3 {
    color: #93c5fd;
    border-left-color: #3b82f6;
}

body.dark .pw-result-content h4 {
    color: #94a3b8;
}

body.dark .pw-result-content p,
body.dark .pw-result-content li {
    color: #cbd5e1;
}

body.dark .pw-result-content blockquote {
    background: #1e2d1a;
    border-left-color: #f59e0b;
    color: #fcd34d;
}

body.dark .pw-result-content strong {
    color: #e2e8f0;
}

body.dark .pw-result-content code {
    background: #0f172a;
    color: #93c5fd;
}

body.dark .pw-result-badge {
    background: #1e3a5f;
    color: #93c5fd;
}

body.dark .pw-result-error-block {
    background: #1f1010;
    border-color: #742020;
}

body.dark .pw-result-error-title {
    color: #fc8181;
}

body.dark .pw-result-error-hint {
    color: #94a3b8;
}

body.dark .pw-modal {
    background: #1e293b;
}

body.dark .pw-modal-header {
    background: linear-gradient(to bottom, #243147 0%, #1e293b 100%);
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .pw-modal-header h3 {
    color: #93c5fd;
}

body.dark .pw-modal-close {
    background: #334155;
    color: #94a3b8;
}

body.dark .pw-modal-close:hover {
    background: #3d4f66;
    color: #e2e8f0;
}

body.dark .pw-modal-body {
    background: #1e293b;
}

body.dark .pw-example-card {
    background: #243147;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .pw-example-card:hover {
    background: #1e3a5f;
    border-color: #3b82f6;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.15);
}

body.dark .pw-example-card-title {
    color: #e2e8f0;
}

body.dark .pw-example-card-badge {
    background: #1e3a5f;
    color: #93c5fd;
}

body.dark .pw-example-card-meta span {
    background: #334155;
    color: #94a3b8;
}

body.dark .pw-result-content h5 {
    color: #94a3b8;
}

body.dark .pw-result-content a {
    color: #93c5fd;
}

body.dark .pw-result-content a:hover {
    color: #60a5fa;
}

/* 暗黑模式自定义滚动条 */
body.dark .pw-result-body::-webkit-scrollbar-thumb,
body.dark .pw-history-list::-webkit-scrollbar-thumb,
body.dark .pw-input-body::-webkit-scrollbar-thumb {
    background: #334155;
}

body.dark .pw-result-body::-webkit-scrollbar-thumb:hover,
body.dark .pw-history-list::-webkit-scrollbar-thumb:hover,
body.dark .pw-input-body::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

body.dark .pw-result-body,
body.dark .pw-history-list,
body.dark .pw-input-body {
    scrollbar-color: #334155 transparent;
}
