/* ========================================
   正则表达式生成器样式
   ======================================== */

html, body { height: 100%; overflow: hidden; margin: 0; }
body { display: flex; align-items: center; justify-content: center; padding-top: 70px; }

.main-content {
    width: 100%; max-width: 1200px; height: calc(100vh - 120px);
    display: flex; align-items: center; padding: 0 20px; padding-bottom: 50px; z-index: 10;
}
.container { width: 100%; height: 100%; }
.tool-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-xl);
    overflow: hidden; display: flex; width: 100%; height: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* 左侧分类列表 */
.regex-sidebar {
    width: 260px; flex-shrink: 0; border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; overflow: hidden;
}
.panel-header {
    padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted);
    background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.regex-category-list { flex: 1; overflow-y: auto; padding: 8px; }
.regex-cat-item {
    padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: 0.15s;
    margin-bottom: 2px; display: flex; align-items: center; gap: 10px;
}
.regex-cat-item:hover { background: rgba(255,255,255,0.05); }
.regex-cat-item.active { background: var(--primary-light); color: var(--primary-color); }
.regex-cat-item i { width: 20px; text-align: center; font-size: 14px; color: var(--text-muted); }
.regex-cat-item.active i { color: var(--primary-color); }
.regex-cat-item span { font-size: 13px; }

/* 右侧主内容 */
.regex-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* 表达式详情 */
.regex-info-panel { border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.regex-info-content { padding: 16px; }
.regex-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; color: var(--text-muted); gap: 12px; }
.regex-placeholder i { font-size: 40px; }
.regex-placeholder p { font-size: 14px; }
.regex-pattern { font-family: var(--font-mono); font-size: 15px; color: #f59e0b; padding: 12px 16px; background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); border-radius: var(--radius-md); margin: 12px 0; word-break: break-all; }
.regex-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.8; padding: 0 16px 16px; }
.regex-example { font-size: 13px; color: var(--text-muted); padding: 0 16px 16px; }
.regex-example code { font-family: var(--font-mono); color: #8b5cf6; }
.regex-copy-btn {
    padding: 6px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.05); color: var(--text-secondary); cursor: pointer;
    font-size: 12px; display: inline-flex; align-items: center; gap: 6px; transition: 0.2s;
}
.regex-copy-btn:hover { background: var(--primary-light); color: var(--primary-color); }

/* 测试区 */
.regex-test-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.regex-test-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 16px; }
.regex-test-input {
    width: 100%; padding: 12px 16px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); color: var(--text-primary); font-size: 14px; outline: none;
    font-family: var(--font-mono);
}
.regex-test-input:focus { border-color: var(--primary-color); }
.regex-test-result { flex: 1; padding: 12px 0; overflow-y: auto; }
.regex-match-success { color: #22c55e; font-size: 13px; }
.regex-match-fail { color: #ef4444; font-size: 13px; }
.regex-match-highlight { color: #f59e0b; font-weight: 600; background: rgba(245,158,11,0.1); padding: 0 2px; border-radius: 2px; }

@media (max-width: 768px) {
    .tool-card { flex-direction: column; }
    .regex-sidebar { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border-color); }
}
