

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background: #1a1a1a;
    color: #e0e0e0;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #2a2a2a;
    color: #e0e0e0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid #3a3a3a;
}

.header h1 {
    font-size: 1.5em;
    margin: 0;
    font-weight: 500;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-btn {
    background: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #4a4a4a;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    font-weight: 400;
}

.control-btn:hover {
    background: #4a4a4a;
    border-color: #5a5a5a;
}

.control-btn.clear {
    background: #d73a49;
    border-color: #d73a49;
    color: white;
}

.control-btn.clear:hover {
    background: #cb2431;
    border-color: #cb2431;
}

.download-btn {
    background: #22c55e;
    color: white;
    border: 1px solid #22c55e;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    font-weight: 500;
}

.download-btn:hover {
    background: #16a34a;
    border-color: #16a34a;
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-section {
    background: #1a1a1a;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.preview-section {
    background: #1a1a1a;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.gutter {
    background: #5a5a5a;
    cursor: col-resize;
    width: 12px !important;
    min-width: 12px;
    border-left: 2px solid #222;
    border-right: 2px solid #222;
    transition: background 0.2s;
    z-index: 10;
}

.gutter:hover {
    background: #0366d6;
}

.section-header {
    padding: 15px 20px;
    background: #2a2a2a;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.editor-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    scrollbar-width: thin;
    scrollbar-color: #888 #222;
}

#htmlInput {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    border: none;
    font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    background: transparent;
    color: transparent;
    caret-color: #e0e0e0;
    z-index: 2;
    outline: none;
    scrollbar-width: thin;
    scrollbar-color: #888 #222;
}

#highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: #1a1a1a;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    z-index: 1;
    pointer-events: none;
    color: #e0e0e0;
    scrollbar-width: thin;
    scrollbar-color: #888 #222;
}

#preview {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #888 #222;
}

.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.status-message.success {
    background: #28a745;
    color: white;
}

.status-message.error {
    background: #dc3545;
    color: white;
}

.status-message.show {
    opacity: 1;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .header h1 {
        font-size: 1.2em;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Code highlighting - Dark theme */
.token.tag {
    color: #ff6b6b;
}

.token.attr-name {
    color: #feca57;
}

.token.attr-value {
    color: #48dbfb;
}

.token.string {
    color: #1dd1a1;
}

.token.comment {
    color: #636e72;
    font-style: italic;
}

.token.doctype {
    color: #a29bfe;
}

.token.punctuation {
    color: #ddd;
}

/* Scrollbar 樣式優化 */
.editor-container::-webkit-scrollbar,
#highlight::-webkit-scrollbar,
#htmlInput::-webkit-scrollbar,
.preview-section::-webkit-scrollbar,
#preview::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: #222;
}

.editor-container::-webkit-scrollbar-thumb,
#highlight::-webkit-scrollbar-thumb,
#htmlInput::-webkit-scrollbar-thumb,
.preview-section::-webkit-scrollbar-thumb,
#preview::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
    border: 2px solid #222;
}

.editor-container::-webkit-scrollbar-thumb:hover,
#highlight::-webkit-scrollbar-thumb:hover,
#htmlInput::-webkit-scrollbar-thumb:hover,
.preview-section::-webkit-scrollbar-thumb:hover,
#preview::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Footer 樣式 */
.footer {
    background: #2a2a2a;
    color: #e0e0e0;
    padding: 12px 0;
    margin-top: 20px;
    border-top: 1px solid #3a3a3a;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.social-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.social-link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.social-link:hover {
    color: #22c55e;
    transform: translateY(-1px);
}

.social-link i {
    font-size: 1.1em;
}

.threads-link:hover {
    color: #22c55e;
}

.official-link:hover {
    color: #0366d6;
}

.footer-text {
    font-size: 0.85em;
    color: #adb5bd;
    text-align: right;
}

.footer-text p {
    margin: 0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .social-links {
        justify-content: center;
    }

    .footer-text {
        text-align: center;
    }
}