/* ========================================
   在线违禁词替换工具 - 009weijinci.css
   ======================================== */

/* 全局重置 */
body, html {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f5f5f7;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ========================================
   工具页面通用顶部底部样式
   ======================================== */

/* 顶部导航 */
.tool-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tool-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tool-logo {
    display: flex;
    align-items: center;
}

.tool-logo-img {
    height: 32px;
    width: auto;
}

.tool-page-title-link {
    flex: 1;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.tool-page-title-link:hover {
    opacity: 0.8;
}

.tool-page-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-page-title::before {
    content: '✦';
    font-size: 14px;
    color: #6d55fe;
    opacity: 0.6;
}

.tool-page-title::after {
    content: '✦';
    font-size: 14px;
    color: #6d55fe;
    opacity: 0.6;
}

.tool-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(109, 85, 254, 0.08);
    border: 1px solid rgba(109, 85, 254, 0.15);
    border-radius: 20px;
    color: #6d55fe;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-back-btn:hover {
    background: rgba(109, 85, 254, 0.15);
    border-color: rgba(109, 85, 254, 0.3);
    transform: translateX(-2px);
}

.tool-back-btn svg {
    transition: transform 0.2s ease;
}

.tool-back-btn:hover svg {
    transform: translateX(-2px);
}

/* 底部 */
.tool-footer {
    background: #f5f5f7;
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 0;
}

.tool-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
    text-align: center;
}

.tool-copyright {
    font-size: 13px;
    color: #6e6e73;
    margin: 0;
}

.tool-copyright a {
    color: #6d55fe;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.tool-copyright a:hover {
    opacity: 0.7;
}

/* ========================================
   违禁词工具专用样式
   ======================================== */

:root {
    --brand-purple: #6d55fe;
    --forbidden-red: #ef4444;
    --replaced-green: #10b981;
}

/* 主内容区 */
.wjc-main {
    min-height: calc(100vh - 120px);
    padding: 24px 0;
}

.wjc-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 介绍区域 */
.wjc-intro {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 24px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(109, 85, 254, 0.08);
}

.intro-text {
    font-size: 14px;
    line-height: 1.8;
    color: #1d1d1f;
    margin: 0;
}

/* 违禁词分类选择 */
.wjc-categories {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(109, 85, 254, 0.08);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.manage-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--brand-purple) 0%, #8572ff 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manage-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 85, 254, 0.3);
}

.category-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.category-option {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.category-option:hover {
    border-color: var(--brand-purple);
    background: rgba(109, 85, 254, 0.05);
}

.category-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-purple);
    margin-right: 12px;
    flex-shrink: 0;
}

.category-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
}

.category-count {
    font-size: 12px;
    color: #fff;
    background: var(--brand-purple);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.view-words-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(109, 85, 254, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--brand-purple);
    flex-shrink: 0;
    margin-left: 8px;
}

.view-words-btn:hover {
    background: var(--brand-purple);
    color: #fff;
    transform: scale(1.1);
}

/* 操作按钮区 */
.wjc-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.action-btn:hover {
    border-color: var(--brand-purple);
    color: var(--brand-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 85, 254, 0.15);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--brand-purple) 0%, #8572ff 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(109, 85, 254, 0.3);
}

.action-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(109, 85, 254, 0.4);
}

.action-btn svg {
    flex-shrink: 0;
}

/* 编辑器区域 */
.wjc-editors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.editor-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(109, 85, 254, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f7 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
}

.editor-title svg {
    color: var(--brand-purple);
}

.editor-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6e6e73;
}

.editor-stats .stat-item strong {
    color: var(--brand-purple);
    font-weight: 600;
}

.editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Quill编辑器样式 */
#originalEditor,
#replacedEditor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f7 100%);
    padding: 12px 16px;
}

.ql-container.ql-snow {
    border: none;
    flex: 1;
    font-size: 15px;
    line-height: 1.8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.ql-editor {
    min-height: 500px;
    padding: 24px;
    color: #1d1d1f;
}

.ql-editor.ql-blank::before {
    color: #86868b;
    font-style: normal;
    left: 24px;
}

.ql-toolbar .ql-stroke {
    stroke: #1d1d1f;
}

.ql-toolbar .ql-fill {
    fill: #1d1d1f;
}

.ql-toolbar .ql-picker-label {
    color: #1d1d1f;
}

.ql-toolbar button:hover,
.ql-toolbar button:focus,
.ql-toolbar button.ql-active {
    color: var(--brand-purple);
}

.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button:focus .ql-stroke,
.ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--brand-purple);
}

.ql-toolbar button:hover .ql-fill,
.ql-toolbar button:focus .ql-fill,
.ql-toolbar button.ql-active .ql-fill {
    fill: var(--brand-purple);
}

/* 违禁词高亮 - Quill编辑器内 */
.ql-editor .wjc-forbidden {
    color: var(--forbidden-red) !important;
    font-weight: 600 !important;
    background: rgba(239, 68, 68, 0.15) !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    text-decoration: underline !important;
    text-decoration-color: var(--forbidden-red) !important;
    text-decoration-style: wavy !important;
}

.ql-editor .wjc-replaced {
    color: var(--replaced-green) !important;
    font-weight: 600 !important;
    background: rgba(16, 185, 129, 0.15) !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
}

/* 违禁词列表 */
.wjc-word-list {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(109, 85, 254, 0.08);
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.word-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.word-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.word-item:hover {
    border-color: var(--forbidden-red);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.word-original {
    color: var(--forbidden-red);
    font-weight: 600;
}

.word-arrow {
    color: #86868b;
    font-size: 12px;
}

.word-replacement {
    color: var(--replaced-green);
    font-weight: 500;
}

.empty-state {
    width: 100%;
    text-align: center;
    padding: 32px;
    color: #86868b;
    font-size: 14px;
}

/* 使用说明 */
.wjc-guide {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(109, 85, 254, 0.08);
}

.guide-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 24px;
    text-align: center;
}

.guide-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.guide-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(109, 85, 254, 0.1);
    transition: all 0.3s ease;
}

.guide-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(109, 85, 254, 0.15);
    border-color: rgba(109, 85, 254, 0.3);
}

.guide-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.guide-text h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 8px;
}

.guide-text p {
    font-size: 13px;
    line-height: 1.6;
    color: #6e6e73;
    margin: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .tool-header-inner {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .tool-logo-img {
        height: 28px;
    }
    
    .tool-page-title {
        font-size: 16px;
        gap: 6px;
    }
    
    .tool-back-btn span {
        display: none;
    }
    
    .wjc-main {
        padding: 16px 0;
    }
    
    .wjc-container {
        padding: 0 16px;
    }
    
    .wjc-intro,
    .wjc-word-list,
    .wjc-guide {
        padding: 20px;
    }
    
    .wjc-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .wjc-editors {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .ql-editor {
        min-height: 300px;
        padding: 16px;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .editor-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .guide-content {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   自定义词库管理弹窗
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1d1d1f;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.custom-word-form {
    background: linear-gradient(135deg, rgba(109, 85, 254, 0.05) 0%, rgba(133, 114, 255, 0.05) 100%);
    border: 1px solid rgba(109, 85, 254, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-of-type {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 14px;
    color: #1d1d1f;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(109, 85, 254, 0.1);
}

.form-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--brand-purple) 0%, #8572ff 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 85, 254, 0.3);
}

.import-export-section {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    padding: 16px;
    background: #f5f5f7;
    border-radius: 10px;
}

.ie-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.import-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
}

.import-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.custom-words-list {
    margin-top: 24px;
}

.list-subtitle {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 16px;
}

.custom-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.custom-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f5f5f7;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.custom-item:hover {
    background: #e8e8ed;
}

.custom-item-words {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.custom-item-original {
    color: var(--forbidden-red);
    font-weight: 600;
    font-size: 14px;
}

.custom-item-arrow {
    color: #86868b;
    font-size: 12px;
}

.custom-item-replacement {
    color: var(--replaced-green);
    font-weight: 500;
    font-size: 14px;
}

.custom-item-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--forbidden-red);
}

.custom-item-delete:hover {
    background: var(--forbidden-red);
    color: #fff;
}

.custom-item-delete:hover {
    background: var(--forbidden-red);
    color: #fff;
}

.view-words-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.view-word-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f5f5f7;
    border-radius: 10px;
    transition: all 0.2s ease;
    gap: 12px;
}

.view-word-item:hover {
    background: #e8e8ed;
}

.view-word-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-word-original {
    color: var(--forbidden-red);
    font-weight: 600;
    font-size: 14px;
    min-width: 80px;
}

.view-word-arrow {
    color: #86868b;
    font-size: 12px;
}

.view-word-replacement {
    color: var(--replaced-green);
    font-weight: 500;
    font-size: 14px;
    flex: 1;
}

.view-word-replacement-input {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid var(--brand-purple);
    border-radius: 6px;
    font-size: 14px;
    color: var(--replaced-green);
    font-weight: 500;
    outline: none;
}

.view-word-actions {
    display: flex;
    gap: 6px;
}

.view-word-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-word-edit {
    background: rgba(109, 85, 254, 0.1);
    color: var(--brand-purple);
}

.view-word-edit:hover {
    background: var(--brand-purple);
    color: #fff;
}

.view-word-save {
    background: rgba(16, 185, 129, 0.1);
    color: var(--replaced-green);
}

.view-word-save:hover {
    background: var(--replaced-green);
    color: #fff;
}

.view-word-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: #6e6e73;
}

.view-word-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

.view-word-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--forbidden-red);
}

.view-word-delete:hover {
    background: var(--forbidden-red);
    color: #fff;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式 - 弹窗 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .category-options {
        grid-template-columns: 1fr;
    }

    .view-word-original {
        min-width: 0px;
        font-size: 12px;
    }

    .view-word-replacement {
    font-size: 12px;
    }
    .view-word-replacement-input {
    padding: 5px;
    font-size: 12px;
    }
}
