* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    line-height: 1.6;
    color: #000;
    background-color: #fff;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 30px 0;
    margin-bottom: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    font-size: 18px;
    color: #000;
    margin-top: -2px;
}

h1 {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: -0.5px;
    text-transform: lowercase;
}

/* Stats */
.stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
}

.stat-item {
    display: block;
}

.stat-item span {
    font-family: 'Courier New', monospace;
    font-weight: 400;
}

/* Editor */
.title-input {
    width: 100%;
    font-size: 28px;
    font-weight: 400;
    border: none;
    outline: none;
    margin-bottom: 25px;
    font-family: inherit;
    padding: 5px 0;
    color: #000;
    letter-spacing: -0.3px;
}

.title-input::placeholder {
    color: #999;
    font-weight: 300;
}

.editor-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
    flex-wrap: wrap;
}

.tool-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 4px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    border-radius: 2px;
    color: #666;
    transition: all 0.1s ease;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    border-color: #999;
    color: #000;
}

.tool-char {
    font-weight: 500;
}

.tool-divider {
    color: #ddd;
    margin: 0 2px;
    font-size: 12px;
}

.text-editor {
    min-height: 400px;
    font-size: 17px;
    line-height: 1.7;
    outline: none;
    padding: 20px 0;
    font-weight: 300;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.text-editor:empty:before {
    content: attr(placeholder);
    color: #ccc;
}

.text-editor:focus {
    outline: none;
}

/* Actions */
.actions {
    display: flex;
    gap: 8px;
    margin: 30px 0 20px 0;
}

.btn {
    background: #fff;
    color: #000;
    border: 1px solid #ddd;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.1s ease;
    border-radius: 2px;
    font-weight: 400;
    flex: 1;
    height: 40px;
    text-transform: lowercase;
}

.btn:hover:not(:disabled) {
    border-color: #000;
    background: #fafafa;
}

.btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #fff;
}

.share-btn {
    flex: 2;
}

.preview-btn, .clear-btn {
    flex: 1;
}

/* Link Container */
.link-container {
    margin: 40px 0;
    border: 1px solid #eee;
    border-radius: 2px;
    animation: fadeIn 0.2s ease;
}

.link-box {
    padding: 25px;
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.link-header h3 {
    font-weight: 400;
    font-size: 16px;
    text-transform: lowercase;
}

.link-stats {
    font-size: 13px;
    color: #666;
    font-family: 'Courier New', monospace;
}

.stat-label {
    color: #999;
    margin-right: 4px;
}

.link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: #fafafa;
    color: #333;
    height: 40px;
}

.link-input:focus {
    outline: none;
    border-color: #999;
}

.copy-btn {
    background: #000;
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    border-radius: 2px;
    font-family: inherit;
    font-size: 13px;
    height: 40px;
    min-width: 80px;
    transition: opacity 0.1s ease;
}

.copy-btn:hover {
    opacity: 0.9;
}

.link-note {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.link-note p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    border-radius: 2px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalFade 0.2s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-modal {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-weight: 400;
    font-size: 16px;
    text-transform: lowercase;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
}

/* HTML Input */
.html-input {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 20px;
    background: #fafafa;
}

.html-input:focus {
    outline: none;
    border-color: #999;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.modal-actions .btn {
    flex: 1;
}

.cancel-btn {
    background: #f5f5f5;
    border-color: #ddd;
}

.cancel-btn:hover {
    background: #eee;
}

/* HTML Examples */
.html-examples {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.examples-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    text-transform: lowercase;
}

.example-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 12px;
    margin: 0 8px 8px 0;
    cursor: pointer;
    font-size: 12px;
    border-radius: 2px;
    color: #666;
    transition: all 0.1s ease;
    display: inline-block;
}

.example-btn:hover {
    border-color: #999;
    color: #000;
    background: #fafafa;
}

/* Preview Content */
.preview-content {
    min-height: 300px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 2px;
    background: #fafafa;
}

.preview-content * {
    max-width: 100%;
}

/* Info */
.info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 12px;
    text-align: center;
    text-transform: lowercase;
}

.info p {
    letter-spacing: 0.3px;
}

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    color: #999;
    font-size: 12px;
}

.footer-content {
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.footer-text {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.divider {
    color: #eee;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #000;
    color: white;
    padding: 10px 18px;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
    font-size: 13px;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Utility */
.hidden {
    display: none !important;
}

.view-mode .text-editor {
    color: #333;
    background: #fafafa;
    padding: 20px;
    border-radius: 2px;
    border: 1px solid #eee;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding-bottom: 25px;
    }
    
    .stats {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }
    
    .title-input {
        font-size: 24px;
    }
    
    .text-editor {
        font-size: 16px;
        min-height: 350px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .link-row {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
    }
    
    .footer-text {
        flex-direction: column;
        gap: 8px;
    }
    
    .divider {
        display: none;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .html-examples {
        text-align: center;
    }
    
    .example-btn {
        margin: 4px;
        padding: 8px 12px;
    }
    
    .preview-content {
        padding: 15px;
    }
}

@media (max-width: 400px) {
    .editor-tools {
        justify-content: center;
    }
    
    .tool-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}
