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

        :root {
            --bg: #ffffff;
            --bg-secondary: #f8f9fa;
            --text: #000000;
            --text-secondary: #6c757d;
            --border: #dee2e6;
            --accent: #000000;
            --hover: #f8f9fa;
            --line-number-bg: #f6f8fa;
            --line-number-text: #6e7781;
        }

        [data-theme="dark"] {
            --bg: #0d1117;
            --bg-secondary: #161b22;
            --text: #e6edf3;
            --text-secondary: #7d8590;
            --border: #30363d;
            --accent: #ffffff;
            --hover: #21262d;
            --line-number-bg: #161b22;
            --line-number-text: #6e7681;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        header {
            padding: 1rem 1.5rem;
            background: var(--bg);
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .logo {
            font-size: 1.5rem;
            font-weight: 700;
            letter-spacing: -0.02em;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            height: 40px;
            display: flex;
            align-items: center;
            user-select: none;
        }

        .logo:hover {
            transform: translateY(-2px);
            background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        }

        .logo:active {
            transform: translateY(0) scale(0.98);
        }

        [data-theme="dark"] .logo {
            background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        [data-theme="dark"] .logo:hover {
            background: linear-gradient(135deg, #ec4899 0%, #a78bfa 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
        }

        .controls {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            flex-wrap: wrap;
        }

        select,
        button {
            padding: 0.5rem 0.75rem;
            border: 1px solid var(--border);
            background: var(--bg);
            color: var(--text);
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 500;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            position: relative;
            overflow: hidden;
        }

        button::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.1);
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        [data-theme="dark"] button::before {
            background: rgba(255, 255, 255, 0.1);
        }

        button:hover::before {
            width: 300px;
            height: 300px;
        }

        button:hover,
        select:hover {
            background: var(--hover);
            border-color: var(--accent);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        [data-theme="dark"] button:hover,
        [data-theme="dark"] select:hover {
            box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
        }

        button:active {
            transform: translateY(0) scale(0.98);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        button svg,
        select svg {
            width: 24px;
            height: 24px;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        button:hover svg {
            transform: scale(1.1) rotate(-5deg);
        }

        select {
            min-width: 150px;
            height: 42px;
        }

        .icon-btn {
            padding: 0.5rem;
            min-width: auto;
        }

        main {
            flex: 1;
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            max-width: 1400px;
            width: 100%;
            margin: 0 auto;
        }

        .editor-wrapper {
            flex: 1;
            display: flex;
            border: 1px solid var(--border);
            border-radius: 8px;
            overflow: hidden;
            background: var(--bg);
        }

        .line-numbers {
            display: none;
            background: var(--line-number-bg);
            color: var(--line-number-text);
            padding: 1.5rem 0.5rem;
            text-align: right;
            user-select: none;
            font-family: 'JetBrains Mono', 'Monaco', 'Courier New', monospace;
            font-size: 0.9375rem;
            line-height: 1.6;
            border-right: 1px solid var(--border);
            min-width: 50px;
            overflow: hidden;
        }

        .line-numbers.visible {
            display: block;
        }

        .line-numbers div {
            padding-right: 0.75rem;
        }

        .editor-container {
            flex: 1;
            position: relative;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        #editor {
            flex: 1;
            width: 100%;
            min-height: 400px;
            padding: 1.5rem;
            background: transparent;
            color: var(--text);
            font-size: 0.9375rem;
            line-height: 1.6;
            font-family: 'JetBrains Mono', 'Monaco', 'Courier New', monospace;
            resize: none;
            outline: none;
            border: none;
            overflow-y: auto;
        }

        #highlightLayer {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            padding: 1.5rem;
            pointer-events: none;
            overflow-y: auto;
            white-space: pre-wrap;
            word-wrap: break-word;
            font-size: 0.9375rem;
            line-height: 1.6;
            font-family: 'JetBrains Mono', 'Monaco', 'Courier New', monospace;
            color: transparent;
            display: none;
        }

        #highlightLayer.visible {
            display: block;
        }

        #highlightLayer pre {
            margin: 0;
        }

        #highlightLayer code {
            background: transparent !important;
            padding: 0 !important;
        }

        .status-bar {
            margin-top: 1rem;
            padding: 0.75rem 1rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 6px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.8125rem;
            color: var(--text-secondary);
            flex-wrap: wrap;
            gap: 1rem;
        }

        .status-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .indicator {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--text-secondary);
        }

        .indicator.active {
            background: #22c55e;
            animation: pulse 2s ease-in-out infinite;
        }

        @keyframes pulse {

            0%,
            100% {
                opacity: 1;
            }

            50% {
                opacity: 0.4;
            }
        }

        .char-limit-container {
            flex-direction: column;
            align-items: flex-start !important;
            gap: 0.25rem;
        }

        .char-limit-bar-container {
            width: 120px;
            height: 3px;
            background: var(--border);
            border-radius: 3px;
            overflow: hidden;
        }

        .char-limit-bar {
            height: 100%;
            background: var(--accent);
            transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
            border-radius: 3px;
            position: relative;
            overflow: hidden;
        }

        .char-limit-bar::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            0% {
                transform: translateX(-100%);
            }

            100% {
                transform: translateX(100%);
            }
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 2rem;
            opacity: 0;
            transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .modal.active {
            display: flex;
            animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        .modal-content {
            background: var(--bg);
            padding: 2rem;
            border-radius: 12px;
            border: 1px solid var(--border);
            max-width: 500px;
            width: 100%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            transform: scale(0.9) translateY(20px);
            animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }

        [data-theme="dark"] .modal-content {
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
        }

        @keyframes modalSlideIn {
            to {
                transform: scale(1) translateY(0);
            }
        }

        .modal h2 {
            margin-bottom: 1rem;
            font-size: 1.25rem;
            font-weight: 600;
        }

        .modal-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 1.5rem;
            justify-content: flex-end;
        }

        .history-list {
            max-height: 400px;
            overflow-y: auto;
            margin: 1rem 0;
        }

        .history-item {
            padding: 0.75rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 6px;
            margin-bottom: 0.5rem;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 1rem;
            animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) backwards;
        }

        .history-item:nth-child(1) {
            animation-delay: 0.05s;
        }

        .history-item:nth-child(2) {
            animation-delay: 0.1s;
        }

        .history-item:nth-child(3) {
            animation-delay: 0.15s;
        }

        .history-item:nth-child(4) {
            animation-delay: 0.2s;
        }

        .history-item:nth-child(5) {
            animation-delay: 0.25s;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateX(-20px);
            }

            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .history-item:hover {
            background: var(--hover);
            border-color: var(--accent);
            transform: translateX(4px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        [data-theme="dark"] .history-item:hover {
            box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
        }

        .history-info {
            flex: 1;
            min-width: 0;
        }

        .history-title {
            font-weight: 500;
            margin-bottom: 0.25rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .history-date {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .history-lang {
            font-size: 0.75rem;
            color: var(--text-secondary);
            background: var(--bg);
            padding: 0.125rem 0.5rem;
            border-radius: 4px;
            display: inline-block;
            margin-top: 0.25rem;
        }

        .history-actions {
            display: flex;
            gap: 0.5rem;
            flex-shrink: 0;
        }

        .history-actions button {
            padding: 0.25rem 0.5rem;
            font-size: 0.75rem;
        }

        @media (max-width: 768px) {
            header {
                padding: 1rem;
            }

            main {
                padding: 1rem;
            }

            .controls {
                width: 100%;
            }

            select,
            button {
                flex: 1;
                justify-content: center;
            }
        }

        /* Custom scrollbar */
        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-secondary);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 5px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-secondary);
        }

        /* Sync scroll between editor and highlight layer */
        .editor-container {
            position: relative;
        }

        /* Override highlight.js background */
        .hljs {
            background: transparent !important;
        }