/**
 * 前端内容样式
 * 适配个人IP博客主题风格
 */

/* CSS变量 - 深色简约博客主题，使用正确的 #3A485C */
.content-body {
    --primary-color: #3A485C;
    --primary-color-dark: #2d3748;
    --primary-color-light: #4a5568;
    --secondary-color: #718096;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
    --gradient-primary: linear-gradient(135deg, #3A485C 0%, #2d3748 100%);
}

/* 基础内容样式 - 适配博客主题 */
.content-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-800);
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 标题样式 - 使用主题色 #3A485C */
.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.025em;
}

.content-body h1:first-child,
.content-body h2:first-child,
.content-body h3:first-child,
.content-body h4:first-child,
.content-body h5:first-child,
.content-body h6:first-child {
    margin-top: 0;
}

.content-body h1 {
    font-size: 1.375rem; /* 22px - 小于页面框架24px */
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
    margin: 2rem 0 1.5rem 0;
    position: relative;
}

.content-body h1::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.content-body h2 {
    font-size: 1.25rem; /* 20px */
    border-bottom: 2px solid var(--gray-300);
    padding-bottom: 0.5rem;
    margin: 2rem 0 1.25rem 0;
    position: relative;
}

.content-body h2::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.125rem;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.content-body h3 {
    font-size: 1.125rem; /* 18px */
    color: var(--primary-color-light);
    font-weight: 600;
    margin: 1.75rem 0 1rem 0;
}

.content-body h4 {
    font-size: 1rem; /* 16px */
    color: var(--primary-color-light);
    font-weight: 600;
    margin: 1.5rem 0 0.875rem 0;
}

.content-body h5 {
    font-size: 0.9rem; /* 14.4px */
    color: var(--primary-color-light);
    font-weight: 600;
    margin: 1.25rem 0 0.75rem 0;
}

.content-body h6 {
    font-size: 0.8rem; /* 12.8px */
    color: var(--primary-color-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem 0;
}

/* 段落样式 - 规范化间距 */
.content-body p {
    margin: 0 0 1.25rem 0;
    text-align: justify;
    line-height: 1.7;
}

/* 列表样式 - 规范化间距，确保显示项目符号 */
.content-body ul,
.content-body ol {
    margin: 1.25rem 0;
    padding-left: 2rem;
    list-style-position: outside;
}

.content-body ul {
    list-style-type: disc;
}

.content-body ol {
    list-style-type: decimal;
}

.content-body li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    display: list-item;
}

.content-body ul ul,
.content-body ol ol,
.content-body ul ol,
.content-body ol ul {
    margin: 0.5rem 0;
}

.content-body ul ul {
    list-style-type: circle;
}

.content-body ul ul ul {
    list-style-type: square;
}

.content-body ol ol {
    list-style-type: lower-alpha;
}

.content-body ol ol ol {
    list-style-type: lower-roman;
}

/* 最后一个子元素去除下边距 */
.content-body li:last-child {
    margin-bottom: 0;
}

/* 引用样式 - 深色简约风格，规范化间距 */
.content-body blockquote {
    border: none;
    margin: 2rem 0;
    padding: 1.5rem 1.75rem;
    background: var(--gray-50);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    position: relative;
    box-shadow: var(--box-shadow);
    font-style: normal;
}

.content-body blockquote::before {
    content: '"';
    font-size: 2.5rem;
    color: var(--primary-color);
    position: absolute;
    left: 12px;
    top: 8px;
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.content-body blockquote p {
    margin: 0 0 1rem 0;
    color: var(--gray-700);
    font-size: 16px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.content-body blockquote p:last-child {
    margin-bottom: 0;
}

.content-body blockquote cite {
    display: block;
    margin-top: 16px;
    font-size: 14px;
    color: var(--gray-500);
    font-style: normal;
}

.content-body blockquote cite::before {
    content: "— ";
}

/* 特殊引用样式 */
.content-body blockquote.highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border-left-color: var(--warning-color);
}

.content-body blockquote.highlight::before {
    color: var(--warning-color);
}

.content-body blockquote.success {
    background: linear-gradient(135deg, #d1fae5 0%, #f0fdf4 100%);
    border-left-color: var(--success-color);
}

.content-body blockquote.success::before {
    color: var(--success-color);
}

/* 代码样式 - 现代博客风格 */
.content-body code {
    background: var(--gray-100);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-size: 0.875em;
    font-weight: 500;
    border: 1px solid var(--gray-200);
    white-space: nowrap;
}

/* 代码块容器 */
.content-body .code-block {
    position: relative;
    margin: 2rem 0;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--box-shadow-lg);
    background: #2a3441;
}

.content-body pre {
    background: #2a3441;
    color: #e2e8f0;
    padding: 1.5rem;
    margin: 0;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-size: 0.875em;
    line-height: 1.6;
    position: relative;
    /* 确保代码块不会超出容器 */
    max-width: 100%;
    box-sizing: border-box;
}

.content-body pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    border: none;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
    word-wrap: normal;
}

/* 代码块头部 */
.content-body .code-header {
    background: #1e2832;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.content-body .code-language {
    color: var(--gray-300);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* 复制按钮 */
.content-body .code-copy-btn {
    background: var(--gray-700);
    color: var(--gray-300);
    border: 1px solid var(--gray-600);
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
}

.content-body .code-copy-btn:hover {
    background: var(--gray-600);
    border-color: var(--gray-500);
    color: white;
}

.content-body .code-copy-btn.copied {
    background: var(--success-color);
    border-color: #38a169;
    color: white;
}

/* 代码行号 */
.content-body .code-with-lines {
    display: flex;
}

.content-body .code-line-numbers {
    background: var(--gray-800);
    color: var(--gray-500);
    padding: 1.5rem 0.75rem;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--gray-700);
    min-width: 3rem;
}

.content-body .code-content {
    flex: 1;
    overflow-x: auto;
}

/* 代码高亮主题 */
.content-body .hljs-keyword { color: #c792ea; }
.content-body .hljs-string { color: #c3e88d; }
.content-body .hljs-number { color: #f78c6c; }
.content-body .hljs-comment { color: #546e7a; font-style: italic; }
.content-body .hljs-function { color: #82aaff; }
.content-body .hljs-variable { color: #eeffff; }
.content-body .hljs-tag { color: #f07178; }
.content-body .hljs-attr { color: #c792ea; }
.content-body .hljs-title { color: #ffcb6b; }
.content-body .hljs-built_in { color: #ffcb6b; }

/* 表格样式 - 现代博客风格 */
.content-body .table-container {
    margin: 2rem 0;
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    background: white;
    /* 确保表格不会超出容器 */
    max-width: 100%;
    box-sizing: border-box;
}

.content-body table {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px; /* 最小宽度确保可读性 */
    margin: 0;
    background: white;
    font-size: 0.875rem;
}

.content-body table th,
.content-body table td {
    border: 1px solid var(--gray-200);
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.content-body table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
    position: sticky;
    top: 0;
    z-index: 1;
}

.content-body table tbody tr {
    transition: var(--transition);
}

.content-body table tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.content-body table tbody tr:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.01);
}

.content-body table tbody tr:hover td {
    border-color: var(--primary-color-dark);
}

/* 表格标题 */
.content-body .table-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    text-align: center;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .content-body .table-container {
        margin: 1.5rem 0;
        border-radius: var(--border-radius);
    }

    .content-body table {
        min-width: 500px;
        font-size: 0.8rem;
    }

    .content-body table th,
    .content-body table td {
        padding: 0.5rem 0.75rem;
    }
}

/* 图片样式 - 响应式约束 */
.content-body img {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    margin: 2rem 0;
    display: block;
    transition: var(--transition);
    object-fit: cover;
    /* 确保图片不会超出容器 */
    box-sizing: border-box;
}

.content-body img:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-xl);
}

.content-body img.img-center {
    margin-left: auto;
    margin-right: auto;
}

.content-body img.img-responsive {
    width: 100%;
    max-width: 100%;
}

/* 图片容器 - 防止溢出 */
.content-body .image-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
    box-shadow: var(--box-shadow-lg);
    background: var(--gray-100);
}

.content-body .image-container img {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.content-body .image-container:hover img {
    transform: scale(1.02);
}

/* 图片说明文字 */
.content-body .image-caption {
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 0.5rem;
    font-style: italic;
}

/* 图片网格布局 */
.content-body .image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.content-body .image-grid img {
    margin: 0;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* 视频样式 - 响应式约束 */
.content-body video {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    margin: 2rem 0;
    display: block;
    background: var(--gray-900);
    /* 确保视频不会超出容器 */
    box-sizing: border-box;
}

/* 视频容器 - 16:9 响应式 */
.content-body .video-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 2rem 0;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--box-shadow-lg);
    background: var(--gray-900);
}

.content-body .video-container.aspect-16-9 {
    padding-bottom: 56.25%; /* 16:9 宽高比 */
    height: 0;
}

.content-body .video-container.aspect-4-3 {
    padding-bottom: 75%; /* 4:3 宽高比 */
    height: 0;
}

.content-body .video-container video,
.content-body .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
}

/* iframe 响应式处理 */
.content-body iframe {
    max-width: 100%;
    width: 100%;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    margin: 2rem 0;
    border: none;
    /* 确保iframe不会超出容器 */
    box-sizing: border-box;
}

/* 媒体说明文字 */
.content-body .media-caption {
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 0.5rem;
    font-style: italic;
    padding: 0 1rem;
}

/* 媒体播放控件样式 */
.content-body video::-webkit-media-controls-panel {
    background: rgba(0, 0, 0, 0.8);
}

.content-body video::-webkit-media-controls-play-button {
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* 分隔线样式 - 现代博客风格 */
.content-body hr {
    border: none;
    height: 1px;
    background: var(--gray-200);
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
}

.content-body hr::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: var(--gradient-primary);
}

.content-body hr.gradient-hr {
    background: var(--gradient-primary);
    height: 2px;
    border-radius: 1px;
}

.content-body hr.dotted-hr {
    background: none;
    border-top: 2px dotted var(--gray-300);
    height: 0;
}

.content-body hr.dashed-hr {
    background: none;
    border-top: 2px dashed var(--gray-300);
    height: 0;
}

/* 装饰性分割线 */
.content-body hr.decorative {
    height: auto;
    background: none;
    border: none;
    text-align: center;
    margin: 4rem 0;
}

.content-body hr.decorative::before {
    content: "✦ ✦ ✦";
    color: var(--gray-400);
    font-size: 16px;
    letter-spacing: 1rem;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    width: auto;
    height: auto;
    background: none;
}

/* 链接样式 - 使用主题色 */
.content-body a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
}

.content-body a:hover {
    color: var(--primary-color-dark);
    border-bottom-color: var(--primary-color-dark);
}

.content-body a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.content-body a:hover::after {
    width: 100%;
}

/* 外部链接图标 */
.content-body a[href^="http"]:not([href*="localhost"]):not([href*="127.0.0"])::before {
    content: '🔗';
    font-size: 0.8em;
    margin-right: 0.25rem;
    opacity: 0.7;
}

/* 信息块样式 - 现代博客风格，规范化间距 */
.content-body .info-block {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.content-body .info-block:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-lg);
}

.content-body .info-block p {
    margin: 0;
    font-weight: 500;
}

.content-body .info-block p:first-child {
    margin-top: 0;
}

.content-body .info-block p:last-child {
    margin-bottom: 0;
}

.content-body .info-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

/* 提示信息块 - 深色简约风格 */
.content-body .info-tip {
    background: #f0f8ff;
    border-color: var(--info-color);
    color: var(--gray-700);
}

.content-body .info-tip::before {
    background: var(--info-color);
}

/* 成功信息块 */
.content-body .info-success {
    background: #f0fff4;
    border-color: var(--success-color);
    color: var(--gray-700);
}

.content-body .info-success::before {
    background: var(--success-color);
}

/* 警告信息块 */
.content-body .info-warning {
    background: #fffaf0;
    border-color: var(--warning-color);
    color: var(--gray-700);
}

.content-body .info-warning::before {
    background: var(--warning-color);
}

/* 错误信息块 */
.content-body .info-error {
    background: #fff5f5;
    border-color: var(--danger-color);
    color: var(--gray-700);
}

.content-body .info-error::before {
    background: var(--danger-color);
}

/* 普通信息块 */
.content-body .info-note {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.content-body .info-note::before {
    background: var(--gray-400);
}

/* 强调样式 - 使用主题色 */
.content-body strong,
.content-body b {
    font-weight: 600;
    color: var(--primary-color);
}

.content-body em,
.content-body i {
    font-style: italic;
    color: var(--primary-color-light);
}

/* 删除线和下划线 */
.content-body del,
.content-body s {
    text-decoration: line-through;
    color: var(--gray-500);
}

.content-body u {
    text-decoration: underline;
    text-decoration-color: var(--primary-color);
}

/* 其他元素间距规范化 */
.content-body hr {
    margin: 3rem 0;
}

.content-body .decorative {
    margin: 3rem 0;
}

.content-body figure {
    margin: 2rem 0;
}

.content-body .mnemonic-trigger {
    margin: 0 0.25rem;
}

/* 助记词样式 - 深色简约博客风格 */
.content-body .mnemonic-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color-dark);
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    margin: 0 2px;
    vertical-align: baseline;
    box-shadow: var(--box-shadow);
    line-height: 1.4;
}

.content-body .mnemonic-trigger:hover {
    background: var(--primary-color-dark);
    border-color: var(--gray-600);
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-1px);
}

.content-body .mnemonic-trigger:active {
    transform: translateY(0);
    box-shadow: var(--box-shadow);
}

/* 图标样式 */
.content-body .mnemonic-trigger .mnemonic-icon {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1;
}

/* 在不同背景下的适配 */
.content-body .info-block .mnemonic-trigger,
.content-body blockquote .mnemonic-trigger {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--gray-100);
}

.content-body .info-block .mnemonic-trigger:hover,
.content-body blockquote .mnemonic-trigger:hover {
    background: var(--gray-600);
    border-color: var(--gray-500);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-body .mnemonic-trigger {
        padding: 5px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .content-body .mnemonic-trigger .mnemonic-icon {
        font-size: 11px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .content-body .mnemonic-trigger {
        border: 2px solid var(--primary-color-dark);
        background: var(--primary-color-dark);
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .content-body .mnemonic-trigger {
        transition: none;
    }

    .content-body .mnemonic-trigger:hover {
        transform: none;
    }
}

/* 助记词弹窗样式 - 个人博客风格 */
.mnemonic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    pointer-events: none;
}

.mnemonic-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* PC端：精确定位到白色内容区域的正中间 */
@media (min-width: 1024px) {
    .mnemonic-modal {
        /* 基于实际布局：左侧目录约320px，剩余空间为内容区 */
        left: 320px;
        width: calc(100% - 320px);
        justify-content: center;
        padding: 0 2rem;
    }
}

/* 更大屏幕的精确定位 */
@media (min-width: 1280px) {
    .mnemonic-modal {
        /* 大屏幕上左侧目录可能更宽 */
        left: 360px;
        width: calc(100% - 360px);
        justify-content: center;
        padding: 0 3rem;
    }
}

.mnemonic-modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 460px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
    border: 1px solid #e5e7eb;
    position: relative;
    z-index: 10001;
}

.mnemonic-modal.show .mnemonic-modal-content {
    transform: scale(1) translateY(0);
}

.mnemonic-modal-header {
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 12px;
}

.mnemonic-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mnemonic-modal-close {
    background: var(--gray-100);
    border: none;
    font-size: 20px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.mnemonic-modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
    transform: scale(1.05);
}

.mnemonic-content {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    padding: 16px;
    margin: 0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    word-break: break-all;
    user-select: all;
    cursor: text;
    min-height: 70px;
    text-align: left;
    transition: var(--transition);
    position: relative;
}

.mnemonic-content:hover {
    border-color: var(--primary-color);
    background: white;
}

.mnemonic-content:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mnemonic-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.mnemonic-copy-btn {
    background: #3D4B5F;
    color: white;
    border: 1px solid #2d3748;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(61, 75, 95, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    z-index: 1;
    min-height: 40px;
}

.mnemonic-copy-btn:hover {
    background: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(61, 75, 95, 0.4);
}

.mnemonic-copy-btn:active {
    transform: translateY(0);
}

.mnemonic-copy-btn.copied {
    background: #4a5568;
    border-color: #2d3748;
    box-shadow: 0 4px 8px rgba(74, 85, 104, 0.3);
}

.mnemonic-copy-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* 手机端弹窗优化 */
@media (max-width: 768px) {
    .mnemonic-modal {
        left: 0;
        width: 100%;
        justify-content: center;
        padding: 0;
    }

    .mnemonic-modal-content {
        padding: 20px;
        margin: 20px;
        max-width: none;
        width: calc(100% - 40px);
        border-radius: 8px;
    }

    .mnemonic-modal-header {
        margin-bottom: 16px;
        padding-bottom: 10px;
    }

    .mnemonic-modal-title {
        font-size: 16px;
    }

    .mnemonic-content {
        padding: 14px;
        font-size: 13px;
        line-height: 1.5;
        min-height: 60px;
    }

    .mnemonic-actions {
        margin-top: 16px;
    }

    .mnemonic-copy-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .mnemonic-copy-btn svg {
        width: 14px;
        height: 14px;
    }
}

.copy-success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.copy-success-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .content-body {
        font-size: 15px;
        line-height: 1.6;
    }

    /* 移动端标题大小优化 */
    .content-body h1 {
        font-size: 1.25rem; /* 20px - 移动端进一步缩小 */
        margin: 1.5rem 0 1rem 0;
        padding-bottom: 0.5rem;
    }

    .content-body h1::after {
        width: 40px;
        height: 2px;
    }

    .content-body h2 {
        font-size: 1.125rem; /* 18px */
        margin: 1.5rem 0 1rem 0;
        padding-bottom: 0.375rem;
    }

    .content-body h2::before {
        left: -0.5rem;
        width: 3px;
        height: 0.875rem;
    }

    .content-body h3 {
        font-size: 1rem; /* 16px */
        margin: 1.25rem 0 0.75rem 0;
    }

    .content-body h4 {
        font-size: 0.9rem; /* 14.4px */
        margin: 1rem 0 0.75rem 0;
    }

    .content-body h5 {
        font-size: 0.85rem; /* 13.6px */
        margin: 1rem 0 0.5rem 0;
    }

    .content-body h6 {
        font-size: 0.75rem; /* 12px */
        margin: 0.75rem 0 0.5rem 0;
    }

    /* 移动端段落和间距优化 */
    .content-body p {
        margin: 0 0 1rem 0;
        line-height: 1.6;
    }

    .content-body ul,
    .content-body ol {
        margin: 1rem 0;
        padding-left: 1.5rem;
    }

    .content-body li {
        margin-bottom: 0.375rem;
    }

    .content-body .info-block {
        margin: 1.5rem 0;
        padding: 1rem 1.25rem;
        font-size: 0.875rem;
    }

    .content-body table {
        font-size: 0.8rem;
    }

    .content-body table th,
    .content-body table td {
        padding: 0.5rem 0.75rem;
    }

    .content-body blockquote {
        margin: 1.5rem 0;
        padding: 1rem 1.25rem 1rem 2rem; /* 增加左内边距，避免文字与引号重叠 */
        font-size: 0.875rem;
    }

    .content-body blockquote::before {
        left: 8px; /* 手机端引号位置稍微调整 */
        font-size: 2rem; /* 手机端引号稍微小一点 */
    }

    .content-body pre {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .content-body .code-header {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* 打印样式 */
@media print {
    .content-body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    .content-body .info-block {
        border: 1px solid #ccc;
        background-color: #f9f9f9 !important;
        color: #333 !important;
        page-break-inside: avoid;
    }
    
    .content-body img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    .content-body table {
        page-break-inside: avoid;
    }
    
    .content-body h1,
    .content-body h2,
    .content-body h3,
    .content-body h4,
    .content-body h5,
    .content-body h6 {
        page-break-after: avoid;
    }
    
    .content-body a {
        color: #000;
        text-decoration: underline;
    }
}
