/**
 * HTML代码着色工具样式
 */

/* 全屏模式 */
.html-coloring-container {
    transition: all 0.3s ease;
}
.html-coloring-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    background: #fff;
    padding: 15px;
    box-sizing: border-box;
    overflow: auto;
}
.html-coloring-container.fullscreen .code-input-container {
    height: calc(100vh - 280px);
}

.code-input-container {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
}
.code-input-wrapper, .code-output-wrapper {
    min-width: 200px;
}

/* 拖拽分隔条 */
.resize-handle {
    width: 8px;
    background: #e2e8f0;
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.2s;
    position: relative;
    margin: 0 4px;
}
.resize-handle:hover,
.resize-handle.dragging {
    background: #4a90d9;
}
.resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: #cbd5e1;
    border-radius: 1px;
    transition: background 0.2s;
}
.resize-handle:hover::before,
.resize-handle.dragging::before {
    background: white;
}
.code-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.code-output-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.code-label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}
.code-label .label-icon {
    font-size: 16px;
}
.code-textarea {
    width: 100%;
    min-height: 300px;
    flex: 1;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: none;
    background: #fafafa;
    box-sizing: border-box;
}
.code-textarea:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

/* 语法高亮颜色 - 暗色主题 */
.hl-tag { color: #569cd6; }
.hl-attr-name { color: #9cdcfe; }
.hl-attr-value { color: #ce9178; }
.hl-string { color: #ce9178; }
.hl-comment { color: #6a9955; font-style: italic; }
.hl-doctype { color: #808080; }
.hl-entity { color: #d7ba7d; }
.hl-bracket { color: #808080; }
.hl-text { color: #d4d4d4; }

/* 语法高亮颜色 - 亮色主题 */
.light-theme .hl-tag { color: #0000ff; }
.light-theme .hl-attr-name { color: #ff0000; }
.light-theme .hl-attr-value { color: #0000ff; }
.light-theme .hl-string { color: #a31515; }
.light-theme .hl-comment { color: #008000; font-style: italic; }
.light-theme .hl-doctype { color: #808080; }
.light-theme .hl-entity { color: #800000; }
.light-theme .hl-bracket { color: #800000; }
.light-theme .hl-text { color: #333333; }

/* Monokai主题 */
.monokai-theme { background: #272822; color: #f8f8f2; }
.monokai-theme .hl-tag { color: #f92672; }
.monokai-theme .hl-attr-name { color: #a6e22e; }
.monokai-theme .hl-attr-value { color: #e6db74; }
.monokai-theme .hl-string { color: #e6db74; }
.monokai-theme .hl-comment { color: #75715e; font-style: italic; }
.monokai-theme .hl-doctype { color: #75715e; }
.monokai-theme .hl-entity { color: #ae81ff; }
.monokai-theme .hl-bracket { color: #f8f8f2; }
.monokai-theme .hl-text { color: #f8f8f2; }

/* GitHub主题 */
.github-theme { background: #f6f8fa; color: #24292e; border-color: #e1e4e8; }
.github-theme .hl-tag { color: #22863a; }
.github-theme .hl-attr-name { color: #6f42c1; }
.github-theme .hl-attr-value { color: #032f62; }
.github-theme .hl-string { color: #032f62; }
.github-theme .hl-comment { color: #6a737d; font-style: italic; }
.github-theme .hl-doctype { color: #6a737d; }
.github-theme .hl-entity { color: #005cc5; }
.github-theme .hl-bracket { color: #24292e; }
.github-theme .hl-text { color: #24292e; }

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.btn-primary {
    background: #4a90d9;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}
.btn-primary:hover { background: #3a7bc8; }
.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}
.btn-secondary:hover { background: #5a6268; }
.btn-success {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}
.btn-success:hover { background: #218838; }

/* 设置面板 */
.settings-panel {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.setting-item label {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}
.setting-item select, .setting-item input[type="checkbox"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
.setting-item select {
    height: 36px;
}
.setting-item .btn-secondary {
    height: 36px;
    padding: 0 15px;
}

/* 复制成功提示 */
.copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    display: none;
    z-index: 1000;
    animation: fadeInOut 2s ease;
}
@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translateY(-10px); }
    20%, 80% { opacity: 1; transform: translateY(0); }
}

/* 行号 */
.line-numbers {
    display: flex;
}
.line-numbers-col {
    background: #2d2d2d;
    color: #858585;
    padding: 12px 8px;
    text-align: right;
    user-select: none;
    border-right: 1px solid #3e3e3e;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    min-width: 40px;
    white-space: pre;
}
.light-theme .line-numbers-col {
    background: #f0f0f0;
    color: #999;
    border-right-color: #ddd;
}
.monokai-theme .line-numbers-col {
    background: #1e1e1e;
    color: #75715e;
    border-right-color: #3e3d32;
}
.github-theme .line-numbers-col {
    background: #eaecef;
    color: #6a737d;
    border-right-color: #e1e4e8;
}
.code-content-col {
    flex: 1;
    padding: 12px;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}
.code-output-with-lines {
    display: flex;
    min-height: 300px;
    flex: 1;
    border: 1px solid #3e3e3e;
    border-radius: 6px;
    overflow: hidden;
    background: #1e1e1e;
}
.code-output-with-lines.light-theme {
    background: #ffffff;
    border-color: #ccc;
}
.code-output-with-lines.monokai-theme {
    background: #272822;
    border-color: #3e3d32;
}
.code-output-with-lines.github-theme {
    background: #f6f8fa;
    border-color: #e1e4e8;
}

/* 统计信息 */
.stats-panel {
    background: #e8f4fd;
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 15px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
}
.stat-value {
    font-weight: bold;
    color: #4a90d9;
}

/* AI面板 */
.ai-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    color: white;
}
.ai-panel h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}
.ai-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    resize: vertical;
    margin-bottom: 10px;
}
.ai-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}
.ai-btn:hover {
    background: rgba(255,255,255,0.3);
}
.ai-result {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    display: none;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .code-input-container {
        flex-direction: column;
    }
    .settings-panel {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn-group {
        flex-direction: column;
    }
    .btn-group button {
        width: 100%;
    }
}

/* 快捷提示 */
.shortcut-tip {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

/* 初始提示 */
.empty-hint {
    color: #666;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 280px;
    text-align: center;
    padding: 20px;
}
.light-theme .empty-hint { color: #999; }
.monokai-theme .empty-hint { color: #75715e; }
.github-theme .empty-hint { color: #6a737d; }

/* 按钮禁用状态 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-loading {
    position: relative;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
