/* ========================================
   在线文档格式化编辑器 - Y916.COM制作
   ======================================== */

/* 全局重置 */
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;
}

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

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

/* 介绍区域 */
.bjq-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;
}

/* 工具栏 */
.bjq-toolbar {
    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);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
}

.toolbar-left {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    padding-right: 32px;
}

.toolbar-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.toolbar-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex: 1;
}

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

.toolbar-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);
}

.toolbar-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);
}

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

.toolbar-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-purple);
}

.option-item span {
    font-size: 14px;
    color: #1d1d1f;
}

/* 编辑器区域 */
/* Quill编辑器样式覆盖 */
#editor {
    min-height: 600px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    overflow: auto;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(109, 85, 254, 0.08);
    resize: vertical;
    margin-bottom: 24px;
}
.bjq-bottom-functions {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.function-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 16px;
    padding: 24px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(109, 85, 254, 0.08);
}

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

/* 字数统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: linear-gradient(135deg, rgba(109, 85, 254, 0.05) 0%, rgba(133, 114, 255, 0.05) 100%);
    border-radius: 10px;
    border: 1px solid rgba(109, 85, 254, 0.1);
    transition: all 0.2s ease;
    text-align: center;
}

.stat-item:hover {
    background: linear-gradient(135deg, rgba(109, 85, 254, 0.1) 0%, rgba(133, 114, 255, 0.1) 100%);
    border-color: rgba(109, 85, 254, 0.2);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 13px;
    color: #6e6e73;
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-purple);
}

/* 功能按钮 */
.function-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.function-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.function-btn:hover {
    border-color: var(--brand-purple);
    color: var(--brand-purple);
    background: rgba(109, 85, 254, 0.05);
    transform: translateX(4px);
}

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

/* Quill编辑器样式覆盖 */
#editor {
    min-height: 600px;
    background: #fff;
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    resize: vertical;
}

.ql-container {
    font-size: 16px;
    line-height: 1.8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    height: 100%;
}

.ql-editor {
    min-height: 600px;
    padding: 32px;
    font-size: 14px;
    color: #1d1d1f;
}

.ql-editor p {
    margin-bottom: 1em;
    line-height: 1.8;
}

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

.ql-toolbar {
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f7 100%);
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
    position: sticky;
    top: 64px;
    z-index: 10;
}

.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);
}

.ql-container {
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    border: none;
    background: #fff;
}

/* 使用说明 */
.bjq-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;
    }
    
    .bjq-main {
        padding: 16px 0;
    }
    
    .bjq-container {
        padding: 0 16px;
    }
    
    .bjq-intro,
    .bjq-toolbar,
    #editor,
    .function-card,
    .bjq-guide {
        padding: 20px;
    }
    
    /* 工具栏改为单列 */
    .bjq-toolbar {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .toolbar-left {
        border-right: none;
        padding-right: 0;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    .toolbar-buttons {
        flex-direction: row;
        gap: 12px;
    }
    
    .toolbar-btn {
        flex: 1;
    }
    
    /* 底部功能区改为单列 */
    .bjq-bottom-functions {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-item {
        padding: 12px 8px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .function-buttons {
        flex-direction: row;
        gap: 12px;
    }
    
    .function-btn {
        flex: 1;
        justify-content: center;
        padding: 12px 12px;
    }
    
    #editor {
        min-height: 400px;
    }
    
    .ql-editor {
        min-height: 400px;
        padding: 16px;
    }
    
    .guide-content {
        grid-template-columns: 1fr;
    }
}
