* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
    flex-shrink: 0;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

/* 工具栏样式 */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    align-items: center;
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-group label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.toolbar select,
.toolbar input[type="color"] {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.toolbar button {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.toolbar button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toolbar button:active {
    transform: scale(0.95);
}

.toolbar button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.export-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
}

.export-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* 编辑器样式 */
#editor {
    min-height: 300px;
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    font-size: 16px;
    line-height: 1.8;
    color: #212529;
    outline: none;
}

#editor:empty::before {
    content: '在这里开始编辑你的笔记...';
    color: #adb5bd;
}

#editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    cursor: move;
}

#editor .resizable-image {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

#editor .resizable-image img {
    display: block;
    width: 100%;
    height: auto;
}

#editor .resizable-image .resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #667eea;
    border: 2px solid white;
    border-radius: 50%;
    cursor: nwse-resize;
    right: -6px;
    bottom: -6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#editor .resizable-image:hover .resize-handle {
    background: #764ba2;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 30px auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

/* 确保滚动条不影响圆角 */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #adb5bd;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #495057;
}

.modal-content h2 {
    margin-bottom: 25px;
    color: #212529;
    font-size: 24px;
}

.export-config {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-item label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.config-item input[type="text"],
.config-item input[type="number"],
.config-item select {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.config-item input[type="range"] {
    width: 100%;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 200px;
}

.position-btn {
    padding: 12px;
    background: white;
    border: 2px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}

.position-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.position-btn.active {
    background: #667eea;
    border-color: #667eea;
    transform: scale(1.1);
}

.confirm-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.confirm-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        height: calc(100vh - 20px);
    }

    .toolbar {
        padding: 15px;
        gap: 10px;
    }

    #editor {
        padding: 20px;
        min-height: 200px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10% auto;
    }
}
