/**
 * 云笔记应用样式
 * 整合了基础样式、编辑器样式和代码高亮样式
 */

/* ====== 基础样式 ====== */
:root {
    --triangle-left: 20px;
    --triangle-right: auto;
    --primary: #4a6bfa;
    --primary-dark: #3a56d4;
    --primary-light: rgba(74, 107, 250, 0.1);
    --secondary: #6c63ff;
    --dark: #1a1e2e;
    --darker: #151824;
    --light: #f0f2f5;
    --gray: #6e7888;
    --success: #10b981;
    --danger: #ef4444;
    --border-radius: 12px;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "SF Pro Display", "SF Pro Icons", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", sans-serif;
    line-height: 1.6;
    color: #f0f2f5;
    background-color: #1a1e2e;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    /* 恢复垂直滚动以避免在某些情况下的布局问题 */
    overflow-y: auto;
}

/* 背景几何元素 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.1;
    filter: blur(60px);
    transform: translateZ(0);
}

.shape-1 {
    background: #4a6bfa;
    width: 600px;
    height: 600px;
    top: -300px;
    right: -100px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: float 10s ease-in-out infinite alternate;
}

.shape-2 {
    background: #6c63ff;
    width: 500px;
    height: 500px;
    bottom: -200px;
    left: -100px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: float 12s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, 50px) rotate(10deg); }
}

.container {
    max-width: 80%; /* 限制容器宽度为屏幕的80% */
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    /* 移除固定高度和滚动设置 */
    height: auto;
    min-height: calc(100vh - 60px);
}

h1, h2, h3 {
    margin-bottom: 20px;
    color: #f0f2f5;
}

a {
    color: #4a6bfa;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: none;
    color: #6c63ff;
}

/* ====== 表单样式 ====== */
.form-container {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #f0f2f5;
    font-size: 1.1em;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4a6bfa;
    box-shadow: 0 0 0 3px rgba(74, 107, 250, 0.3);
}

.btn {
    display: inline-block;
    background: linear-gradient(90deg, #4a6bfa, #6c63ff);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(74, 107, 250, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 107, 250, 0.6);
}

.center-btn {
    display: block;
    margin: 0 auto;
    width: 100%;
}

/* ====== 记事本编辑器样式 ====== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.left-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8em;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.logo span {
    background: linear-gradient(90deg, #4a6bfa, #6c63ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.notebook-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #f0f2f5;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.back-link {
    color: #6e7888;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 8px 15px;
    border-radius: 8px;
}

.back-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.card {
    background-color: #151824;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.card:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

.card-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: white;
    text-align: center;
}

.editor-section {
    height: calc(100vh - 140px);
    min-height: 650px;
    overflow: hidden;
    border-radius: 10px;
}

.editor-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background-color: #1c2033;
    padding: 15px;
    border-radius: 10px;
}

.editor-status {
    font-size: 14px;
    color: #6e7888;
    text-align: right;
    min-width: 180px;
}

.save-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    border: none;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.editor-main {
    height: 100%;
    overflow: hidden;
    border-radius: 10px;
}

.editor-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    overflow: auto;
}

.editor-preview {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    overflow: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

#editor {
    width: 100%;
    height: 100%;
    padding: 20px;
    border: none;
    resize: none;
    background-color: transparent;
    color: #f0f2f5;
    font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
    font-size: 16px;
    line-height: 1.7;
}

#editor:focus {
    outline: none;
}

#preview {
    padding: 20px;
    color: #f0f2f5;
    font-size: 16px;
    line-height: 1.7;
}

/* ====== Markdown 预览样式 ====== */
#preview h1 {
    font-size: 2em;
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#preview h2 {
    font-size: 1.75em;
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#preview h3 {
    font-size: 1.5em;
    margin-top: 20px;
    margin-bottom: 10px;
}

#preview h4, #preview h5, #preview h6 {
    margin-top: 15px;
    margin-bottom: 10px;
}

#preview p {
    margin-bottom: 15px;
}

#preview ul, #preview ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

#preview blockquote {
    border-left: 4px solid #4a6bfa;
    padding: 10px 15px;
    color: #a0aec0;
    margin: 15px 0;
    background-color: rgba(74, 107, 250, 0.1);
    border-radius: 0 5px 5px 0;
}

#preview code {
    font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
    color: #f0f2f5;
}

#preview pre {
    background-color: #0d1117;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#preview pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

#preview table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 15px;
}

#preview th, #preview td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
}

#preview th {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

#preview img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
}

.error-message {
    color: #ef4444;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

.password-section {
    max-width: 500px;
    margin: 0 auto;
}

/* 设置菜单样式 */
.settings-dropdown {
    position: relative;
    display: inline-block;
}

.settings-btn {
    background: linear-gradient(90deg, #566074, #3f4758);
    box-shadow: 0 4px 15px rgba(86, 96, 116, 0.4);
}

.settings-content {
    display: none;
    position: absolute;
    top: 100%;
    background-color: #1a1e2e; /* 更深的背景色 */
    min-width: 180px;
    max-width: 180px;
    width: 180px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 15px;
    z-index: 1000;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    left: 0; /* 默认左对齐 */
}

/* 设置三角形指示器位置 */
.settings-content::before {
    content: '';
    position: absolute;
    top: -8px;
    left: var(--triangle-left);
    right: var(--triangle-right);
    width: 16px;
    height: 16px;
    background: #1a1e2e;
    transform: rotate(45deg);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.settings-content.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 设置内容项样式 */
.settings-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
}

.settings-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    font-weight: 500;
}

.settings-description {
    font-size: 13px;
    color: #a0aec0; /* 更亮的描述文字颜色 */
    margin-bottom: 12px;
    line-height: 1.4;
}

.mini-btn {
    padding: 8px 15px;
    font-size: 14px;
    width: 100%;
    background: linear-gradient(90deg, #4a6bfa, #6c63ff);
}

/* 容器滚动条样式 */
.container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 编辑器和预览区域滚动条样式 */
.editor-preview::-webkit-scrollbar, #editor::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.editor-preview::-webkit-scrollbar-track, #editor::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.editor-preview::-webkit-scrollbar-thumb, #editor::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.editor-preview::-webkit-scrollbar-thumb:hover, #editor::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 隐藏所有其他可能的滚动条 */
.editor-main::-webkit-scrollbar,
.editor-section::-webkit-scrollbar,
.editor-container::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body::-webkit-scrollbar {
    width: 8px;
}

/* ====== 响应式布局 ====== */
@media (max-width: 768px) {
    .container {
        padding: 15px 10px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .left-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: space-between;
    }
    
    .editor-section {
        height: auto;
        min-height: auto;
    }
    
    .editor-container {
        height: auto;
    }
    
    .editor-main {
        flex-direction: column;
        height: 800px;
    }
    
    .editor-input, .editor-preview {
        height: 400px;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .editor-actions, .editor-status {
        width: 100%;
    }
    
    .editor-status {
        text-align: left;
    }
    
    .card {
        padding: 20px;
    }
    
    .editor-main table {
        display: block;
    }
    
    .editor-main table tr {
        display: flex;
        flex-direction: column;
    }
    
    .editor-main table td {
        display: block;
        width: 100% !important;
        height: 400px !important;
    }
    
    .editor-main table td:first-child {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    #editor, #preview {
        height: 100% !important;
    }
    
    /* 移动设备上的设置菜单样式 */
    .settings-content {
        position: absolute;
        min-width: 180px;
        max-width: 180px;
        width: 180px;
        right: auto;
        left: 0;
    }
}

/* ====== 代码高亮样式 ====== */
.hljs {
    color: #e6e6e6;
    background: #0d1117;
}

.hljs-doctag, .hljs-keyword, .hljs-meta .hljs-keyword, .hljs-template-tag, 
.hljs-template-variable, .hljs-type, .hljs-variable.language_ {
    color: #ff7b72;
}

.hljs-title, .hljs-title.class_, .hljs-title.class_.inherited__, .hljs-title.function_ {
    color: #d2a8ff;
}

.hljs-attr, .hljs-attribute, .hljs-literal, .hljs-meta, .hljs-number, 
.hljs-operator, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id, .hljs-variable {
    color: #79c0ff;
}

.hljs-meta .hljs-string, .hljs-regexp, .hljs-string {
    color: #a5d6ff;
}

.hljs-built_in, .hljs-symbol {
    color: #ffa657;
}

.hljs-code, .hljs-comment, .hljs-formula {
    color: #8b949e;
}

.hljs-name, .hljs-quote, .hljs-selector-pseudo, .hljs-selector-tag {
    color: #7ee787;
}

.hljs-subst {
    color: #c9d1d9;
}

.hljs-section {
    color: #1f6feb;
    font-weight: bold;
}

pre code.hljs {
    display: block;
    overflow-x: auto;
    padding: 1em;
}

code.hljs {
    padding: 3px 5px;
}

/* 完全隐藏滚动条 */
#editor::-webkit-scrollbar,
#preview::-webkit-scrollbar {
    width: 0 !important;
}

/* 归档码查询页面样式 */
.search-card {
    background: rgba(21, 24, 36, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.6s ease;
}

.search-header {
    text-align: center;
    margin-bottom: 35px;
    animation: fadeInDown 0.6s ease;
}

.search-title {
    color: var(--light);
    font-size: 2.2em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.search-title i {
    color: var(--primary);
    font-size: 1.1em;
    opacity: 0.9;
    filter: drop-shadow(0 2px 8px rgba(74, 107, 250, 0.4));
}

.search-description {
    color: var(--gray);
    font-size: 1.1em;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.input-group {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.2em;
    opacity: 0.8;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--light);
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(74, 107, 250, 0.1);
}

.search-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(74, 107, 250, 0.2);
}

.search-btn i {
    font-size: 1.1em;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .search-card {
        padding: 25px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .search-title {
        font-size: 1.8em;
    }
    
    .search-description {
        font-size: 1em;
    }
}
    height: 0 !important;
    display: none !important;
}

/* Firefox 滚动条隐藏 */
#editor, #preview {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* 确保IE也隐藏滚动条 */
#editor, #preview {
    -ms-overflow-style: none !important;
} 