/* =============================================
   网民大师 - netizen_master.css
   互联网紫蓝渐变主题，三栏布局，支持暗黑模式
   ============================================= */

/* ========== 主容器 ========== */
.nm-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f5f3ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(124, 58, 237, 0.13);
    transition: all 0.3s ease;
}

.nm-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;
}

/* ========== 顶部工具栏 ========== */
.nm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 40%, #2563eb 80%, #0891b2 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 3px 12px rgba(124, 58, 237, 0.45);
    flex-shrink: 0;
}

.nm-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.96);
    letter-spacing: 1px;
    margin-right: 8px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.nm-toolbar .toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.nm-toolbar .toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: white;
    transition: all 0.2s;
    white-space: nowrap;
}

.nm-toolbar .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.55);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.nm-toolbar .toolbar-btn:active:not(:disabled) { transform: translateY(0); }
.nm-toolbar .toolbar-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.nm-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    border: none;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.5);
}

.nm-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f472b6 0%, #a78bfa 100%);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.6);
    transform: translateY(-1px);
}

/* ========== 主内容区：三栏 ========== */
.nm-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f5f3ff;
}

/* ========== 左栏：历史记录 ========== */
.nm-history-panel {
    width: 215px;
    flex-shrink: 0;
    background: #faf5ff;
    border-right: 1px solid #ddd6fe;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nm-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #faf5ff 0%, #f3e8ff 100%);
    border-bottom: 1px solid #ddd6fe;
    flex-shrink: 0;
}

.nm-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #4c1d95;
}

.nm-history-count { font-size: 11px; color: #7c3aed; font-weight: 400; }

.nm-history-limit-footer {
    flex-shrink: 0;
    padding: 5px 8px;
    text-align: center;
    font-size: 10px;
    color: #a78bfa;
    border-top: 1px solid #e9d5ff;
    background: #faf5ff;
    letter-spacing: 0.2px;
    user-select: none;
}

.nm-history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #e74c3c;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.nm-history-clear-btn:hover { background: #fde8e8; }

.nm-history-search {
    padding: 8px;
    border-bottom: 1px solid #e9d5ff;
    flex-shrink: 0;
}

.nm-history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #2e1065;
    background: #fff;
}

.nm-history-search input::placeholder { color: #b0a4d0; font-size: 12px; }

.nm-history-search input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
}

.nm-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.nm-history-list::-webkit-scrollbar { width: 4px; }
.nm-history-list::-webkit-scrollbar-track { background: transparent; }
.nm-history-list:hover::-webkit-scrollbar-track { background: #f3e8ff; }
.nm-history-list::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 2px; }
.nm-history-list::-webkit-scrollbar-thumb:hover { background: #7c3aed; }

.nm-history-empty {
    text-align: center;
    color: #a78bfa;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
    line-height: 1.7;
}

@keyframes nmHistoryFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
}

.nm-history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #fff;
    border: 1px solid #e9d5ff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: nmHistoryFadeIn 0.22s ease;
}

.nm-history-item:hover {
    background: #f3e8ff;
    border-color: #ddd6fe;
    transform: translateX(2px);
}

.nm-history-item.active {
    background: #ede9fe;
    border-color: #7c3aed;
    box-shadow: 0 1px 4px rgba(124, 58, 237, 0.15);
}

.nm-history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fff0f0;
    color: #e74c3c;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.nm-history-item:hover .nm-history-item-delete { opacity: 1; }
.nm-history-item-delete:hover { background: #fde8e8 !important; }

.nm-history-item-preview {
    font-size: 12px;
    color: #2e1065;
    font-weight: 500;
    line-height: 1.5;
    padding-right: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nm-history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    gap: 4px;
}

.nm-history-item-mode {
    font-size: 10px;
    color: #fff;
    background: #7c3aed;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nm-history-item-time {
    font-size: 10px;
    color: #8b5cf6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== 中栏：输入区 ========== */
.nm-input-panel {
    width: 340px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #ddd6fe;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nm-panel-header {
    padding: 12px 16px 10px;
    background: linear-gradient(to bottom, #fff 0%, #faf5ff 100%);
    border-bottom: 1px solid #e9d5ff;
    flex-shrink: 0;
}

.nm-panel-header h3 {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 700;
    color: #2e1065;
}

.nm-panel-tip { font-size: 11px; color: #a78bfa; }

.nm-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nm-input-body::-webkit-scrollbar { width: 4px; }
.nm-input-body::-webkit-scrollbar-track { background: transparent; }
.nm-input-body::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 2px; }
.nm-input-body::-webkit-scrollbar-thumb:hover { background: #7c3aed; }

.nm-textarea {
    width: 100%;
    min-height: 160px;
    max-height: 260px;
    padding: 12px 14px;
    border: 2px solid #ddd6fe;
    border-radius: 6px;
    font-size: 14px;
    color: #2e1065;
    background: #faf5ff;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.7;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.nm-textarea:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.nm-textarea::placeholder { color: #c4b5fd; font-size: 12.5px; line-height: 1.6; }

@keyframes nmShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-6px); }
    30%, 70% { transform: translateX(6px); }
}

.nm-textarea.shake {
    animation: nmShake 0.5s ease-in-out;
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15) !important;
}

.nm-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #a78bfa;
    margin-top: -6px;
}

.nm-char-count { font-variant-numeric: tabular-nums; transition: color 0.2s; }
.nm-char-count.warning { color: #f39c12 !important; }
.nm-char-count.danger  { color: #e74c3c !important; font-weight: 700; }

/* ========== 模式选择 ========== */
.nm-mode-section { display: flex; flex-direction: column; gap: 8px; }
.nm-mode-label { font-size: 12px; font-weight: 600; color: #4c1d95; letter-spacing: 0.5px; }

.nm-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.nm-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    background: #faf5ff;
    border: 2px solid #ddd6fe;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
    user-select: none;
    position: relative;
}

.nm-mode-card:hover {
    border-color: #7c3aed;
    background: #f3e8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.18);
}

.nm-mode-card.selected {
    border-color: #ec4899;
    background: linear-gradient(135deg, #fdf4ff 0%, #fce7f3 100%);
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.2);
}

.nm-mode-card.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    color: #ec4899;
    font-weight: 900;
    line-height: 1;
}

.nm-mode-icon { font-size: 20px; margin-bottom: 4px; line-height: 1; }
.nm-mode-name { font-size: 12px; font-weight: 700; color: #2e1065; margin-bottom: 2px; }
.nm-mode-desc { font-size: 10px; color: #8b5cf6; line-height: 1.3; }
.nm-mode-card.selected .nm-mode-name { color: #ec4899; }

/* ========== 使用提示 ========== */
.nm-tips-box {
    background: linear-gradient(135deg, #fdf4ff 0%, #fce7f3 100%);
    border: 1px solid #e9d5ff;
    border-left: 3px solid #7c3aed;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 12px;
}

.nm-tips-box p { margin: 0 0 6px; font-weight: 600; color: #4c1d95; }
.nm-tips-box ul { margin: 0; padding-left: 16px; color: #6d28d9; line-height: 1.9; }
.nm-tips-box ul li { font-size: 11px; }
.nm-tips-box li::marker { color: #ff9800; }

/* ========== 右栏：结果区 ========== */
.nm-result-panel {
    flex: 1;
    min-width: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nm-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 10px;
    background: linear-gradient(to bottom, #fff 0%, #faf5ff 100%);
    border-bottom: 1px solid #e9d5ff;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.nm-result-header h3 { margin: 0; font-size: 14px; font-weight: 700; color: #2e1065; }

.nm-result-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nm-result-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.nm-result-action-btn {
    padding: 4px 10px;
    background: linear-gradient(135deg, #fdf4ff 0%, #fce7f3 100%);
    border: 1px solid #e9d5ff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #7c3aed;
    transition: all 0.2s;
    white-space: nowrap;
}

.nm-result-action-btn:hover {
    background: linear-gradient(135deg, #f3e8ff 0%, #fce7f3 100%);
    border-color: #7c3aed;
    color: #4c1d95;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

.nm-result-mode-tag {
    font-size: 11px;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.nm-result-time { font-size: 11px; color: #a78bfa; }

.nm-word-count {
    font-size: 11px;
    color: #7c3aed;
    background: #ede9fe;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.nm-textarea-hint {
    font-style: italic;
    font-size: 11px;
    color: #a78bfa;
    user-select: none;
}

.nm-result-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.nm-result-body::-webkit-scrollbar { width: 5px; }
.nm-result-body::-webkit-scrollbar-track { background: transparent; }
.nm-result-body:hover::-webkit-scrollbar-track { background: #f3e8ff; }
.nm-result-body::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 3px; }
.nm-result-body::-webkit-scrollbar-thumb:hover { background: #7c3aed; }

/* ========== 占位 ========== */
.nm-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    padding: 40px 20px;
    text-align: center;
    user-select: none;
}

.nm-placeholder-icon {
    font-size: 54px;
    margin-bottom: 16px;
    opacity: 0.7;
    animation: nmFloatIcon 3s ease-in-out infinite;
}

@keyframes nmFloatIcon {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
}

.nm-placeholder-title { font-size: 16px; font-weight: 700; color: #4c1d95; margin: 0 0 8px; }
.nm-placeholder-desc { font-size: 13px; color: #8b5cf6; margin: 2px 0; line-height: 1.6; }

.nm-placeholder-quote {
    margin-top: 18px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #fdf4ff 0%, #fce7f3 100%);
    border-left: 3px solid #ec4899;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    font-style: italic;
    color: #6d28d9;
    letter-spacing: 0.5px;
}

/* ========== 加载中 ========== */
.nm-result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    padding: 40px 20px;
}

.nm-loading-icon-wrap {
    font-size: 42px;
    margin-bottom: 12px;
    animation: nmLoadingPulse 1s ease-in-out infinite;
}

@keyframes nmLoadingPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.18); opacity: 1; }
}

.nm-loading-dots { display: flex; gap: 6px; margin: 8px 0 12px; }

.nm-loading-dots span {
    width: 8px;
    height: 8px;
    background: #7c3aed;
    border-radius: 50%;
    animation: nmDotBounce 1.2s ease-in-out infinite;
    opacity: 0.7;
}

.nm-loading-dots span:nth-child(2) { animation-delay: 0.2s; background: #ec4899; }
.nm-loading-dots span:nth-child(3) { animation-delay: 0.4s; background: #2563eb; }

@keyframes nmDotBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); opacity: 1; }
}

.nm-loading-text { font-size: 13px; color: #7c3aed; margin: 0; font-weight: 500; }

/* ========== 结果内容 ========== */
@keyframes nmResultFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.nm-result-content {
    padding: 18px 20px;
    font-size: 14px;
    color: #1e0f3a;
    line-height: 1.9;
    border-left: 3px solid #7c3aed;
    word-break: break-word;
    overflow-wrap: break-word;
    animation: nmResultFadeIn 0.35s ease;
}

/* ========== 错误提示 ========== */
.nm-result-error {
    flex: 1;
    min-height: 300px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.nm-error-message {
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-left: 4px solid #e74c3c;
    color: #7f1d1d;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
}

.nm-error-retry-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 18px;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.nm-error-retry-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #db2777 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
}

/* ========== AI 结果专属样式 ========== */
.nm-section {
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #e9d5ff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(124, 58, 237, 0.07);
}

.nm-section-title {
    margin: 0;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 60%, #ec4899 100%);
    letter-spacing: 0.5px;
}

.nm-section-body {
    padding: 13px 16px;
    color: #2e1065;
    line-height: 1.85;
    font-size: 13.5px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 网络体改写块 */
.nm-rewrite-block {
    padding: 13px 16px;
    background: linear-gradient(135deg, #fdf4ff 0%, #fce7f3 100%);
    border-left: 4px solid #ec4899;
    border-radius: 0 8px 8px 0;
    margin: 8px 0;
    font-size: 14px;
    line-height: 2;
    color: #1e0f3a;
    word-break: break-word;
}

.nm-original-block {
    padding: 10px 14px;
    background: #f8f8fc;
    border-left: 3px solid #a78bfa;
    border-radius: 0 6px 6px 0;
    margin: 6px 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.7;
}

/* 评论条目 */
.nm-comment-item {
    display: flex;
    flex-direction: column;
    padding: 11px 14px;
    margin: 8px 0;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
    gap: 5px;
    transition: all 0.2s;
}

.nm-comment-item:hover {
    background: #f3e8ff;
    border-color: #ddd6fe;
    transform: translateX(2px);
}

.nm-comment-header { display: flex; align-items: center; gap: 8px; }

.nm-comment-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.nm-comment-user { font-size: 12px; font-weight: 700; color: #4c1d95; }

.nm-comment-type {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #ede9fe;
    color: #6d28d9;
    font-weight: 600;
}

.nm-comment-text { font-size: 13px; color: #2e1065; line-height: 1.75; padding-left: 4px; }

.nm-comment-footer { display: flex; gap: 12px; font-size: 11px; color: #8b5cf6; padding-left: 4px; }

/* 用语解读 */
.nm-slang-word {
    display: inline-block;
    font-size: 22px;
    font-weight: 900;
    color: #4c1d95;
    background: linear-gradient(135deg, #f3e8ff 0%, #fce7f3 100%);
    padding: 4px 14px;
    border-radius: 8px;
    margin: 4px 0 10px;
    letter-spacing: 2px;
    border: 2px solid #ddd6fe;
}

.nm-slang-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #fff;
    font-weight: 600;
    margin: 2px 3px;
}

.nm-slang-origin {
    background: #fdf4ff;
    border: 1px solid #e9d5ff;
    border-left: 3px solid #7c3aed;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin: 8px 0;
    font-size: 13px;
    color: #4c1d95;
    line-height: 1.75;
}

.nm-slang-example {
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    border-radius: 6px;
    padding: 9px 14px;
    margin: 6px 0;
    font-size: 13px;
    color: #2e1065;
    line-height: 1.7;
    border: 1px solid #ddd6fe;
}

/* 表情包文案 */
.nm-meme-item {
    background: linear-gradient(135deg, #fff 0%, #fdf4ff 100%);
    border: 2px solid #e9d5ff;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 8px 0;
    position: relative;
    transition: all 0.2s;
}

.nm-meme-item:hover {
    border-color: #7c3aed;
    box-shadow: 0 3px 12px rgba(124, 58, 237, 0.15);
    transform: translateY(-1px);
}

.nm-meme-style {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 10px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.nm-meme-text { font-size: 14px; font-weight: 600; color: #2e1065; line-height: 1.8; padding-right: 60px; }

/* 高亮 */
.nm-highlight {
    background: linear-gradient(120deg, rgba(124,58,237,0.15) 0%, rgba(236,72,153,0.1) 100%);
    color: #4c1d95;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
}

/* 通用结果内容 */
.nm-result-content table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.nm-result-content table th { background: linear-gradient(135deg, #4c1d95, #7c3aed); color: #fff; padding: 7px 12px; text-align: left; font-weight: 600; }
.nm-result-content table td { padding: 7px 12px; border: 1px solid #e9d5ff; color: #2e1065; }
.nm-result-content table tr:nth-child(even) td { background: #faf5ff; }
.nm-result-content li { margin: 4px 0; line-height: 1.8; }
.nm-result-content li::marker { color: #ff9800; }
.nm-section-body li::marker { color: #ff9800; }
.nm-result-content p { margin: 6px 0; }

/* ========== nm-section-body 富文本标签统一样式 ========== */
.nm-section-body h3 {
    font-size: 14px;
    font-weight: 700;
    color: #4c1d95;
    margin: 12px 0 6px;
    border-bottom: 1px dashed #ddd6fe;
    padding-bottom: 4px;
}
.nm-section-body h4 {
    font-size: 13px;
    font-weight: 700;
    color: #6d28d9;
    margin: 10px 0 5px;
}
.nm-section-body strong { color: #4c1d95; font-weight: 700; }
.nm-section-body em { color: #7c3aed; font-style: italic; }
.nm-section-body a { color: #7c3aed; text-decoration: underline; }
.nm-section-body a:hover { color: #ec4899; }
.nm-section-body ul, .nm-section-body ol { padding-left: 18px; margin: 6px 0; }
.nm-section-body li { margin: 3px 0; line-height: 1.8; }

/* ========== 模态框动画 ========== */
@keyframes nmModalFadeIn {
    from { opacity: 0; transform: translate(-50%, -53%) scale(0.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes nmOverlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.nm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 5, 40, 0.55);
    z-index: 10000;
    backdrop-filter: blur(2px);
    animation: nmOverlayFadeIn 0.2s ease;
}

.nm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: min(780px, 92vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: nmModalFadeIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nm-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(76, 29, 149, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.nm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 60%, #ec4899 100%);
    color: white;
    flex-shrink: 0;
}

.nm-modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: rgba(255,255,255,0.97); }

.nm-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nm-modal-close:hover { background: rgba(255,255,255,0.35); }

.nm-modal-body {
    padding: 18px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.nm-modal-body::-webkit-scrollbar { width: 5px; }
.nm-modal-body::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 3px; }
.nm-modal-body::-webkit-scrollbar-thumb:hover { background: #7c3aed; }

.nm-example-card {
    display: flex;
    flex-direction: column;
    padding: 14px;
    background: #fff;
    border: 2px solid #e9d5ff;
    border-radius: 10px;
    transition: all 0.2s;
    position: relative;
}

.nm-example-card:hover {
    border-color: #7c3aed;
    background: #fdf4ff;
    box-shadow: 0 3px 12px rgba(124, 58, 237, 0.15);
    transform: translateY(-1px);
}

.nm-example-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.nm-example-title { font-size: 12px; font-weight: 700; color: #4c1d95; }

.nm-example-mode-tag {
    font-size: 10px;
    background: #ede9fe;
    color: #6d28d9;
    padding: 1px 7px;
    border-radius: 10px;
    border: 1px solid #ddd6fe;
    white-space: nowrap;
}

.nm-example-text {
    font-size: 12px;
    color: #4c1d95;
    line-height: 1.7;
    margin-bottom: 10px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nm-example-import-btn {
    padding: 5px 14px;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    align-self: flex-end;
}

.nm-example-import-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #db2777 100%);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* ========== 打印样式 ========== */
@media print {
    .nm-toolbar, .nm-history-panel, .nm-input-panel,
    #nmResultPlaceholder, #nmResultLoading, .nm-result-error,
    .nm-modal, .nm-modal-overlay { display: none !important; }
    .nm-container { height: auto !important; box-shadow: none !important; overflow: visible !important; }
    .nm-result-panel { width: 100% !important; overflow: visible !important; }
    .nm-result-body { overflow: visible !important; height: auto !important; }
    .nm-section { break-inside: avoid; }
    .nm-result-content { border-left: 2px solid #7c3aed; padding: 10px; }
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .nm-history-panel { width: 0; overflow: hidden; border-right: none; }
    .nm-input-panel { width: 280px; }
}

@media (max-width: 600px) {
    .nm-input-panel { width: 100%; border-right: none; }
    .nm-result-panel { display: none; }
    .nm-mode-grid { grid-template-columns: 1fr 1fr; }
    .nm-modal-body { grid-template-columns: 1fr; }
}

/* ========================================================
   暗黑模式 - 所有选择器必须以 body.dark 为父级前缀
   ======================================================== */
body.dark .nm-container { background: #0a0518; box-shadow: 0 2px 14px rgba(0,0,0,0.5); }
body.dark .nm-toolbar { background: linear-gradient(135deg, #1e0a3c 0%, #3b1073 40%, #1e3a8a 80%, #075985 100%); box-shadow: 0 3px 12px rgba(0,0,0,0.6); }
body.dark .nm-toolbar .toolbar-title { color: rgba(221,214,254,0.96); }
body.dark .nm-toolbar .toolbar-btn { background: rgba(124,58,237,0.2); border-color: rgba(167,139,250,0.35); color: #ddd6fe; }
body.dark .nm-toolbar .toolbar-btn:hover:not(:disabled) { background: rgba(124,58,237,0.35); border-color: rgba(167,139,250,0.6); }
body.dark .nm-toolbar .toolbar-btn-primary { background: linear-gradient(135deg, #9d174d 0%, #6d28d9 100%); }
body.dark .nm-toolbar .toolbar-btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #be185d 0%, #7c3aed 100%); }
body.dark .nm-main-content { background: #0a0518; }
body.dark .nm-history-panel { background: #120830; border-right-color: #3b1073; }
body.dark .nm-history-header { background: linear-gradient(to bottom, #120830 0%, #1a0a45 100%); border-bottom-color: #3b1073; }
body.dark .nm-history-header h3 { color: #c4b5fd; }
body.dark .nm-history-count { color: #7c3aed; }
body.dark .nm-history-search input { background: #1e0f50; border-color: #3b1073; color: #c4b5fd; }
body.dark .nm-history-search input::placeholder { color: #4c1d95; }
body.dark .nm-history-search input:focus { border-color: #7c3aed; box-shadow: 0 0 0 2px rgba(124,58,237,0.25); }
body.dark .nm-history-list:hover::-webkit-scrollbar-track { background: #1a0a45; }
body.dark .nm-history-list::-webkit-scrollbar-thumb { background: #3b1073; }
body.dark .nm-history-empty { color: #6d28d9; }
body.dark .nm-history-limit-footer { background: #120830; color: #4c1d95; border-top-color: #2e1065; }
body.dark .nm-history-item { background: #1a0a45; border-color: #3b1073; }
body.dark .nm-history-item:hover { background: #2e1065; border-color: #6d28d9; }
body.dark .nm-history-item.active { background: #3b1073; border-color: #7c3aed; }
body.dark .nm-history-item-preview { color: #c4b5fd; }
body.dark .nm-history-item-mode { background: #4c1d95; }
body.dark .nm-history-item-time { color: #7c3aed; }
body.dark .nm-input-panel { background: #0f0825; border-right-color: #3b1073; }
body.dark .nm-panel-header { background: linear-gradient(to bottom, #0f0825 0%, #130935 100%); border-bottom-color: #2e1065; }
body.dark .nm-panel-header h3 { color: #c4b5fd; }
body.dark .nm-panel-tip { color: #6d28d9; }
body.dark .nm-input-body::-webkit-scrollbar-thumb { background: #3b1073; }
body.dark .nm-textarea { background: #1a0a45; border-color: #3b1073; color: #c4b5fd; }
body.dark .nm-textarea:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.2); }
body.dark .nm-textarea::placeholder { color: #4c1d95; }
body.dark .nm-textarea-footer { color: #6d28d9; }
body.dark .nm-textarea-hint { color: #5b279e; }
body.dark .nm-char-count { color: #6d28d9; }
body.dark .nm-mode-label { color: #c4b5fd; }
body.dark .nm-mode-card { background: #1a0a45; border-color: #3b1073; }
body.dark .nm-mode-card:hover { background: #2e1065; border-color: #7c3aed; }
body.dark .nm-mode-card.selected { background: linear-gradient(135deg, #2e1065 0%, #4a1942 100%); border-color: #ec4899; }
body.dark .nm-mode-name { color: #c4b5fd; }
body.dark .nm-mode-desc { color: #7c3aed; }
body.dark .nm-mode-card.selected .nm-mode-name { color: #f9a8d4; }
body.dark .nm-tips-box { background: linear-gradient(135deg, #1a0a45 0%, #2d0a30 100%); border-color: #3b1073; border-left-color: #7c3aed; }
body.dark .nm-tips-box p { color: #c4b5fd; }
body.dark .nm-tips-box ul { color: #8b5cf6; }
body.dark .nm-result-panel { background: #0f0825; }
body.dark .nm-result-header { background: linear-gradient(to bottom, #0f0825 0%, #130935 100%); border-bottom-color: #2e1065; }
body.dark .nm-result-header h3 { color: #c4b5fd; }
body.dark .nm-result-action-btn { background: linear-gradient(135deg, #1a0a45 0%, #2d0a30 100%); border-color: #3b1073; color: #a78bfa; }
body.dark .nm-result-action-btn:hover { background: linear-gradient(135deg, #2e1065 0%, #4a1942 100%); border-color: #7c3aed; color: #c4b5fd; }
body.dark .nm-result-time { color: #6d28d9; }
body.dark .nm-word-count { background: #2e1065; color: #a78bfa; }
body.dark .nm-result-body:hover::-webkit-scrollbar-track { background: #1a0a45; }
body.dark .nm-result-body::-webkit-scrollbar-thumb { background: #3b1073; }
body.dark .nm-placeholder-title { color: #c4b5fd; }
body.dark .nm-placeholder-desc { color: #7c3aed; }
body.dark .nm-placeholder-quote { background: linear-gradient(135deg, #1a0a45 0%, #2d0a30 100%); color: #a78bfa; border-left-color: #ec4899; }
body.dark .nm-loading-text { color: #a78bfa; }
body.dark .nm-result-content { color: #c4b5fd; border-left-color: #7c3aed; }
body.dark .nm-error-message { background: #2d0a0a; border-color: #7f1d1d; border-left-color: #e74c3c; color: #fca5a5; }
body.dark .nm-error-retry-btn { background: linear-gradient(135deg, #4c1d95 0%, #9d174d 100%); }
body.dark .nm-error-retry-btn:hover { background: linear-gradient(135deg, #6d28d9 0%, #be185d 100%); }
body.dark .nm-section { background: #1a0a45; border-color: #3b1073; }
body.dark .nm-section-title { background: linear-gradient(135deg, #1e0a3c 0%, #4c1d95 60%, #831843 100%); }
body.dark .nm-section-body { color: #c4b5fd; }
body.dark .nm-rewrite-block { background: linear-gradient(135deg, #2e1065 0%, #2d0a30 100%); border-left-color: #ec4899; color: #f0abfc; }
body.dark .nm-original-block { background: #1a1a2e; border-left-color: #6d28d9; color: #8892a4; }
body.dark .nm-comment-item { background: #1a0a45; border-color: #3b1073; }
body.dark .nm-comment-item:hover { background: #2e1065; border-color: #6d28d9; }
body.dark .nm-comment-user { color: #c4b5fd; }
body.dark .nm-comment-type { background: #2e1065; color: #a78bfa; }
body.dark .nm-comment-text { color: #c4b5fd; }
body.dark .nm-comment-footer { color: #6d28d9; }
body.dark .nm-slang-word { color: #c4b5fd; background: linear-gradient(135deg, #2e1065 0%, #2d0a30 100%); border-color: #3b1073; }
body.dark .nm-slang-origin { background: #1a0a45; border-color: #3b1073; border-left-color: #7c3aed; color: #c4b5fd; }
body.dark .nm-slang-example { background: linear-gradient(135deg, #2e1065 0%, #1a0a45 100%); border-color: #3b1073; color: #c4b5fd; }
body.dark .nm-meme-item { background: linear-gradient(135deg, #1a0a45 0%, #2e1065 100%); border-color: #3b1073; }
body.dark .nm-meme-item:hover { border-color: #7c3aed; box-shadow: 0 3px 12px rgba(124,58,237,0.25); }
body.dark .nm-meme-text { color: #c4b5fd; }
body.dark .nm-highlight { background: linear-gradient(120deg, rgba(124,58,237,0.25) 0%, rgba(236,72,153,0.15) 100%); color: #c4b5fd; }
body.dark .nm-result-content table th { background: linear-gradient(135deg, #1e0a3c, #4c1d95); }
body.dark .nm-result-content table td { border-color: #3b1073; color: #c4b5fd; }
body.dark .nm-result-content table tr:nth-child(even) td { background: #1a0a45; }
body.dark .nm-result-content li::marker { color: #ff9800; }
body.dark .nm-section-body li::marker { color: #ff9800; }
body.dark .nm-section-body h3 { color: #c4b5fd; border-bottom-color: #3b1073; }
body.dark .nm-section-body h4 { color: #a78bfa; }
body.dark .nm-section-body strong { color: #c4b5fd; }
body.dark .nm-section-body em { color: #a78bfa; }
body.dark .nm-section-body a { color: #a78bfa; }
body.dark .nm-section-body a:hover { color: #f9a8d4; }
body.dark .nm-modal-content { background: #1a0a45; }
body.dark .nm-modal-header { background: linear-gradient(135deg, #1e0a3c 0%, #4c1d95 60%, #831843 100%); }
body.dark .nm-modal-body::-webkit-scrollbar-thumb { background: #3b1073; }
body.dark .nm-example-card { background: #1a0a45; border-color: #3b1073; }
body.dark .nm-example-card:hover { background: #2e1065; border-color: #7c3aed; }
body.dark .nm-example-title { color: #c4b5fd; }
body.dark .nm-example-mode-tag { background: #2e1065; color: #a78bfa; border-color: #3b1073; }
body.dark .nm-example-text { color: #a78bfa; }
